Hi Ferdinand,
Thank you, I will consider different approaches based on your reply and might file a feature request as you suggested if I can't find any solution.
Thanks,
Peter
Hi Ferdinand,
Thank you, I will consider different approaches based on your reply and might file a feature request as you suggested if I can't find any solution.
Thanks,
Peter
Hi Ferdinand,
Thanks for your feedback, Yes, I'm aware of the object structure. Let me explain a bit more what I'm trying to do and what I'm missing.
Here's a simple example of a Cloner with two shapes, a Sphere and a Torus, and a Plain Effector with a Spherical Field. The effector sets the weight of the clones (1 to zero from the middle) and also modifies the shape order ("Modify Clone" is enabled), so that Torus shapes are in the middle and Spheres are outside the field. So the shape order is not necessarily the same as how the data is stored on the mograph tag. I'd like to export weight as user data per shape. In Instance or Render Instance mode I can read the mograph data index from the clones, that tells me the weight from the MoData tag.
In Multi-Instance mode, I would expect the same result. However, since the indexes are not available, I can not connect the MoGraph data to the instances and read the weights. As you said, in Multi-Instance mode there are reference shapes and Instance Objects per each reference shape in the cache. The InstanceObject can return the matrices and colors of the individual shape instances, but no indexes as far as I can see. I'm not sure how complicated is to generate this data, but would be nice to have.
Cheers,
Peter
When using a MoGraph Cloner in Instance or Render Instance mode, the MoGraph data index is available via the BC_ID_MODATAINDEX
id in each clone.
clone->GetDataInstance()->GetInt32(BC_ID_MODATAINDEX);
This is the index of the clone in the data arrays of the MoGraph Data tag.
Is this index available in Multi-Instance mode as well via the SDK? Via the InstanceObject maybe?
We'd need this index to be able to export MoGraph attributes to each clone/instance.
Thanks for looking into it @m_adam.
Maybe this is specific to Arnold, but there are shader parameters that are not linkable. It's a flag on the parameter. Typically, boolean and enum type parameters are not linkable, like the ones highlighted in the screenshot below. But could be any parameters really, depending on the shader code.
Hi Ferdinand,
Thank you for your reply. Sorry for not being completely clear. Yes, I meant maxon::nodes::ReqOrderIndex. I feel like it would be more natural if the input menu would match the order in the Attribute Editor, instead of listing the items in alphabetical order. Being able to control the behavior via the API could be welcome. I'll make a feature request, just in case. What's the best option to file an API request? Should I use the form in support.maxon.net or the contact form here?
Thanks,
Peter
Hi Ferdinand,
Thank you for the detailed description, it's very useful, I have a good understanding now how this should work. Yes, the main goal here is installer optimization. Unfortunately, hosting online is not an option. I'll give it a thorough testing to see if we hit any limitations with this approach, and we might drop the idea if so.
Thanks,
Peter
We set the order index of the ports and they are displayed properly in the Attribute Editor, but the input port menu does not respect this and groups and ports are displayed in a "random" order, that does not match the UI and is quite confusing.
Is this a limitation or is there a flag or other attribute we have to set to match the layout of the Attribute Editor?
Is there a flag to hide a port from the input port menu in the Node Editor. We'd like to have the parameters displayed in the Attribute Manager, but there are some that are not linkable, thus it does not make sense to have them in the input port menu.
Our plugin ships with a few material assets. I'm wondering if it's possible to install our custom asset library (asset database) as a zip file, instead of hundreds of files and folders.
Sure, no worries, it's not a high priority, more like a nice to have feature. We can manage without this. I was just wondering if something like this could be possible already in the context of node materials. Thanks.
Hi Ferdinand,
Yes, I'm referring to a reference as a BaseLink or port with a linkbox custom gui. Our legacy material using the classic API does exactly what you have described. It clones the linked node in NodeData::CopyTo(), packs it with the material and unpacks in the new scene via a scene hook/message data plugin. Not pretty, but works fine.
This level of flexibility is missing from Node Materials, so as I understand it's not possible to achieve something similar right now nor in the near future most likely. Alright, I can live with that.
Cheers,
Peter
This might be a very unique use-case.
We define a custom node system that is used in Node Materials. We have a shader that references another nodes from the scene, such as materials and objects. Currently when the Node Materials is copied over to a new scene, these references are lost. Ideally, the referenced nodes should be cloned and copied over to the new scene along with the material. Is it possible to do this with the current SDK?
This was not an issue with our legacy material, since it was our custom MaterialData implementation, and so we had control over copying by overriding the CopyTo() method.
Thanks Ferdinand, that makes sense. Will do the preroll step in my code. Cheers.
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
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
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
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?
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.
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
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?