Block in the CAPI...

craouettecraouette Posts: 113

Hello,

I am looking at the new methods in the CAPI for Exec...
I am not sure to understand all of them.
There is

exec.getExecBlockCount()

but on the "Deform_1" node (instance of compounds.block.geometry) it returns 0... however, canvas shows one block for it.
If I drill down, there is a ForLoop Node, with a body Block. Calling
exec.getExecBlockCount()
on this ForLoop node returns 1.

And the actual deform Block is only visible in Canvas when doing edit body Block of the ForLoop node.

Does that means that we need to inspect all sub node of a graph node in order to know if there is a block or not? How can we distinguish between blocks used in the subgraph and blocks available at the top node level?

Thanks,

Pierre

Comments

  • pzionpzion Moderator, Fabric Employee Posts: 117 Fabric Employee

    Hi Pierre,

    What you're looking for is exec.getInstBlockCount(instName). At the core level, a block that is a placeholder for user code is called an ExecBlock and the actual user implementation on an Inst (node) is called an InstBlock.

    Peter Zion
    Fabric Engine

  • craouettecraouette Posts: 113

    Thanks peter.
    Next question...
    I can't figure how to get the typeSpec of a fixed port.
    there is:
    getExecFixedPortName( unsigned index )
    for the name
    DFGPortType getExecFixedPortType( unsigned index )
    for i, o, io port.
    but nothing like
    const char *getExecFixedPortTypeSpec( unsigned index )

  • pzionpzion Moderator, Fabric Employee Posts: 117 Fabric Employee

    Hi Pierre,

    ExecFixedPorts are to ExecBlockPorts as InstPorts are to ExecPorts: they are automatically created as "mirrors" of the other. Because of this, there is no API call to get the typeSpec of an InstPort, and similarly there is no API call to get the typeSpec of an ExecFixedPort. I realize that it's easy to get the typeSpec of an InstPort already by just "diving in" to the exec, and that it's not so easy to do the same with ExecFixedPorts.

    If it would be useful for you to be able to get the typeSpec of InstPorts and ExecFixedPorts it's easy enough for us to add it as an API call but it wouldn't happen until 2.4.0. In the meantime, remember that you can't actually set the type spec on either of these "mirrored" port types and so it would only be for informational purposes in your UI.

    Peter Zion
    Fabric Engine

  • craouettecraouette Posts: 113

    thanks peter. I understand they are for display only, but it is nice to show the user the expected type...
    I will use the long way, through ExecBlock, but having the shortcut will be nice...

Sign In or Register to comment.