View Full Version : Get Layout Selected Item
Hey,
How do I store a reference to the selected object in layout. I had been using Mesh(), but It gets the first loaded object.
Thanks,
Wes
evenflcw
02-10-2006, 06:58 PM
Not sure what you want, but...
scene = Scene(); //Creates scene obj agent
item = scene.firstSelect(); //Creates an object agent for the first selected item.
After that you can you can use any common (lscript reference manual, chapter 5) or type-specific (chapter 6-10) data member or method on that oa, ex. pos = item.getPosition(time). Naturally if you have several functions inside your script (create{}, process{} etc) you should probably declare 'item' as a global variable.
EDIT: If you want to save the reference to an item between Layout sessions someone presented a clever way to do this by using item id offsets.
wesleym
02-28-2006, 02:29 PM
Thanks that will help. I am trying to apply a certain shader to all of the surfaces of a selected object. I now, would like to be able to do this to all of the images loaded in the image editor. I am going to post a new thread on this.
Thanks for the help,
Wes
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.