If you're looking for a programmable way of separating scenes, you can
utilise the fact that Maya .ma files are plain-text.
*# Step 1*
You need some way of distinguishing between the nodes you want to separate
from the rest. If what you're looking to extract is simply "all polygon
meshes" or "all lights" then you can distinguish them via their node-type.
*## 1a*
If your needs are more custom, then there are a few alternatives you can
try. One might be to assign a common attribute per set of objects; for
instance, all left arms of multiple characters get the attribute "leftArm".
Then you can separate them by cmds.ls('*.leftArm').
*## 1b*
Another way to do it might be to collect all nodes in a
objectSet<http://download.autodesk.com/global/docs/maya2013/en_us/Nodes/objectSet.html>,
then you can reference them either via cmds.set() or traversing connections.
*# Step 2*
Locate the nodes you distinguished from above in your saved Ascii file and
generate a new one with only those nodes, and their related attribute
changes. You won't be able to use cmds.ls or cmds.set here, but if they can
find it, so can you via some straightforward string-manipulation.
You'll keep the header of the original Maya file, with Maya version and
such, and simply copy the lines only relevant to your criteria.
On 2 April 2014 09:36, Ricardo Viana <[email protected]> wrote:
> In that case you can import as Justin mentioned, select all you dont want
> and delete it.
> After that, run the file scene optimize that cleans up unnecessary nodes.
> Not sure if it cleans up everything.
>
>
> On Wednesday, April 2, 2014, Tuan Nguyen <[email protected]> wrote:
>
>> Hi Ricardo
>> That's would be the best, however, too much files will get hard to
>> maintain. Our artists said to keep it as simple as i can, so i decide not
>> to export them all over the place :D
>>
>>
>> On Wed, Apr 2, 2014 at 3:02 PM, Ricardo Viana <[email protected]>wrote:
>>
>>> I would suggest open the scene ,select only the objects you want, and
>>> export selected as new scene. Same applies for materials.
>>>
>>> On Wednesday, April 2, 2014, Tuan Nguyen <[email protected]> wrote:
>>>
>>>> Hi Justin
>>>> The only thing i worry about, that is not only objects, but materials,
>>>> shading, or many unnecessary things, will get imported along as well.
>>>> But we can select object to import from reference file, maybe i will
>>>> give it a try, or maybe open that scene implicit and export what we need to
>>>> another scene.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Python Programming for Autodesk Maya" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BEJPxq7k7zaAkn8ANYrXeJRAyscZTtObFmNLpfTQa1Rmg%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BEJPxq7k7zaAkn8ANYrXeJRAyscZTtObFmNLpfTQa1Rmg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> --
>>> Sent from Mobile
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/python_inside_maya/99ENXsZJXEI/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/CAK%2Bp0%3DYVLzTzrVL688o-9eOVmVSSKVCw-T5cvYhu-uS3x9xE0w%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAK%2Bp0%3DYVLzTzrVL688o-9eOVmVSSKVCw-T5cvYhu-uS3x9xE0w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BE0uONMKYC_UpjtWnQgStKvH4iKpQDtMWRezmg8ykeiDQ%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAMCvD%2BE0uONMKYC_UpjtWnQgStKvH4iKpQDtMWRezmg8ykeiDQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Sent from Mobile
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAK%2Bp0%3DZO%3DvFRhAfdqpd8JcL9cmscSVn93e8d%3DXfkw3oLvOyp7Q%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAK%2Bp0%3DZO%3DvFRhAfdqpd8JcL9cmscSVn93e8d%3DXfkw3oLvOyp7Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
*Marcus Ottosson*
[email protected]
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODH2bXA_LEU3rSfNOuYGrdpWR2b4BNT_5aBn03zUeUXJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.