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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Texture Tag

    SDK Help
    0
    3
    329
    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
      Helper
      last edited by

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

      On 16/07/2003 at 01:50, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   7.303 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi,
      I am trying to add a material to more than one object at a same time. But my control never come out of the loop. When I check with a single object it works fine. What could be the problem?
      Lets consider I have five objects in my document (named 1,2,3,4,5) Here is some part of my code,

          
          
          
          
              NewMat = new(Material);  
              doc->InsertMaterial(NewMat, NULL);  
              NewMat->SetChannelState(CHANNEL_COLOR, TRUE);  
              NewMat->SetName("NewTexture");  
              color_channel = NewMat->GetChannel(CHANNEL_COLOR);  
              container = color_channel->GetContainer();  
              container->SetData(CH_COLOR,vector(0,100,100));  
              color_channel->SetContainer(container);  
              MatMarker = NewMat->GetMarker();  
              NewMat->Update();
          
          
          
          
              GeEventAdd(MATERIAL_CHANGED);
          
          
          
          
              TexTag = new(TextureTag);
          
          
          
          
              for(i=1; i<=5; i++)  
              {  
                 Obj = doc->FindObject(i);  
                 Obj->InsertTag(TexTag, NULL);  
                 TexTag->SetMaterial(MatMarker);
          
          
          
          
              }
          
          
          
          
              GeEventAdd(REDRAW_ALL);
          
          
          
      

      As I mentioned earlier, this code works fine for single object. But I want to update multiple objects, its getting hang. Where am I doing mistake?

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

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

        On 23/07/2003 at 10:26, xxxxxxxx wrote:

        You cannot insert the same TextureTag onto several objects at the same time. Move the allocation of the tag into the loop.
        (Btw. this is the 2000th post on this new forum... 🙂

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

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

          On 23/07/2003 at 15:01, xxxxxxxx wrote:

          (Btw. this is the 2000th post on this new forum... 🙂
          Cool! 🙂 But you still have more posts than me...I´m gonna get you sooner or later >8))

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