AEGP_LayerFlag_LAYER_IS_3D

Hi!
I got a crazy problem with AEGP_LayerFlag_LAYER_IS_3D in a layer effect. I'm trying to make a layer automatically collapsed when 3D, and uncollapsed when 2D.
Here's my code:
ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectLayer(in_data->effect_ref, &layerH));
ERR(suites.LayerSuite7()->AEGP_GetLayerFlags( layerH, &flags));
if (flags & AEGP_LayerFlag_LAYER_IS_3D) {
if (flags & ~AEGP_LayerFlag_COLLAPSE) {
ERR(suites.LayerSuite7()->AEGP_SetLayerFlag( layerH, AEGP_LayerFlag_COLLAPSE, TRUE));
} else {
if (flags & AEGP_LayerFlag_COLLAPSE) {
ERR(suites.LayerSuite7()->AEGP_SetLayerFlag( layerH, AEGP_LayerFlag_COLLAPSE, FALSE));
Using the same code with AEGP_LayerFlag_ADJUSTMENT_LAYER instead of AEGP_LayerFlag_LAYER_IS_3D works just fine...
Is there something I don't get about 3D layers?
Thanx,
François
PS: I tried with && instead of &, with LayerSuite1() instead of LayerSuite7()...

Hello Shachar! :-)
It works fine with the parameter, but I got a problem with "if (flags & ~AEGP_LayerFlag_COLLAPSE) {DO SOMETHING}" now...
It doesn't work this way, I have to write: "if (flags & AEGP_LayerFlag_COLLAPSE) {} else {DO SOMETHING}"
Is there a mistake in writing "(flags & ~AEGP_LayerFlag_COLLAPSE)", or do we get closer to the issue?
Cheers,
François

Similar Messages

Maybe you are looking for