gl.model: "texgroup 0" message crashes max.. and stuff
I am experiencing crashes when I try to assign textures to a model using the "texgroup 0 xx" message.
If I open the jit.gl.model help-patcher, load seymour, create a jit.gl.texture and try to assign it to the model with "texgroup 0 mytex": Max crashes instantly.
It does not matter how I format the texgroup message, nor does the texture-type.
If I use the normal "texture tex1 tex2 .." message It works like one would expect. Except if I try to assign more textures than there are drawgroups. –> Max crashes.
I did not work very often with jit.gl.model yet, so am I doing something unexpected? Or is it just that you have to define all textures for a model within a .material file?
The reason I want to use several textures are: Lighting. E.g. A color map, a normal map, a specular map ….
I forgot: OsX 10.6.8, Nvidia GT330M, Max6.0.5
thanks for the report regarding the texgroup crashing. i can reproduce.
the first texgroup argument should be a number between 1 and the number of drawgroups in the mesh (not 0).
you probably don’t want to be using the "texgroup" message to achieve what you are describing. texgroup is legacy functionality, from previous versions of the jit.gl.model.
jit.gl.model creates internal jit.gl.material objects for all the materials loaded from the model-file. you can get a dictionary-description of these materials with the "getmaterial_dict" message, followed by the material index. the material index corresponds to the drawgroup index (however materials can be shared among drawgroups).
you can modify the materials with different texture properties by using the sendmaterial message. there is an example patch that demonstrates this functionality found here:
any message or attribute of the jit.gl.material object can be handled using the "sendmaterial" message.
you can also change the properties of the internal textures, using the "sendtexture" message, although this won’t help you if the existing model-file doesn’t already contain the textures.
please check this out and let me know if you have any more questions, or need some clarifications.
Awesome. I’ll dig right in.
Thank you for the informations.
I cannot find the example mentioned:
Can someone send an updated source or url for this maxpat, the Cycling ’74 literature is really cloudy on jit.gl.material properties and anything that can help make it clearer would be helpful.