PDA

View Full Version : How to move objects using variables? (Max 8)


Goig!
06-06-2006, 03:04 AM
This is the problem I have, I want to make a Custom Attribute slider that moves one object 1 unit distance along local axis X and another object the same distance in the opposite direction. Basically the objects would swap positions.
By the way, a complication may arise from the fact that the second object is parented to the first object.

Now Iīve been squeezing my brain and I havenīt found how to make this, apparently simple thing. Itīs not that I canīt come up with the logical steps for it:

Slider with a value from 0 to 1, create a variable with the input from this slider, letīs call this variable "Bob"
The X position of the first object should be "X position + Bob"
The X Position of the second object should be "X position - 2*Bob" (since this object is a child of the first as the parent moves one unit it has to move back 2 units to end up in the original position of the first object... clear, no?

Quite simple, but I canīt figure out how to get it done. Any ideas?

omega3d
06-06-2006, 04:21 AM
I think it would work if you used 2way wiring params and had a negative parameter on one of the objects.. then have a CA and wire that to the X or Y or Z position of the object.. I believe that would work..

eek
06-06-2006, 07:04 AM
Make a CA slider range 0-1.
Wire the first objects[x] to the slider.
Wire the second object to the firsts objects negative value eg. '-x_position.'

Now as its parented you having to double the value eg. as the first goes from 0 to 10, so does the second. So a straignt negative value will result it ending up at 0, so you have to multiply it by 2. eg.

-X_postion * 2

cheers,

Goig!
06-06-2006, 12:17 PM
Thanks. eek and Omega3d, but Iīve already tried that and it doesnīt work as I want, because I want to be able to animate the parent box on its own; if I simply wire the x position to the slider I can only move it within the sliders range.

I think I should explain what Iīm up to with this.
What I want to do is make a foot controller that can be repositioned along the lenght of the foot. In the typical control setup of a feet you have a master foot control that usually pivots at the heel, a ball bend control and another control to pivot the foot at tip. What I want to do is to have a position and rotation control at the heel that can be moved to the tip so I can vary the foots point of rotation, basically I want to be able to animate the footīs pivot point.
To do this Iīve come to the idea of adding an auxiliary controller to the footh, between the footīs master control and the other controlers, so when I move the master to the tip the auxiliar one moves to the heel, thus keeping the other controllers and the feet in place. Does that make sense?, maybe I should make a sketch later... =)

Thatīs why I need to move the master controller with variables and not a straightforward wiring, I need to get the current x position of both the master and auxiliar and then add the slider value to the first and substract it to the second so the system works independently of the position where the master controller is.

omega3d
06-06-2006, 01:48 PM
I tried something else.. I made a little video with the Max file. I believe this may work in your situation.. If I understand what you aresaying..

http://pinnacle3d.com/Wiring.zip

I used the Motion panel and the PositionXYZ and Position Lists & instead of using a CA, I just used a manipulator, it works the same way..

Goig!
06-06-2006, 03:03 PM
I tried something else.. I made a little video with the Max file. I believe this may work in your situation.. If I understand what you aresaying..

http://pinnacle3d.com/Wiring.zip

I used the Motion panel and the PositionXYZ and Position Lists & instead of using a CA, I just used a manipulator, it works the same way..

Many thanks for that little tutorial, its very informative; unfortunately it doesnīt work when I parent one of the objects to the other.
I attached a file with a mock-up of what Iīm aiming for, I animated by hand the position of the dummy that keeps the feet in place... I hope this is self explanatory enough.

Youīll have to rename the extension from .txt to .rar

omega3d
06-06-2006, 07:37 PM
So what was wrong with this part of the foot rig? is it the little movement in frames 25-35?

eek
06-06-2006, 07:59 PM
OHHHHHHHH!!! Well, thats an entirely different thing your trying to do. IF you want to drive it in a controlled fashion i.e rotate the heel> ball > then toe. This is easy via scripting and expressions. What your trying to do sounds like using and converting transforms, its complicated stuff.

If you want the pivot to be anywhere, this is doable - but im not gunna explain how just atm.

eek

Goig!
06-07-2006, 12:10 AM
If you want the pivot to be anywhere, this is doable - but im not gunna explain how just atm.

eek

Yep, thatīs the idea; for now, in the rig Iīm building, Iīve set the dummy in the foot to be adjusted manually; not very elegant but just as effective as a tidy slider.

Goig!
06-07-2006, 01:29 AM
So what was wrong with this part of the foot rig? is it the little movement in frames 25-35?

Yes, thatīs part of the problem; that mock-up works by moving the dummy object by hand so the foot controller its repositioned so the pivot point ends in another part of the footīs lenght. For this example I eyeballed the counter movement of the dummy, a more precise way would be, if I want to move the pivot say, 30 cm towards the tip I should move the foot controler by that amount and then the dummy by -30 cm, that way the foot remains in place and the controler pivots in another location.

This is useful for example when you want to make your character turn around on its toes, or around the ball of the foot without the other feet controllers getting out of alignment or having to orbit your foot controller around an offset center.

What I am looking for is to have a Custom Attribute or the like working on a function that takes the position of the foot controller and moves it X cm in one direction and the Auxiliar Dummy X cm in the opposite, so the foot remains in place and the pivot changes.

CGTalk Moderation
06-07-2006, 01:29 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.