[Maya] - Expressions Vs Node Tree for a tool

Hey all.

Long winded, but the question I’m asking isn’t specific, just a general theory question. Shouldn’t be hard for advanced TDs that have been doing this stuff for a while.

I just created the foundation for a script that will be in essence a product light rig. The idea behind this is to have a general light rig that adapts to camera position and “light rig origin”. Right now everything is driven by an expression, but is this the best way to build up? Should I attempt to reproduce the expression as a node tree (for expand-ability purposes for features described below).

A video below to describe what I’m talking about. Imagine the small box is a camera and the big box is a light with an eventual look-at constraint to the origin.

[video]https://youtu.be/P9kZb3_d9gU[/video]

The “light” is maintaining a specific angle offset from the camera as the locator is acting as origin. The goal here is to have it be able have the following functionality-

-Have tweak offset controls for each light

-Add, subtract lights from the rig

-Swap out light types (all vray driven) from different HDRI images of lights to things like a gradient softbox

-Be able to push all settings (number of lights, light types, any offsets, intensity values) into a .INI config file acting as a database so that the specific settings can be pushed back into the system.

So should I be using expressions here? Or would I be better served by creating a node tree which would be generated by a python script? I’m thinking Node tree by Python would be the most sensible route here.

Thanks,
9k

After thinking about it for a little while longer, this is going to need to be a mix of a python driven node tree. Maybe have an expression created by python/mel in there, but I’d like to avoid that if possible since I’ve had complications driving expressions through Python before.

If any of you have any theory tips on how to setup a “plugin” like this let me know. Seems a bit daunting… I know I could hardcode everything, but I want this to be flexible. Will post more updates on where I’m at in this thread.

After digging into this a little bit more I found out how to do everything in Python. I was a bit confused at first as expressions are updated constantly and I didn’t know how to do this with Python (yet).

Ended up using a scriptJob and it worked really well. Not as sexy as expressions as I cannot see the lights changing real time, but still worked out really well. (making a studio lighting tool btw… Need to add a lot more functionality, but the heavy lifting is done for the most part).

[video]https://youtu.be/3T9ZArXC7ao[/video]

I’ll make a final post once I get this thing done and all polished off. I think it’s really going to be an asset in workflow for what I do (lots of product renders).