The wiki is correct in that "Custom" topology operators are not fully
supported. It's long been a gripe amongst users wishing to do significant
development with the SDK.
PolygonNode data lives in ClusterProperties which are separate from the
geometry. Any time you create vertex colors, Texture UV coordinates, or
User Normals, Softimage creates a "Sample" cluster ('sample' being the
generic term for polygon nodes that spans all geometry types) and populates
it with a ClusterProperty of the required data type. The Texture UVW
property has a few extra bells and whistles in terms of support, but all
three types can be created an modified by custom tools. When creating the
sample cluster, make sure to set it as 'always complete' (see SDK docs)
which means Softimage will manage the resizing of the data in the properties
when topology changes. For the most part this should be automatic, but
doesn't hurt to check your code carefully to make sure it's enforced.
Since you're defining a custom topology operator, be aware you can be
setting yourself up for a crash if too much activity occurs on the geometry.
It's a limitation you'll have to live with. Generally speaking, your custom
topology operator should mainly manage addition/removal of geometry and let
Softimage handle the details on resizing the Sample Cluster and
ClusterProperties. After Softimage has finished it's task, you can jump in
and further massage the ClusterProperty data if needed. If you try to force
the issue, you'll likely induce corruption or crash.
As for setting the color values, all you need to do is connect your operator
to the ClusterProperty containing the desired values and use the regular
methods to read/write to the property. Traverse the geometry to determine
which indices you need to access in the ClusterProperty as they'll be
matched. If you're using scripting, the most convenient way to do it is
with a GridData object (eg: GridData.Data =
oClusterProperty.Elements.Array). If you're using C++, then you'll likely
use arrays. You need dedicated ports to read and write to the
ClusterProperty. Although a single read-write port can be used to modify
data, I've had better success (less crashing) using separate input and
output ports. Reading and writing to a ClusterProperty can be really
expensive as you must always read and write the entire data set to make
updates, so make sure you minimize the number of Gets and Sets.
Matt
Date: Sat, 5 Nov 2016 09:01:13 +0300
From: Andrew Prostrelov <[email protected]>
Subject: Re: Preserve UV methods after PolygonMesh.Set()
To: [email protected]
I guess PolygonMesh.Set() works as it should. Have no problem with that.
The friend of mine suggest me to attach a UV_Cluster to CustomOperator Port
to prevent it from changes.
When we use "AddEdge Op" or "SplitEdge Op" they also have uv_cluster
attached at one of input ports.
But we never would know the inner magic that they apply to this cluster
thet keep PolygonNodes untouched and new geometry added at the same time.
I dig through XSI Wiki and that's what i found in Operators Documentation:
http://softimage.wiki.softimage.com/index.php?title=Custom_Operators_(XSISDK)#Parameter_Connections
" ... XSI currently does not fully support custom topology operators. The
problem is that any cluster or cluster property will not properly
update when a topology operator adds or removes points that belong to the
cluster. In the worst case XSI may crash. Hence custom topology
operators should only be used in the more limited scenario of objects that
do not have any clusters. Once the geometry is ready it would be
possible to freeze the object to remove the custom topology operators (but
leave the result of their evaluation),
then to add the clusters and other operators. "
I hope this is out of date information or some not a usual case.
As for the PolygonNodes, i think i should rephrase it like "is there a way
or method to SET PolygonNode values ?" or they calculated somehow
automatically.
I mean when we use PolygonMesh.Set() we do not operate with PolygonNode
objects as it is. We operate with 2 arrays.
Array of polygons descriptions that consist of vertex indices and array of
this vertices coordinates.
No Nodes here.
And i also didn't find any methods that give me opportunity to change
PolygonNode by my self. To .Set() them, not to .Get() them.
Maybe PolygonNodes doesn't supposed to be changed by user himself and i
should stick with other processing method.
Maybe i should leave PolygonNodes changed after PolygonMesh.Set() and try
to update uv_cluster values according new PolygonNodes values
(but i guess it would be a hell of work).
------
Softimage Mailing List.
To unsubscribe, send a mail to [email protected] with
"unsubscribe" in the subject, and reply to confirm.