Question about transform script controller...

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2013
Question about transform script controller...

When you assign a transform script controller to an object, the transform gizmo's position, rotation, and scale values change when you manipulate them but obviously have no affect on the object. Is there a way to access and use the gizmo's own position, rotation, and scale values as parameters in the object's custom transform script?
 
  02 February 2013
Like this?

http://www.scriptspot.com/3ds-max/scripts/gizmocontrol
 
  02 February 2013
Originally Posted by scrimski: Like this?

http://www.scriptspot.com/3ds-max/scripts/gizmocontrol


No... I'm not at a computer to verify, but that appears to only be for modifier gizmos.

Do this... create an object. Change the PRS controller by assigning a transform script controller to the object. Now try to move, rotate, or scale the object by the usual means... you see the gizmo appears to work with the values changing, but they have no affect on the object... I want to access these gizmo shape values and use them in the transform script.
 
  02 February 2013
You can always have multiple list controllers instead of a single PRS script controller. I don't know what you intend to do but maybe having a helper object that you'd read the values from instead would be a way. Or maybe there's much simpler way but nobody will be able to tell from your description
__________________
Scripts :: linkedin
 
  02 February 2013
Originally Posted by Swordslayer: You can always have multiple list controllers instead of a single PRS script controller. I don't know what you intend to do but maybe having a helper object that you'd read the values from instead would be a way. Or maybe there's much simpler way but nobody will be able to tell from your description


Thanks for your reply... I thought my example was pretty clear. Did you give it a try? I want to write my own custom transform script controller and use its own gizmo's values in deriving the matrix3 result. I've searched the Maxscript reference, but can't find anywhere how to access the gizmo's values.
 
  02 February 2013
Originally Posted by Archangel35757: Thanks for your reply... I thought my example was pretty clear. Did you give it a try?


I didn't say I had no idea what you wanted to do, your example makes sense. Well, sort of, anyway. What I don't know, though, is why did you choose this way which might prove to be quite painful (and potentially slow) instead of using a helper (for example). Is there any reason for that?
__________________
Scripts :: linkedin
 
  02 February 2013
Originally Posted by Swordslayer: …What I don't know, though, is why did you choose this way which might prove to be quite painful (and potentially slow) instead of using a helper (for example). Is there any reason for that?


I don't want to have to depend on another object. Either it's possible or not-- if someone knows how to access the gizmo's values on an object with a Transform Script Controller via Maxscript please tell me-- I would be really grateful.
 
  02 February 2013
Originally Posted by Archangel35757: I don't want to have to depend on another object. Either it's possible or not-- if someone knows how to access the gizmo's values on an object with a Transform Script Controller via Maxscript please tell me-- I would be really grateful.


You could try the following:
create a lsit controller for the position. assign a script controller into the new slot, set the weight for the original slot to 0% and read out it's values, either by scripting or using a Expose TM Helper
 
  02 February 2013
Originally Posted by scrimski: You could try the following:
create a list controller for the position. assign a script controller into the new slot, set the weight for the original slot to 0% and read out it's values, either by scripting or using a Expose TM Helper


Thanks for the reply. When you assign a Transform Script Controller to an object it has to return a Matrix3 value-- it completely replaces the PRS Controller... so there are no position, rotation, or scale tracks. I know I can add custom attributes to the Transform Script controller.

Last edited by Archangel35757 : 02 February 2013 at 04:13 PM.
 
  02 February 2013
does it need to be a TM controller or would scripted controllers for position, rotation and scale do the job?
 
  02 February 2013
Originally Posted by scrimski: does it need to be a TM controller or would scripted controllers for position, rotation and scale do the job?



I do see your point, and I might be able to accomplish what I want by using list controllers and script controllers in the PRS Controller's position and rotation tracks, but I don't want to confuse my question. But I will look into that...
 
  02 February 2013
Originally Posted by Archangel35757: When you assign a transform script controller to an object, the transform gizmo's position, rotation, and scale values change when you manipulate them but obviously have no affect on the object. Is there a way to access and use the gizmo's own position, rotation, and scale values as parameters in the object's custom transform script?


No. The act of assigning a transform controller essentially nullifies its controller interface access at that high level (grandparent of the entire controller tree).

The relationship of the interface to the transforms i.e gizmo control IS through controller assignment, so when you stomp on them it breaks that tie. Unless you use lists.

The best thing to do is on position, rotation and scale controllers add list controllers - the available slot could be a script controller. In the script controller you could have a weak reference pointing to the first controller in the stack - with the first controller being the active one - so you can use it.

This is because the order of operation multiplication top-to-bottom controllers, of left-to-right for matrix multiplication. Your multiplying the first controller with the second in the controller stack.

To note all controller work in local space, even constraints - they do some funky stuff with parent spaces and offsets. If your object is parented, to push it back into world space you'd multiply it by its inverse parent space. But remember this will give it the identity so you'd have to add an offset.

cheers,
__________________
Disclaimer: My opinions are not those of my employer.


 
  02 February 2013
Thanks eek for the answer...

Quote: …To note all controller work in local space, even constraints - they do some funky stuff with parent spaces and offsets. If your object is parented, to push it back into world space you'd multiply it by its inverse parent space. But remember this will give it the identity so you'd have to add an offset.

cheers,


I thought all controllers worked in parent space-- or maybe I'm misunderstanding you?
 
  02 February 2013
Originally Posted by Archangel35757: Thanks eek for the answer...



I thought all controllers worked in parent space-- or maybe I'm misunderstanding you?


Same thing - local space is parent space. Crucially everything is relative to something i.e it has a basis.

As a side note you could swap the controllers, so the first gets the script and the second is active as a regular controller. I could be wrong but they should be mutually exclusive i.e each controller is relative to its parent and at evaluation there multiplied together.
__________________
Disclaimer: My opinions are not those of my employer.


 
  02 February 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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 04:06 AM.


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