Change parameter in texture tag



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

    On 12/02/2004 at 06:28, xxxxxxxx wrote:

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

    ---------
    I use my own object and shader. This pair should only use UVW-Mapping. So, within my object, I grab a pointer to the texture tag, and want to set the projection to uvw....
    GePrint( "textag " + LongToString( ptagdata->GetLong( TEXTURETAG_PROJECTION ) ) );
       ptagdata->SetLong( TEXTURETAG_PROJECTION, TEXTURETAG_PROJECTION_UVW );
       GePrint( "textag " + LongToString( ptagdata->GetLong( TEXTURETAG_PROJECTION ) ) );
    Before, the projection is set to 0, after it is set to 6. This value is kept, if I run to that lines later, I also read 6 before the setting line. So, the new value should be sucessfully written into the tags container. But if I look at the attributes of the tag in the manager, the projection is still set to the original value, and when I start rendering, also the original value is used......is it impossible, or is there a way to do it? The user would have to set the projection to uvw MANUALLY for each object, thats not too nice.



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

    On 12/02/2004 at 23:12, xxxxxxxx wrote:

    Found something strange....when I take a cinema basematerial and drop it onto my object, then the texture tag is set to uvw-mapping by default. If I use my own shader and drop it on my object, then spherical projection is set by default. This depends on the material I use, but not on the kind of object. So somehow it has to deal with or even can set by the material/shader. But how?



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

    On 15/02/2004 at 16:22, xxxxxxxx wrote:

    Some things I can think of:

    1. I assume that ptagdata is what you get from GetDataInstance(), right? (GetData() won't work in that way.)
    2. Perhaps you need to call tag->Message(MSG_UPDATE)?
    3. A more fool proof way to set parameters in C4D R8 is to use SetParameter(). That would be:
        
        
        tag->SetParameter(DescLevel(TEXTURETAG_PROJECTION), GeData(TEXTURETAG_PROJECTION_UVW), 0);
    


Log in to reply