Jump to content
Search Community

Infamous question: Papervision3d Plane apply filter

Choochoo test
Moderator Tag

Recommended Posts

I have searched everywhere and cannot find solution.

 

I have a simple filter being applied to a plane (event.currentTarget) and its being triggered but nothing happens. Its looking for a movieclip and I'm just using a regular plane and bitmapmaterial on it.

 

 

import com.greensock.*;

import com.greensock.easing.*;

import com.greensock.plugins.*;

 

TweenPlugin.activate([TintPlugin]);

 

TweenLite.to(event.currentTarget, 1, {tint:{color:0xFFFFFF, tintAmount:0.5} });

 

I've been on this for a few hours now and any help would be very useful. Thank you.

Link to comment
Share on other sites

You're passing the wrong kind of value to tint.

 

BAD: tint:{color:0xFFFFFF, tintAmount:0.5}

 

GOOD: tint:0xFFFFFF

 

If you need to control the amount of tint, just use the colorTransform plugin, like:

 

import com.greensock.*;
import com.greensock.plugins.*;

TweenPlugin.activate([ColorTransformPlugin]);

TweenLite.to(event.currentTarget, 1, {colorTransform:{tint:0xFFFFFF, tintAmount:0.5} });

Link to comment
Share on other sites

Thanks for the reply, you give awesome support here by the way.

 

I tried your code and it went through, but it still didn't change the tint, I tried using the tint in the way you said, the colortransform in the way you said, and added both plugins.

 

I am sure it works on a plane with a color material background,but I have a bitmapmaterial that I applied to my plane, and it doesn't want to budge at all. Regular X,Y,Z and rotation tweening works perfectly though.

Link to comment
Share on other sites

  • 2 weeks later...

Hey thanks, I figured it out.

 

Need to make sure the material is a MovieMaterial, created from a movieclip....example:

 

private function maskPlane(w:Number,h:Number,thex:Number,they:Number):Plane

{

var mm:MovieMaterial = new MovieMaterial(createFill(w,h),false,true);

var p:Plane = new Plane(mm,w,h);

p.position = this.position;

p.z -=5;

p.x = thex;

p.y = they;

p.useOwnContainer = true;

return p;

}

 

private function createFill(w:Number,h:Number):MovieClip

{

var holder:MovieClip = new MovieClip();

holder.graphics.beginFill(0x58595B);

holder.graphics.drawRect(0, 0, w, h);

holder.graphics.endFill();

return holder;

}

 

make sure .usecontainer = true as well (as shown above); and also what ukla said, moviematerial needs to be (true) for animated... then to animate, you animate the movie of the plane's material.

 

TweenMax.allTo([MovieMaterial(top.material).movie,MovieMaterial(left.material).movie,MovieMaterial(right.material).movie,MovieMaterial(bottom.material).movie],.3,{tint:0xC1DCF7}),0);

 

 

might be ugly code, BUT IT WORKS, WOOHOO

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...