Constrain Position of Object A to Scale of Object B

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  07 July 2013
Constrain Position of Object A to Scale of Object B

Good afternoon,

Is it possible to constrain the position of object A to scale of object B? Essentially I want to scale object B in a set axis based on the distance away object A is from it.
  07 July 2013
Depends on what you actually want, for connecting the position to scale the most straightforward is to use wire parameters - assign ScaleXYZ controller to object B scale transform part, rightclick the object and in the quadmenu pick Wire Parameters. After choosing for example Transform > Scale > Z Scale a dialog will pop up where you can pick for example X Position controller of object A.

If you would rather want to use relative distance instead of absolute position on one axis, scripted controllers are another way:

	local objectA = Point pos:[-10,0,0]
	local objectB = Box pos:[10,0,0]
	objectB.scale.controller = ScaleXYZ()

	local ctrl = float_script()
	ctrl.addTarget #pos objectA[#transform][#position]
	ctrl.addObject #self (nodeTransformMonitor node:objectB)
	ctrl.setExpression "distance pos self.pos / 100"

	objectB.scale.controller.z_scale.controller = ctrl
Scripts :: linkedin
  07 July 2013
Try the Reaction Manager.
Renderfarm hire available @
  07 July 2013
To extract the distance between two objects(and ultimately using it in a wiring operation), you can use a helper object called 'Expose Transform', it returns a lot of parameters one of which is the distance between it and a referenced object, then you can of course use that value to derive the scale of the other object the way Swordslayer described...
  08 August 2013
Many thanks for the great responses regarding my original post. They have all been helpful on my quest to find a solution for this project. I am sorry for my lack of response since the original post but I was away for three weeks doing various things but am back now. Once again thank you so much!
  08 August 2013
I think this can be useful to you too:

This guy is explaining the reaction manager in this clip, and I think he tied the scale of one object to the position of other as an example, as far as I can remember
  08 August 2013
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:01 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.