Data Channel to change object color when it moves

Data Channel to change object color when it moves

MacArnu
Participant Participant
505 Views
5 Replies
Message 1 of 6

Data Channel to change object color when it moves

MacArnu
Participant
Participant

How to configure Data Channel modifier, to make it change objects color or material, when it is moving (animated), but when object is stopped, it returns to the original color/material?

0 Likes
Accepted solutions (1)
506 Views
5 Replies
Replies (5)
Message 2 of 6

MartinBeh
Advisor
Advisor

Why Data Channel? I would suggest to use a Script or Expression controller for that.

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 3 of 6

MacArnu
Participant
Participant

Data channel because of its scalability, to be able to copy-paste the same Data channel to various other models in the scene. Plus it's a built in solution, no external code or plugins needed.

The objective is to create a installation animation, where various parts in succession fly into place. 

 

But if you can suggest a Script or an Expression that would be as efficient, it would be much appreciated.

0 Likes
Message 4 of 6

MartinBeh
Advisor
Advisor
Accepted solution

I just sent you a PM with a .max file to try. This uses a script controller on the diffuse color of a Physical Material but one could also make the controller just output a float value to drive some other map.

 

If you still want to do it with Data Channel, you probably have to use vertex colors, or an additional UVW channel to hold the result of your speed calculation and to be used by another shader.

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
Message 5 of 6

MartinBeh
Advisor
Advisor

OK, I might have found a way to do this with Data Channel:

  • Create a dummy and use it as node in a 'Node Influence' operator
  • Give the dummy a Position Expression controller to follow the actual moving object, BUT with a Tick Offset, e.g. -160 ticks if you work at 30 fps - this will make the dummy follow the object with one frame delay
  • Set the Node Influence > Influence parameter to 'By Object'
  • Adjust the Node Influence ranges, i.e. the Min/Max radius (rather low values unless your object is moving really fast) and the min/max value
  • Then complete the Data Channel stack by adding a Vertex Output operator and set it to Vertex Color

With this, the vertex color will depend on the object speed (which really is the distance between it's current position and the position one frame before, hence the -160 tick offset).

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
Message 6 of 6

MacArnu
Participant
Participant

Thank you for the expression and Data Channel work-around idea!

 

The Script Controller on the diffuse/base color does exactly what needed.
Though the Data Channel setup works in a way, it is not very practical in a scene with over a hundred animated objects, compared to the expression workflow that uses one central material on all of those objects.

0 Likes