PDA

View Full Version : instanced controllers created via script not saving...


steev
09-07-2008, 03:38 PM
to illustrate my issue, i've create a sample with boxes (setup script below). i have a scene with 5 boxes. via script i'll add an empty modifier and assign a CA slider named "box spin" to it (with a range of 0 360). i then wire the slider to control the z rotation of all the boxes, so when i scrub the slider they all rotate in unison. i then instance the modifier onto the other boxes, so no matter which box i have selected i can still rotate the boxes via the instanced slider. if i run the below script (excuse the ham-handedness, it's a quickie) to setup this scene, it works perfectly. if i save the max file, open a new scene & then re-open the box test max file, the instanced sliders no longer work.

is there something i'm missing?

clearListener()
--make boxes
for i in 1 to 5 do
(
randomX = random -100 100
randomY = random -100 100
thisBox = box pos:[randomX, randomY,0]
)
--make slider on $box01 mod panel
select $Box01
addModifier $Box01 (EmptyModifier ())
$Box01.modifiers[1].name = "box spin"
box_Controls_Attr = attributes box_Controls
(
parameters main rollout:box_Controls
(
boxCtrl type:#float UI:boxCtrl default:0
)
rollout box_Controls "boxSpin Controls" width:160 height:100
(
slider boxCtrl "" pos:[9,19] width:152 height:25 range:[0,360,0]
label boxCtrl_label "boxSpin" pos:[70,5] width:91 height:16
)
)
custAttributes.add $Box01.modifiers[1] box_Controls_Attr #unique

paramWire.connect $Box01.modifiers[#box_spin].box_Controls[#boxCtrl] $Box01.rotation.controller[#Z_Rotation] "degtorad boxCtrl"
paramWire.connect $Box01.modifiers[#box_spin].box_Controls[#boxCtrl] $Box02.rotation.controller[#Z_Rotation] "degtorad boxCtrl"
paramWire.connect $Box01.modifiers[#box_spin].box_Controls[#boxCtrl] $Box03.rotation.controller[#Z_Rotation] "degtorad boxCtrl"
paramWire.connect $Box01.modifiers[#box_spin].box_Controls[#boxCtrl] $Box04.rotation.controller[#Z_Rotation] "degtorad boxCtrl"
paramWire.connect $Box01.modifiers[#box_spin].box_Controls[#boxCtrl] $Box05.rotation.controller[#Z_Rotation] "degtorad boxCtrl"

mymod = $Box01.modifiers[1]

addModifier $Box02 mymod
addModifier $Box03 mymod
addModifier $Box04 mymod
addModifier $Box05 mymod

steev
09-07-2008, 07:07 PM
also the same behavior happens if i do the same setup entirely by hand.

bug?

btw - max 2k9

Bobo
09-07-2008, 08:21 PM
also the same behavior happens if i do the same setup entirely by hand.

bug?

btw - max 2k9

Don't have 2009 installed at home, but it works ok in 2008 (even loading the scene after a full restart of Max).
So it sounds like a bug in 2009.

steev
09-07-2008, 09:02 PM
thanks bobo for checking. your response led me to another test of creating the scene, saving & restarting max.

loading the saved file in a freshly booted max2k9 works. the instanced controllers behave properly. it's only when i reload the scene during the same session that the controllers fail to work.

i double checked in an older version of max on another machine (max8) & it worked as expected, the instanced controllers functioned no matter how many times i reloaded the scene.

so, it does smell like a bug & a pretty stinky one as all my character rigs depend on instanced controllers. how do i get this pushed through at autodesk? hopefully i don't have to wait for max2k10 :eek:

ofer_z
09-08-2008, 12:15 AM
Hi Steev,

I just tested you script in max 2009 and it works on my end, both with a reset scene and without before opening the saved file.


Forgot to mention that this is max 2009 with SP1 and creativity extension installed.



Cheers,
o

steev
09-08-2008, 01:38 AM
thx ofer.

i guess the good news is that it's not a bug. the bad news is i've borked something up on my machine.

well at least i know it's local!

thanks again guys. sorry for the scare.

steev
09-08-2008, 05:04 AM
weird...
just found mention of the exact same bug here (http://forums.cgsociety.org/showpost.php?p=5204023&postcount=212)...

maybe it's not something i borked after all. if this is true, that's a pretty significant oversight on autodesk's part.

oops, just caught ofer's edit & i haven't installed sp1 yet


installed & yes, sp1 fixes it. thanks!

CGTalk Moderation
09-08-2008, 05:04 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.