Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / Modeling / Attaching Scripts to Objects.
  RSS 2.0 ATOM  

Attaching Scripts to Objects.
Rate this thread
 
47485
 
Permlink of this thread  
avatar
  • Total Posts: 101
  • Joined: 31 August 2010 07:17 AM

Dear all,

I wish to use Softimage as a 3D Level Editor for my game. It would be exremely practical, if I can attach some short script to a particular object. Later, it could be exported, say, into .DXF file.

My question therefore is, if Softimage 2011 64bit allows attaching few additonal lines of script/text to object/cameras/lights/etc… I would efine some object properties, invulnerability, tags, and basic behavior to objects..

If not directly, is there a way how to achieve this via scripting?

I did not find a forum specified for scripting, therefore I ask here.

Thank you. Regards.



Replies: 0
avatar
  • mantom
  • Posted: 21 September 2010 12:03 PM

If you needed to attached script code to objects, then use a text property and apply it to the relevent objects.

Most workflows don’t attach “scripts” to objects.  Rather, you’d be creating custom properties with the parameters and values you desire, and apply that to the object(s) in question.  When exported, the engine/parser on the other end would be able to interpret that data as needed.

I would advise reading the appropriate material in the SDK guides about creating your own custom properties (Help > SDK Guide > customizing with the SDK > Custom Properties).

The workflow is pretty simple:

1) write your script that defines the self-installing custom property and it’s parameters.
2) install (drag n’ drop) the custom property into the ‘plugins’ folder of your workgroup
3) Inside Softimage, apply custom property to scene object(s).  Usually accomplished with a simple script that iterates through the selection list and applies the property using ProjectItem.AddProperty().
4) Open the PPG for the custom property and edit values as desired.
5) export scene to your game.

I would advise using ‘self-installing’ custom properties because they have some built-in properties that are really handy.  The main advantage is all instances of the custom property have the same “type” so tools can find the properties easily and not have to rely on object names.  You also have the ability to create custom UI for the property to arrange controls in the PPG as you like.  If you need to modify the PPG layout, just make the changes in the custom property’s script and it’ll be reflected in all instances deployed in scenes next time they’re opened/refreshed.

Although customparamsets created through the “parameter” menu of the Animation toolbar could also be used, they’re localized to the scene in which they were created, don’t have UI customization capability, and cannot be uniquely identified by tools.  Therefore, you’d have to regenerate the customparamset from scratch each time you need it.



Replies: 0
avatar

Dear Mantom,

beautifully written and explained. I simply do not have another questions.

Thank you.



Replies: 0