Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    setting Material-Projection

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 287 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 13/05/2009 at 06:28, xxxxxxxx wrote:

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

      ---------
      Hi all,

      with the Help of Mathias (thanks a lot here again) I can run through all objetcs and allocte the material tag to do many things.
      But:
      Unfortunately I didn`t find a possibility to set the projektion (cubic, sphere, uvw) in the SDK and here in the forum.

          
          
          
          
          void StepThruHierarchy(BaseObject *obj)  
          {  
               while (obj)  
               {  
                    TextureTag *ttag = NULL;  
                    ttag = static_cast<TextureTag*>(obj->GetTag(Ttexture));  
                    if (ttag)  
                    {  
                         BaseMaterial *mat = NULL;  
                         mat = ttag->GetMaterial();  
                         ttag = SetTag(Ttexture)->projection(cubic) // hier soll die Projektion  auf "cubic"gesetzt werden  
                         if (mat) GePrint(mat->GetName());  
                    }  
            
                    StepThruHierarchy(obj->GetDown());  
                    obj = obj->GetNext();  
               }  
          }  
          
      

      Thanks Ronny

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 13/05/2009 at 08:43, xxxxxxxx wrote:

        void StepThruHierarchy(BaseObject \*obj) \> { \>      while (obj) \>      { \>           // No need to first set to NULL then to return value \>           TextureTag \*ttag = static_cast<TextureTag\*>(obj->GetTag(Ttexture)); \>           if (ttag) \>           { \>                // Set Projection like this (the values exist in the resource/res/description/ttexture.res) \>                ttag->SetParameter(DescLevel(TEXTURETAG_PROJECTION), GeData(TEXTURETAG_PROJECTION_UVW), 0L); \>                // ditto \>                BaseMaterial\* mat = ttag->GetMaterial(); \>                if (mat) GePrint(mat->GetName()); \>           } \>           // Save stack, time, recursion by not calling function if no children! \>           if (obj->GetDown()) StepThruHierarchy(obj->GetDown()); \>           obj = obj->GetNext(); \>      } \> }

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 13/05/2009 at 10:20, xxxxxxxx wrote:

          You can also do it this way...

              
              
                
              -------- S N I P ----------
              
              
              
              
              TextureTag *ttag = NULL;   
              LONG ttagi = 0;
              
              
              
              
              while( (ttag = (TextureTag* )(obj->GetTag(Ttexture, ttagi++))) )  
              {  
                  BaseContainer tagvals = ttag->GetData();
              
              
              
              
                  tagvals.SetLong(TEXTURETAG_PROJECTION, TEXTURETAG_PROJECTION_UVW);
              
              
              
              
                  ttag->SetData(tagvals);  
                  ttag->Message(MSG_UPDATE);  
              }  
              -------- S N I P ----------  
              
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 18/05/2009 at 03:13, xxxxxxxx wrote:

            Hi kuroyume0161, Hi Giblet,
            thanks to both of you.
            the way with:

                
                
                ttag->SetParameter(DescLevel(TEXTURETAG_PROJECTION), GeData(TEXTURETAG_PROJECTION_UVW), 0L);  
                
            

            wors absolutly fine.
            Thanks again.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post