Also worth mentioning here is the strength of using the api for such
operations. For instance, it's straight forward to grab all of the MObjects
of the nodes you are working on, before renaming them. If you rename a
number of nodes in the same hierarchy using a mel-centric approach you need
to do some pretty ugly string manipulation to ensure that you don't maintain
a reference to a node that was renamed by your action. If you grab the
MObjects first, you don't have to worry about this possibility since
renaming an MObjects won't change its address.

On Thu, Jan 7, 2010 at 3:30 PM, chrysl666 <[email protected]> wrote:

> its just a sintax error
>
>
> import maya.mel as mm
> command = "searchReplaceNames \"joint\" \"finger\" \"hierarchy\" "
> mm.eval(command)
>
>
>
>
> On Thu, Jan 7, 2010 at 7:25 PM, rudi <[email protected]> wrote:
>
>> Hi,
>> So the searchReplaceNames mel command is not available in python
>> right?
>> I tryed to run from python like so:
>> I have 3 joints in my scece named joint1,joint2 and joint 3.The mel
>> command to replace "joint" to "fingers" is:
>>
>> searchReplaceNames "joint" "finger" "selected";
>>
>> So in python I did:
>>
>> import maya.mel as mm
>> mm.eval("searchReplaceNames "joint" "finger" ")
>>
>> But the mel is not well evaluated,beacuse there is the quote sign in
>> both names joint and finger...I know I should be skipping signs in
>> order to evaluate it as a string,but I am not succeeding to do it.
>>
>> Thx
>>
>> --
>> http://groups.google.com/group/python_inside_maya
>>
>
>
> --
> http://groups.google.com/group/python_inside_maya
>
-- 
http://groups.google.com/group/python_inside_maya

Reply via email to