View Full Version : 3ds Max 8 -- Question about scripting and Attribute Holder Rollout
Mahlon 06-22-2006, 06:59 PM Hey there,
I've been trying to take apart Brad Noble's rig and see how it works. I've got most of it, but there are a couple of neat tricks he has on the arms that I'd like to imitate -- and I'm not sure how he's doing them. Was hoping that some of you might be able to steer me in the right direction.
He has a attribute holder modifier on the Arm IK Control (see attached picture). I've got pretty much eveything figured out except how he has scripted the "IK to FK" and "FK to IK" buttons to make them work. I know how to make a button (from Paul's rigging DVD's), but I don't know what code you'd write to make the IK Control snap to the position of the FK control and vice versa.
Which brings me to my second question. How does one go about retrieving the content of the script which Brad Noble wrote to create that attribute holder? Is it possible to "pull it off" the rig within the scene? If so, how? It would be a lot easier if I could see and print out the script. Then I think I could figure things out.
Thanks so much,
Mahlon Bouldin
p.s. I can post a small version of the scene/rig if needed.
|
|
Well Pauls got a set of tools designed for editing existing CAparamblocks on his site. Essentiall all your doing is building a rollout but giving it the ca header info for an object:
test_ca = attributes ikfkattributes -- header
(
parameters ikfk parameters rollout:ikfk_roll
(
-- where you define your parameters eg.
ikfkblend type:#float ui:ikfk_slider animatable:true
)
rolout ikfk_roll "IK/FK Options"
(
-- where you define you sliders/code block for the parameters eg.
slider ikfk_slider "IKFK Blend" range:[0,100,0] ticks:0
on slider ikfk_slider changed val do
(
-- code block i.e what the slider does
)
)
)
custattributes.add yourobject.whereitgoes theCAname eg.
custattributes.add $.box01.modifiers[1] test_ca
This thread should help you a little: i wrote a fk/ik tutorial from scratch including an CAparamblock for blending and snapping:
http://forums.cgsociety.org/showthread.php?t=359670&highlight=ik%2Ffk
Funny I was just helping Brad on the Max board on custom attributes. As eek pointed out I have a tool that is part of the PEN Rigging Utils script that I think I use on the DVD's, It is the Edit Attributes tab that you will want.
Also you can use some simple code to get at them your self.
def=custAttributes.getDef $.modifiers[#'Attribute Holder'].theNameOfTheDefinition
format "%" def.source to:newScript())
That will format the definition to a new script file for editing. You just need to add the "redefine:def" line under "attributes theNameOfTheDefinition" as the second line of the script and execute so that it will update in the scene.
Mahlon
06-23-2006, 07:39 PM
Thanks very much, eek and Paul, for the help. I'll try it and see if I can implement IK/FK snap -- one of my favorite features...
Mahlon
Mahlon
06-24-2006, 03:42 AM
Paul,
Thanks for your great rigging utility to pull the ca scripts off. I didn't know it could do that.
Well, after having looked at the script Brad Noble has written to set up the IK FK snap buttons and functions, I think it's getting a little complicated for my head to understand. I'm kind of getting it, though. I guess I have some detective work to do in terms of node storage and the position script on the node.
I'll probably have some more questions if you guys don't mind. For right now, it's back to dissecting the ca script and node script.
Mahlon
Wow, that's handy as!
Just wondering though, in an effort to funk up my custom attributes a little, I was just wondering is it possible to make a button, that has an image on it? At the moment i am using the Standard buttons but I just thought it cool look a little cooler..
Pete
Thanks again for that awesome script!
Wow, that's handy as!
Just wondering though, in an effort to funk up my custom attributes a little, I was just wondering is it possible to make a button, that has an image on it? At the moment i am using the Standard buttons but I just thought it cool look a little cooler..
Pete
Thanks again for that awesome script!
There is a bitMap parameter that can be passed to a button so that you can add an image. Read up on it in the help as it isn't just as stright forward as you might think .
CGTalk Moderation
06-26-2006, 12:49 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.