I'd like to add support for animated previews in my custom node space. I assumed, that enabling Animate Preview on the Viewport tab of the material means that the GetMaterialParameters()
function of my viewport material is called every time the frame changes in the scene.
However that does not seem to be the case, nothing happens when moving the timeline. Am I missing something? Do you have an example of how to support animated previews?
Best posts made by peter_horvath
-
Animated viewport preview in Node Materials
-
RE: Particles and RenderDocument
Hey Ferdinand,
Nothing special about the context. Tried cloning with AliasTrans, but it does not help.
I'm attaching a simple code taken from the manual in case you want to reproduce the issue. The code adds two commands, one calling RenderDocument() with the
RENDERFLAGS::NODOCUMENTCLONE
flag and one without. You can see, that the one with the flag does not render the particles. Note, that no manual cloning is involved in the example, just loading the document, which might indicate that it's indeed a bug.Thanks,
Peter
Latest posts made by peter_horvath
-
RE: Particles and RenderDocument
Thanks Ferdinand, that makes sense. Will do the preroll step in my code. Cheers.
-
RE: Particles and RenderDocument
Hi Ferdinand,
Thank you for the update. Your python script works indeed, however, weirdly, doing the same thing from c++ still fails. You can check with my sample code attached above.
Edit: I went back to 2024.4.0 and tried the python script there as well and it was working. Not sure what's different between the two calls, but the issue seems to be c++-specific.
Cheers,
Peter -
RE: Animated viewport preview in Node Materials
Hey Ferdinand,
Thank you for investigating and digging deep on the topic, much appreciated. I'll handle this as a limitation for now, until an official solution exists. But don't worry, it's not a high priority for us at the moment.
Thank you,
Peter -
RE: Animated viewport preview in Node Materials
Hey Ferdinand,
Thank you for looking into this. Yes, this is about implicitly animated shaders, like the noise you mentioned, or an image sequence in the Image/Texture shader. You are right, it does not work in the Standard node space, only in Redshift, so might be indeed some custom solution there. What is the Animate Preview checkbox for then, if you don't mind me asking.
I was also thinking about a workaround that triggers an update in the graph explicitly upon frame changes, if no standard solution exists. Don't worry about putting that together, I think I'll manage.
Cheers,
Peter -
Animated viewport preview in Node Materials
I'd like to add support for animated previews in my custom node space. I assumed, that enabling Animate Preview on the Viewport tab of the material means that the
GetMaterialParameters()
function of my viewport material is called every time the frame changes in the scene.
However that does not seem to be the case, nothing happens when moving the timeline. Am I missing something? Do you have an example of how to support animated previews? -
RE: How to add parameter groups to Nodes dynamically?
Thank you for taking time on this. Definitely promising. I'll give it a spin to see if I can reach the desired results with any of the mentioned approaches.
-
RE: How to add parameter groups to Nodes dynamically?
Hey Ferdinand,
Thank you for your prompt answer. Yes, I'm talking about parameter groups, like the Base or Reflection group in the Redshift Material and the groups do not exist yet. The goal here is to create these parameter groups and the parameters within them dynamically based on an integer input that defines the number of groups.
Thanks,
Peter -
How to add parameter groups to Nodes dynamically?
dynamic_node_impl.cpp from the example.nodes project shows how to add simple int/string/color parameters (input ports) to a Node dynamically.
maxon::Id portId; portId.Init(part) iferr_return; // Add port for part. maxon::nodes::MutablePort port = root.GetInputs().AddPort(portId) iferr_return; // Make a dependency connection from input to output. This tells the system which // ports are needed for the shader evaluation of the output port. port.Connect(output, maxon::Wires(maxon::Wires::DEPENDENCY)) iferr_return; if (part[0] == 'i') { // Create a port of type Int. port.SetType<maxon::Int>() iferr_return; // Directly set the name. port.SetValue(maxon::NODE::BASE::NAME, part) iferr_return; } ...
Is it possible to add UI groups as well and set them as parent groups of these ports?
-
RE: Particles and RenderDocument
Hey Ferdinand,
Thanks for the reply. Sorry, I forgot to include the test scene. It was just a simple Basic Emitter and I rendered it with Redshift.
You could combat that with setting the cloned document to frame 0 and then executing the passes up to the point where you want to render.
Yeah, I've tried that actually, but did not solve the problem.
I logged the issue as ITEM#506966 (including the tests scene in the zip this time).
It is not critical for us at the moment, since this is a specific use-case and not using the NODOCUMENTCLONE flag can be a good workaround.
Thank you,
Peter -
RE: Particles and RenderDocument
Hey Ferdinand,
Nothing special about the context. Tried cloning with AliasTrans, but it does not help.
I'm attaching a simple code taken from the manual in case you want to reproduce the issue. The code adds two commands, one calling RenderDocument() with the
RENDERFLAGS::NODOCUMENTCLONE
flag and one without. You can see, that the one with the flag does not render the particles. Note, that no manual cloning is involved in the example, just loading the document, which might indicate that it's indeed a bug.Thanks,
Peter