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?
-
RE: Strange string addition crash
Thanks for your response. We found the issue. Turns out we had to delay load our dlls for earlier versions of the plugin R21 etc
Latest posts made by ECHekman
-
RE: Strange string addition crash
Thanks for your response. We found the issue. Turns out we had to delay load our dlls for earlier versions of the plugin R21 etc
-
Strange string addition crash
Im having a strange problem while trying to run our plugin on R21.207
For some reason adding two string together crashesCrashes:
String totalPath = ppath + ver;
Doesnt Crash
String totalPath = ppath; totalPath.Append(ver);
debug output:
../../../frameworks/cinema_emulation.framework/source/maxon/stringencoding_c4demulation.h(33): CRITICAL: Stop A breakpoint instruction (__debugbreak() statement or a similar call) was executed in Cinema 4D.exe. Exception thrown at 0x00007FFA047D6820 (c4dplugin.xdl64) in Cinema 4D.exe: 0xC0000005: Access violation reading location 0x00000035456D34A0.
-
RE: Programmatically create a palette?
@ferdinand
Is this still the best way to create a palette 3 years later? Preferably I would like there to be an option for our plugin to insert its objects into the standard palette.
Switching to Reshift changes the default palette, I was hoping i could do something similar. -
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.