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 07-04-2011, 03:18 PM   #1
Ojah
Veteran
 
Ojah's Avatar
Hajo Hoetjes
Utrecht, Netherlands
 
Join Date: Sep 2002
Posts: 65
Getting an object from a script controller.

Hi,

got a small problem with scripted controllers and hoped you guys could help me .

Im simply trying to extract the objects used in a scriptcontroller. To test this i made some simple code that creates a box with a scriptcontroller that references a created cylinder's position controller.
Now if I want to get the cylinder-object by using getTarget my print returns the controller (Controller:Position_XYZ).
code:
Code:
theBox = box name:"testbox" theCyl = cylinder name:"testCylinder" theBox.pos.controller[1].controller = (float_script()) ctrl = theBox.pos.controller[1].controller ctrl.addTarget "testTarget" theCyl.pos.controller getCyl = ctrl.getTarget 5 asObject:true print getCyl

if anyone knows how to get the print to show the cylinder object, please let me know
Thanks
 
Old 07-04-2011, 08:29 PM   #2
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,416
Look up refs in the help and also have a look at a post that JHN just posted about additions to the struct. You will need to find out what is dependent on that controller.
__________________
Paul Neale
http://paulneale.com
 
Old 07-05-2011, 10:26 AM   #3
Ojah
Veteran
 
Ojah's Avatar
Hajo Hoetjes
Utrecht, Netherlands
 
Join Date: Sep 2002
Posts: 65
Thanks! Works perfect and learned something new . Too bad im working on an old version of max though so i cannot check those additions atm, seems to be something to keep in mind.
 
Old 07-05-2011, 10:26 AM   #4
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 04:02 AM.


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