Project: Set Prop Diffuse Color Keys


https://forum.reallusion.com/Topic401595.aspx
Print Topic | Close Window

By jlittle - 5 Years Ago
Wanted to show some details of my first script I have been working on since I decided to dive into python for iClone which turned out to be a deep, deep dive.
I've worked out most of the issues but am waiting the next iClone python update to fix some functions that are not working so that I can complete this.


On the right is the color change list where you would create a list of color changes.
Each color change has a starting color and transition and a duration.

Clicking on the color box brings up a color dialog to select your color.

So you would end up with a list of color changes:

For the color changes you can REORDER them by dragging and dropping them within the list, REMOVE them, or ADD another color change.
You can also SAVE the list to a file and LOAD a previously save list from a file or CLEAR the current ist.
At the bottom of the list is the total duration time, for all color changes, in seconds and frames as well as the number of changes in the list.

On the left is the prop list.

This list will automatically update as props are added or deleted from the scene.
As you select props in the scene the they will also be selected in the prop list.
I plan on having selections in the prop list also select the prop in the scene but ... waiting on updated python API.

Once you've created a color change list, selected your prop(s), you would then select the start and end time (via spinbox or slider), select the number of times to repeat the changes and then click the ADD button to add the diffuse color keys.

The "Remove all keys prior" will delete any color diffuse keys (once that function is exposed) prior to adding the new keys.

This project is about 90% completed and already pushing 950 lines.
Doing this project covered many aspect of python and the RL API, which was the point of this project: Learn Python and the iClone API.
It even uses Qt ui files for the layouts (main dialog and color change).
There is still some cleanup to do and then the final coding, once the functions are fixed and exposed.
It was an interesting experience and there is still much to learn about this.

Jeff


By luke (RL) - 5 Years Ago
wow, very useful tool, any issue found when you do this kind of tool?
By toystorylab - 5 Years Ago
Nice, as far i understand what it is doing Wink
Would this be possible with diffuse JPEGs/PNGs?

By jlittle - 5 Years Ago
toystorylab (1/18/2019)
Would this be possible with diffuse JPEGs/PNGs?

Well, the framework of my script would definitely handle that.
Could easily change the color to a tile and the transition to a channel selection.

I have not tried the AddUvDataKey function yet and am unsure of the format of the kUVTile parameter.
I'll look into it some.

Jeff

By jlittle - 5 Years Ago
luke (RL) (1/18/2019)
... any issue found when you do this kind of tool?

There was a little learning curve, for me, on using python but being a looong time programmer it was just a matter of finding where everything was at.
Mostly the issues have been missing API functions that are needed or questions about constants:
  1) How do I get a list of all the material keys?
  2) How do I delete all, or just one, material key?
  3) How do I add a material transition key?
  4) Why are there 36 transition types (ETransitionType_<type>Wink listed in RLPy.py but iClone only shows 16 transition Curve Presets?
  5) What format is the kUVTile parameter?

I haven't gone thru all the functions yet since as my first project I pretty much just stuck to the one area of materials mostly.

Jeff

By RobertoColombo - 5 Years Ago
Hope RL will improve the doc in order to fill the gaps...