[3DSMAX] Instance replace script that also replaces groups

Does anyone know where to find an instance replace script that also replaces groups? Most replace script that I know will only replace objects but not whole groups.

- Replace multiple Objects by a Group (instanced)
- Replace multiple Groups by a Group (instanced)
- Replace multiple Groups by an object (instanced)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
TsveTan's picture

Base code (not tested)

oGroupByName = "groupToBeCloned"
oCGroupName = "MyGroup"

oGroup = getNodeByNane (oGroupByName)
setGroupOpen oGroup true
groupHeaad = undefined
oGroupMembers = #()

groupMembers = #()
for o in $objects do (
if isOpenGroupMember o do (
insertitem o groupMembers (groupMembers.count + 1)
)
if isGroupHead o do (groupHead = o /*maybe do something else*/)
)

clonedGroupMembers = #()
for o in groupMembers do (
i = instance o
insertItem i clonedGroupMembers (clonedGroupMembers.count + 1)
)

-- creating the instancied members' group
group clonedGroupMembers name:oCGroupName
setGroupOpen oGroup false

/*You can create a rollout with two edittexboxes for the target and dest. groups and a button , that creates the group.
Unused groups should be closed.*/

OccultArt's picture

Is there no instance replace

Is there no instance replace script that also replaces groups and can replace objects or groups with instances of a certain groups? Does anyone have some code, that shows how to replace groups by an instance of an other group?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.