Exporting parent + each child to separate files

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  04 April 2012
Exporting parent + each child to separate files

Is there a way to do this? For example, if I have a parent curve called MAN. MAN has 3 child groups, head, hand, foot. I want to select the parent, MAN, and have the script exports into 3 files.

MAN + head
MAN + hand
MAN + foot

head, hand and foot are still child of MAN.
  04 April 2012
you mean like this

import maya.cmds as mc

currentPath = mc.file(q=1,sn=1)
if len(currentPath) == 0:
    mc.error('Save current scene first.')
selection = mc.ls(sl=1)
if len(selection) == 0:
    mc.error('Nothing Selected')
for sel in selection:
    children = mc.listRelatives(sel,c=1,f=1)
    if len(children) == 0:
        mc.error('%s has no exportable children'%sel)
    print "\nExporting %s's children -", children
    for child in children:
  04 April 2012
The select(child) would mean that the parent isn't exported tho?

The easy way out I guess is to do loops to unparent > export > reparent them. :O But I'd like to know if there's a better way.
  04 April 2012
yes it would.

I didnt know you wanted to export JUST the child.

Then the only way would be to unparent/re-parent..
  04 April 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:23 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.