gl.model: "texgroup 0" message crashes max.. and stuff

    Jun 08 2012 | 11:51 am
    I am experiencing crashes when I try to assign textures to a model using the "texgroup 0 xx" message.
    If I open the help-patcher, load seymour, create a 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 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 ....
    Thanks alot! Regards.

    • Jun 08 2012 | 3:25 pm
      I forgot: OsX 10.6.8, Nvidia GT330M, Max6.0.5
    • Jun 08 2012 | 5:20 pm
      hello. 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 creates internal 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: Max6/examples/jitter-examples/render/model/model.material.edit.maxpat
      any message or attribute of the 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.
    • Jun 09 2012 | 7:52 am
      Awesome. I'll dig right in. Thank you for the informations.
    • Jul 21 2013 | 10:27 pm
      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 properties and anything that can help make it clearer would be helpful.