View Full Version : How to delete a specific Attribute

09 September 2009, 12:14 AM
Hi everyone!

I'm really new with max script.

Ok right now my problem is this. I succeeded in creating a custom rollout with some custom attributes.

Later I have assigned only to some of my attributes in the created rollout with reaction manager.

Now I just would like to delete only some of the attributes from the it possible?

And if yes how can i do that?

The code I used is the following:

ca = attributes L_Arm_Ctrl
parameters armP rollout:armR
pelvisPar type:#float ui:(pelvisParSp, pelvisParSl)
spine1Par type:#float ui:(spine1ParSp, spine1ParSl)
spine2Par type:#float ui:(spine2ParSp, spine2ParSl)
spine3Par type:#float ui:(spine3ParSp, spine3ParSl)

pinHip type:#float ui:(pinHipSp, pinHipSl)
pinKnee type:#float ui:(pinKneeSp, pinKneeSl)
pinHead type:#float ui:(pinHeadSp, pinHeadSl)

elbow type:#float ui:(elbowSp, elbowSl)
clavicle type:#float ui:(clavicleSp, clavicleSl)
armss type:#boolean ui:armss
negvalue type:#boolean ui:nvalue
ifkarm type:#float ui:(ifkarmSp, ifkarmSl)
rollout armR "Left Arm Controls"

group "Hand Parents"
spinner pelvisParSp "" range:[0,100,0]
slider pelvisParSl "To Pelvis" range:pelvisParSp.range offset:[0,-20]

spinner spine1ParSp "" range:[0,100,0]
slider spine1ParSl "To Spine1" range:spine1ParSp.range offset:[0,-20]

spinner spine2ParSp "" range:[0,100,0]
slider spine2ParSl "To Spine2" range:spine2ParSp.range offset:[0,-20]

spinner spine3ParSp "" range:[0,100,0]
slider spine3ParSl "To Spine 3" range:spine3ParSp.range offset:[0,-20]
group "Hand Pins"
spinner pinHipSp "" range:[0,100,0]
slider pinHipSl "To Hip" range:pinHipSp.range offset:[0,-20]

spinner pinKneeSp "" range:[0,100,0]
slider pinKneeSl "To Knee" range:pinKneeSp.range offset:[0,-20]

spinner pinHeadSp "" range:[0,100,0]
slider pinHeadSl "To Head" range:pinHeadSp.range offset:[0,-20]
Group "Arm Controls"
spinner elbowSp "" range:[0,100,0]
slider elbowSl "Elbow Parent" range:elbowSp.range offset:[0,-20]

spinner clavicleSp "" range:[0,100,100]
slider clavicleSl "Align Clavicle" range:clavicleSp.range offset:[0,-20]

checkbox armss "Auto IK Stretch" type:#boolean align:#center

checkbox nvalue "Negative Stretch" type:#boolean align:#center

spinner ifkarmSp "" range:[0,100,0]
slider ifkarmSl "IK/FK Switch" range:ifkarmSp.range offset:[0,-20]
custAttributes.add $.modifiers[1] ca

Actually I would like to delete first 4 attributes and obviously the first entire rollout.

How can I do that?

Many Thanks


09 September 2009, 12:49 AM
You need to get the definition from the scene and then redefine the definition with the new one.

--Get the def, in this case from an attribute holder modifier.
def=custAttributes.getDef $.'attribute holder' 1

--Then update the definition
ca = attributes L_Arm_Ctrl
--All the code you want here.

09 September 2009, 08:04 AM
Yhanks Paul!! you are really tha man!!

Many many thanks!

Just worked as a charm!


CGTalk Moderation
09 September 2009, 08: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.