|
@@ -900,14 +900,19 @@ void tnsget_MaterialSlotname(tnsMaterialSlot* ms, char *result, char** here){
|
|
|
}
|
|
|
sprintf(result,"%d: %s",ms->Index,transLate("<Default Material>"));
|
|
|
}
|
|
|
-tnsMaterialSlot* tnsget_FirstMaterialSlot(tnsMeshObject* mo, void* unused){
|
|
|
- return mo->Materials.pFirst;
|
|
|
+tnsMaterialSlot* tnsget_FirstMaterialSlot(tnsObject* o, void* unused){
|
|
|
+ if(o->Type==TNS_OBJECT_MESH) return ((tnsMeshObject*)o)->Materials.pFirst;
|
|
|
+ if(o->Type==TNS_OBJECT_SHAPE) return ((tnsShapeObject*)o)->Materials.pFirst;
|
|
|
+ return 0;
|
|
|
}
|
|
|
-tnsMaterialSlot* tnsget_ActiveMaterialSlot(tnsMeshObject* mo){
|
|
|
- return mo->CurrentMaterial;
|
|
|
+tnsMaterialSlot* tnsget_ActiveMaterialSlot(tnsObject* o){
|
|
|
+ if(o->Type==TNS_OBJECT_MESH) return ((tnsMeshObject*)o)->CurrentMaterial;
|
|
|
+ if(o->Type==TNS_OBJECT_SHAPE) return ((tnsShapeObject*)o)->CurrentMaterial;
|
|
|
+ return 0;
|
|
|
}
|
|
|
-void tnsset_ActiveMaterialSlot(tnsMeshObject* mo, tnsMaterialSlot* ms){
|
|
|
- memAssignRef(mo,&mo->CurrentMaterial,ms);
|
|
|
+void tnsset_ActiveMaterialSlot(tnsObject* o, tnsMaterialSlot* ms){
|
|
|
+ if(o->Type==TNS_OBJECT_MESH) return memAssignRef(o,&((tnsMeshObject*)o)->CurrentMaterial,ms);
|
|
|
+ if(o->Type==TNS_OBJECT_SHAPE) return memAssignRef(o,&((tnsShapeObject*)o)->CurrentMaterial,ms);
|
|
|
}
|
|
|
tnsMaterial* tnsget_FirstMaterial(void* unused1, void* unused2){
|
|
|
return T->World->Materials.pFirst;
|
|
@@ -923,6 +928,7 @@ laPropContainer* tnsget_ObjectType(tnsObject* o){
|
|
|
case TNS_OBJECT_MESH: return TNS_PC_OBJECT_MESH;
|
|
|
case TNS_OBJECT_LIGHT: return TNS_PC_OBJECT_LIGHT;
|
|
|
case TNS_OBJECT_ROOT: return TNS_PC_OBJECT_ROOT;
|
|
|
+ case TNS_OBJECT_SHAPE: return TNS_PC_OBJECT_SHAPE;
|
|
|
default: return TNS_PC_OBJECT_GENERIC;
|
|
|
}
|
|
|
}
|
|
@@ -957,6 +963,7 @@ laPropContainer* TNS_PC_OBJECT_INSTANCER;
|
|
|
laPropContainer* TNS_PC_OBJECT_CAMERA;
|
|
|
laPropContainer* TNS_PC_OBJECT_LIGHT;
|
|
|
laPropContainer* TNS_PC_OBJECT_MESH;
|
|
|
+laPropContainer* TNS_PC_OBJECT_SHAPE;
|
|
|
laPropContainer* TNS_PC_OBJECT_ROOT;
|
|
|
laPropContainer* TNS_PC_MATERIAL;
|
|
|
laPropContainer* TNS_PC_MATERIAL_SLOT;
|
|
@@ -1234,7 +1241,23 @@ void la_RegisterTNSProps(){
|
|
|
laAddEnumItem(ep, "orthographic", "Orthographic", "Camera in orthographic view", 0);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ p = laAddPropertyContainer("tns_shape_object", "Shape Object", "Shape object", 0,tnsui_MeshObjectProperties,sizeof(tnsShapeObject), tnspost_Object, 0,2);{
|
|
|
+ laPropContainerExtraFunctions(p,0,0,tnstouched_Object,0/*tnspropagate_Object*/,0);
|
|
|
+ TNS_PC_OBJECT_SHAPE=p;
|
|
|
+ laAddStringProperty(p, "name", "Object Name", "The Name Of The Object", 0,0,0,0,1, offsetof(tnsObject, Name), 0,0,0,0,LA_AS_IDENTIFIER);
|
|
|
+ laAddSubGroup(p, "base", "Base", "Object base", "tns_object",0,0,0,0,0,0,0,0,0,0,0,LA_UDF_LOCAL);
|
|
|
+ ep = laAddEnumProperty(p, "mode", "Mode", "Shape object mode", 0,0,0,0,0,offsetof(tnsShapeObject, Mode), 0,0,0,0,0,0,0,0,0,0);{
|
|
|
+ laAddEnumItemAs(ep, "OBJECT", "Object", "Object mode", TNS_MESH_OBJECT_MODE, 0);
|
|
|
+ laAddEnumItemAs(ep, "EDIT", "Edit", "Edit mode", TNS_MESH_EDIT_MODE, 0);
|
|
|
+ }
|
|
|
+ laAddSubGroup(p, "shapes", "Shapes", "Shapes inside of the object", "tns_shape",0,0,0,-1,0,0,0,0,0,0,offsetof(tnsShapeObject, Shapes), 0);
|
|
|
+ laAddSubGroup(p, "current_material", "Current Material", "Current material slot in this object", "tns_material_slot",0,0,0,offsetof(tnsShapeObject, CurrentMaterial),tnsget_FirstMaterialSlot,0,laget_ListNext,0,0,0,0,LA_UDF_REFER);
|
|
|
+ laAddSubGroup(p, "materials", "Materials", "Material slots in this mesh object", "tns_material_slot",0,0,0,-1,0,tnsget_ActiveMaterialSlot,0,tnsset_ActiveMaterialSlot,0,0,offsetof(tnsShapeObject, Materials),0);
|
|
|
+ laAddOperatorProperty(p,"add_material_slot","Add Material Slot","Add a material slot into this object","M_new_material_slot",L'+',0);
|
|
|
+ laAddOperatorProperty(p,"add_material","Add Material","Add a new material to this material slot","M_new_material",'+',0);
|
|
|
+ //laAddOperatorProperty(p,"assign_material_slot","Assign Material Slot","Assign faces to a current slot","M_assign_material_slot",L'🖌',0);
|
|
|
+ }
|
|
|
+
|
|
|
p = laAddPropertyContainer("tns_mvert", "MVert", "MMesh vert", 0,0,sizeof(tnsMVert), 0,0,0);{
|
|
|
laAddFloatProperty(p, "p", "Position", "Position", 0,"X,Y,Z", 0,0,0,0,0,0,offsetof(tnsMVert, p),0,0,3,0,0,0,0,0,0,0,0);
|
|
|
laAddFloatProperty(p, "n", "Normal", "Normal", 0,"X,Y,Z", 0,0,0,0,0,0,offsetof(tnsMVert, n),0,0,3,0,0,0,0,0,0,0,0);
|
|
@@ -1255,6 +1278,7 @@ void la_RegisterTNSProps(){
|
|
|
laAddIntProperty(p,"flags","Flags","Flags",0,0,0,0,0,0,0,0,offsetof(tnsMFace, flags),0,0,0,0,0,0,0,0,0,0,0);
|
|
|
laAddSubGroup(p, "l", "Loop", "Loop", "tns_loop",0,0,0,-1,0,0,0,0,0,0,offsetof(tnsMFace, l),0);
|
|
|
laAddIntProperty(p,"looplen","Loop Length","Loop length",0,0,0,0,0,0,0,0,offsetof(tnsMFace, looplen),0,0,0,0,0,0,0,0,0,0,LA_READ_ONLY)->ElementBytes=2;
|
|
|
+ laAddIntProperty(p,"mat","Material","Material of this face",0,0,0,0,0,0,0,0,offsetof(tnsMFace, mat),0,0,0,0,0,0,0,0,0,0,LA_READ_ONLY)->ElementBytes=2;
|
|
|
laAddFloatProperty(p, "n", "Normal", "Normal", 0,"X,Y,Z", 0,0,0,0,0,0,offsetof(tnsMFace, n),0,0,3,0,0,0,0,0,0,0,0);
|
|
|
//laAddFloatProperty(p, "gn", "Global Normal", "Global normal", 0,"X,Y,Z", 0,0,0,0,0,0,offsetof(tnsMFace, gn),0,0,3,0,0,0,0,0,0,0,0);
|
|
|
laAddFloatProperty(p, "c", "Center", "Center", 0,"X,Y,Z", 0,0,0,0,0,0,offsetof(tnsMFace, c),0,0,3,0,0,0,0,0,0,0,0);
|
|
@@ -1265,6 +1289,18 @@ void la_RegisterTNSProps(){
|
|
|
p = laAddPropertyContainer("tns_loop", "MFace Loop", "MFace Loop", 0,0,sizeof(laListItemPointer), 0,0,0);{
|
|
|
laAddSubGroup(p, "e", "Edge", "Edge", "tns_medge",0,0,0,offsetof(laListItemPointer, p),0,0,0,0,0,0,0,LA_UDF_REFER);
|
|
|
}
|
|
|
+
|
|
|
+ p = laAddPropertyContainer("tns_shape", "Shape", "Shape data structure", 0,0,sizeof(tnsShape), 0,0,0);{
|
|
|
+ laAddIntProperty(p,"mat","Material","Material of this face",0,0,0,0,0,0,0,0,offsetof(tnsShape, mat),0,0,0,0,0,0,0,0,0,0,LA_READ_ONLY)->ElementBytes=2;
|
|
|
+ laAddIntProperty(p,"flags","Flags","Flags",0,0,0,0,0,0,0,0,offsetof(tnsShape, flags),0,0,0,0,0,0,0,0,0,0,0);
|
|
|
+ laAddSubGroup(p, "points", "Points", "Points in this shape", "tns_spoint",0,0,0,-1,0,0,0,0,0,0,offsetof(tnsShape, Points),0);
|
|
|
+ }
|
|
|
+ p = laAddPropertyContainer("tns_spoint", "SPoint", "Shape point", 0,0,sizeof(tnsSPoint), 0,0,0);{
|
|
|
+ laAddFloatProperty(p, "p", "Position", "Position", 0,"X,Y", 0,0,0,0,0,0,offsetof(tnsSPoint, p),0,0,2,0,0,0,0,0,0,0,0);
|
|
|
+ laAddFloatProperty(p, "dl", "Delta Left", "Delta of left control point", 0,"X,Y", 0,0,0,0,0,0,offsetof(tnsSPoint, dl),0,0,2,0,0,0,0,0,0,0,0);
|
|
|
+ laAddFloatProperty(p, "dr", "Delta Right", "Delta of right control point", 0,"X,Y", 0,0,0,0,0,0,offsetof(tnsSPoint, dr),0,0,2,0,0,0,0,0,0,0,0);
|
|
|
+ laAddIntProperty(p,"flags","Flags","Flags",0,0,0,0,0,0,0,0,offsetof(tnsSPoint, flags),0,0,0,0,0,0,0,0,0,0,0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void la_RegisterInternalProps(){
|