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

Changing VideoPost Effect settings

Author
Message
  Topic Search Topic Search
ScottA View Drop Down
Member
Member


Joined: 2011 Jan 07
Online Status: Offline
Posts: 2288
Direct Link To This Post Topic: Changing VideoPost Effect settings
    Posted: 2011 Apr 18 at 5:23pm

User Information:

Cinema 4D Version:   12 
Platform:   Windows  ;   
Language(s):     C++  ;   

---------

Hi Guys,

I'm trying to change the GI Mode option in the global illumination post effect.
I've done this in Python and Coffee. But in C++ I'm getting and undefined ID error.

BaseDocument *doc = GetActiveDocument();
RenderData *rdata = doc->GetActiveRenderData();   
BaseVideoPost *post = rdata->GetFirstVideoPost();
BaseContainer *bc = post->GetDataInstance();

if(post->GetType() == VPglobalillumination)
 {                 
   bc->SetReal(GI_SETUP_DATA_ANIMATION_METHOD,2); // Error:GI_SETUP_DATA_ANIMATION_METHOD is an Unidentified ID?                            
 }


Can anyone tell me what I'm doing wrong?

-ScottA
Back to Top
affa View Drop Down
Member
Member


Joined: 2005 Mar 03
Location: Germany
Online Status: Offline
Posts: 114
Direct Link To This Post Posted: 2011 Apr 18 at 11:44pm
you need an include to the gi definitions.
the path should be:

#include "../../modules/advanced render/advanced render/res/description/vpgisetup.h"

Back to Top
ScottA View Drop Down
Member
Member


Joined: 2011 Jan 07
Online Status: Offline
Posts: 2288
Direct Link To This Post Posted: 2011 Apr 19 at 9:43am
Thanks affa.
That got me closer. But I still can't get the combo buttons to change properly.

I'm using the ID's found in:modules/advanced render/advanced render/res/description/vpgisetup.h
But I can't find  the combination to make them work with the combo buttons.
I can make the value fields change just fine. But not the combo buttons.


bc->SetReal(GI_SETUP_DATA_DIFFUSE_DEPTH, 6); //Works fine
bc->SetReal(GI_SETUP_DATA_ANIMATION_METHOD, GI_SETUP_DATA_ANIMATION_QMC_ENABLE); //Does Not Work-->Blank!


I've tried every combination of Enums and ID's I can think of. But I'm not finding the correct combination to make the combo buttons change.

-ScottA
Back to Top
Nt2005 View Drop Down
Member
Member
Avatar

Joined: 2006 Jun 29
Location: Germany
Online Status: Offline
Posts: 113
Direct Link To This Post Posted: 2011 Apr 19 at 10:21am
Ehm... Scott, ID is a long value. :D
Best regards,
Toni
If you find any mistake in the language, please send me a private message. Thanks. ;)
Back to Top
ScottA View Drop Down
Member
Member


Joined: 2011 Jan 07
Online Status: Offline
Posts: 2288
Direct Link To This Post Posted: 2011 Apr 19 at 10:39am
I tried using Long and it doesn't work either.

bc->SetLong(GI_SETUP_DATA_ANIMATION_METHOD, GI_SETUP_DATA_ANIMATION_QMC_ENABLE);

Fails.
It sets the button to a blank value.


I've also tried this:
bc->SetLong(GI_SETUP_DATA_ANIMATION_QMC_ENABLE, TRUE);
And it also fails.
The button doesn't change. Not even to a blank state.

I've also tried using the ID numbers listed in the .h file's enums instead of using the words
Fails.
I can't find the elusive ID combination to make these things change properly.


*Update:
I found it...Well I found one of them anyway.Smile

bc->SetLong(GI_SETUP_DATA_ANIMATION_METHOD, GI_SETUP_MASTER_MODE_IC_QMC); //works!


I went into: modules\advanced render\advanced render\res\description\vpgisetup.res
And I found some ID's listed there in a way that makes it a little bit easier to understand how they are grouped and used in the UI.
Now I just have to keep looking and see if I can find all the ones I need.

Thanks for the help guys.

-ScottA


Edited by ScottA - 2011 Apr 19 at 11:04am
Back to Top
kuroyume0161 View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 29
Location: United States
Online Status: Offline
Posts: 3665
Direct Link To This Post Posted: 2011 Apr 19 at 2:10pm
Again, it is a LONG value.  TRUE/FALSE are Bool values.
Seems like you found that you needed to set the proper LONG value for the GI mode. :)
Back to Top
ScottA View Drop Down
Member
Member


Joined: 2011 Jan 07
Online Status: Offline
Posts: 2288
Direct Link To This Post Posted: 2011 Apr 20 at 8:29am
Yeah. I know it's supposed to be a LONG type.
When the ID's I was using didn't work for me I started trying other types just to make sure that wasn't the problem.

I've got it all working now.
The .res file really saved my butt with this. Because the way the ID's are listed in the .h file. It's not clear which ID's are supposed to be used together.
In the .res file you can see a sort of parent->child (group->child) relationship between the ID's needed to be used together. And it made it clear which two ID's need to be used in the setter function.

I guess I should probably post an example of Maxon's preferred method for setting these options.
Just in case anyone new to this stuff (like me) needs it:

BaseVideoPost *post = rdata->GetFirstVideoPost();// assigns this variable to the first video post effect entry
post->SetParameter(DescID(GI_SETUP_DATA_ANIMATION_METHOD), GeData(GI_SETUP_MASTER_MODE_IC_IC), DESCFLAGS_SET_0); //preferred way to set parameters
post->SetParameter(DescID(GI_SETUP_DATA_DIFFUSE_DEPTH), GeData(5), DESCFLAGS_SET_0); //preferred way to set parameters


-ScottA
Back to Top

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.093 seconds.