Xpresso Port ID's



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

    On 16/08/2006 at 19:23, xxxxxxxx wrote:

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

    ---------
    Hey Guys,
    I'm just trying to find how to add the Object output port for the Object node within Xpresso. I know I need to use the AddPort() function but I can't find any input \ output port ID's in the SDK docs. Any help is always appreciated.
    Thanks,
    Josh



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

    On 16/08/2006 at 21:32, xxxxxxxx wrote:

    Here is a sample extracted from one of my projects. Note that the DescID used to get portID is for a description resource belonging to my plugin tag. This should be the same for built-in objects - use the description resource enum from the header (e.g.: Obase.h).

    GvNode*          dnode =          nodeMaster->CreateNode(root, ID_OPERATOR_OBJECT, NULL, x+96, y);  
    if (!dnode)                    return FALSE;  
      
    // This is a node for a plugin tag  
    dnode->OperatorSetData(GV_ATOM, tag, GV_OP_DROP_IN_BODY);  
    LONG          portID =     GvCall(dnode->GetOperatorData(), GetMainID)(dnode, GV_PORT_INPUT, DescID(DescLevel(IPPDIAL_SLAVEVALUE)));  
    GvPort*          dport =          dnode->AddPort(GV_PORT_INPUT, portID, GV_PORT_FLAG_IS_VISIBLE, TRUE);  
    if (!dport)                    return FALSE;  
      
    // - Set Object node reference type  
    BaseContainter*     bc =     dnode->GetOpContainerInstance();  
    bc->SetLong(GV_OBJECT_PATH_TYPE,     GV_OBJECT_PATH_TYPE_ABSOLUTE);  
      
    // - Connect last input to SlaveNode  
    // -- For IsConnectionValid()  
    NodePort                    input;  
    input.node =               constNode;  
    input.port =               constPort;  
    GvNode*          sout =     NULL;  
    GvNode*          din =     NULL;  
    GvPort*          spout =     NULL;  
    GvPort*          dpin =     NULL;  
    if (!nodeMaster->IsConnectionValid(input.node, input.port, dnode, dport, sout, spout, din, dpin))  
         return FALSE;  
    dnode->AddConnection(sout, spout, din, dpin);  
      
    EventAdd();
    

    HTH,



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

    On 17/08/2006 at 09:21, xxxxxxxx wrote:

    Thanks for the quick reply Robert. There are still two things that are confusing:
    1. Where in the SDK is the function GvCall()? The documentation has no reference to this function.
    2. Does the second part of this function (dnode, GV_PORT_INPUT, DescID(DescLevel(IPPDIAL_SLAVEVALUE))) determine the id of the port to get? So in the DescID(DescLevel(IPPDIAL_SLAVEVALUE))) I would specify the ID for the Object output port? If so, where can I find this ID in the SDK docs?
    Once thanks for all of your help.
    Josh



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

    On 17/08/2006 at 14:17, xxxxxxxx wrote:

    Hello Josh,

    1. It isn't. I got this information through Mikael. :)

    2. The GvCall() calls an XPresso node method, in this case GetOperatorData() with the second part as the arguments. But, yes, this gets the node port ID for the description passed to it.

    This drove me mad as well since, as you note, there is no reference to this in the documentation.



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

    On 17/08/2006 at 15:55, xxxxxxxx wrote:

    So is there a way to get the Object output port ID of the Object operator in Xpresso? Or to get the Point Index input port ID of a Point node? I thought this would be a relatively simple thing to do. I'm just getting really confused on how to knowingly get a input / output ID of a specific port for a node that is native to Cinema. Your code makes sense, but finding the PortID constant just seems to be really convoluted.
    I really appreciate all the help Robert!
     
    Josh



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

    On 17/08/2006 at 20:08, xxxxxxxx wrote:

    For the native stuff, look in the Resource/res/description folder within your Cinema 4D install. This has the description resources for most of the native Cinema 4D 'objects'. These are what you will want to plug into DescID(DescLevel(...)) replaceing the ellipses of course to get the in or out port. Note that there is choice between GV_PORT_INPUT and GV_PORT_OUTPUT for what type of port (which may make a difference in the port ID?).


Log in to reply