Polygonal Object



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

    On 27/11/2012 at 01:08, xxxxxxxx wrote:

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

    ---------
    Hi Folks,
     
    two queries on polygon objects here.
     
    First, I'm trying to build (and add - see query two!) polygons to an objectdata plugin. But I'm just a bit confused as to where/how I'm suppose to draw the object. Do I use GetVirtualObjects, or DrawPolygonObject, or DrawPolygon... or something else?
     
    Second, when I use the create polygon tool, I can add a polygon to the object, but it doesn't show up until I hit the render button - i.e. it's not displaying in the viewport. However, I can for example, select a polygon if in polygon mode.
     
    I'm just not quite understanding what I'm suppose to do here to getting polygons to show up!
     
    Regards,
     
    WP.



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

    On 27/11/2012 at 02:30, xxxxxxxx wrote:

    Hi,

    If you return the polygonal data from GetVirtualObjects(), the generator gets automatically drawn.
    RoundedTube SDK example shows this.



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

    On 27/11/2012 at 16:27, xxxxxxxx wrote:

    Hi Yannick,
     
    thanks again.
     
    I've just had a look at the RoundedTube example from the SDK. That one seems to be a generator object, it uses the OBJECT_GENERATOR flag in the plugin registration section. What I'm after is just a plain polygon and point object - one where the points and polygons can be edited with tools.
     
    WP.



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

    On 28/11/2012 at 11:03, xxxxxxxx wrote:

    If you're doing an ObjectData plugin, the only way to return any geometry is in GetVirtualObjects. Which means that the OBJECT_GENERATOR flag must be set. You can't edit the returned geometry because it doesn't really exist in the document, and you can't insert anything produced in GVO into the document, that will crash.

    For example, the cube primitive is simply returning its geometry in GVO. It is still composed of vertices and polygons but they can't be edited until you make the object editable (sort of obvious that, I guess!). I don't think there's any way round this.

    Steve



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

    On 28/11/2012 at 11:04, xxxxxxxx wrote:

    Isn't there an OBJECT_POINTOBJECT and OBJECT_POLYGONOBJECT flag?

    Best,
    N



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

    On 28/11/2012 at 11:15, xxxxxxxx wrote:

    True. Don't know what happens if you set those, but I'd be surprised if you can add points/polygons to an object returned by GVO.

    Pleasantly surprised, that is :-)



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

    On 28/11/2012 at 16:04, xxxxxxxx wrote:

    Well, I haven't been able to add/delete points from a GVO object (through normal mesh editing tools). So that all seems to work as it's meant too. But without the OBJECT_GENERATOR flag, I can edit them. I have OBJECT_POLYGON and OBJECT_POINT flags in there, but the mesh itself won't display. Editing the polys etc is done purely by guess-selecting where they are in the viewport. And here lies what seems to be the issue, they just can't be seen in the viewport.
     
    WP.



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

    On 29/11/2012 at 01:00, xxxxxxxx wrote:

    But that is the fundamental problem. If you don't have OBJECT_GENERATOR set, your plugin won't return any generated geometry because GetVirtualObjects is not called. If GVO is not called, you don't get a visible mesh. OTOH, if it _is_ called, you get a virtual object which you can't edit.

    Hate to say it, but I don't think you can do whatever it is this way.



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

    On 29/11/2012 at 01:03, xxxxxxxx wrote:

    Hi Steve, how are normal polygon objects done then? The plain old polygon mesh object?
     
    And further to that then might be what are the OBJECT_POLYGON etc flags for?



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

    On 29/11/2012 at 02:30, xxxxxxxx wrote:

    An ordinary polygon mesh is inserted into a document, so at that point you can edit it - but you can't change any parametric parameters, like height or radius or fillets. Objects produced by a generator are not inserted into a document, that's why (this is my understanding) they are called virtual objects. They can't be edited but you can change the parametric values.

    TBH I don't know what those flags are for when used in GVO. Maybe someone else might know?

    Steve



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

    On 29/11/2012 at 02:36, xxxxxxxx wrote:

    Hi again Steve,

    Originally posted by xxxxxxxx

    An ordinary polygon mesh is inserted into a document, so at that point you can edit it - but you can't change any parametric parameters, like height or radius or fillets.

    that would be OK. I'm only after a polygon object of my own - so not a generator object that can (for example) change fillet number or radius etc. Just a plain boring old poly object or my own that can be edited with modelling tools.

    Originally posted by xxxxxxxx

    TBH I don't know what those flags are for when used in GVO. Maybe someone else might know?

    Would like to hear this also =)
     
    WP.



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

    On 29/11/2012 at 03:49, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    that would be OK. I'm only after a polygon object of my own - so not a generator object that can (for example) change fillet number or radius etc. Just a plain boring old poly object or my own that can be edited with modelling tools.

    In that case all you'd need is a CommandData plugin to insert a polygon object into the scene when requested. Your plugin would create the necessary object plus any points and polygons required (otherwise it would be empty and you wouldn't see anything) then insert it. That's a one-off action, the user can then edit the object as desired. You wouldn't need an ObjectData plugin at all.



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

    On 29/11/2012 at 15:59, xxxxxxxx wrote:

    Ah, I had a tinker with CommandData but that doesn't appear to be quite what I was after. Might be my explaining =)
    What I'm after is an actual editable polygon object plugin. So my plugin would be an editable polygon object that sits in the object manager.
     
    WP.



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

    On 30/11/2012 at 01:26, xxxxxxxx wrote:

    I think that's not possible. To be a plugin which sits in the OM and generates geometry it has to be an ObjectData. To produce any geometry an ObjectData will return a virtual object. If it's a virtual object you can't edit it. The moment you make it editable it ceases to be a generator object and just becomes an ordinary poly object.

    I'd be very happy for someone else to correct me on that but TBH I really think that it can't be done.



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

    On 04/12/2012 at 04:59, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Ah, I had a tinker with CommandData but that doesn't appear to be quite what I was after. Might be my explaining =)
    What I'm after is an actual editable polygon object plugin. So my plugin would be an editable polygon object that sits in the object manager.

    Not sure what you really want. If your object is just an editable polygon object, and it's not parametric - in what way, then, does it differ from the standard polygon object that you already have?

    What is the functionality that you want to associate with your object, if it is not generated, and all you want is the standard edit functions?

    Perhaps you should describe a usecase. What is a user supposed to do with that object, what is the problem that it solves, in what way does the object's functionality help him?



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

    On 04/12/2012 at 17:35, xxxxxxxx wrote:

    Hi Cairyn,
     
    I've got to be a little careful of saying what it's for at the moment, as it's being built for a project that is under NDA. There was intentions following this project that an alpha version be made available, and following that a formal public version. Though if it doesn't work in the first place, other software may take it's place. I'm just lucky I have a little bit of time before these decisions are made, and am hence trying to make something of this in the hope of keeping the project in Cinema as much as possible (I'm hoping entirely!).
     
    But for the purpose of this thread, the plugin would differ from the general polygon object quite a bit in terms of it's main use and the AM layout. For instance with the layout - there is no Basic or Coord tabs or any of the auto generated tabs etc. All the menus are custom built that do specific actions and functions that can replace half a dozen other objects and tags. Possibly more. It's a bit of an all-in-one object if you like. Aimed at keeping the Object Manager cleaner, simpler, and to feel faster and more efficient to work with (as well as some possible functions that don't currently exist). It's not, however, designed to replace the general polygon object as such. It's purpose built for one area of 3D only really. And while you could possibly model a mountain range or a car in it for example, I don't see why you wouldn't do those things with the normal polygon object.
     
    Probably doesn't help much I know, but can't really say a lot more at the moment =) But for the moment, the bottom line is it needs to be it's own polygon object.
     
    WP.



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

    On 05/12/2012 at 05:16, xxxxxxxx wrote:

    spedler is correct. You will need to create an Object plugin and it will need to use GetVirtualObjects() to output the resultant polygon object and possibly tags. As explained in the SDK documentation, C4D creates a deform cache of rudimentary objects (polygon objects) which are then passed to the editor or renderer. Even if you create your own 'polygon object' plugin, it still needs GetVirtualObjects() so that it can be deconstructed to the built-in polygon objects. In other words, you can't bypass the built-in object types completely - at some point, the results need to be deconstructable into them. Your object plugin would not be able to be edited like a polygon object unless you want to also write a custom set of tool plugins to allow point/edge/polygon highlighting and editing of various sorts.

    Just to add, while it would be great, one cannot extend the built-in types using plugins. For instance, you cannot derive a plugin from PolygonObject to extend or change it capabilities. You would need to implement it from scratch out of ObjectData - and we've already showed you how that must happen.



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

    On 05/12/2012 at 06:59, xxxxxxxx wrote:

    Hello;

    hmm, I see... although I must admit that I follow a different philosophy. I am not a fan of "all in one" or "we do it differently" concepts since they tend to either clash with other concepts, or run afoul of future changes. Difficult to say from this vague description, maybe it's something awesome, but in general I like it better if new tools keep the well-known tools and principles of C4D and build on it, instead of going the "almost the same but better and with different menus" route.

    That said, how about adding a new tag to an arbitrary standard polygon object? For me, tags are a familiar way to enhance the functionality of an object. They can carry a new GUI with new functions, and store any additional values, without disrupting the normal functionality of the polygon object they are attached to.



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

    On 05/12/2012 at 17:24, xxxxxxxx wrote:

    Hmmm,
     
    thanks folks. Looks like this isn't going to be possible through an object plugin. Not sure how keen I am to make a GVO object with my own poly selection tools etc. But thanks Rob, something to consider. Will also look at the tag option - something I admittedly haven't put much thought towards - thanks Cairyn.
     
    It's really meant as an inhouse proprietory plugin for now, but was thinking along the lines of making it available for others for their feedback in the future if all went well.
     
    Is support able to tell us what OBJECT_POLYGON and OBJECT_POINT are for, and when/how they're used?
     
    Cheers,
     
    WP.



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

    On 06/12/2012 at 09:29, xxxxxxxx wrote:

    Hi,

    I got information on OBJECT_POLYGON and OBJECT_POINT flags from the developers.

    The flags are used to allow that an object can carry points or polygons like a regular point or polygon object. The joint object is an example for that: it allows arbitrary geometry.
    Coupling with OBJECT_GENERATOR will only work in a way where the generator takes the points and polygons as input. Getting both output plus the polymesh rendered at the same time is not possible (as a generator object by definition disappears while its output is visible).
    If you want to develop a plain point/poly plugin OBJECT_GENERATOR does not need to be set.


Log in to reply