Haha, I forget even more important stuff sometimes
Btw is there any workaround for this? Or will it be public in the future?
Posts made by Ogers
-
RE: Create Gradient Attribute for Nodes Programmatically
-
RE: Create Gradient Attribute for Nodes Programmatically
Hello.
It's weird as I don't have a render.framework on my machine, although the include file points there on my side as well.. Could this be part of S26 only?
I have also referred to the resource editor to build my own gradient where I found everything I needed except for the file which is missing.Also as you can notice from my previous messages where I showed how I was building the gradient, you can see that the only difference is that I set the datatype by typing the ID manually
("net.maxon.render.portbundle.gradient")
, and all that because I could not find the right file. -
RE: Create Gradient Attribute for Nodes Programmatically
Hello,
Thanks for the update.Regarding the ports you have used, are they already defined as ports, or they should be created too?
At the moment these portsPATTERN::NODE::GENERATOR::GRADIENT::GRADIENT
,RENDER::PORTBUNDLE::GRADIENT::COLOR
andRENDER::PORTBUNDLE::GRADIENT::POSITION
cannot be accessed. I tried searching all files but could not find them. -
RE: Create Gradient Attribute for Nodes Programmatically
Hello?
Is there any news about this one yet?
So far with the code above, I can only get to this part, but as you can see the gradient's colours are not showing on the UI.
Also, how can I get the values set for each knot (colour, interpolation, position etc.)
Do I have to build my own gradient data type to make it work or does the built-in gradient offers all these?Thank you.
-
RE: Create Gradient Attribute for Nodes Programmatically
Hello,
Thanks for the reply. After setting the right ID as you said, I was able to get the UI look I was looking for, but same as you I can't make it work properly. Here is the part of the code I have used for this.maxon::BaseArray<maxon::Id> var_commands; var_commands.Append(maxon::Id("addvariadicport")); var_commands.Append(maxon::Id("removevariadicport")); node.Set(maxon::DATADESCRIPTION_CATEGORY_DATA, maxon::DESCRIPTION::DATA::BASE::DATATYPE, maxon::Id("net.maxon.render.portbundle.gradient")) iferr_return; node.Set(maxon::DATADESCRIPTION_CATEGORY_UI, maxon::DESCRIPTION::UI::BASE::GUITYPEID, maxon::Id("net.maxon.ui.variadicport")) iferr_return; node.Set(maxon::DATADESCRIPTION_CATEGORY_DATA, maxon::DESCRIPTION::DATA::BASE::ISVARIADIC, TRUE) iferr_return; node.Set(maxon::DATADESCRIPTION_CATEGORY_DATA, maxon::DESCRIPTION::DATA::BASE::VARIADICCOUNT, 2) iferr_return; node.Set(maxon::DATADESCRIPTION_CATEGORY_DATA, maxon::DESCRIPTION::DATA::BASE::VARIADICCOMMANDS, var_commands) iferr_return; node.Set(maxon::DATADESCRIPTION_CATEGORY_UI, maxon::DESCRIPTION::UI::NET::MAXON::UI::VARIADICPORT::COMPLEXCUSTOMUI, 200001011);
-
Create Gradient Attribute for Nodes Programmatically
Hello,
I have created a gradient attribute but instead of getting a proper Gradient UI that C4D uses, I am getting this one.
I noticed that it can be achieved by settings
Replace Complex UI
parameter to 200001011 but I could not find a way to set this parameter pragmatically except that from the resource editor. At first, I thought that this parameter would be ondatadescription_ui.h
, but it was missing from there or maybe it is located in another file.
Is there any way to set that parameter pragmatically, or any other way to show my Gradient parameters' UI as it normally should be?Thank you.
-
RE: Collapse/Fold groups by default in nodegraph UI
Hello,
Thank you for your reply. Can I leave the topic open until this is supported?
-
Create custom menu category for nodes?
Hello,
Is it possible to create a custom menu category for nodes or should we use the ones that already exist?
I could not find any way or example of how I can achieve this.Thank you.
-
Collapse/Fold groups by default in nodegraph UI
Hello, I have created a couple of nodes pragmatically but I can't find a way how to fold or collapse the groups in nodes UI by default as in the image.
Setting
maxon::DESCRIPTION::UI::BASE::GROUPDEFAULTOPEN
to false will only deselect the group from the attributes manager. -
RE: Add values for enum data type (node graph)
Hello,
Thanks for the code.
Regarding the second one, I have tried it and also mentioned in the first message that the data does not get added and the array size still stays 0.
I had forgotten to put iferr_return and now with your example, I am getting a critical error when trying to append those data.RefMemberType<S> CritStop() { CriticalOutput(static_cast<const typename S::ReferenceClass*>(this)->ToString()); return this->PrivateGetRefMember(); }
-
RE: Unique ID for maxon::nodes::Node
Hello,
When translating the nodes in our system we need each of them to have a unique ID or name. That's how we identify each node, e.g if I have two or more texture nodes (with the same ID) used on different materials and assigned to different objects, it would only show one texture rendered to all objects as all textures are assigned one similar ID.
For now, I solved this by finding a uniqueID for the corresponding material and concatenating it with the node's ID.As for the error message it only says Error and nothing more. I will send the text via email.
Thank you.
-
Unique ID for maxon::nodes::Node
Sorry to send it again by image but it still gives me an error with text and I don't know what the filtering mechanism has found wrong with it.
-
RE: Add values for enum data type (node graph)
I solved this by having two typename in the template in the Set function.
template <typename ATTR, typename VAL> Result<void> Set(const Id& category, const ATTR& attr, const VAL& value) { // Retrieve the category"s and add an attribute. iferr_scope; DataDictionary& dict = GetPortDictionary(category) iferr_return; dict.Set(attr, value) iferr_return; return OK; }
Thanks for your time.
-
RE: Add values for enum data type (node graph)
I have pasted the message here.
https://pastebin.com/mB3i8TTMThank you.
-
RE: Add values for enum data type (node graph)
For some reason, I can't even post my full reply here. I thought the system was down yesterday that's why I could not reply, but when making the message shorter today it was posted successfully.
reply error video.
I don't know if I should create another thread for this.
Thank you. -
RE: Add values for enum data type (node graph)
Hello @ferdinand
Thank you for your reply. Yes, your assumption is right, sorry to confuse you.
I forgot to mention that I am getting this error when setting the values when using Set function from documentationtemplate <typename ATTR> Result<void> Set(const Id& category, const ATTR& attr, const typename ATTR::ValueType& value) { // Retrieve the category"s and add an attribute. iferr_scope; DataDictionary& dict = GetPortDictionary(category) iferr_return; dict.Set(attr, value) iferr_return; return OK; }
-
Add values for enum data type (node graph)
Hello,
I am trying to create an enum data type with some values (options) added but I can't get the options added to this data type.When setting
DESCRIPTION::DATA::BASE::ENUM
it requires anmaxon::Array<Tuple<Id, Data>>
as a value type, but even if I create a variable of that type and add some values, its size does not change and stays 0.I also tried using
BlockToEnumArray()
but that would return anBaseArray<Tuple<Id, Data>>
which is not accepted inDESCRIPTION::DATA::BASE::ENUM
although the comments in the function say it does.//---------------------------------------------------------------------------------------- /// Converts a given Block<TYPE> to a enum list array to use with DESCRIPTION::DATA::BASE::ENUM. /// @param[in] enumBlock Block to convert into a array. /// @return BaseArray on success. //---------------------------------------------------------------------------------------- template <typename TYPE> inline Result<BaseArray<Tuple<Id, Data>>> BlockToEnumArray(const Block<TYPE>& enumBlock)
Also converting BaseArray<Type> to Array<Type> did not work.
I'm not sure what I am doing wrong.Thank you.
-
RE: Adding Node Descriptions Pragmatically
Thank you. I was getting a unique ID indeed but had declared it as a global (I don't know how I missed it after checking couple of times) and using it like that in the lambda function was causing the issue.
All good now, thank you very much.
Cheers,
Ogers -
RE: Adding Node Descriptions Pragmatically
One more thing to add, I have added a couple of nodes pragmatically each with a different number of input parameters. The last added node has 4 input parameters and that's the only node that shows correctly when created.
Other nodes seem to get those 4 inputs from the last node although not with the proper name (all are named "input" as seen from the image).
This "weirdness" is not reflected in the resource editor of that node though. It's like the node registered is global or static but I have not used something like that. -
RE: Adding Node Descriptions Pragmatically
Hello,
The node is the one created with code, not through the resource editor. I have managed to create the nodes fine using the resource editor but it is time-consuming and each time there is an update on the shader (we use osl shaders), we have to update the UI and it's parameters in the resource editor to match our shaders which is not what we want.
The node has only three inputs and one output added (all inputs are boolean), but when I create the node it also gets those "additional input named" inputs that I have not added. When I check on the resource editor for that node it shows the right inputs as in the image (only three booleans I have added). Both images are of the same node that is created through code.
Thank you.