Posted: Sat Sep 22, 2012 1:57 am
Joined: 22 Sep 2012
Posts: 5
Hy everyone. I got a quick question.
Does anyone knows in wich order does the exporter map the materials to subsets?
I want to create a shader in my engine in the place of the materials. For that i need to know to wich material does each subset "points"
For example, I export a model with two materials, material "A" and "B".
How do I know where's the material "A". is in subset 0, or in 1 ?
Thanks in advance.
_________________
Fusion Games Studio - A dream today, a game tomorrow
Posted: Sun Sep 23, 2012 1:25 am
Joined: 22 Sep 2012
Posts: 5
I'm still with this. Anyone?
_________________
Fusion Games Studio - A dream today, a game tomorrow
Posted: Sun Sep 23, 2012 11:10 pm
Joined: 22 Sep 2012
Posts: 5
If anyone care, I solve it. It orders them in the creation order. Blender appears to do that too to selections.
_________________
Fusion Games Studio - A dream today, a game tomorrow
Posted: Mon Sep 24, 2012 8:34 pm
Joined: 05 Apr 2009
Posts: 680
object materials are organized in material slots, and the slot order as seen in material tab is kept.
If you access materials via python like bpy.data.materials, their numerical order is alphabetically:
bpy.data.materials[0].name -> "1_second"
bpy.data.materials[1].name -> "2_first"
material "2_first" was created first, "1_second" later. The order (0, 1, ...) in bpy.data.materials changes with material names.
_________________
I'm sitting, waiting, wishing, building Blender in superstition...