PDA

View Full Version : unlink from parent


yair
03-07-2002, 07:09 PM
hi all
is there a script that let me select a parent and unlink all its children from it?
it has to be something with a nice name like killChildren :)

ps.
it may be a stupied question as im missing some button but i cant seem to find it.

Ls3D
03-07-2002, 11:40 PM
Well, no script but my technique is right click the parent, select children, unselect parent & unlink. Hitting page down first would enable one to select ancestors, then thier children and unlink that set, negating the need to deselect the parent.

You could write your own script to perform these task at the touch of a custom button.

-Shea
www.Ls3D.com

LFShade
03-08-2002, 01:47 AM
yeah, you could do all that workaround crap...but why not tie it all to a nifty little script!

EDIT: This didn't really work when I tried it out (I didn't have MAX on hand at the time), so I've edited it to behave properly, and just made it into an .mcr file for download. Sorry!

get it here (http://pmpstudio.3dup.net/files/killMyKids.mcr)

Again, just stick it in your ui\macroscripts directory, start up MAX, and set up a keystroke or button from the customize UI dialog. You'll find it under "RHTools":)

Ls3D
03-08-2002, 01:55 AM
Like I said, LFshade could write you a script to do it at the touch of a button.. ;)

-Shea

Bobo
03-08-2002, 08:41 AM
Originally posted by LFShade
yeah, you could do all that workaround crap...but why not tie it all to a nifty little script!



Hmmm, looked like something that would work...

Not trying to be a smart-ass, but did you know that this operation could be done in a single line ?

macroScript KillChildren category:"Killers"
(
for o in selection do for c in o.children do c.parent = undefined
)

One has to love MAXScript ;o)

LFShade
03-08-2002, 01:00 PM
Wow, it's Bobo himself! Didn't know you visited these parts, but I'm a big fan! (if it's really you :rolleyes: )

I'm actually just something of a maxScript hacker with no real programming background, so much of what I script isn't pretty. It just works (most of the time). I'm not at all surprised that there's a better way.

I had tried a more 'elegant' method involving just one for... loop, but it would fail on the last iteration with a "no property 'parent' in: undefined" error. Thus my ersatz workaround.

But yours works fine, which just confirms that you're a damn genius, Bobo:D

Cheers!

Bobo
03-08-2002, 06:35 PM
Originally posted by LFShade
Wow, it's Bobo himself! Didn't know you visited these parts, but I'm a big fan! (if it's really you :rolleyes: )

I'm actually just something of a maxScript hacker with no real programming background, so much of what I script isn't pretty. It just works (most of the time). I'm not at all surprised that there's a better way.

But yours works fine, which just confirms that you're a damn genius, Bobo:D


LOL!

I came to read the Max 5 threads ;) and registered just yesterday. Believe it or not, we ALL are MAXScript hackers - using a scripting language in a 3D package often involves solving of non-standard problems with non-standard methods (not in this case, but in general).

As for your last line, I am pretty sure you are wrong :)

LFShade
03-09-2002, 04:44 AM
Believe it or not, we ALL are MAXScript hackers

Be that as it may, I'm sure it helps to have some structured coding experience. Some grasp of high-level mathematics would do as well; I saw your 'calculate an object's volume' script over at the Discreet board. You make it look so easy, but I would have had no clue how to approach that.

Where do you learn this stuff?

Bobo
03-09-2002, 08:11 PM
Originally posted by LFShade


Be that as it may, I'm sure it helps to have some structured coding experience. Some grasp of high-level mathematics would do as well; I saw your 'calculate an object's volume' script over at the Discreet board. You make it look so easy, but I would have had no clue how to approach that.

Where do you learn this stuff?


Well, I have to admit I work together with some amazing mathematical geniuses and should give them credit here. I am game developer in my real life and it helps much. Our internal scripting language is better structured than MAXScript and forced me to change my coding style from spaghetti code to functional programming over time ;)

bunniked
10-05-2005, 07:48 PM
I wonder if it is possible to stop the objects i'm unlinking from moving all over the place.
I'm building a presentation of but need to remove the links. Only it seems I can restart putting the machine back together if I do so.
Perhaps I don't need to unlink. The problem is: I try to rotate a large series of objects but I'm not able to put them in a group or assembly. My solution was unlinking them, but is there an other way

CGTalk Moderation
10-05-2005, 07:48 PM
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.