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

    BaseObjects and Object-Link_ports

    SDK Help
    0
    4
    443
    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 09/06/2008 at 00:16, xxxxxxxx wrote:

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

      ---------
           Hi 🙂

      I have a question about the object-link-port in Xpresso. I added this kind of ports to my node.

      Whats the difference between a Link Port and an Object Port? I would like to connect the Object(Link?)-Output-Port of a Polygon Object with my Inport-(Link / Object)-Input-port and edit some points of it.

      GeData iptdataA = GvGetPortGeData(bn, iptA, run);
      //This is the part which is called in the Calculation Method of my Node.

      I didn't work with BaseObjects, CDAtom and I have to check their dependencies, yet.
      I have no clue 😞

      Thanks for help

      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 10/06/2008 at 02:21, xxxxxxxx wrote:

        You have to use the GVGENERALOBJECT description type. Please have a look at the following example code. It's a node with an object input that prints the name of the object, much like the result node.

        > \> CONTAINER print_node \> { \>      NAME print_node; \>      INCLUDE GVbase; \>       \>      GROUP ID_GVPROPERTIES \>      { \>           GVGENERALOBJECT PRINT_NODE_INPUT { INPORT; STATICPORT; CREATEPORT; } \>      } \> } \>

        > \> #ifndef \_print_node_H\_ \> #define \_print_node_H\_ \> \> enum \> { \>      PRINT_NODE_INPUT = 2000, \> \>      PRINT_NODE\_ \> }; \> \> #endif \>

        > \> STRINGTABLE print_node \> { \>      print_node "Print Node"; \> \>      PRINT_NODE_INPUT "Input"; \> } \>

        > \> #include "c4d.h" \> #include "c4d_operatordata.h" \> \> #include "print_node.h" \> \> \> class PrintNode : public GvOperatorData \> { \>           INSTANCEOF(PrintNode,GvOperatorData) \> \>      private: \>           BaseList2D\* result; \>           GvValue\* v1; \>                 \>      public: \> \>           virtual const String     GetDetailedText(GvNode \*bn); \>           virtual const String     GetText(GvNode \*bn); \> \>           virtual Bool               iCreateOperator(GvNode \*bn); \> \>           virtual Bool               AddToCalculationTable(GvNode \*bn, GvRun \*r); \> \>           virtual Bool               InitCalculation(GvNode \*bn, GvCalc \*c, GvRun \*r); \>           virtual void               FreeCalculation(GvNode \*bn, GvCalc \*c); \>           virtual Bool               Calculate(GvNode \*bn, GvPort \*port, GvRun \*r, GvCalc \*c); \> \>           static NodeData\*          Alloc(void) { return gNew PrintNode; } \> }; \> \> Bool PrintNode::iCreateOperator(GvNode \*bn) \> { \>      bn->SetShowPortNamesState(FALSE); \>      BaseContainer \*bc = bn->GetOpContainerInstance(); if (!bc) return FALSE; \>      return SUPER::iCreateOperator(bn); \> } \> \> const String PrintNode::GetDetailedText(GvNode \*bn) \> { \>      return GvGetOperatorDetailedText(this,bn); \> } \> \> const String PrintNode::GetText(GvNode \*bn) \> { \>      if(result) \>      { \>           return result->GetName(); \>      } \>      return "no input"; \> } \> \> Bool PrintNode::AddToCalculationTable(GvNode \*bn, GvRun \*r) \> { \>      return r->AddNodeToCalculationTable(bn); \> } \> \> Bool PrintNode::InitCalculation(GvNode \*bn, GvCalc \*c, GvRun \*r) \> { \>      v1 = bn->AllocCalculationHandler(PRINT_NODE_INPUT,c,r,0); if (!v1) return FALSE; \>      return TRUE; \> } \> \> void PrintNode::FreeCalculation(GvNode \*bn, GvCalc \*c) \> { \>      bn->FreeCalculationHandler(v1); \> } \> \> Bool PrintNode::Calculate(GvNode \*bn, GvPort \*port, GvRun \*r, GvCalc \*c) \> { \>      if (!v1->Calculate(bn,GV_PORT_INPUT,r,c)) return FALSE; \>      if (!v1->GetPort()->GetObject(result, r)) return FALSE; \> \>      return TRUE; \> } \> \> //////////////////////////////// \> \> #define GVPRINTNODE_ID 1010815 \> \> Bool RegisterPrintNode() \> { \>      return GvRegisterOperatorPlugin(GVPRINTNODE_ID, "Print Node", 0, PrintNode::Alloc, "print_node", 0, ID_GV_OPCLASS_TYPE_GENERAL, ID_GV_OPGROUP_TYPE_GENERAL, 0, NULL); \> } \>

        cheers,
        Matthias

        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 10/06/2008 at 11:57, xxxxxxxx wrote:

          Hi, works fine 🙂 Thank you...

          Is it correct to use GetTypeName() to differ the several objects (camera, spline, etc..)? After that I could cast it to the object, right?

          Thanks 🙂

          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 12/06/2008 at 12:31, xxxxxxxx wrote:

            Hi!

            Wrote the needed lines to my project. It works with a BaseObject.
            But what about the other objects? With GetLink(..) I get a BaseLink2D which hands its members to BaseTag and BaseObject.

            -->On BaseObject:    ...->GetName()   (works)
            -->On BaseTag:        ...->GetName()    (doesn't work)!!!! ????

            The BaseTag is derieved from the BaseList2D. I am confused about it.
            Could someone throw a light on my prob? Thx

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