Hi,
I'm totally new to the forums, so thank you for letting me know!
Latest posts made by confidence-room
-
RE: Keyframe RS Standard Material Geometry Opacity Using Python Script
-
Keyframe RS Standard Material Geometry Opacity Using Python Script
I want to use a Python script to animate a set of cubes (called parcels) using a given JSON dataset. I have previously written a script that works for this, with a set of 15 parcels. This script reads the data, and then generates cubes with different materials and keyframes accordingly. All parcels spawn on the same spot and have different paths to their end destinations.
For the sake of the animation, I want the parcels to fade in and out, meaning only one parcel should be visible at a time on the spawning spot. Once a parcel has reached its end destination, it should fade out.
I accomplished this by manually keyframing the RS material's geometry opacity V value in HSV. I did this manually because the number of parcels wasn't too large.
Now I want to do all of this with 100 parcels. Naturally, it's not effective or sustainable to manually keyframe 100 parcel's opacity. Thus, I want to implement this into the script. This is where I'm struggling.
In my script for 100 parcels, I've made a function called … Here, I make sure the node material (the material applied to the parcel) has a node space, and I've found the node graph, root and ultimately the target node port for color opacity.
I get a ValueError when I try to create define the DescID for creating the keyframes. I have tried defining the DescID in two ways to try to debug:
…
In Ver 1, I have verified that the values of the passed arguments are valid, at least for the rest of the script, as they work correctly there. So I'm struggling to find out where this value error occurs.
… I am rather unfamiliar with scripting for C4D, and most definitely the use of the latest Maxon API with my 2025.1.0 version of C4D. See the JSON dataset and script for my 15 parcels and 100 parcels respectively in this Drive folder (ignore the fact that my scripts are NOT optimized or pretty at all):