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: GUI shows M (meters) instead of CM (centimeters) in CUSTOMGUI_VECTOR
Ok that makes a lot of sense. Ill see what i can do on my end then
-
GUI shows M (meters) instead of CM (centimeters) in CUSTOMGUI_VECTOR
I programmatically create a vector gui using CUSTOMGUI_VECTOR. I set DESC_UNIT to DESC_UNIT_METER.
However the gui will show CM after the number. And i would like it to display M for meter at the end of the number.
I cant find in the SDK how to do this -
Start CUSTOMGUI_LINKBOX expanded
I am using the CUSTOMGUI_LINKBOX UI, but for some reason it always starts out as collapsed, but i would like to expand it.
DESC_GUIOPEN, DESC_DEFAULT both dont work. -
RE: GeListNode from ShaderData::Read function does not have a document?
After some digging it seems only some ShaderDatas dont have their document set. Other do have it.
However after the Read, c4d will set the document at some point, because in the ::Message() function GetDocument does return a basedocument. -
GeListNode from ShaderData::Read function does not have a document?
Im loading in c4d project and want to get the Document the GeListNode belongs to, but i am getting a nullptr back.
Is it expected for certain ShaderDatas not to be associated with a document?Code looks something like this:
Bool SomeShaderDataPlugin::Read(GeListNode* node, HyperFile* hf, Int32 level) { const BaseDocument* bd = node->GetDocument(); //bd is nullptr sometimes for some ShaderDatas return SUPER::Read(node, hf, level); }
-
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); }