Transferring a color attribute between models is a frequent task for me, especially when I need to accumulate the color from Model 2 onto Model 1 based on their proximity.
To achieve this, I often use an attribute transfer node to copy the color from Object 2 onto Object 1. My goal is to ensure that the color transferred from Model 2 to Model 1 remains accumulated, regardless of any changes in their relative positions. To accomplish this persistent color accumulation, I prefer using a SOP solver.
By using a SOP solver, I can maintain the transferred color on Model 1, even if Object 2 moves closer or further away. This approach ensures that the color data remains consistent and doesn't reset with changes in distance between the objects.
Step-by-Step Guide:
Drop two objects. Input expression sin($FF) to move the sphere up and down.
2. Assign black to object 1 and red to object 2, using the color node.
3. Connect an attribute transfer node and input Cd in the points tab to transfer the red color from the sphere to the rubber toy. In the conditions tab, reduce the distance threshold to 0.2 or something similar.
As shown above, the color is being transferred from the sphere to the rubber toy, but it is not accumulating over time.
4. Drop a SOP solver after the attribute transfer. Dive-in.
Drop a switch node and connect input_1 to the first output and prev_frame to the second input of the switch. In the switch node key the 1st frame to 0 and the next frame to 1.
We do this because on the first frame, there is no previous frame data, so the initial color attribute of the rubber duck is used. For each subsequent frame, the prev_frame node provides the previous frames' color data, this way we accumulate the red color over time.
5. Drop a point wrangle and connect input_1 to the first input and switch1 to the second input. Switch 1 will essentially provide us with the color changes of each frame and input_1 will provide us with the initial color data of the rubber duck.
In the point wrangle add this piece of code.
vector accumulate_Cd = @Cd;
vector original_Cd = point(1, "Cd", @ptnum);
@Cd = original_Cd + accumulate_Cd;
Thats it! Now the Red color should accumulate with time, it should look something like this:
FAQs
Can the color accumulation process be animated? Yes, by keyframing the source model’s movements and using a SOP solver to accumulate color attributes over time.
Can attributes other than color be transferred and accumulated? Yes, attributes like temperature, density, or custom attributes can also be transferred and accumulated using the attribute transfer node and SOP solver.
What are some practical applications of color accumulation in VFX? Applications include creating animated color transitions, visualizing dynamic effects like heat maps, wet maps and enhancing interactive zones within scenes.
What adjustments can be made to the attribute transfer node for better results? Adjust the distance threshold to control the source model’s influence and apply smoothing techniques for seamless attribute transitions.
Download the example .hip file here: arctiem_accumulateAttribute.hip
Comments