When you get a reference to the geometry object, you're getting a snapshot
at a specific moment in time independent of the source object. If you make
modifications to the geometry after you obtain your reference, results may
be invalid. Therefore, make sure you get the Geometry after you apply the
last extrusion. Alternately, try the CGeometryAccessor class. While
intended for use in exporters, it may be of use in your case.
You may want to pass the construction history mode as an argument to
GetGeometry(). This ensures you're getting the correct snapshot of the
geometry. Also doesn't hurt to specify the frame on the timeline which to
get that snapshot. Not required, but the more inputs you define, the more
narrow the expected results should be making troubleshooting a little
quicker and easier.
For comparison, try the following JScript code to see if you get the same
behavior:
var oObject = Selection(0);
var oGeometry = oObject.ActivePrimitive.Geometry;
var oPolygons = oGeometry.Polygons;
LogMessage( "Polygons[" + oPolygons.Count + "]: " + (
oPolygons.IndexArray ).toArray(), siComment );
If the script code works but C++ fails, then consider using COM/OLE in C++
to dig into the same methods as used by the scripting engine. Remember, the
pure C++ API you are currently using was not part of the original XSI design
spec. It was bolted on later. There are areas where the implementation is
incomplete and/or different than what you experience going through the
scripting engine. The COM/OLE interface is the original C++ interface of
XSI, but when XSI 1.0 was released, there was a lot of complaints from
customers that it was not compatible with Linux and other operating systems.
So Softimage put effort into developing a pure C++ API and pretty much
played catch-up the rest of the product's history. COM/OLE is more of a
burden to code with, but will give you the exact same results as returned
through the scripting engine - because it is the scripting engine.
One area you are forced to use COM/OLE is dealing with SubComponents as the
pure C++ API doesn't implement the SubComponent class. So start there for
your tutorial. I believe the C++ reference has such a tutorial in the
beginning of the SDK docs.
Matt
Date: Thu, 21 Sep 2017 21:34:50 +0300
From: Andrew Prostrelov <[email protected]>
Subject: Re: Clusters
To: "Official Softimage Users Mailing List.
Clusters again i guess.
I have an object. It have 2 edge Clusters and a some Operators applied.
When i try to get all object polygons like so:
PolygonMesh curMesh(save_obj.GetActivePrimitive().GetGeometry());
CPolygonFaceRefArray all_polys = curMesh.GetPolygons();
I don't have all of them. I don't have last extruded polygons.
But if i delete edge clusters. The same code above bring back all polygons
of this object.
Is there any workaround about this problem other than freez it all ?
------
Softimage Mailing List.
To unsubscribe, send a mail to [email protected] with
"unsubscribe" in the subject, and reply to confirm.