Page 1 of 1

3D switch bug

Posted: April 17th, 2009, 7:07 am
by nab
Hey guys,

I'm not sure whether it is a bug or if I misunderstand something, but I observed the same behavior on both CS3 and CS4 (Mac & Win).

Setting the 3D flag to true, when the layer is already 3D, resets the Z position to 0. It seems that internally the 3D switch is first disabled, and then it is (re)enabled. This could explain why the former Z value is lost.

To test the snippet below, create a new solid, enable its 3D switch, and change the Z position.

Code: Select all

var comp = app.project.activeItem;
var layer = app.project.activeItem.layer(1); // assume 3D layer
var prevZ = layer.position.value[2];
layer.threeDLayer = true;
var curZ = layer.position.value[2];
alert("Previous Z: " + prevZ + "\r Current Z: " + curZ);
Of course this can be avoided by replacing layer.threeDLayer = true; with if (!layer.threeDLayer) layer.threeDLayer = true;.

Re: 3D switch bug

Posted: April 17th, 2009, 5:23 pm
by Yenaphe
Nice find !

Re: 3D switch bug

Posted: April 19th, 2009, 3:33 am
by davestewart
Not sure if you can file a bug report or not. Maybe check the adobe site or the scripting reference.