Print Page | Close Window

C++ SDK Documentation for CINEMA 4D R15.037

Printed From: Plugin Cafe
Category: Plugin Cafe
Forum Name: SDK Help
Forum Discription: COFFEE, C++ and Xpresso Q&A
URL: http://www.plugincafe.com/forum/forum_posts.asp?TID=9265
Printed Date: 2018 Aug 16 at 1:35am
Software Version: Web Wiz Forums 9.61 - http://www.webwizforums.com


Topic: C++ SDK Documentation for CINEMA 4D R15.037
Posted By: Yannick Puech
Subject: C++ SDK Documentation for CINEMA 4D R15.037
Date Posted: 2013 Sep 17 at 7:56am

User Information:

Cinema 4D Version:    
Platform:      
Language(s):       

---------

Dear developers,

The C++ SDK documentation has been updated for CINEMA 4D R15.037

As usual it can be download from the http://www.plugincafe.com/ - Plugin Café

Please report any errors or typos in the http://www.plugincafe.com/forum/forum_topics.asp?FID=3 - Bug Reports forum. 




-------------
MAXON
Developer Support



Replies:
Posted By: ScottA
Date Posted: 2013 Sep 17 at 9:25am
Wow!
I just took a quick look at the changes section. And got quite a shock.
It appears that Maxon is dumping the LONG & REAL types! Shocked

-ScottA


Posted By: NiklasR
Date Posted: 2013 Sep 17 at 10:36am
Well, not really dumping, just renaming. Smile
If you want to compile a plugin coded with the R14 (or later) API, you can define __LEGACY_API
before including the c4d header file. You can do this in your IDE's settings or in a source file

#ifndef __LEGACY_API
    #define __LEGACY_API
#endif

#include <c4d.h>

Bool SomeFunc(LONG x) {
   // ...
}

Best,
-Niklas


-------------


Posted By: ScottA
Date Posted: 2013 Sep 17 at 11:31am
Interesting trick Nik.
I'll probably just force myself to learn the new names though.
My fingers type LONG & REAL without thinking about them. It's just going to take a while to re-train my brain to these new names.

Change is hard.

-ScottA


Posted By: Cactus Dan
Date Posted: 2013 Sep 23 at 4:58pm
Howdy,
Originally posted by NiklasR

Well, not really dumping, just renaming. Smile
If you want to compile a plugin coded with the R14 (or later) API, you can define __LEGACY_API
before including the c4d header file. You can do this in your IDE's settings or in a source file

#ifndef __LEGACY_API
    #define __LEGACY_API
#endif

#include <c4d.h>

Bool SomeFunc(LONG x) {
   // ...
}

Best,
-Niklas
Well, I can't get it to work. I'm still getting a ton of "Unknown type name ..." errors. Ouch
Does it matter to which one of my header files I add the above define?

Adios,
Cactus Dan


Posted By: Katachi
Date Posted: 2013 Sep 25 at 1:47am
Is there anywhere a description as how and what needs to be done to support the new TeamRender functionality (there's a bunch of corresponding classes...)? The code that worked fine on NET does not seem to work anymore. How is custom asset distribution handled? Is TeamRender replacing the old NET interface in the future?

I have endless questions and there is not a single example in the docs showing this utterly important feature.


-------------
Best
Samir

http://www.fluidsimulation.de - NAVIÉ - fluidsimulation.de


Posted By: NiklasR
Date Posted: 2013 Sep 26 at 4:46am
Originally posted by Cactus Dan

Howdy,
Originally posted by NiklasR

Well, not really dumping, just renaming. Smile
If you want to compile a plugin coded with the R14 (or later) API, you can define __LEGACY_API
before including the c4d header file. You can do this in your IDE's settings or in a source file

#ifndef __LEGACY_API
    #define __LEGACY_API
#endif

#include <c4d.h>

Bool SomeFunc(LONG x) {
   // ...
}

Best,
-Niklas
Well, I can't get it to work. I'm still getting a ton of "Unknown type name ..." errors. Ouch
Does it matter to which one of my header files I add the above define?

Adios,
Cactus Dan

Hi Cactus,

__LEGACY_API must be defined whenever you include the c4d.h header file. The best solution
is usually to add the definition to the Visual Studio/XCode project settings under "Preprocessor
Options" so that every single translation unit has that definition pre-defined.

Best,
-Niklas


-------------


Posted By: NiklasR
Date Posted: 2013 Sep 26 at 4:48am
Originally posted by Katachi

Is there anywhere a description as how and what needs to be done to support the new TeamRender functionality (there's a bunch of corresponding classes...)? The code that worked fine on NET does not seem to work anymore. How is custom asset distribution handled? Is TeamRender replacing the old NET interface in the future?

I have endless questions and there is not a single example in the docs showing this utterly important feature.

I have forwarded your question to our internal communication platform. There should be an answer
soon.


-------------


Posted By: Katachi
Date Posted: 2013 Sep 26 at 7:08am
Thanks Niklas!

-------------
Best
Samir

http://www.fluidsimulation.de - NAVIÉ - fluidsimulation.de


Posted By: NiklasR
Date Posted: 2013 Sep 27 at 12:32pm
Hi Katachi,

I got an answer from a developer. Unfortunately I am unable to contribute to the discussion as
I didn't work with this part of the API before. Is this information satisfying your needs?


These are the two functions which must be implemented in Message(...).

case MSG_GETALLASSETS:
{
   // add the file to the asset list.
   if (some_filename.Content())
   {
      ((AssetData*)msgdata)->Add(some_filename, (BaseList2D*)node, netRequestOnDemand);
   }
   break;
}

// Remove the path of the bitmap file, leaving just the filename
case MSG_MULTI_CLEARSUGGESTEDFOLDER:
{
   if (some_filename.Content())
   {
      some_filename = some_filename.GetFile();
   }
   break;
}


If the bool value passed to AssetData::Add(..,..,netRequestOnDemand ) is false then the developer doesn't need to do anything.
If he sets it to true he must following the next steps:
If the plugin registered the file and reads it on its own then it must be requested also from the server with the following peace of code before its read the first time on the client.
It depends on the object where to get the correct _service (1st argument passed to NetRenderGetFileFromServer) where to get it from. Where is the corresponding developer
going to implement that piece of code?

Filename fSourceFile = some_filename; // just the filename: "mycache.cache"
Filename fPath            = vps->doc->GetDocumentPath();
Filename fDestName      = fPath + fSourceFile;

NetRenderGetFileFromServer((NetRenderService*)vps->net->_service, fSourceFile, fDestName, vps->thread);

Best,
-Niklas


-------------


Posted By: Katachi
Date Posted: 2013 Sep 29 at 3:51am
Thanks very much Niklas! I will try this when I am back in the office and let you know.

Oh and btw. I am implementing this code in a scenehook of mine (dynamics execution stage) to answer the question. Does this pose any issues?


-------------
Best
Samir

http://www.fluidsimulation.de - NAVIÉ - fluidsimulation.de


Posted By: Katachi
Date Posted: 2015 Nov 18 at 12:15pm
Hi,

I am coming back to this finally as I am working on it right now but it doesn't seem to work.

As mentioned I am in a SceneHook::Execute. I have reacted to MSG_GETALLASSETS and CLEARSUGGESTEDFOLDER (I know there will be no duplicate asset names so I am not handling RENAMETEXTURE yet...it's not thrown as I am at least printing that out in case).

Testing this with "Save Project with all assets" works without problems. All my custom assets are copied over to the scene folder and the paths are correctly removed during CLEARSUGGESTEDFOLDER leaving only the asset names.

However, I am stuck with the NetRenderGetFileFromServer call which should get the asset from the server on demand (so I can load it myself). It always returns false though. I am using something like:

Filename tr_output_filename;
NetRenderService* glb_service = GetGlobalNetRenderService();
        if(glb_service && glb_service->IsRunning() && NetRenderGetFileFromServer(glb_service, assetname.GetFileString(), tr_output_filename))...


I have no clue if that's supposed to work or if it's correct. I can't find any other way to get a NetRenderService pointer or any other information concerning this.

Can somebody shed some light how the function is supposed to be called from a scene hook? Is my assumption correct that it will ask the server to copy the asset with the given filename to the client machine (specifically to the folder where the scene file asset itself was copied to)?

Using "Team Render to PV" the assets don't seem to be copied over to the client (roaming folder c4d/teamrender client/users/client/pv).

I have some more TR related questions but let's stick with this one for now.

Thanks in advance


-------------
Best
Samir

http://www.fluidsimulation.de - NAVIÉ - fluidsimulation.de


Posted By: Katachi
Date Posted: 2015 Nov 18 at 12:29pm
Oh btw. I am doing all this in R16. And maybe the mods could split this topic (or at least change the topic name). It seems misguiding with this topic (but I didn't want to start an all new thread either for the information contained in here).


-------------
Best
Samir

http://www.fluidsimulation.de - NAVIÉ - fluidsimulation.de


Posted By: Andreas Block
Date Posted: 2015 Nov 19 at 2:15am
Hi Katachi,

we have no option to split threads and I don't think, we should rename this thread, as it is the announcement of the R15 SDK documentation. I'd rather ask you to open a new thread for this question, if you don't mind.



-------------
Cheers,
Andreas
SDK Support Engineer


Posted By: Katachi
Date Posted: 2015 Nov 19 at 5:01am
Ok, did so.


-------------
Best
Samir

http://www.fluidsimulation.de - NAVIÉ - fluidsimulation.de



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.61 - http://www.webwizforums.com
Copyright ©2001-2009 Web Wiz - http://www.webwizguide.com