Changing Base Color with ERC/Proxy script?

macleanmaclean Posts: 2,438

After several hours with this one, I can't quite nail it, and I'm not sure if it's even possible. Basically, I'd like to be able to change an object's Base Color with a single control slider.

Using Rob's 'Post_Load_Material_Proxy_Create' and 'Post_Load_Material_Proxy_Link_Properties' scripts, I've added a new Surface group to Parameters for a material's Base Color. (Which, btw, in the script must be named as 'Diffuse Color', NOT 'Base Color').

Then I did a 10-stage timelined color change for Base Color. At first, I tried using a morph to trigger it. DId an ERC Freeze, but couldn't extract from the timeline. Tried New Property and that was no good. Tried creating all the above in the Surfaces group, No go. I've been in and out the Prop Hierarchy, dragging channels onto controllers, and can't get a thing to work. Maybe, I could set up my own keyed ERC in the hierarchy, but this is just an initial test, and the real thing would probably be fairly complex, so I'd rather avoid manual calculations.

I just need a way to extract the timeline info and link it to a control channel, but I'm just not getting there. Any thoughts?

PS I can get a basic color change by dragging the material into the Hierarchy, but not the full timelined one of 10 changes. So it des work, but not how I want it.

 

Post edited by maclean on

Comments

  • MikeDMikeD Posts: 299
    edited October 2019

    Hmmm, interesting.....

    Why don't you:

    1. Create a new property in the item (Integer would be fine)

    2. Use scripts like the Post-Load Callbacks samples Rob has in the samples page

             2.1 Connect a call back with the new property's currentValueChanged () signal.

            2.2 Have a call back script that change the Base Color Property (name: "Diffuse Color") according to your property value

           2.3 Don' t forget to have the Destroy Callbacks so you don't have any memory leaks

    In that way the base color should change according to your Integer property value for some prefix colors named in your script.

     

    I haven't tested it, it is just an idea and how I would work on this.

    Post edited by MikeD on
  • macleanmaclean Posts: 2,438

    Thanks for the suggestion, Mike. Unfortunately, I'm incapable of that level of scripting. I just wouldn't know where to start.

    I have a sort of feeling that when a surface is ERC linked, it may not be animatable by default and that's why it won't work. However, that's just a wild guess based on a previous experience with ERC-ing the Visibility channel.

    Anyway, this isn't anything crucial. It was more of a Wouldn't-it-be-fun-if....

Sign In or Register to comment.