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

    GetVirtualObjects Questions

    Scheduled Pinned Locked Moved SDK Help
    7 Posts 0 Posters 542 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 15/01/2011 at 09:19, xxxxxxxx wrote:

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

      ---------
      I would like to have my generator plugin return three different spheres each one slightly bigger than the other.  I would like this to all happen in GetVirtualObjects() so that the sphere's options are not immediately accessible to the user.  The onyl way I want the user to be able to change the spheres is through making the plugin object editable.  How would I go about returning 3 different spheres in GVO?  is this possible?

      Thanks,

      ~Shawn

      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 15/01/2011 at 12:51, xxxxxxxx wrote:

        Create a Null object, allocate the three spheres, insert them under the Null object, configure the spheres, return the Null object.

        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 15/01/2011 at 12:53, xxxxxxxx wrote:

          Perfect.  Worked like a charm.  Thanks again Robert.  🙂

          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 03/02/2011 at 01:09, xxxxxxxx wrote:

            Hello,
            I tried this also, but the configuration of the spheres doesn't work. I set some differents radius and possitions (in GetVirtualObjects), but I see only one sphere with the defallt sizes. Where or how can I set the configurations.
            regards
            Markus

            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 03/02/2011 at 02:55, xxxxxxxx wrote:

                
                
              BaseObject* null = BaseObject::Alloc(Onull);  
              if(!null) return NULL;  
                
              BaseObject* sphere1 = BaseObject::Alloc(Osphere);  
              if(!sphere1) return NULL;  
                
              BaseObject* sphere2 = BaseObject::Alloc(Osphere);  
              if(!sphere2) return NULL;  
                
              BaseObject* sphere3 = BaseObject::Alloc(Osphere);  
              if(!sphere3) return NULL;  
                
              doc->InsertObject(sphere1, null, NULL, 0);  
              doc->InsertObject(sphere2, null, sphere1, 0);  
              doc->InsertObject(sphere3, null, sphere2, 0);  
                
                
              return null;  
                
              

              You would of course need to make adjustments to each sphere's parameters to make them different sizes but this is how I did it.  🙂

              Hope that helps.
              ~Shawn

              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 03/02/2011 at 04:08, xxxxxxxx wrote:

                Hello,

                ok, that's the same like in my function.

                NullObj = BaseObject::Alloc(Onull);
                  if (!NullObj) return NULL;
                  text = BaseObject::Alloc(Osplinetext);
                  if (!text) return NULL;
                  nurbs = BaseObject::Alloc(Oextrude);
                  if (!nurbs) return NULL;

                doc->InsertObject(nurbs,NullObj,NULL,FALSE);
                  doc->InsertObject(text,nurbs, NULL, FALSE);

                GeData data;
                  data.SetString("hello world");
                  BaseContainer *bc = text->GetDataInstance();
                  bc->SetParameter(DescLevel(ID_PAINTSPLINETEXT_TEXT), data);

                return NullObj;

                But the changing of the default "Text" in the text spline doesn't work. Or the movement in the extrude NURBS object from "20" to e.g. 2 doesn't work. Do you have an idee how I can do this?

                Marky

                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 03/02/2011 at 06:12, xxxxxxxx wrote:

                  ahh, now it works.

                  BaseDocument *doc = GetActiveDocument();

                  Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA);
                    if (!dirty)
                        return op->GetCache(hh);

                  BaseObject* null = BaseObject::Alloc(Onull);
                    if(!null) return NULL;
                    BaseObject* text = BaseObject::Alloc(Osplinetext);
                    if (!text) return NULL;
                    BaseObject* nurbs = BaseObject::Alloc(Oextrude);
                    if (!nurbs) return NULL;

                  doc->InsertObject(nurbs, null,NULL,0);
                    doc->InsertObject(text, nurbs, NULL, 0);

                  BaseContainer *bc = text->GetDataInstance();
                    bc->SetString( PRIM_TEXT_TEXT, "hello world!");

                  bc = nurbs->GetDataInstance();
                    bc->SetVector( EXTRUDEOBJECT_MOVE, Vector(0,0,2) );

                  return null;

                  thanks a lot

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