Jump to content

CVEX_Context question


bareja

Recommended Posts

Hi I have question about CVEX_Context, I am trying to add some inputs to CVEX_Context and it always says it's equal to 0.

For example:

CVEX_Context        cvex;
cvex.addInput("Npt", CVEX_TYPE_INTEGER, &npts, 1);
/*
load cvex code 
*/
CVEX_ValueList &iclist = cvex.getInputList();
std::cout << "inputs: " << iclist.entries() << std::endl;

CVEX_ValueList &oclist = cvex.getOutputList();
std::cout << "outputs: "<< oclist.entries() << std::endl;

and result will be like this:

inputs: 0
outputs: 2

My cvex network is really simple, four parameter nodes, 2 parameter nodes to get and set P and two to get and set Cd.

it looks like getOutputList() works correct, but inputlist should be equal to 3 because one input was defined.

Can you help me and explain what I am doing wrong ?

Cheers!

Edited by bareja
Link to comment
Share on other sites

probably I am doing something wrong with code loading, because if I will comment lines responsible for loading, my output is like this:

inputs: 3
outputs: 0

and it make sense, 1 - P, 2 - Cd and 3 - Npt.

Please help :)

P.S.

OK it's working I did mistake with type assignment.

I am sorry,

Thanks.

Edited by bareja
Link to comment
Share on other sites

Hey,

I have another question about CVEX_Context, If I will add one input:

// add input
cvex.addInput("P", CVEX_TYPE_VECTOR3, true);

//
CVEX_Value *P;
GEO_AttributeHandle ahandle = gdp->getPointAttribute("P");

how can I copy/set data from ahandle to *P ? should I copy it ? or maybe somehow I can get pointer to that data and set it to *P ?

thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...