Method arguments that use the [Out] attribute in front of the argument name do not appear on Bolt units.
If they are out arguments, they will appear as outputs, as they should, because they're not specifiable on calling, they're return values. Unless I'm misunderstanding?
It is not an out argument like
someMethod(out float values)
but rather the [Out] attribute, like
someMethod([Out] float values)
I see! It's odd, there's no special handling of OutAttribute anywhere in the source. I'll have to investigate. In the mean time, can you create a wrapper around your P/Invoke method?
Thanks, yes, I created a wrapper for the method for now.
Hi gyltefors, sorry for the late reply on this.
From my understanding on P/Invoke and [Out], you are expecting the array parameter to show up as an output, is that right?
Your parameter kind of falls between the cracks currently for Bolt. ParameterInfo.ParameterType.IsByRef returns false, because it's not marked as out or ref, so Bolt doesn't show it as an output. But ParameterInfo.IsOut returns true, because it has the [Out] attribute, so Bolt hides it as an input.
I've had to do a little bit on research to understand how Bolt should even behave in that case. My conclusion is that:
So your method will look like this:
Hi, thanks for the follow up. Houdini API is using "[Out]" extensively, and as it differs from "out" an input parameter has to be supplied. I think the best solution might be to ignore "[Out]", and just provide inputs and outputs as normal.
That's odd, I believe it's a mistake from Houdini's side then. A P/Invoke parameter marked as [Out] indicates that the argument will not be provided by the caller, and that it will be assigned by the callee. Unless I misunderstood?
Can you give me an example of how you would be supposed to call one of those methods in Houdini's API?
Sorry for the delay in responding. The original API is a C API documented here:
As the Unity API is commercial, I can't copy paste the full code, but e.g the data array is declared in C-Sharp as:
[Out] double data_array
The array has to be created and passed to the method, who fills in the values.
Customer support service by UserEcho