[C++][CustomOp] - UV Cluster update problem

2012-05-09 Thread Oleg Bliznuk
Hi list,
Recently I have encountered with the problem that I cant update UVs and
Usernormals clusters on the mesh.
Situation is here:
I have a some custom op connected to some original geometry ( input ) and
setted on the some result geo ( output ). Work is going in the operator
update callback. Topology of the result geo is changeable and can has more
of polygons than in the original one. It also has a UVs and usernormal
clusters ( both created as "always completed" ) which must be resized
respectivetly to the topology changes. But problem is that nothing similar
to resizing simply doesnt happen, when I have a result topology with a
greater number of polys and try to update clusters values with UVCls.Set (
const float * _pValues, LONG nbNodes ) - I get crash. And at this time,
GeometryAccessor reports a valid nodes count. Furthermore, if I call
UVCls.GetValues (  CFloatArray& ) I will get the size of CFloatArray is
valid also. So, I cant understood what I am doing wrong or is it a bug. If
topology is not being changed - UVs updates fine.
I have also looked at this threads
http://www.xsibase.com/forum/index.php?board=14;action=display;threadid=35564
http://www.xsibase.com/forum/index.php?board=14;action=display;threadid=41707
and seems like that my problem is the same.
Are there possible workarounds ( even something like CCOMApiHandle ways ) ?
Thanks,
-Oleg


Re: [C++][CustomOp]

2012-05-02 Thread Oleg Bliznuk
Thanks guys, GetSource() works well in my case.

>>can't you use the OperatorContext and use either GetOutputTarget ?
It's return the valid cref only in the Execute Command callback, but in the
Operator Update I always get something very empty :-)

Thanks,
-Oleg


Re: [C++][CustomOp]

2012-05-01 Thread jo benayoun
Hey Oleg,
most of times, GetSource() with operators returns empty references in cpp.
You can still try it, with some luck, you should get the operator itself
and then by a call to GetParent3DObject() whhat you're looking for.
jo



2012/5/1 Steven Caron 

> can't you use the OperatorContext and use either GetOutputTarget ? or
> maybe use GetSource to get the operator itself and navigate up?
>
> i haven't tried it in c++ but a simple runtime SCOP with this in the
> Update callback works...
>
> Application.LogMessage(In_UpdateContext.Operator.Parent3DObject)
> # INFO : sphere
>
> s
>
>
> On Tue, May 1, 2012 at 11:33 AM, Oleg Bliznuk  wrote:
>
>> Hi List,
>> a simple question about custom op. I have a custom op which can has
>> either 1 or 2 input geometries and connected to polymesh of created geo as
>> output target ( see screenshot ).I need to get name of the global parent (
>> X3DObject ) of the object on which this operator is applied ( "grid_FR" in
>> my case ). The SDK says that I am unable to do it from the operator update
>> callback, only from ExecuteCommand. So is there way to obtain this name
>> without creating any additional properties\userdatas etc in the op update
>> callback ? Something like this which works validly in executeCommand
>> callback :
>>
>>  Application().LogMessage ( "GLOB NAME: " +
>> mainMeshObj.GetActivePrimitive().GetParent3DObject().GetName() );
>>
>> Many thanks,
>> -Oleg
>>
>>
>>
>


Re: [C++][CustomOp]

2012-05-01 Thread Steven Caron
can't you use the OperatorContext and use either GetOutputTarget ? or maybe
use GetSource to get the operator itself and navigate up?

i haven't tried it in c++ but a simple runtime SCOP with this in the Update
callback works...

Application.LogMessage(In_UpdateContext.Operator.Parent3DObject)
# INFO : sphere

s

On Tue, May 1, 2012 at 11:33 AM, Oleg Bliznuk  wrote:

> Hi List,
> a simple question about custom op. I have a custom op which can has either
> 1 or 2 input geometries and connected to polymesh of created geo as output
> target ( see screenshot ).I need to get name of the global parent (
> X3DObject ) of the object on which this operator is applied ( "grid_FR" in
> my case ). The SDK says that I am unable to do it from the operator update
> callback, only from ExecuteCommand. So is there way to obtain this name
> without creating any additional properties\userdatas etc in the op update
> callback ? Something like this which works validly in executeCommand
> callback :
>
>  Application().LogMessage ( "GLOB NAME: " +
> mainMeshObj.GetActivePrimitive().GetParent3DObject().GetName() );
>
> Many thanks,
> -Oleg
>
>
>


[C++][CustomOp]

2012-05-01 Thread Oleg Bliznuk
Hi List,
a simple question about custom op. I have a custom op which can has either
1 or 2 input geometries and connected to polymesh of created geo as output
target ( see screenshot ).I need to get name of the global parent (
X3DObject ) of the object on which this operator is applied ( "grid_FR" in
my case ). The SDK says that I am unable to do it from the operator update
callback, only from ExecuteCommand. So is there way to obtain this name
without creating any additional properties\userdatas etc in the op update
callback ? Something like this which works validly in executeCommand
callback :

 Application().LogMessage ( "GLOB NAME: " +
mainMeshObj.GetActivePrimitive().GetParent3DObject().GetName() );

Many thanks,
-Oleg
<>