How to assign materials to the object?

How to assign materials to the object?

Hi,

I have a question.
Is there any way to asign material to the object from the script?

I've done so far:

- adding objects to the scene;
- adding all materials to the document;
- adding material tag to my object by using addTagOfType(SHADERTAG);
- How do I tell this TAG to which material to use?

I checked this SHADERTAG's parameterInfo(), but it seems it does not have a parameter like materialIndex...:confused:
 
Hi,
yes that would be indeed something for the wish list. It isn't implemented yet. Sorry.

bye,
Martin
 
Is it possible to create materials via script and then assign them via script to an object?

I was looking into this tonight and couldn't get anything to work. Any help would be appreciated. [edit] To clarify: I can make materials just fine via script. Its adding them to an object that is the trick. Materials seem to be their own thing and I can not find a function to add them to an object. I've messed with addchildatindex and the like, but that has not worked for me either because the material is the wrong kind of object.
 
Last edited:
Back
Top