Rigging hierarchy questions

Hi guys,

I am pretty new to rigging stuff in 3dsMax and I am writing a script that automatically rigs a vehicle then connects the main controller of the rig to a path.

The problem i have is that some of the objects in the rig are not in direct hierarchy with the main controller so I cannot get to them through script. For example, my wheels are linked to a dummy which is attached to a plane, and the plane is connected to the main controller. So I cannot get to the wheels from the main controller. My initial solution was to add appdata to the main controller containing all the rig elements and later on to call that. The problem is that when I merge that rigged vehicle multiple times, the name of the wheels will be automatically changed to avoid duplicate names thus breaking the rig.

I am sure this is something pretty straightforward but it seems I cannot get my head around it!

Thanks in advance!

You’d probably want to store a Custom Attribute of a type:#nodeTab on the main controller, that would reference whatever nodes you need it to reference.

What Rob said will work. Another option is to set variables of type node in a script controller. The variables should update by themselves when the objects they reference change names.

Thanks guys!

I was thinking about trying CA’s but I’ve never played with them before.

As for the script controllers, I already have the rig setup with node variables for the elements that need that. It might be an idea to have a script controller that contains the node variables only and refer to it, but I am not sure that this will work…

I was looking more on how to deal with custom attributes for my needs and stumbled upon this article by Martin Breidt which explains in detail all the possible ways to solve my issue: http://scripts.breidt.net/script_controllers.pdf

Awesome article!!!

[QUOTE=vasilescu_anton;1660]Thanks guys!

I was thinking about trying CA’s but I’ve never played with them before.

As for the script controllers, I already have the rig setup with node variables for the elements that need that. It might be an idea to have a script controller that contains the node variables only and refer to it, but I am not sure that this will work…[/QUOTE]

Yeah this would work. CAs seems like a better/cleaner but I’ve often set the scale controller as a script controller on an object for the sole purpose of storing nodes while prototyping because it was less typing.

Look up the “Script Controllers” page in the manual, it should give you all you need about setting and retrieving variables.

Thanks for that article btw. I wonder how the speed statistics hold up in the latest versions of max. I could be wrong but I believe a fair amount of work went into speeding up the script controllers.

That sounds great and I think I’ll use your idea as with CA’s I am still not sure what’s what. Btw, can you set a CA with multiple nodes in it or do you have to have a CA for each node?

[QUOTE=vasilescu_anton;1665]That sounds great and I think I’ll use your idea as with CA’s I am still not sure what’s what. Btw, can you set a CA with multiple nodes in it or do you have to have a CA for each node?[/QUOTE]

check Paul Neale’s article on the subject if you haven’t already:
http://paulneale.com/tutorials/Scripting/weakReferences/weakReferences.htm

This would be an ideal solution if you have to store a list of unknown dimensions. If you have a specific set of variables I’d separate them to avoid confusion down the road.

Mihai, thanks for the link! That’s exactly what I needed!

Does anybody have any idea which way is best to set up a truck and trailer rig? The way I have it now is with a control point at the hitch and a lookAt controller to figure out the rotation of the trailer but it doesn’t work properly as the lookAt control takes over all axis rotation and I would need it to do it only on the z axis. Any idea how to achieve that? I am sure I saw something like that on the net somewhere but I cannot find it back :frowning:

Thanks in advance!
Anton

There are a few ways, the way I’d probably try first is using a Expose Transform Helper. You can use it to extract the local or world rotation of the rig element (per axis) that has the look at on it. Then you can wire your trailer Z rotation to that value.

Another way would be with a script controller on an intermediary object, but I feel you’d be replicating what the expose transform helper does, and would be slower.

Wow! I didn’t know about the Expose Transform Helper! This seem to be the solution to all my problems. Now I have to go back and redo the rig using this. Thanks alot!

hehe yeah useful little thing.
I think it was a new feature in max 7, that was a good year for rigging in max :slight_smile:

good luck with the rig.