Thanks @ferdinand! Appreciate everything you do. Also what the rest of the sdk support and docs team are doing! Not an easy job keeping on top of all these changes.
![](/forum/assets/uploads/profile/79-profileavatar.jpeg)
Posts made by kbar
-
RE: How to use GetAllNimbusRefs in 2023
-
RE: How to use GetAllNimbusRefs in 2023
Thanks @ferdinand,
I thought it must have been a missing framework, my eyes just didn't see nodespace.framework in the frameworks folder otherwise I would have tried that.
Adding the nodespace.framework and including "maxon/nimbusbase.h" is what did the trick.
Sharing my full code wouldn't have helped, since the issue was that I didn't have the framework, otherwise I would have found the header file during my searches.
It would be great if the documentation samples could somehow also mention what frameworks they require to get them to run.
Unfortunately I won't be able to use it due to the use of the nodespace.framework, since I am still providing supporting back to R20 and it gets messy altering/swapping out projectdefinition.txt files to support additional frameworks.
Also thanks for the tip on the MaterialNodeSpaces registry, although I have no idea how to use that at all. But will keep it in mind for future.
My intention was not to write a diary. I was just trying to provide as much information as I could. Since it seemed simple, and it was... ie missing framework.
I sometimes forget that this site is no longer a community and is really just a support system. I am still used to the old days of being able to provide info and have discussions with other developers. I will refrain from doing this from now on.
Thanks again!
Kent -
How to use GetAllNimbusRefs in 2023
Hi,
I am trying to call the following code in 2023. From this page.// Print all the NodeSpace ID from the selected material. In practice we should // test if mat is a nullptr before proceeding. BaseMaterial* mat = doc->GetActiveMaterial(); // The error handling needs to have an error context defined with either iferr_scope or iffer_handler. const maxon::HashMap<maxon::Id, maxon::NimbusForwardRef> hashNimbusRefs = mat->GetAllNimbusRefs() iferr_return; for (const auto& e : hashNimbusRefs) { const maxon::Id& key = e.GetKey(); const maxon::NimbusBaseRef nimbusRef = e.GetValue().GetBase(); ApplicationOutput("NodeSpace ID: @"_s, key); }
I get the following errors in my code.
Error C2079 'nimbusRef' uses undefined class 'maxon::NimbusBaseRef' Error C2027 use of undefined type 'maxon::NimbusBaseRef'
I have the nodes.framework and the graph framework installed (and actually use it in places as well). But looking through the maxon code I can't find where NimbusBaseRef is supposed to be defined.
I see the following in operatingsystem.hclass NimbusBaseRef; using NimbusForwardRef = ForwardRefWithExtraBase<NimbusRef, NimbusBaseRef>;
Is there some other framework that I am supposed to use so that this code will compile?
I tend to find this a lot with the documentation, where it will have the code I need, but not tell me the header file to include, or the required framework to use it.Thanks.
edited by @ferdinand:
@kbar wrote:
Actually looks like I don't have the graph.framework for this project. I will add that and see if it fixes the issue.
Unfortunately adding graph.framework did not fix the issue.
I case anyone is reading this I went back to using the following alternative, checking for an exact node space to see if it is what I am looking for, in this case redshift.
BaseMaterial *pMat = //the passed in material Int32 matID = pMat->GetType(); Bool isRSNode = false; // Documentation states this is always safe to cast NodeMaterial* pNodeMat = static_cast<NodeMaterial*>(pMat); if (matID == Mmaterial) { if (pNodeMat->HasSpace(maxon::Id("com.redshift3d.redshift4c4d.class.nodespace"))) isRSNode = true; }
-
Plugin Developer Job opening at Greyscalegorilla
Hey everyone,
We have a job opening at Greyscalegorilla for a plugin developer. Come and work with me on some fun projects.
https://greyscalegorilla.com/jobs/jobs-3d-plugin-developer/
Cheers,
Kent -
Message on "Quit and Free License"
Is there some way to receive a message, and run a function, when a users presses "Quit and Free License"?
-
How to set options when saving TIF file
Is it possible to set the Byte Order and Compression values when saving a TIF?
BaseContainer bc; //What do we set here? bmp->Save(tiffFile, FILTER_TIF, &bc, SAVEBIT::USE16BITCHANNELS);
-
"maxon::GenericData &extraData" is not documented
Is it supposed to be the data returned from calling DirectInitSampling?
-
RE: How to find and delete a node in a NodeGraph?
@ferdinand said in How to find and delete a node in a NodeGraph?:
Fig. I: The two IDs are displayed in the node editor info panel for the selected node. Make sure to have Preferences\Node Editor\Ids enabled to also see the node ID in addition to the asset ID.
I didn't know about this! I have been copying and pasting the selected nodes into a text editor up until now, which in itself is a very cool feature.
-
RE: How to find and delete a node in a NodeGraph?
Thanks @ferdinand and @Dunhou! Using FindNodesByAssetId has done the trick.
Unfortunately I can't jump to using the latest frameworks for everything just yet, but I will make sure to use the new methods for anything in 2024 onwards.
-
How to find and delete a node in a NodeGraph?
I have a redshift material node graph. I would like to delete the default Material (com.redshift3d.redshift4c4d.nodes.core.material) within that graph. I can't figure out how to find this node or how to delete it once I find it.
BaseMaterial* pMat = BaseMaterial::Alloc(Mmaterial); NodeMaterial* pNodeMat = static_cast<NodeMaterial*>(pMat); pNodeMat->AddGraph(RedshiftNodeSpaceIds::nodespace) iferr_return; const maxon::nodes::NodesGraphModelRef& nodeGraph = pNodeMat->GetGraph(nodeSpaceID) iferr_return; const maxon::GraphNode rootNode = nodeGraph.GetRoot(); maxon::NodePath materialNodePath; pNodeMat->GetMaterialNodePath(nodeSpaceID, materialNodePath) iferr_return; materialNode = nodeGraph.GetNode(materialNodePath);
materialNode now contains a node with the id "com.redshift3d.redshift4c4d.nodes.core.material". I only know this because I can see it in the NodeGraph editor in C4D. How do I find this node and how can I delete it?
Thanks!
Kent -
RE: How many C++ and Python devs do we have here?
Like this post if you are using the new Node System to create features.
-
RE: How many C++ and Python devs do we have here?
Like this post if you are a Python Developer.
-
How many C++ and Python devs do we have here?
I am just curious to know how many C++ developers we have here.
Since we don't have polls on this forum can you do the following...
Like this post if you are a C++ Developer.
-
RE: SnapTool for R2023?
Here is the link x_nerve mentioned for my tutorials. The first one compiles the SDK examples.
-
RE: Plug-in running fine on one OS but not another
I was reading through this to see if you used a Debug build. Glad you finally found it. I assume what you were doing was compiling on one machine in Debug mode and then just copying the plugin to your second machine to try it out. That second machine wouldn't have had Visual Studio installed so it wouldn't have had the debug runtime dlls, so your plugin wouldn't have loaded. Always compile in Release mode if you are going to test your plugin on another machine, or if you are giving the plugin to someone to test out.
-
ActiveObjectManager_SetObject to display BaseObject in a GetListHead
I am trying to figure out how to display ObjectData information when the object itself it is not directly in the Object Manager.
I have an ObjectData node that contains a GeListHead, which is parented to it. This object is actually in the scene and shows in the Object Manager list.
The GeListHead contains other ObjectData nodes.
I would like to be able to display the data for the child nodes of the GeListHead in the Attribute Manager. But I am finding that if I call ActiveObjectManager_SetObject then the nodes descriptions are only visable in the Attribute Manager until the next EventAdd is called, then it reverts back to whatever is selected in the Object Manager itself.
class MyObject : public ObjectData { public: virtual Bool Init(GeListNode *node) { _objects->SetParent(node); } void ShowData() { BaseObject* pObj = (BaseObject* )_objects->GetFirst(); ActiveObjectManager_SetObject(ACTIVEOBJECTMODE::OBJECT, pObj, ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN); EventAdd(); } private: AutoAlloc<GeListHead> _objects; };
Is ActiveObjectManager_SetObject able to be used this way?
Alternatively how does the Xpresso editor work? How does it ensure the selected Xpresso nodes data gets displayed in the Attribute Manager? Would it work if I used the same approach as above but instead used a TagData plugin that contains the GeListHead?
Thanks,
Kent -
DragDrop Model from UserArea into Viewport or Object Manager
I am trying to do what is described in this old thread.
https://developers.maxon.net/forum/topic/6844/7627_how-to-use-handlemousedrag?_=1664942133957
Basically I have a c4d file on disk that I have the Filename for, I then start a HandleMouseDrag from my GeUserArea and want to be able to drop it into the Viewport or Object Manager and have it load.
So far with my testing none of the following types work.
- DRAGTYPE_FILES
- DRAGTYPE_FILENAME_SCENE
- DRAGTYPE_FILENAME_OTHER
So I have instead tried doing it via a different approach. I am loading the document, grabbing some models from the scene, adding them to an AtomArray and then doing a HandleMouseDrag using the type DRAGTYPE_ATOMARRAY. But this only seems to work when dropping into the Object Manager. If you drop it over the viewport then nothing happens.
Is there anyway to be able initiate a drag drop from a GeUserArea and have C4D merge the file that is dropped? Or is there a way to manually do it an have the Viewport accepted the dropped content? Needs to work in R20 to 2023.
Thanks!
-
RE: Updating my r20 C++ plugins to r21 and up
@rui_mac said in Updating my r20 C++ plugins to r21 and up:
However, is there a description on how to start clean?
My first tutorial goes through from having absolutely nothing to being able to compile the sample SDK. It takes you through every step required without assuming any prior experience.
https://www.youtube.com/playlist?list=PLEPTxkpDVvX0r292yn8xL39Cm3Wi3E69i
-
RE: maxon::Url 206 partial content
Hi @ferdinand,
I will see if I can get a URL to you next week to debug on your end.
I went with C++ because that suited me better for the project. I compile libCurl already for every version of C4D from R20 to S26 so it is not a problem to keep using it. It works well. But I try to use the maxon API when I can if it works for my needs.
I know python has all of this nailed down. But I do all my development in C++ for a variety of reasons so I am sticking with that for now. I deal with Gigabytes of data transfer daily so there is a lot of complexity that I know how to deal with in C++, but in python I have only scratched the surface of it in regards to C4D integration. So threading and fine grained control over memory was always a worry if I was to jump ship.