AE ENHANCERS

Expressions/Scripts/Presets
It is currently Thu May 23, 2013 2:54 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Getting/Converting Color Values From Lights?
PostPosted: Thu Feb 12, 2009 1:56 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 5:55 am
Posts: 157
Location: United States, Ohio
I am working with the AE3DExport script written by the urbanspaceman.

I am adding Blender functionality to the export section and have run into a snag on lights.

It seems there is no way to tell what kind of light an After Effects light is? Does anyone know of a way to detect the light type?

Also, working with the color of the light I am stuck. I know how to get the color
Code:
G.LIGHT_COLOR = layer.property("Color")


But how do I get access to the RGB elements of the color?

Here is my attempted Blender python output that fails.
Code:
"localLamp.R = " + G.LIGHT_COLOR[0]+G.RET+
"localLamp.G = " + G.LIGHT_COLOR[1]+G.RET+
"localLamp.B = " + G.LIGHT_COLOR[2]+G.RET+


I assumed the color value was an array, but I get undefined from the above code.

Thanks!

_________________
"Up And Atom

No...No

Up And At Them!"


Top
 Profile  
 
 Post subject: Re: Getting/Converting Color Values From Lights?
PostPosted: Fri Feb 13, 2009 7:26 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 5:55 am
Posts: 157
Location: United States, Ohio
I think I figured it out.

Code:
G.LIGHT_COLOR = layer.property("Color").value


I have to add .value to my initial color fetch.

_________________
"Up And Atom

No...No

Up And At Them!"


Top
 Profile  
 
 Post subject: Re: Getting/Converting Color Values From Lights?
PostPosted: Thu Apr 29, 2010 5:26 am 
Atomic wrote:
I think I figured it out.

Code:
G.LIGHT_COLOR = layer.property("Color").value


I have to add .value to my initial color fetch.


Hi Atomic,

Did you ever solve the light type issue. If not, try this...

Code:
function getLightType(aLightLayer) {
            
            //check it's a light layer
            if(aLightLayer.lightOption) {
               if(!aLightLayer.lightOption("Shadow Darkness").canSetExpression) {
                  //ambient light
                  return("AMBIENT");
               } else if(!aLightLayer.lightOption("Shadow Diffusion").canSetExpression){
                  //parallel light
                  return("PARALLEL");
               } else if(!aLightLayer.lightOption("Cone Angle").canSetExpression) {
                  return("POINT");
               } else {
                  return("SPOT");
               }
                  
            } else {
               return("NOT_A_LIGHT");
            }
         
         
      }


I'd be very interested if you get further with your AE to Blender script. It could not only prove useful as AE to Blender, but also as an intermediary for C4D to Blender, since I can't seem to get animating scenes from one package into the other.

Best,

Ben.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group