you can use the as3 output from prefab as holder.
var mymanymanyMeshes:MyOutput : new Output();
myManyManyMeshes.meshes[0].material = myBetterMaterial;
or loop over the meshes
and compare names.
for(var i ...
if(name == myManyManyMeshes.meshes[i].name)
Prefab does output only unique names.
note that if you do use bitmapmaterial, it would be better to make a small
render at say 32x32
this way awd parser will make all the materials for you. You simply then to
swap bitmap instead of generating eveything by hand.
Fabrice
PS: --> dam, the f9 as3 is still outputing MatrixAway3d??? will be fixed next
update!
On Jul 26, 2010, at 9:33 AM, martinillo wrote:
> Hi all, Hi Fabrice
>
> I am using away3d 2.5, Flash CS3, Prefab 1.375 and blender 2.49b.
>
> Away3d is very cool but on one thing I got stuck: I need to replace
> the material textures of each 3d object during runtime a lot. earlyer
> i used the away collada importer and was able to alter the material
> library so that i could change things very easy and quick. but the
> file sizes of colladas are quite bad. and I temporarily updated my
> away3d from the trunk and got an additional 10 second delay while
> loading the colladas...
>
> Using models as classes would be great. but how to do so and not
> loosing the material library?
>
> I do the following:
> 1. export from blender as collada 1.4
> 2. import in prefab
> 3. export from prefab "As Away3d AS3 class". Using "Away3D Flash 9"
> and "Only geometry"
> 4. search & Replace MatrixAway3d with Matrix3d in the output .as file
> 5. load in away3d and set "modell.material=xy;"
>
> is there a more simple way?
> (e.g. I tried the blender export-plugin from rozengain.com but the
> output is as well without materials.)
>
> And how to retrive the material library from blender? the goal is to
> have "Material_001", "_002"... and so on in each of my 3d object
> classes so that i can replace the assigned texture for all objects
> easily. Or is there a alternative solution to replace them?
>
> Thank you for your advice!
> Martin