[Closed] multiple rollouts in a PEN_Attribute_holder2
Using Mr. Neale’s PEN_Attribute_holder2 (thanks, PN). My ArmDef and HandDef script loads fine with the scene. So then I added a <include fileName.ms> rollout to each ArmDef and HandDef script so they will load the same additional rollout. This works fine if run on each respective CTRL Attribute_holder manually post scene load.
So everything working fine and I save the scene and quit max. The problem is when I re-open that same scene two error popups:
[ol]
[li]MAXScript Scripted Custom Attribute definition loading Exception[/li]
–Compile error: Attempt to redefine: JOE
–In line: rollout JOE JOE Controll Selection
[/ol] [ol]
[li]Missing Dlls[/li]
FileName: Scripted Plugin Class: FK Arm Control: SupperClass:0x1160
FileName: Scripted Plugin Class: FK Arm Control: SupperClass:0x1160
[/ol] This make senses that the PEN_Attribute_holder2 modifier scripts I applied to the CTRL’s is trying to load the “include” rollouts, But why don’t they load? There all in the same dir scripts.
Any ideas???
p.s. I want a new smile face icon with a burned out lightbulb
+#@nKs
Thanks for the thumbs up.
So are you trying to update the attribute definition every time that you open the scene? What is the include doing? What is it loading and can you provide either the scripts that you are using or mockup that causes the same problem.
Yes, Sorry.
Along with the attribute holder controls to move my subjects I have a second Rollout CTRL interface Joe Control Selection that allows me to select each CTRL attribute holder instead of clicking in the viewport.
If I click LA [(see fig A)]( http://www.othoap.com/posts) the Modify panel updates to the LeftArm CTRL attribute holder. If I click LH the Modify panel updates to the LeftHand CTRL attribute holder.
So in both scripts that describes the wire properties for arm and hand I have an <include> that loads in the JOE Control Selection rollout (see fig A) that way each CTRL references the same script JOE Control Selection.
JOE_arm_13.ms --- JOE_hand_3.ms
———-\ ———-/
…JOE_CTRL_2.ms
–This is including the script-LOOK FOR <<<<<<—JOE_arm_13.ms—————
--Author - sam@othoap.com
--JOE_CTRL
--This script was modified on 7/10/06 from the original script "handDef.ms"
--from the 3D StudioMax tutorial files on hand rigging Attributes. Sorry I
--don't know the original authors name:( I also had help from Mobeen at
--3DBuzz with a spinner "ui:naming" issue, Thanks Mobeen.
--I found my self always having to type in "0" for each spinner to return
--the subject back to the start pose. So I altered the script to include
--reset buttons on each spinner Attribute and a master reset for all.
--Also I find sliders a nicer control to work with so use the slider for control
--and the spinner for confirmation of the value. I would like to see a slider with a
--built in value field read out in the future. Maybe even a grow bar behind
--the scrubber under the tic marks. Also it would be great to have a alpha on the
--slider so backgrounds would show thought.
-------------------------------------------------------------------------------
--The following block communicates with PEN_Attribute_Holder2 to insert the rollout into the ui
global armCTRL
for numDef = 1 to (custAttributes.count $.modifiers[1]) do
(
print (custAttributes.get $.modifiers[1] numDef).name
if (custAttributes.get $.modifiers[1] numDef).name == "Arm Controls" then
(
armCTRL = (custAttributes.getDef $.modifiers[1] numDef)
)
)
armCTRL = Attributes "FK Arm Controls:"
--redefine:armCTRL
--This block sets up the spinner and slider variable names
(
parameters mainP rollout:mainR
(
ShoulderExten type:#float ui:(spinSE,slideSE)
ShoulderLift type:#float ui:(spinSL,slideSL)
ShoulderShrug type:#float ui:(spinSS,slideSS)
ArmLift type:#float ui:(spinAL,slideAL)
ArmSwing type:#float ui:(spinAS,slideAS)
ArmSwingX type:#float ui:(spinASX,slideASX)
ElboBend type:#float ui:(spinEB,slideEB)
ArmTwist type:#float ui:(spinAT,slideAT)
ForermTwist type:#float ui:(spinAT2,slideAT2)
WristWave type:#float ui:(spinWW,slideWW)
WristShake type:#float ui:(spinWS,slideWS)
)
--<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
include "JOE_CTRL_2.ms" --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
--<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
--This block describes the interface elements and the positions and parameters. I'm using alignments and offsets to
--arrange the spinners and sliders instead of pos:. It's easier to adjust if you add a new block. I only have to adjust
--the reset button y vale "pos:[x,y]" by 55 units to move down.
rollout mainR "FK Arm Controls:"
(
spinner spinSE "" width:50 height:16 range:[-180,180,0] pos:[108,14]
button resetSE "reset" width:40 height:14 pos:[60,15]
slider slideSE "" width:105 range:[-180,180,0] ticks:0 pos:[61,30]
GroupBox grp1 "Shoulder Exten" width:163 height:53 pos:[1,2]
bitmap bmp1 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\shoulder_exten.bmp" width:50 height:38 pos:[3,15]
on resetSE pressed do
(
#(slideSE,spinSE).value = 0.0 --inserts 0.0 value into the spinner field to only reset this block
)
spinner spinSL "" width:50 height:16 range:[-180,180,0] pos:[108,67]
button resetSL "reset" width:40 height:14 pos:[60,68]
slider slideSL "" width:105 range:[-180,180,0] ticks:0 pos:[61,83]
GroupBox grp2 "Shoulder Lift" width:163 height:53 pos:[1,55]
bitmap bmp2 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\Shoulder_lift.bmp" width:50 height:38 pos:[3,68]
on resetSL pressed do
(
#(slideSL,spinSL).value = 0.0
)
spinner spinSS "" width:50 height:16 range:[-180,180,0] pos:[108,120] --53
button resetSS "reset" width:40 height:14 pos:[60,121]
slider slideSS "" width:105 range:[-180,180,0] ticks:0 pos:[61,136] --53
GroupBox grp3 "Shoulder Shrug" width:163 height:53 pos:[1,108] --53
bitmap bmp3 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\Shoulder_shrug.bmp" width:50 height:38 pos:[3,121]
on resetSS pressed do
(
#(slideSS,spinSS).value = 0.0
)
spinner spinAL "" width:50 height:16 range:[-180,180,0] pos:[108,173]
button resetAL "reset" width:40 height:14 pos:[60,174]
slider slideAL "" width:105 range:[-180,180,0] ticks:0 pos:[61,189]
GroupBox grp4 "Arm Lift" width:163 height:53 pos:[1,161]
bitmap bmp4 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm_lift.bmp" width:50 height:38 pos:[3,173]
on resetAL pressed do
(
#(slideAL,spinAL).value = 0.0
)
spinner spinAS "" width:50 height:16 range:[-180,180,0] pos:[108,226]
button resetAS "reset" width:40 height:14 pos:[60,227]
slider slideAS "" width:105 range:[-180,180,0] ticks:0 pos:[61,242]
GroupBox grp5 "Arm Swing Y" width:163 height:53 pos:[1,214]
bitmap bmp5 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm01.bmp" width:50 height:38 pos:[3,227]
on resetAS pressed do
(
#(slideAS,spinAS).value = 0.0
)
spinner spinASX "" width:50 height:16 range:[-180,180,0] pos:[108,279]
button resetASX "reset" width:40 height:14 pos:[60,280]
slider slideASX "" width:105 range:[-180,180,0] ticks:0 pos:[61,295]
GroupBox grp6 "Arm Swing X" width:163 height:53 pos:[1,267]
bitmap bmp6 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm01.bmp" width:50 height:38 pos:[3,280]
on resetASX pressed do
(
#(slideASX,spinASX).value = 0.0
)
spinner spinEB "" width:50 height:16 range:[-180,180,0] pos:[108,332]
button resetEB "reset" width:40 height:14 pos:[60,333]
slider slideEB "" width:105 range:[-180,180,0] ticks:0 pos:[61,348]
GroupBox grp7 "Elbo" width:163 height:53 pos:[1,320]
bitmap bmp7 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm01.bmp" width:50 height:38 pos:[3,333]
on resetEB pressed do
(
#(slideEB,spinEB).value = 0.0
)
spinner spinAT "" width:50 height:16 range:[-180,180,0] pos:[108,385]
button resetAT "reset" width:40 height:14 pos:[60,386]
slider slideAT "" width:105 range:[-180,180,0] ticks:0 pos:[61,401]
GroupBox grp8 "ArmTwist" width:163 height:53 pos:[1,373]
bitmap bmp8 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm01.bmp" width:50 height:38 pos:[3,385]
on resetAT pressed do
(
#(slideAT,spinAT).value = 0.0
)
spinner spinAT2 "" width:50 height:16 range:[-180,180,0] pos:[108,438]
button resetAT2 "reset" width:40 height:14 pos:[60,439]
slider slideAT2 "" width:105 range:[-180,180,0] ticks:0 pos:[61,454]
GroupBox grp9 "ForearmTwist" width:163 height:53 pos:[1,426]
bitmap bmp9 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm01.bmp" width:50 height:38 pos:[3,438]
on resetAT2 pressed do
(
#(slideAT2,spinAT2).value = 0.0
)
spinner spinWW "" width:50 height:16 range:[-180,180,0] pos:[108,491]
button resetWW "reset" width:40 height:14 pos:[60,492]
slider slideWW "" width:105 range:[-180,180,0] ticks:0 pos:[61,507]
GroupBox grp10 "Wrist Shake" width:163 height:53 pos:[1,479]
bitmap bmp10 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm01.bmp" width:50 height:38 pos:[3,491]
on resetWW pressed do
(
#(slideWW,spinWW).value = 0.0
)
spinner spinWS "" width:50 height:16 range:[-180,180,0] pos:[108,544]
button resetWS "reset" width:40 height:14 pos:[60,545]
slider slideWS "" width:105 range:[-180,180,0] ticks:0 pos:[61,560]
GroupBox grp11 "Wrist Wave" width:163 height:53 pos:[1,532]
bitmap bmp11 "" fileName:"c:\\3dsmax7\\_scenes\\Joe\\Scripts\\arm01.bmp" width:50 height:38 pos:[3,544]
on resetWS pressed do
(
#(slideWS,spinWS).value = 0.0
)
--This block sets up an array of the spinners to insert a 0.0 value to reset all at once.
button resetAll "Reset All" width:154 height:20 pos:[1,590]
on resetAll pressed do
(
#(spinSE,spinSL,spinSS,spinAL,spinAS,spinASX,spinEB,spinAT,spinAT2,spinWW,spinWS).value = 0.0)
)
)
custAttributes.add $.modifiers[1] armCTRL
-----This is the included script---------JOE_CTRL_2.ms---------------------
rollout JOE "JOE Control Selection"
(
--head, neck--------------------------------------------------
button head "H" pos:[73,10] width:20 height:20
on head pressed do
(
select $head
max modify mode
)
button neck "N" pos:[73,30] width:20 height:20
on neck pressed do
(
select $neck
max modify mode
)
--Sholders-----------------------------------------------------
button spineTop "St" pos:[73,50] width:20 height:20
on spineTop pressed do
(
select $CTRLspineTop
max modify mode
)
button spineBot "Sb" pos:[53,140] width:60 height:10
on spineBot pressed do
(
select $CTRLspineBot
max modify mode
)
button shirt "S" pos:[73,70] width:20 height:60
on shirt pressed do
(
select $shirt
max modify mode
)
--Arms and Hands------------------------------------------------
button armL "LA" pos:[33,50] width:20 height:20
on armL pressed do
(
select $CTRLarmL
max modify mode
)
button clavL "C" pos:[53,50] width:20 height:20
on clavL pressed do
(
select $B_clavL
max modify mode
)
button armskinL "" pos:[33,70] width:20 height:40
on armskinL pressed do
(
select $Arm_L
max modify mode
)
button handL "LH" pos:[33,110] width:20 height:20
on handL pressed do
(
select $CTRLhandL
max modify mode
)
button btn21 "" pos:[93,50] width:20 height:20
button armR "RA" pos:[113,50] width:20 height:20
button armSkinR "" pos:[113,70] width:20 height:40
on armSkinR pressed do
(
select $Arm_R
max modify mode
)
button handR "RH" pos:[113,110] width:20 height:20
--Hip, Belly
button hip "H" pos:[53,130] width:60 height:10
on hip pressed do
(
select $CTRLhip
max modify mode
)
button paints "P" pos:[73,150] width:20 height:20
on paints pressed do
(
select $paints
max modify mode
)
--Legs and Feet
button kneeL "LN" pos:[53,150] width:20 height:20
on kneeL pressed do
(
select $CTRLkneeL
max modify mode
)
button legSkinL "L" pos:[53,170] width:20 height:20
on legSkinL pressed do
(
select $leg_L
max modify mode
)
button footL "LF" pos:[53,190] width:20 height:20
on footL pressed do
(
select $CTRLfootL
max modify mode
)
button kneeR "RN" pos:[93,150] width:20 height:20
on kneeR pressed do
(
select $CTRLkneeR
max modify mode
)
button legSkinR "L" pos:[93,170] width:20 height:20
on legSkinR pressed do
(
select $leg_R
max modify mode
)
button footR "RF" pos:[93,190] width:20 height:20
on footR pressed do
(
select $CTRLfootR
max modify mode
)
button ground "Both Feet" pos:[33,210] width:100 height:20
on ground pressed do
(
select $CTRLground
max modify mode
)
button moveAll "Move All" pos:[33,230] width:100 height:20
on moveAll pressed do
(
select $CTRLmoveAll
max modify mode
)
)
thanks Paul
I’m still not sure that I completely follow what it is you are trying to do. Do you want to be able to add the controls dynamicaly when parts of the character are picked?
Sorry but I’m just not clear on the work flow that you are shooting for here.
Sorry my fault,
If I apply the script JOE_arm_13.ms to the PEN_Attribute_holder2 WITHOUT the <include> line things work just fine. I can save the scene and re-open it thing are still wired, every thing still works.
If I apply the script JOE_arm_13.ms to the PEN_Attribute_holder2 WITH the <include> line things work just fine BUT the wiring with not work after a save and re-open of the scene.
WITHOUT <include> good
WITH <include> bad,
I would like JOE Control Selection interface in the Modify panel for every CTRL PEN_Attribute_holder2 I.E. (Left Arm, Right Arm, Left Hand, Right Hand).
Using <include> I only have to maintain one script for the selection of the attribute controls.
Please walk away if this is to much thanks for your time ether way.
I think that I see what it is you are trying to do. You might be going about it the wrong way. You want to have a rollout that will show up in many places on the rig but you will only have to have one definition for it so that when you update it all will receive the update.
To do this it would be best to use an instance of the definition on the other objects. This way any change to one will result in a change to all the others.
if I were to do something like this:
b=box()
s=sphere()
def=attributes test
(
)
custAttributes.add b def
custAttributes.add s def
the definition is the same definition on both objects. Any change that happens to one will happen to all others. If you are looking for a way to handle this across many files in a production so that you can make a change to the rollout without opening a Max file I’m not sure.
Another solution might be to add it to the PEN Attribute Holder modifier although if you have other characters that wouldn’t be very useful as you would need a modifier for each character.
I think that I have a way, I need to test and I will report tomorrow.
OK it looks like it worked if I created a rollout and have it sitting in global scope, to add it I use addRollout and call that from inside the custom attributes rollout in the on open event handler. This way it is added only when the modifier panel is opened.
I will try the addrollout. I have some material to study to pull that off, but ether way I will report back to conclude the thread.
A question on your DVD:
Do you talk about the scripting with in the Parameter Wiring Dialog?
Thank you so much for you expertise, time and good will.
I cover script wire params in a couple spots. I don’t remember where though.