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

    problem with ID_BASEOBJECT_COLOR

    Scheduled Pinned Locked Moved SDK Help
    9 Posts 0 Posters 739 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 30/09/2010 at 14:03, xxxxxxxx wrote:

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

      ---------
      Hi, i have a quick question about coloring objects by using ID_BASEOBJECT_COLOR

      i tried both of the following, but none did work. any idea what i am missing?

          tempObj->SetParameter(ID_BASEOBJECT_USECOLOR,GeData(ID_BASEOBJECT_USECOLOR_ALWAYS),0);  
                tempObj->SetParameter(ID_BASEOBJECT_COLOR,GeData(Vector(1,0,0)),0);  
      
           tempObj->GetDataInstance()->SetLong(ID_BASEOBJECT_USECOLOR,ID_BASEOBJECT_USECOLOR_ALWAYS);  
                    tempObj->GetDataInstance()->SetVector(ID_BASEOBJECT_COLOR,Vector(1,0,0));  
      

      thanks in advance,
      cheers,
      Ello

      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 01/10/2010 at 06:39, xxxxxxxx wrote:

        is it a problem that i am inside GetVirtualObjects? yes, it seems so, but is there a way to do it in GetVirtualObjects? I dont want to assign materials for achiving this. Any ideas?

        cheers,
        Ello

        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 01/10/2010 at 09:04, xxxxxxxx wrote:

          what is tempObj? An object that you create inside of GetVirtualObjects? Then it should work I´d assume. Without a context it´s hard to say. Do you return that object in GetVirtualObjects? Then what does the object look like when you convert your plugin object that creates this?

          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 01/10/2010 at 09:17, xxxxxxxx wrote:

            tempObj is a BaseObject::Alloc(Ocube) and is inserted under a Nullobject. When I convert the plugin, the Cube is there, but no Color is set. I temporarily tried what happens when i insert the Cube directly into the document and the color was set, thats why i assume it doesnt work with virtual objects...

            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 01/10/2010 at 10:14, xxxxxxxx wrote:

              yeah I can confirm it (just tried with a sphere). Don´t know why it doesn´t work (setting primitive specific settings works just fine) but I see no real reason why it shouldn´t work.

              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 01/10/2010 at 14:08, xxxxxxxx wrote:

                I'm having something of a similar problem with reading/writing color vectors.  I'm doing it as SReal() for each component yet the values are reset to default every time - this despite all other settings being read/written properly.  Maxon is boiling my blood at the moment.  I can't spend every friggin week fixing these issues in R12 while I'm trying to employ what little free time to write a new commercial plugin.  It is being evaporated for these vapid hunts of stupid issues.  Grrrr...... ;(

                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 05/10/2010 at 05:51, xxxxxxxx wrote:

                  To set the object's color of child objects of a generator you have to use BaseObject::SetColorProperties and additionally the OBJECT_USECACHECOLOR flag has to be set during plugin registration.

                  here some example code:

                    
                  BaseObject *RoundedTube::GetVirtualObjects(BaseObject *op, HierarchyHelp *hh)  
                  {  
                    BaseObject *ret = NULL;  
                    
                    Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTYFLAGS_DATA);  
                    if (!dirty) return op->GetCache(hh);  
                    
                    ret = BaseObject::Alloc(Ocube);  
                    if (!ret) return NULL;  
                    
                    ObjectColorProperties prop;  
                    prop.usecolor = ID_BASEOBJECT_USECOLOR_AUTOMATIC;  
                    prop.color = Vector(1.0,0.0,0.0);  
                    prop.xray = FALSE;  
                    
                    ret->SetColorProperties(&prop);  
                    
                    return ret;  
                  }  
                    
                    
                  // be sure to use a unique ID obtained from www.plugincafe.com  
                  #define ID_ROUNDEDTUBEOBJECT 1001157  
                    
                  Bool RegisterRoundedTube(void)  
                  {  
                    return RegisterObjectPlugin(ID_ROUNDEDTUBEOBJECT,GeLoadString(IDS_ROUNDED_TUBE),OBJECT_GENERATOR|OBJECT_USECACHECOLOR,RoundedTube::Alloc,"Oroundedtube",AutoBitmap("roundedtube.tif"),0);  
                  }  
                  

                  cheers,
                  Matthias

                  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 05/10/2010 at 06:31, xxxxxxxx wrote:

                    thank you very much matthias, i'll try that

                    cheers,
                    ello

                    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 05/10/2010 at 07:03, xxxxxxxx wrote:

                      thanks matthias. Could you additionally explain why this is necessary and doesn´t work by changing the container values? I just would like to understand the reason for this procedure. thank you!

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