PDA

View Full Version : Adding a very simple modifier to the modifier list


Context
05-18-2008, 11:45 PM
Hello everyone.

I'm in the process of building a modifier I plan on using to create a finger rigging tool.

I am trying to add this very simple modifier to the modifier list. I can get it to show up in the list by dropping a file with this code into my Scripts->Startup folder, but the modifier shows up empty, and the parameters are not added to the object.

I know I'm missing something farily fundimental here. Any assistance would be greatly appreciated.



plugin modifier 'JTQ_Finger_Controls 1'
name:"JTQ_Finger_Controls 1"
classID:#(0x489d4f55, 0x7cf7b4d2)
(
local baseFinger = attributes myFingerControls
(
parameters main rollout:MyRollout
(
firstDigitValue type:#float ui:sldFirst default: 1
secondDigitValue type:#float ui:sldSecond default: 1
thirdDigitValue type:#float ui:sldThird default: 1
)

rollout MyRollout "My Controls"
(
slider sldFirst "First Digit" type:#float range:[0,1,1]
slider sldSecond "Second Digit" type:#float range:[0,1,1]
slider sldThird "Third Digit" type:#float range:[0,1,1]
)
)
)

ZeBoxx2
05-19-2008, 12:50 AM
drop the entire...

local baseFinger = attributes myFingerControls
(


and matching closing parenthesis from the definition, that should do the trick.

( Parameters and Rollouts for plugins are local to the scripted plugin definition; custom attribute blocks are a wholly separate entity only tangentially related to scripted plugins )

Context
05-19-2008, 01:18 AM
Ah ha.

Thanks. Very much thanks.

Context
05-19-2008, 04:25 AM
I have another question, only tangentially related to the first.

How do you access the functionality located within the "Align" tool?



It does not display code in the listener, and it is nowhere in the documentation. Can it be accessed or do I have to build a custom function for it?

Bobo
05-19-2008, 05:11 AM
I have another question, only tangentially related to the first.

How do you access the functionality located within the "Align" tool?



It does not display code in the listener, and it is nowhere in the documentation. Can it be accessed or do I have to build a custom function for it?

The align tool is a relict from Max 1.0 and is not exposed to MAXScript.
But it is very easy to reimplement, since all it does is matching portions of the transformation matrices (translation, rotation and scaling separately).

For example, doing objA.transform = objB.transform is equivalent to checking all checkboxes (Position, Orientation and Scaling) and using Pivot to Pivot mode. Partial alignment (single axes and center, bbox etc. modes) are a bit trickier, but along the same lines...

CGTalk Moderation
05-19-2008, 05:11 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.