Need plans for a nuclear bomb! (MEL explode all groups)

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  04 April 2013
Need plans for a nuclear bomb! (MEL explode all groups)


I'm trying to "explode" all groups in Maya.

ie a recursive ungroup - or a funnier way to look at it as per subject, nuclear bombing / explode all groups.

I've currently got this far:

	string $group[] = `select -hi`;
	string $transforms[] = `ls -sl -tr`;
	//print $transforms; optional, just feedback
	select $transforms[0];
	float $howMany = `size($transforms)` - 1;
	print $howMany;
	for ($i=0; $i<$howMany; $i++)

But this fails after it goes through a second round. Anyone know anything better?
  04 April 2013
It's pymel, but it might do the trick, if it doesn't have to be mel?

import pymel.core as pm
 [shape.getParent().setParent(world=1) for shape in, shapes=1, dag=1)]
  04 April 2013
Perfect, many thanks. Boy that solution looks so simple - really have to jump on the bandwagon I think.
  04 April 2013
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 07:17 AM.

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