Something I've been trying to do that illudes me.
The only example there is that's even close is exampledataobject.cpp and Clinton's dataobjects. I want to return a value to a command not a dataobject. I assume it's done on the RiExamplesPlugin.cpp. I'm trying to pass a float. See my image
well I finally got some results, I had my extern variable in the wrong place. There is still an issue as I have to click twice on my command to get the value I set, because my global variable needed to be initialized with a value, maybe I just have it in the wrong place too.
Clinton, the command test is just a value(myflt=5.0f) to pass from itself to RiExamplesPlugin.cpp. I have extern float myflt; at the end of both .h files.
My global float myflt; is on the parameterpassng.cpp where my value originated but not in the function where my value is:
STDMETHODIMP CRcParameterPassing::Execute()
I don't seem to be able to use the connectors in the sample to pass the value either.
This seems to work. Using a second command, first one creates the value(IRcParameterPassing2) and then it's there for the second one that uses it.
So my original IRcParameterPassing is only a dummy command, but I suppose it too could do stuff.
//global under includes
float myflt;
STDMETHODIMP CRcParameterPassing::Execute(void)
{
//this is just a random int to test code.
int a = rand()%10000;
myflt = (float)a;
return S_OK;
}