When a obj model loaded(has texture), then set lights, error occured.

Software: Away3D 4.x

liuyi, Member
Posted: 08 September 2011 11:07 AM   Total Posts: 65

(it show chinese,I tranlate it to english, I am in china)

TypeErrorError #2007: param data can not be empty? 


code snippets come from BvhTriangleMeshCarTest.as

var materia :BitmapMaterial=new BitmapMaterial((new CarSkin() as Bitmap).bitmapData)
   
[strong]materia.lights [_light,_pl];[/strong]
   materia
.ambient 0.8;
   
materia.specular 0.8;
   
materia.specularColor 0xff0000;
   
   
   
materia.shadowMethod = new FilteredShadowMapMethod(_light);
   var 
sceneMesh Mesh Mesh(container.getChildAt(0));
   
sceneMesh.geometry.scale(1000);
   
sceneMesh.geometry.scaleUV(1000);
   
sceneMesh.material materia;
   
sceneMesh.castsShadows true


or

var sceneMesh Mesh Mesh(container.getChildAt(0));
   
sceneMesh.geometry.scale(1000);
   
sceneMesh.geometry.scaleUV(1000);
  
// sceneMesh.material = materia;
   //sceneMesh.castsShadows = true;
   
(sceneMesh.material as BitmapMaterial).lights=[_light] 

both got error.
Please help try any example on github or write a simple test class .

Thanks.

   

liuyi, Member
Posted: 09 September 2011 02:47 AM   Total Posts: 65   [ # 1 ]

No one got this problem?

   

Mr Margaret Scratcher, Sr. Member
Posted: 09 September 2011 03:02 AM   Total Posts: 344   [ # 2 ]

I had this, I think I fixed it by importing the .obj into prefab, and then re-exporting… Let me know if this helps..

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X