Render Data



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/05/2012 at 22:22, xxxxxxxx wrote:

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

    ---------
    Hi folks,
     
    how do I get the various render data values? I have the following, but it returns 0:

    RenderData *RDA = RenderData::Alloc();  
    if(!RDA){GePrint("RDA not available...");}  
    RDA = doc->GetActiveRenderData();  
    Real WIDTH = RDA->GetData().GetReal(RDATA_XRES_VIRTUAL);  
    GePrint("Width = " + LongToString(WIDTH));  
    

    In this instance I'm just trying to print the render width value. I've tried numerous combinations, along with the use of BaseContainer, but I can't seem to return the correct value.
     
    Kind regards,
     
    WP.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/05/2012 at 23:51, xxxxxxxx wrote:

    Hi,

    I think you should better use RDATA_XRES and RDATA_YRES to get the render width and height:

    BaseContainer bc = doc->GetActiveRenderData()->GetData();
      
    Real renderW = bc.GetReal(RDATA_XRES),
         renderH = bc.GetReal(RDATA_YRES);
    

    I'll contact the developers to get more information on RDATA_XRES_VIRTUAL and RDATA_YRES_VIRTUAL.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/05/2012 at 00:48, xxxxxxxx wrote:

    Hi Yannick,
     
    thanks for your help. That seems to have done the trick!
     
    I'd be interested to hear about the _VIRTUAL flag if you get some feedback - just for knowledge's sake.
     
    Thanks again,
     
    WP.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 10/05/2012 at 00:31, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    I'd be interested to hear about the _VIRTUAL flag if you get some feedback - just for knowledge's sake.

    _VIRTUAL refer to virtual values not stored in the container. So to access them we have to use GetParameter() :

    GeData data; 
    RenderData *rd = doc->GetActiveRenderData();
      
    // Get virtual (units applied) width and height resolution
      
    rd->GetParameter(RDATA_XRES_VIRTUAL, data, DESCFLAGS_GET_0);
    Real renderWvirt = data.GetReal();
      
    rd->GetParameter(RDATA_YRES_VIRTUAL, data, DESCFLAGS_GET_0);
    Real renderHvirt = data.GetReal();
    


  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 26/05/2012 at 23:12, xxxxxxxx wrote:

    Thanks for that Yannick,
     
    I have a follow up question for yourself or anyone who could help in regards to the above. My plugin is getting the render data at startup through Init(). And then I'm getting it if the user changes it through GetDParameter(). However I'm now wanting the ability to set the render data through my plugin.
     
    I have the following in the GetDParameter() function:

    case ID_TAB_REAL_RENDER_WIDTH:  
    {  
      t_data = RD.GetReal(RDATA_XRES);  
      flags |= DESCFLAGS_GET_PARAM_GET;  
      return SUPER::GetDParameter(node, id, t_data, flags);  
    }
    

    That seems to work.
     
    However, I can't seem to set the RDATA_XRES. The following in SetDParameter() :

    BaseDocument *doc = GetActiveDocument();
    BaseObject *obj = (BaseObject* )node;
    BaseContainer RD = doc->GetActiveRenderData()->GetData();
    case ID_TAB_REAL_RENDER_WIDTH:  
    {  
      RD.SetReal(RDATA_XRES, t_data.GetReal());    // t_data comes from the SetDParameter() function  
      flags |= DESCFLAGS_SET_PARAM_SET;  
      obj->SetDirty(DIRTYFLAGS_DATA);  
      return SUPER::SetDParameter(node, id, t_data, flags);  
    }
    

    isn't working. It just goes back to whatever the GetDParameter returns. Am I right in the understanding of Get/SetDParameters here? I thought (in this case) that where one is getting the render width if it's changed, the other should be setting it?
     
    I've tried a few different combinations, but to no avail.
     
    WP.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/05/2012 at 07:42, xxxxxxxx wrote:

    I often misinterpret the SDK. So I could be wrong about this.
    But I think the SetDParameter() method is a workaround method that Maxon created to help deal with the problem that base containers don't always contain all the information that you might need.

    We're supposed to use GetParameter() & SetParameter() as often as possible. Because that gives us access to things a container doesn't store.
    So try it like this and see if it works:

        BaseDocument *doc = GetActiveDocument();        //Get the active document  
      RenderData *rdata = doc->GetFirstRenderData();  //Get the first render preset  
      
      GeData d;     //Create a variable to store what we get using GetParameter next  
      
      rdata->GetParameter(DescID(RDATA_XRES), d, DESCFLAGS_GET_0); //Get the current value of RDATA_XRES and store it in "d"  
      rdata->SetParameter(RDATA_XRES, 311, DESCFLAGS_SET_0);       //Set the RDATA_XRES value using what's stored inside of "d"
    

    I compiled a complete list of render setting and posted them here: https://plugincafe.maxon.net/topic/5774/5822_document-project-settings&KW=Render+Settings&PID=24352#24352

    -ScottA



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/05/2012 at 05:51, xxxxxxxx wrote:

    Hi Scott,
     
    thanks for that. I still can't seem to get this to work, but I'll stick at it. Thanks for the link to the other forum post as well - I hadn't come across that before.
     
    WP.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/05/2012 at 07:30, xxxxxxxx wrote:

    You aren't by chance trying to use that code inside of the SetDParameter() method are you?
    You should be able to use the Get&SetParameters() code to change your render settings inside of your GetDParameter() or Command() method.

    There's also known issues with trying to change render settings while rendering.
    Not sure if you're trying to do that or not.

    -ScottA



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/05/2012 at 23:11, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    You aren't by chance trying to use that code inside of the SetDParameter() method are you?

    Yep - I am/was. I'll remove them from SetDParameter() and try them in either GetDParameter() or Command().

    Originally posted by xxxxxxxx

    There's also known issues with trying to change render settings while rendering.
    Not sure if you're trying to do that or not.

    No. I think I may have seen a thread somewhere on that, but I'm trying to do it pre-render.
     
    Maybe I should send you an example of the plugin and where it's at, so you can see what I mean. Am I able to send a pm with an attachment through here?
     
    WP.
     
    EDIT : small correction to formatting.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 29/05/2012 at 07:55, xxxxxxxx wrote:

    I'd be happy to look at it. But I'm still a learner myself.
    There's a good chance that I wouldn't know the answer either.

    Probably better for you to send it to Maxon.

    -ScottA


Log in to reply