Hey Besjan,

It might be a good idea to follow up on your questions if you ask the
community something and then someone answers. I keep seeing a pattern in
this discussion group where people will ask a question, someone takes the
time to provide information, and then that original person says nothing
about it for maybe a week or never. In your case, you stated you solved
this soon after posting. Closing this thread would prevent someone else
from putting time into it for you, or might help someone else that comes
across this in the meantime.

I feel like we need to address the Q&A etiquette situation here on this
group. Am I wrong anyone? Just a thought.

-- justin



On Sun, Apr 22, 2012 at 2:36 AM, Besjan Xhika <mayan...@gmail.com> wrote:

> Thanks for your reply, I found the solution soon after I posted in here.
>
>
> On Friday, April 13, 2012 2:26:09 AM UTC+2, damonshelton wrote:
>
>> in python time is required as a start and end time
>> keyt = (keytimes[0], keytimes[0])
>> cmds.keyframe('nurbsSphere1_**translateX', time = keyt, query = True,
>> valueChange = True)
>>
>> On Tue, Apr 10, 2012 at 11:15 AM, Besjan Xhika wrote:
>>
>>> Hi, I'm studying Maya programming..
>>> and got around this error while trying to convert a MEL script to a
>>> Python script..
>>>
>>> MEL
>>>
>>> float $keytimes[];
>>> $keytimes = `keyframe -query -timeChange nurbsSphere1_translateX`;
>>> // Result: 1 48 //
>>> $keyt =  $keytimes[0];
>>> // Result: 1 //
>>> keyframe -time $keyt -query -valueChange nurbsSphere1_translateX;
>>> // Result: -5.321007 //
>>>
>>> nurbsSphere1_translateX is an animation curve..
>>> // Result: 1 48 // are two frames that have keys..
>>>
>>> In MEL works OK.
>>> ****************************************************
>>> Python
>>>
>>> keytimes = cmds.keyframe('nurbsSphere1_**translateX', query = True,
>>> timeChange = True)
>>>
>>> # Result: [1.0, 48.0] #
>>>
>>> keyt = keytimes[0]
>>>
>>> # Result: 1.0 #
>>>
>>> cmds.keyframe('nurbsSphere1_**translateX', time = keyt, query = True,
>>> valueChange = True)
>>>
>>> # Error: TypeError: file <maya console> line 1: Invalid arguments for
>>> flag 'time'. Expected (time, [time]), got float #
>>>
>>>
>>> In Python doesn't work..
>>>
>>> So $keyt = 1 and keyt = 1.0 should be the same (floats)..
>>>
>>> While in MEL is accepting a float for time (maybe is being converted
>>> automatically, or something..), in Python is not..
>>>
>>> Anyone got any idea?
>>>
>>> --
>>> view archives: 
>>> http://groups.google.com/**group/python_inside_maya<http://groups.google.com/group/python_inside_maya>
>>> change your subscription settings: http://groups.google.com/**
>>> group/python_inside_maya/**subscribe<http://groups.google.com/group/python_inside_maya/subscribe>
>>>
>>
>>  --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to