Animate UVs Warning

Software: Away3D 4.x

John Brookes, Moderator
Posted: 31 January 2013 12:51 PM   Total Posts: 732

Warning: animateUVs is set to true with an IRenderable without a uvTransform. Identity matrix assumed.

If you use animate UVs and set the same U or V value as a previous one
uvTransformDirty is not set (submesh line 60 & 70)
and causes the trace warning (DefaultScreenPass line 583)

private function initObjects():void
{
 
var splitH:Number 8
 
var splitV:Number 8
 
var depth:Number 69;
 var 
i:int 0;
 var 
j:int 0;
 
 var 
mat:TextureMaterial = new TextureMaterial(Cast.bitmapTexture(new ImageEmbed()));
 
mat.animateUVs true;
 
 var 
cont:ObjectContainer3D
 
var planeFrontMesh:Mesh
 
var pg:PlaneGeometry
 pg 
= new PlaneGeometry(1920 splitH1080 splitV11false)
 
 for (
0<= splitH 1i++)
 
{
  
for (0<= splitV 1j++)
  
{
       c ObjectContainer3D
();
   
cont.1920 splitH 1920 1920 / (splitH 2);
   
cont.1080 splitV * -1080 1080 / (splitV 2);
   
cont.depth 2;
   
scene.addChild(cont);
   
       
planeFr Mesh(pgmat);
   
planeFrontMesh.= -depth 2;
   
cont.addChild(planeFrontMesh);
   
   
planeFrontMesh.geometry.scaleUV(splitHsplitV);
   
//causes UV warning
   
planeFrontMesh.subMeshes[0].offsetU = ((splitH) * i);
   
planeFrontMesh.subMeshes[0].offsetV = (splitV j);
   
   
//note this doesnt cause the trace warning as offsetU is never the same as the last value set
   //so uvTransformDirty is set and matrix assigned
   //planeFrontMesh.subMeshes[0].offsetU = 1/i;
  
}
 }

 

   

John Brookes, Moderator
Posted: 31 January 2013 12:56 PM   Total Posts: 732   [ # 1 ]
for (0<= splitV 1j++)
  
{    c ObjectContainer3D(); 


And this forum keeps eating code samples.
c o n t = new ObjectContainer3D();

Posted this
https://gist.github.com/4682713
and thats what I get above

   

Matej, Jr. Member
Posted: 20 February 2013 11:10 AM   Total Posts: 38   [ # 2 ]

I get the same, seems like you avoid the traces by changing to different uv and then return back to default:)

mesh.meshes[0].subMeshes[0].offsetU 1;     
mesh.meshes[0].subMeshes[0].offsetU 0
   

John Brookes, Moderator
Posted: 20 February 2013 11:18 AM   Total Posts: 732   [ # 3 ]

yeah.
I just comment out the line that traces the warning smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X