How to get points/poligon from Primitive



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

    On 15/11/2004 at 14:56, xxxxxxxx wrote:

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

    ---------
    Hi all, i would like to understand how i can get geometry from primitive and nurbs object.
    I saw that SplinePrimitiveObjects can return real spline.. but i don't found anything for "Nurbs" object and Primitive
    Objects.
    Same thing, how i can get in coffee deformed geometry?

    thanks all
    Renato T.



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

    On 15/11/2004 at 19:02, xxxxxxxx wrote:

    A primitive only has primitive properties. The displayed 'geometry' only exists virtually.

    So, in order to get points and polygons, you need to make the object editable using SendModelingCommand(MCOMMAND_MAKEEDITABLE,...). Then it will have points and polygons.

    If you need to get it back into its original state (primitive), do a StartUndo(), AddUndo(), EndUndo() set around the command, then undo the action.

      
         // Process active Object  
         // - Make editable if necessary  
         if (!instanceof(op, PointObject))  
         {  
              var bc = new(BaseContainer);  
              doc->StartUndo();  
              doc->AddUndo(UNDO_OBJECT_REC, op);  
              SendModelingCommand(MCOMMAND_MAKEEDITABLE, doc, op, bc, MODIFY_ALL);  
              doc->EndUndo();  
              op = GetActiveObject(doc);  
              undos = TRUE;  
         }  
    ... do your thing to the points/polygons  
         // Undo objects made editable  
         if (undos)  
         {  
              doc->DoUndo();  
              op = GetActiveObject(doc);  
         }  
    

    Robert



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

    On 15/11/2004 at 19:33, xxxxxxxx wrote:

    Robert.... thanks! :)

    best regards
    Renato T.



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

    On 15/11/2004 at 21:21, xxxxxxxx wrote:

    Robert,

    can you help me to understand how i can transform points of a object without lose original geometry?
    For now i tried to make that with a 2 objects, origin and destination.
    What i wrong?

    Thanks in advance
    Renato T.



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

    On 15/11/2004 at 22:04, xxxxxxxx wrote:

    Depends on what you mean by "transform points".

    If you mean "object", you can apply transformation matrices to the object itself which will allow object-level translation, scaling, rotation. These do not directly change the points, only those object properties that will affect all points together.

    You can transform points for doing calculations based on them without affecting the originals. In this way, the actual points do not change.

    Or, if you are interested in actually making changes to the object's points while retaining the original points, you will need two objects.

    Finally, in order to keep the original but allow changes over time, you can use PLA (Point Level Animation) keyframes.

    So, we need to establish the purpose of transforming the points and retaining the originals.

    Robert



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

    On 15/11/2004 at 22:35, xxxxxxxx wrote:

    Robert,

    uhm... ok, thanks for info.

    So if i want deform an object i must create onother destination object... i can use [bool] CopyTo([BaseObject] dest, [int] flags)?

    Can i copy a PointObject to a NullObect?
    I wrote a deform tool in coffee trought Xpresso that need 2 object, origin and destination, will be good to semplify all if i can "transform" Null that have a Xpresso tag in a Point Object directly in coffee code because i'am not able to write a C++ a new Deformator.

    I hope that you understand this bad english :)

    thanks a lot
    Renato T.



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

    On 15/11/2004 at 23:30, xxxxxxxx wrote:

    I see.

    In C++, a deformer plugin has a virtual method called ModifyObject(). Inside it, you create a clone of the original which is then deformed by the deformer instead of directly deforming the original. Cinema itself knows to place the clone in the scene, overriding the original object.

    In COFFEE, I do not know how this is approached, if at all. You do need a copy of the point/polygon object. But COFFEE has no access to 'virtual' objects, so that leaves a gap in understanding.

    I might leave this for someone with more knowledge of COFFEE and deformers to answer. Wish I could be of more use.

    Robert



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

    On 16/11/2004 at 07:13, xxxxxxxx wrote:

    There is no other way than using 2 objects. Real deformers (like in C++) cannot be created with COFFEE.



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

    On 16/11/2004 at 07:44, xxxxxxxx wrote:

    I'm trying to copy obj to other.. but c4D is crashing any time that i trying to do that.
    I need to make more test and info.

    thanks all
    Renato T.


Log in to reply