Notifications
Clear all

[Closed] help with script for saving objects in different maxfiles.

believe me I wouldn’t ask if it’s one time job.

select $*
for obj in selection do
(
if (classof obj.baseobject) == dummy then
(
if obj.children.count != 0 then
(
save_file = “C:\” +obj.name +”.max”
obj.position = [0,0,0]
max zoomext sel
saveNodes obj.children save_file
)
)
)

well, i;ve tested this with a dummy in the group and it seems to work fine.

Thank you Richard. But now script is splitting everything apart. I looks like if I have more than one dummy assigne to an object it’s creating files for each dummy.

select $*

for obj in selection do
(
if (classof obj.baseobject) == dummy then
(
if isGroupHead obj == true then
(
save_file = “C:\” +obj.name +”.max”
obj.position = [0,0,0]
max zoomext sel
saveNodes obj.children save_file
)
)
)

if this doesnt work, i give up! What version of max have you got?

still it save only dummy. I’m working with max 8. I think I will have to remove dummies in the future and will use your first script. Thank you again Richard.

very strange, i’ve got max 8 as well and when i create 2 groups with boxes\dummies and seperate dummies, it only saves the groups and when i load them back in they contain just the data required. (using my scripts)

sorry i cant help you any further.

ok, never one to give up that easily: try this.

select $*
for obj in selection do
(
if (classof obj.baseobject) == dummy then
(
if isGroupHead obj == true then
(
[font=Courier New]old_pos = obj.position[/font]
object_array = #()
for n = 1 to obj.children.count do
(
object_array[n] = obj.children[n]
)
save_file = “C:\” +obj.name +”.max”
obj.position = [0,0,0]
saveNodes object_array save_file
[font=Courier New]obj.position = old_pos[/font]
)
)
)

1 Reply
(@lukx)
Joined: 11 months ago

Posts: 0

Will try that but I also send you pm with testing scene:)

ah! there were links inside the group

group_array = #()
select $*

for obj in selection do
(
if (classof obj.baseobject) == dummy then
(
if isGroupHead obj == true then
(
group_array[group_array.count + 1] = obj
)
)
)

for n = 1 to group_array.count do
(
select group_array[n]
old_pos = group_array[n].pos
group_array[n].pos = [0,0,0]
save_file = “C:\mystuff
ew\” +group_array[n].name +”.max”

for obj in selection do
(
if obj.children != undefined do
(
selectmore obj.children
)
)

saveNodes selection save_file
select group_array[n]
group_array[n].pos = old_pos
)

wow! You’re the best! Where did you learn all this?

Im just an amateur really.

Page 2 / 3