Gradient



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

    On 21/11/2009 at 15:00, xxxxxxxx wrote:

    My gdata.gradient is just a Gradient pointer... I'm just taking the object, not creating a copy.

    Kabe



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

    On 21/11/2009 at 15:32, xxxxxxxx wrote:

    Gradient* test;
    test = (Gradient* )data->GetCustomDataType(ATMOSPHERIC_COLOR, CUSTOMDATATYPE_GRADIENT);

    I use the above code and get the following errors.

    1>c:\users he fosters\desktop\cinema4dr11010\plugins\#planet\source\object\planet.cpp(606) : error C2665: 'GeData::GeData' : none of the 18 overloads could convert all the argument types
    1>        c:\users he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(119) : could be 'GeData::GeData(void *,VOIDVALUETYPE)'
    1>        c:\users he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(125) : or       'GeData::GeData(LLONG,LLONGVALUETYPE)'
    1>        c:\users he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(189) : or       'GeData::GeData(LONG,const CustomDataType &)'
    1>        c:\users he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(196) : or       'GeData::GeData(LONG,DEFAULTVALUETYPE)'
    1>        while trying to match the argument list '(int, Gradient * )'



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

    On 21/11/2009 at 19:34, xxxxxxxx wrote:

    Still can't figure this one out. Any help would be greatly appreciated.

    Thanks,

    ~Shawn



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

    On 22/11/2009 at 05:31, xxxxxxxx wrote:

    Your base container should be created something along this:
    BaseContainer *data = sh->GetDataInstance();

    Check that ATMOSPHERIC_COLOR is defined properly in yourplugin.h, and have a look at the SDK examples, at least one of them loads a gradient.

    Hope it helps

    Kabe



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

    On 23/11/2009 at 09:17, xxxxxxxx wrote:

    I am able to load the gradient into the shader with no problem. The problem I am running in to is that I am not sure how to load a gradient from an existing description element gradient in the attributes manager. I would like the user to be able to create a gradient using the description element and have that gradient loaded in to the shader.

    ATMOSPHERIC_COLOR is a GRADIENT decription element and is setup correctly in the .res, .h, and .str files.

    Thanks,

    ~Shawn



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

    On 23/11/2009 at 11:57, xxxxxxxx wrote:

    Shawn, please have a look into the gradientshader.cpp of the cinema4dsdk. It's all in there!

    Note especially gdata, which is set up as a public class variable, initialized in Init() to avoid non-initialized data, and then reading the user data from the description during InitRender(). This is general good practice for storing user parameters, Cinema takes care of parameter persistence.

    Hope it helps

    Kabe



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

    On 23/11/2009 at 15:33, xxxxxxxx wrote:

    Hi Kabe,

    I have looked at the gradientshader.cpp..   I see how they get the user data from the description element. But when I try to to that, I get errors. Because my gradient is defined as :

      
              AutoAlloc<Gradient> colorGradient;   
              if (!colorGradient) return FALSE;   
    

    Therefore, I can't assign it the value :

      
    colorGradient = (Gradient* )data->GetCustomDataType(ATMOSPHERIC_COLOR,CUSTOMDATATYPE_GRADIENT);   
    

    When I try to change the declaration to :

      
         Gradient* colorGradient;   
              if (!colorGradient) return FALSE;   
    

    I can no longer pass the gradient to the shader with :

      
    fresnelColor->SetParameter(SLA_FRESNEL_GRADIENT,GeData(CUSTOMDATATYPE_GRADIENT, colorGradient), 0);   
    

    I get the following errors:

      
    1>planet.cpp   
    1>c:\users	he fosters\desktop\cinema4dr11010\plugins\#planet\source\object\planet.cpp(641) : error C2665: 'GeData::GeData' : none of the 18 overloads could convert all the argument types   
    1>        c:\users	he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(119) : could be 'GeData::GeData(void *,VOIDVALUETYPE)'   
    1>        c:\users	he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(125) : or       'GeData::GeData(LLONG,LLONGVALUETYPE)'   
    1>        c:\users	he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(189) : or       'GeData::GeData(LONG,const CustomDataType &)'   
    1>        c:\users	he fosters\desktop\cinema4dr11010\resource\_api\c4d_gedata.h(196) : or       'GeData::GeData(LONG,DEFAULTVALUETYPE)'   
    1>        while trying to match the argument list '(int, Gradient * )'   
      
    

    I really appreciate you helping me out. Do you know why these errors are occurring?

    Thanks,

    ~Shawn



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

    On 24/11/2009 at 09:19, xxxxxxxx wrote:

    Can anyone help me with this?

    ~Shawn



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

    On 26/11/2009 at 13:55, xxxxxxxx wrote:

    Any thoughts? :) Why would AutoAlloc<Gradient> colorGradient; allow me to pass the gradient to the shader but Gradient* colorGradient does not?



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

    On 27/11/2009 at 06:38, xxxxxxxx wrote:

    Instead of:

      
    fresnelColor->SetParameter(SLA_FRESNEL_GRADIENT,GeData(CUSTOMDATATYPE_GRADIENT, colorGradient), 0);  
    

    use:

      
    fresnelColor->SetParameter(SLA_FRESNEL_GRADIENT,GeData(CUSTOMDATATYPE_GRADIENT, *colorGradient), 0);  
    

    or:

      
    fresnelColor->SetData(SLA_FRESNEL_GRADIENT,GeData(CUSTOMDATATYPE_GRADIENT, *colorGradient));  
    

    cheers,
    Matthias



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

    On 27/11/2009 at 15:32, xxxxxxxx wrote:

    Perfect.. That worked wonderfully. Thanks Matthias.

    ~Shawn


Log in to reply