PDA

View Full Version : Problem with Groups


duke
12-22-2010, 01:45 AM
I'm making a script where you select and xref'd group, and it reloads it and any of its children (if there are new children, they're added, and if children are moved relative to it, they're moved), however i'm having trouble recognising a group.

If a group is closed, "isGroupHead $" it says "-- Runtime error: isGroupHead requires a node".

If I try "setGroupOpen $ true", I get the same issue.

So yeah, i'm stuck on the first step, which is determining if i've got a group selected.

batigolnguyen
12-22-2010, 02:40 AM
your $ = selection is collection of selected objects. But that function require input node, so it made error. You should to access each object of that selection

for obj in selection do
(
if (isGroupHead obj) then
setGroupOpen obj true --or anything you want
)

duke
12-22-2010, 07:33 AM
Of course! Thanks :)

CGTalk Moderation
12-22-2010, 07:33 AM
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.