changing materials of an .awd (2) file

Software: Away3D 4.x

Qbrain, Member
Posted: 04 December 2012 10:34 AM   Total Posts: 92

Hey Everyone,

I want to add a normal map to one of the 150 materials an .awd (2) file is using. (since awd2 doesnt support normal maps yet.)

How can I acces a specific material inside the awd format and change the material of it in away3d 4?

It would be great if there were tutorials/examples/documentation for this, and I would love to make them if I am able to change stuff in it.

thanks already!

-Q

   

Avatar
loth, Sr. Member
Posted: 18 December 2012 12:46 AM   Total Posts: 236   [ # 1 ]

that’s easy
when you load your model use
loader3d.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);

function onAssetComplete(event : AssetEvent) : void {
  if (event.asset.assetType == AssetType.MESH) {
    var mesh : Mesh = event.asset as Mesh;
    if (mesh.name == “myModelName”) {
  mesh.material.normalMap = Cast.bitmapTexture(_bitmap);
  }
}}

myModelName is the name you done in 3dsmax

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X