Thanks Ferdinand. Putting those lines in the projectdefinitions.txt of the solution was the... solution
Best posts made by ECHekman
-
RE: Natvis settings not working?
Latest posts made by ECHekman
-
RE: SubContainers and Symbol ranges
Ofcourse in the code example i mean to set the pin data and links in their correct subcontainer, and not in the AttributeContainer
-
RE: SubContainers and Symbol ranges
Thank you for the detailed answer.
I think I have settled on how to store data then that makes it the most future proof for us.
A quick mockup of our setup would be something like this then:// OurShaderNode.h enum OurShaderNode { OUR_NODE_TYPE = 1001, OUR_NODE_PINS, OUR_NODE_PIN_LINKS, OUR_NODE_ATTRIBUTES, OUR_NODE_OFFSET = 10000, // Pin Ids. These map to IDs from our application OUR_NODE_PIN_SCALE = OUR_NODE_OFFSET + 1; // Maps to our internal ID PIN_SCALE which is 1, same for the others OUR_NODE_PIN_ALBEDO = OUR_NODE_OFFSET + 2; OUR_NODE_PIN_SPECULAR = OUR_NODE_OFFSET + 3; OUR_NODE_PIN_NORMAL = OUR_NODE_OFFSET + 4; OUR_NODE_PIN_FRAME = OUR_NODE_OFFSET + 245; // Attribute. These map to IDs from our application OUR_NODE_ATTRIBUTE_VALUE = OUR_NODE_OFFSET + 1; OUR_NODE_ATTRIBUTE_COUNT = OUR_NODE_OFFSET + 2; OUR_NODE_ATTRIBUTE_SCALE = OUR_NODE_OFFSET + 3; OUR_NODE_ATTRIBUTE_FRAME = OUR_NODE_OFFSET + 4; OUR_NODE_ATTRIBUTE_FILENAME = OUR_NODE_OFFSET + 3456; } // pluginOurShaderNode.cpp // These two functions will map c4d IDs to our internal Ids int ConvertToOurID(OurShaderNode c4dId) { return c4dId - OUR_NODE_OFFSET; } int ConvertToC4D(int ourId) { return ourId + OUR_NODE_OFFSET; } // pluginOurShaderNode is derived from the base class ShaderData Bool pluginOurShaderNode::Init(GeListNode* node, Bool isCloneInit) { BaseContainer *data = ((BaseShader*)node)->GetDataInstance(); // The subcontainers use overlapping numbers for their IDs, but this setup gives us the biggest range of id numbers BaseContainer PinContainer; // Contains all pin data AttributeContainer.SetVector(OUR_NODE_PIN_ALBEDO, Vector(1,0,0)); BaseContainer PinLinkContainer; // Containes links to other shadernodes. AttributeContainer.SetLink(OUR_NODE_PIN_ALBEDO, nullptr); BaseContainer AttributeContainer; // Contains all attribute data AttributeContainer.SetInt32(OUR_NODE_ATTRIBUTE_VALUE); data->SetContainer(OUR_NODE_PINS, PinContainer); data->SetContainer(OUR_NODE_PIN_LINKS, PinLinkContainer); data->SetContainer(OUR_NODE_ATTRIBUTES, AttributeContainer); }
-
SubContainers and Symbol ranges
I am looking into mapping symbols from my plugin application to symbols in c4d.
This is for ShaderData/TagData/ObjectData derived plugins.However im running into two issues. Some of these symbols clash with existing symbols in c4d.
1 I have read that the first 1000 are reserved. And that I shouldnt go above 1 million?
2. My other related issue is that I would like to reuse symbols in the same NodeData plugin.My solution idea was to use sub-containers to avoid both of these symbol clashes.
However I cannot find in the sdk if the same symbol restrictions apply for subcontainers.
Can I just put in any ID in a subcontainer? Or are there limitations for those aswel?Additionally, do links work the same as with normal BaseContainers?
-
How to use String::Split
I feel a bit silly asking this. But im trying to use the split function on maxon::string. And nothing seems to work.
Like array is a value receiver? but im getting loads of strange template errors.String cat = ninfo->mCategory; maxon::Array<const String&> parts; cat.Split(String("/"), true, parts); if(parts.GetCount()) info(parts[0]);
-
RE: Get and Set DTYPE_COLORA/DTYPE_VECTOR4D on basecontainer or gedata
DTYPE_VECTOR4 and DTYPE_COLORA are not maxon::data types internally in c4d.
When I get or set them as maxon::data like your example code the GeData changes to a DTYPE_DATA instead
Additionally the existing 4d colorpicker GUI for DTYPE_COLORA will override the maxon::data type and reset it to whatever DTYPE_COLORA is internally. -
RE: Data, DataTypes, Python and GUI
Ok thanks for the help Ferdinand. I will take the road of least resistance and just build on top of float64 vectors
-
RE: Get and Set DTYPE_COLORA/DTYPE_VECTOR4D on basecontainer or gedata
I made this separate thread specifically because of the clear singular question rule i have been told to follow. And this is a different question from the question on custom data types.
-
RE: Get and Set DTYPE_COLORA/DTYPE_VECTOR4D on basecontainer or gedata
This is a different question from:
https://developers.maxon.net/forum/topic/15823/data-datatypes-python-and-gui/6?_=1732092863717If you are referring to the same post i wrote on the backstage forum the suggestion i got there does not work:
const ColorA* color = data.GetCustomDataType<ColorA>();
^^ this does not work
I am asking how to use existing types here. And not new/custom ones
Specifically the DTYPE_COLORA and DTYPE_VECTOR4 and not the regular types DTYPE_COLOR and DTYPE_VECTOR -
Get and Set DTYPE_COLORA/DTYPE_VECTOR4D on basecontainer or gedata
How do I get and set Vector4 and ColorA to the basecontainer/gedata?
I have tried pretty much every possible function and method but I dont seem to be able to use Vec4/Color4.I have managed to get it via unsafe c-style casting:
GeData ge(DTYPE_COLORA, DEFAULTVALUETYPE::DEFAULTVALUE); // Create // Get const CustomDataType* customPtr = ge.GetCustomDataTypeI(DTYPE_COLORA); maxon::ColorA color = *(maxon::ColorA*)customPtr; // Set color = maxon::ColorA(0.5, 0.1, 0.6, 0.7); CustomDataType* customPtrDst = (CustomDataType*)&color; ge.SetCustomDataTypeI(DTYPE_COLORA, *customPtrDst); // Get again to check if it worked const CustomDataType* customPtr2 = ge.GetCustomDataTypeI(DTYPE_COLORA); maxon::ColorA color2 = *(maxon::ColorA*)customPtr2;
But this is basically undefined behavior
-
RE: Data, DataTypes, Python and GUI
Just to clear something up that you wrote: maxon::IntVector32 is not a new template specialization.
And are you sure maxon::IntVector32 is not wrapped in python. It is in the python sdk?
https://developers.maxon.net/docs/py/2025_0_0/modules/maxon_generated/datatypes/vec_col_mat/maxon.IntVector32.html?highlight=intvector32#module-maxon.IntVector32
Or am I missing something here?I have the UI working for the pre-existing maxon::IntVector32 data type. The only problem with this method is that when i animate it, it does not interpolate between multiple keyframes - it just jumps from one to the other.
The problem im trying to solve is that Octane supports these other types (int3 float4 long2 etc). But from what I now learned, and reading your answers, I will either need to chose between:
- Use Custom Data Type - dropping python support
- Use maxon::IntVector32 - dropping keyframe interpolation support
- Cast everything from Vector4d to int vectors and in64 vectors - possible data loss and clunkyness by having to set int values with floats in python
Btw, I recently got backstage access, would it be better to ask these questions there?