Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / AddPolygonMesh with C# scripting
  RSS 2.0 ATOM  

AddPolygonMesh with C# scripting
Rate this thread
 
30144
 
Permlink of this thread  
avatar
  • Total Posts: 2
  • Joined: 08 October 2008 04:59 AM

Hello,

Does someone know how to use the X3DObject.AddPolygonMesh() method when scripting with C#?
The following code does not work: 
double[] vertices = new double[] {
0.0, 0.0, 0.0,
0.0, 0.0, 1.0,
1.0, 0.0, 1.0,
1.0, 0.0, 0.0};
int[] polygons = new int[] { // long does not work either
4, 0, 1, 2, 3};
X3DObject newMesh = root.AddPolygonMesh(
vertices, polygons, “newmesh");
Thank you in advance…



Replies: 0
avatar

It works when replacing doubles and ints by objects:
object[] vertices = new object[] {
0.0, 0.0, 0.0,
0.0, 0.0, 1.0,
1.0, 0.0, 1.0,
1.0, 0.0, 0.0};
object[] polygons = new object[] {
4, 0, 1, 2, 3};
root.AddPolygonMesh(
vertices,
polygons,
“newMesh");



Replies: 0
avatar
  • Steve_C
  • Posted: 19 October 2008 12:31 AM

I am tring to get the c# scripting to work.
:/



Replies: 0
avatar
  • mabxsi
  • Posted: 27 December 2008 01:12 AM

Hi,

the C# support is based on the OM layer so native array types won’t work, you have to use arrays of type object which are equivalent to safearrays in the OM.

-mab



Replies: 0