Page 1 of 1

attributes driving an object's geometry

Posted: Sat Feb 07, 2009 2:22 pm
by deadalvs
hi ..

is it possible to have an object's attribute drive it's geometry ?

i am thinking about an input field (like the scale value) that drives for example the frame width in a window.

how's it possible or done best to create such intelligent objects without using construction history ?

Posted: Sat Feb 07, 2009 8:09 pm
by DrMerman
Hey man :)

Something like this? :

http://www.drmerman.com/dump/windowFrame.mb

Basically, I've used the connectAttr command to connect the FrameWidth and FrameDepth attributes to the appropriate parts of the objects history, like this :
Code: Select all
connectAttr windowFrame.FrameWidth windowFrameWidth.localScaleX;
connectAttr windowFrame.FrameWidth windowFrameWidth.localScaleY;
connectAttr windowFrame.FrameWidth windowFrameWidth.localScaleZ;

connectAttr windowFrame.FrameDepth windowFrameDepth.localTranslateZ;
You might have to do some dynamic renaming in your script if you want multiple windows, but this should get you on your way.

Hope it helps!

Matt