Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

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

 Post Reply Post Reply
Author
Message
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1100
Post Options Post Options   Quote Yannick Puech Quote  Post ReplyReply Direct Link To This Post Topic: C++ SDK Documentation for CINEMA 4D R15.037
    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 Plugin Café

Please report any errors or typos in the Bug Reports forum. 


MAXON
Developer Support
Back to Top
ScottA View Drop Down
Member
Member


Joined: 2011 Jan 07
Online Status: Offline
Posts: 2288
Post Options Post Options   Quote ScottA Quote  Post ReplyReply Direct Link To This Post 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


Edited by ScottA - 2013 Sep 17 at 9:26am
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2559
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post 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


Edited by NiklasR - 2013 Sep 17 at 10:37am
Back to Top
ScottA View Drop Down
Member
Member


Joined: 2011 Jan 07
Online Status: Offline
Posts: 2288
Post Options Post Options   Quote ScottA Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Cactus Dan View Drop Down
Member
Member
Avatar

Joined: 2003 Apr 18
Location: United States
Online Status: Offline
Posts: 1053
Post Options Post Options   Quote Cactus Dan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Katachi View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 30
Location: Germany
Online Status: Offline
Posts: 2543
Post Options Post Options   Quote Katachi Quote  Post ReplyReply Direct Link To This Post 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.


Edited by Katachi - 2013 Sep 25 at 1:50am
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2559
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2559
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post 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.


Edited by NiklasR - 2013 Sep 26 at 4:49am
Back to Top
Katachi View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 30
Location: Germany
Online Status: Offline
Posts: 2543
Post Options Post Options   Quote Katachi Quote  Post ReplyReply Direct Link To This Post Posted: 2013 Sep 26 at 7:08am
Thanks Niklas!
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2559
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Katachi View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 30
Location: Germany
Online Status: Offline
Posts: 2543
Post Options Post Options   Quote Katachi Quote  Post ReplyReply Direct Link To This Post 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?


Edited by Katachi - 2013 Sep 29 at 3:51am
Back to Top
Katachi View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 30
Location: Germany
Online Status: Offline
Posts: 2543
Post Options Post Options   Quote Katachi Quote  Post ReplyReply Direct Link To This Post 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


Edited by Katachi - 2015 Nov 18 at 12:28pm
Back to Top
Katachi View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 30
Location: Germany
Online Status: Offline
Posts: 2543
Post Options Post Options   Quote Katachi Quote  Post ReplyReply Direct Link To This Post 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).


Edited by Katachi - 2015 Nov 18 at 12:30pm
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1679
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Katachi View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 30
Location: Germany
Online Status: Offline
Posts: 2543
Post Options Post Options   Quote Katachi Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Nov 19 at 5:01am
Ok, did so.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.