fabric-engine/JSSceneGraph — Issue #120: modelViewer example in github fails 
Author: dimo3d
Created: 2012-01-19 09:37:37+00:00
State: open

Hi,

I am just exploring the fabric engine. I followed the installation instructions for windows and I am exploring the demos.
The model viewer demo crashes here with following error messages:
Can you confirm the error, or is my installation not right?

-Dieter

Error compiling operator: parseObj in FABRIC_ROOT/SceneGraph/KL/loadObj.kl
File:FABRIC_ROOT/SceneGraph/KL/loadObj.kl
20:3: error: calling function 'FabricOBJDecode': incorrect number of arguments: expected 3, actual 6
Boolean splitByMaterial,
io Data objParseHandle,

io String objectNames[],
io String materialNames[]
) {
>>>	FabricOBJDecode(resource.data.data(), resource.data.dataSize(), splitByObject, splitByGroup, splitByMaterial, objParseHandle);
resource.data.resize(0);//Note: this might not be safe if loadObj is called twice on the same data; maybe it should be an option?

Boolean hadErrors;
FabricOBJHadErrors( objParseHandle, hadErrors );
if( hadErrors )
{
34:5: error: function 'FabricOBJGetNbEntities(Data,Size)' not found
FabricOBJGetErrors( objParseHandle, errors );
for( Integer i = 0; i < errors.size; i++ )
report 'Error while parsing obj file ' + resource.url + ': ' + errors[i];
}
else{
Size nbEntities;
>>>	FabricOBJGetNbEntities(objParseHandle, nbEntities);
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
objectNames.push(groupName);
FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
materialNames.push(matName);
37:7: error: function 'FabricOBJGetEntityGroupName(Data,Size,String)' not found
}
else{
Size nbEntities;
FabricOBJGetNbEntities(objParseHandle, nbEntities);
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
>>>	FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
objectNames.push(groupName);
FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
materialNames.push(matName);
}
}

39:7: error: function 'FabricOBJGetEntityMaterialName(Data,Size,String)' not found
Size nbEntities;
FabricOBJGetNbEntities(objParseHandle, nbEntities);
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
objectNames.push(groupName);
>>>	FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
materialNames.push(matName);
}
}

if( printDetailedInfo ) {
Size nbEntities, nbPts, nbTris;
46:5: error: function 'FabricOBJGetNbEntityPoints(Data,Integer,Size)' not found
materialNames.push(matName);
}
}

if( printDetailedInfo ) {
Size nbEntities, nbPts, nbTris;
>>>	FabricOBJGetNbEntityPoints(objParseHandle, -1, nbPts);
FabricOBJGetNbEntityTriangles(objParseHandle, -1, nbTris);
FabricOBJGetNbEntities(objParseHandle, nbEntities);
report "OBJ " + resource.url + ": " + nbEntities + " entities: " + nbPts + " vertices, " + nbTris + "triangles";
String values[];
FabricOBJGetMaterialLibraries(objParseHandle, values);
report " Materials libraries: " + values;
47:5: error: function 'FabricOBJGetNbEntityTriangles(Data,Integer,Size)' not found
}
}

if( printDetailedInfo ) {
Size nbEntities, nbPts, nbTris;
FabricOBJGetNbEntityPoints(objParseHandle, -1, nbPts);
>>>	FabricOBJGetNbEntityTriangles(objParseHandle, -1, nbTris);
FabricOBJGetNbEntities(objParseHandle, nbEntities);
report "OBJ " + resource.url + ": " + nbEntities + " entities: " + nbPts + " vertices, " + nbTris + "triangles";
String values[];
FabricOBJGetMaterialLibraries(objParseHandle, values);
report " Materials libraries: " + values;
FabricOBJGetMaterialNames(objParseHandle, values);
48:5: error: function 'FabricOBJGetNbEntities(Data,Size)' not found
}

if( printDetailedInfo ) {
Size nbEntities, nbPts, nbTris;
FabricOBJGetNbEntityPoints(objParseHandle, -1, nbPts);
FabricOBJGetNbEntityTriangles(objParseHandle, -1, nbTris);
>>>	FabricOBJGetNbEntities(objParseHandle, nbEntities);
report "OBJ " + resource.url + ": " + nbEntities + " entities: " + nbPts + " vertices, " + nbTris + "triangles";
String values[];
FabricOBJGetMaterialLibraries(objParseHandle, values);
report " Materials libraries: " + values;
FabricOBJGetMaterialNames(objParseHandle, values);
report " Materials: " + values;
51:5: error: function 'FabricOBJGetMaterialLibraries(Data,String[])' not found
Size nbEntities, nbPts, nbTris;
FabricOBJGetNbEntityPoints(objParseHandle, -1, nbPts);
FabricOBJGetNbEntityTriangles(objParseHandle, -1, nbTris);
FabricOBJGetNbEntities(objParseHandle, nbEntities);
report "OBJ " + resource.url + ": " + nbEntities + " entities: " + nbPts + " vertices, " + nbTris + "triangles";
String values[];
>>>	FabricOBJGetMaterialLibraries(objParseHandle, values);
report " Materials libraries: " + values;
FabricOBJGetMaterialNames(objParseHandle, values);
report " Materials: " + values;
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityObjectName(objParseHandle, i, objName);
53:5: error: function 'FabricOBJGetMaterialNames(Data,String[])' not found
FabricOBJGetNbEntityTriangles(objParseHandle, -1, nbTris);
FabricOBJGetNbEntities(objParseHandle, nbEntities);
report "OBJ " + resource.url + ": " + nbEntities + " entities: " + nbPts + " vertices, " + nbTris + "triangles";
String values[];
FabricOBJGetMaterialLibraries(objParseHandle, values);
report " Materials libraries: " + values;
>>>	FabricOBJGetMaterialNames(objParseHandle, values);
report " Materials: " + values;
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityObjectName(objParseHandle, i, objName);
FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
57:7: error: function 'FabricOBJGetEntityObjectName(Data,Size,String)' not found
FabricOBJGetMaterialLibraries(objParseHandle, values);
report " Materials libraries: " + values;
FabricOBJGetMaterialNames(objParseHandle, values);
report " Materials: " + values;
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
>>>	FabricOBJGetEntityObjectName(objParseHandle, i, objName);
FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
FabricOBJGetNbEntityPoints(objParseHandle, i, nbPts);
FabricOBJGetNbEntityTriangles(objParseHandle, i, nbTris);
report " Entity #" + i + ": objName: " + (objName != "" ? objName : "(none)") + ", groupName: " + (groupName != "" ? groupName : "(none)") + ", matName: " + (matName != "" ? matName : "(none)") + ", " + nbPts + " vertices, " + nbTris + " triangles";
}
58:7: error: function 'FabricOBJGetEntityGroupName(Data,Size,String)' not found
report " Materials libraries: " + values;
FabricOBJGetMaterialNames(objParseHandle, values);
report " Materials: " + values;
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityObjectName(objParseHandle, i, objName);
>>>	FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
FabricOBJGetNbEntityPoints(objParseHandle, i, nbPts);
FabricOBJGetNbEntityTriangles(objParseHandle, i, nbTris);
report " Entity #" + i + ": objName: " + (objName != "" ? objName : "(none)") + ", groupName: " + (groupName != "" ? groupName : "(none)") + ", matName: " + (matName != "" ? matName : "(none)") + ", " + nbPts + " vertices, " + nbTris + " triangles";
}
}
59:7: error: function 'FabricOBJGetEntityMaterialName(Data,Size,String)' not found
FabricOBJGetMaterialNames(objParseHandle, values);
report " Materials: " + values;
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityObjectName(objParseHandle, i, objName);
FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
>>>	FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
FabricOBJGetNbEntityPoints(objParseHandle, i, nbPts);
FabricOBJGetNbEntityTriangles(objParseHandle, i, nbTris);
report " Entity #" + i + ": objName: " + (objName != "" ? objName : "(none)") + ", groupName: " + (groupName != "" ? groupName : "(none)") + ", matName: " + (matName != "" ? matName : "(none)") + ", " + nbPts + " vertices, " + nbTris + " triangles";
}
}
}
60:7: error: function 'FabricOBJGetNbEntityPoints(Data,Size,Size)' not found
report " Materials: " + values;
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityObjectName(objParseHandle, i, objName);
FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
>>>	FabricOBJGetNbEntityPoints(objParseHandle, i, nbPts);
FabricOBJGetNbEntityTriangles(objParseHandle, i, nbTris);
report " Entity #" + i + ": objName: " + (objName != "" ? objName : "(none)") + ", groupName: " + (groupName != "" ? groupName : "(none)") + ", matName: " + (matName != "" ? matName : "(none)") + ", " + nbPts + " vertices, " + nbTris + " triangles";
}
}
}
operator parseObj(
61:7: error: function 'FabricOBJGetNbEntityTriangles(Data,Size,Size)' not found
for( Size i = 0; i < nbEntities; ++i ) {
String objName, groupName, matName;
FabricOBJGetEntityObjectName(objParseHandle, i, objName);
FabricOBJGetEntityGroupName(objParseHandle, i, groupName);
FabricOBJGetEntityMaterialName(objParseHandle, i, matName);
FabricOBJGetNbEntityPoints(objParseHandle, i, nbPts);
>>>	FabricOBJGetNbEntityTriangles(objParseHandle, i, nbTris);
report " Entity #" + i + ": objName: " + (objName != "" ? objName : "(none)") + ", groupName: " + (groupName != "" ? groupName : "(none)") + ", matName: " + (matName != "" ? matName : "(none)") + ", " + nbPts + " vertices, " + nbTris + " triangles";
}
}
}
operator parseObj(
io FabricResource resource,
91:3: error: function 'FabricOBJGetNbEntityPoints(Data,Integer,Size)' not found
operator setVertexCount(
io Data objParseHandle,
io Integer entityIndex,
io Boolean reload,
io Size newCount
) {
>>>	FabricOBJGetNbEntityPoints(objParseHandle, entityIndex, newCount);
}

operator setObjGeom(
io Data objParseHandle,
io Integer entityIndex,
io Integer indices[],
103:3: error: function 'FabricOBJGetEntityTriangleIndices(Data,Integer,Integer[])' not found
io Integer indices[],
io Vec3 positions<>,
io Vec3 normals<>,
io Vec2 uvs<>,
io Boolean reload
) {
>>>	FabricOBJGetEntityTriangleIndices( objParseHandle, entityIndex, indices );
FabricOBJGetEntityPointsSliced( objParseHandle, entityIndex, positions );
FabricOBJGetEntityNormalsSliced( objParseHandle, entityIndex, normals );

Boolean hasTexture = false;
FabricOBJHasTextureCoords( objParseHandle, hasTexture );
if( hasTexture )
(3 more diagnostic(s) omitted)
scene.constructOperator.configureOperatorFABRIC.SceneGraph.js:406
scene.constructOperator.filenameFABRIC.SceneGraph.js:419
xhreq.onreadystatechange