CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-16-2013, 12:07 AM   #1
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 485
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?
 
Old 02-16-2013, 12:55 AM   #2
scrimski
antieverything
portfolio
J. Schreyer
head->wall
ARRI Berlin
Berlin, Germany
 
Join Date: Aug 2003
Posts: 7,983
 
Old 02-16-2013, 01:28 AM   #3
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 485
Quote:
Originally Posted by scrimski


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.
 
Old 02-16-2013, 08:54 AM   #4
Swordslayer
isKindOf Artist
 
Swordslayer's Avatar
portfolio
Vojtech Cada
3D generalist
Czech Republic
 
Join Date: Jun 2006
Posts: 376
Send a message via ICQ to 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
__________________
Blog :: LinkedIn profile
 
Old 02-16-2013, 02:32 PM   #5
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 485
Quote:
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.
 
Old 02-16-2013, 04:33 PM   #6
Swordslayer
isKindOf Artist
 
Swordslayer's Avatar
portfolio
Vojtech Cada
3D generalist
Czech Republic
 
Join Date: Jun 2006
Posts: 376
Send a message via ICQ to Swordslayer
Quote:
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?
__________________
Blog :: LinkedIn profile
 
Old 02-18-2013, 03:35 PM   #7
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 485
Quote:
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.
 
Old 02-18-2013, 03:44 PM   #8
scrimski
antieverything
portfolio
J. Schreyer
head->wall
ARRI Berlin
Berlin, Germany
 
Join Date: Aug 2003
Posts: 7,983
Quote:
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
 
Old 02-18-2013, 03:58 PM   #9
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 485
Quote:
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-18-2013 at 04:13 PM.
 
Old 02-18-2013, 04:10 PM   #10
scrimski
antieverything
portfolio
J. Schreyer
head->wall
ARRI Berlin
Berlin, Germany
 
Join Date: Aug 2003
Posts: 7,983
does it need to be a TM controller or would scripted controllers for position, rotation and scale do the job?
 
Old 02-18-2013, 04:14 PM   #11
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 485
Quote:
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...
 
Old 02-18-2013, 04:28 PM   #12
eek
Fixer
 
eek's Avatar
portfolio
Charles Looker
Snr Technical Artist
Electronic Arts
Vancouver, Canada
 
Join Date: Feb 2002
Posts: 4,221
Quote:
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.


 
Old 02-18-2013, 04:55 PM   #13
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 485
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?
 
Old 02-18-2013, 05:00 PM   #14
eek
Fixer
 
eek's Avatar
portfolio
Charles Looker
Snr Technical Artist
Electronic Arts
Vancouver, Canada
 
Join Date: Feb 2002
Posts: 4,221
Quote:
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.


 
Old 02-18-2013, 05:00 PM   #15
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:01 PM.


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