|
@@ -1928,8 +1928,9 @@ int OPINV_RemoveRootObject(laOperator *a, laEvent *e){
|
|
}
|
|
}
|
|
|
|
|
|
int OPINV_NewMaterial(laOperator *a, laEvent *e){
|
|
int OPINV_NewMaterial(laOperator *a, laEvent *e){
|
|
- tnsMaterial* mat=tnsCreateMaterial("Material"); laNotifyUsers("tns.world.materials");
|
|
|
|
- if(!a->This && a->This->EndInstance) return;
|
|
|
|
|
|
+ tnsMaterial* mat=tnsCreateMaterial("Material"); laRecordDifferences(0,"tns.world.materials");
|
|
|
|
+ laDetachedTrySet("material",mat); laNotifyUsers("tns.world.materials");
|
|
|
|
+ if(!a->This || !a->This->EndInstance){ laPushDifferences("New material",0); return; }
|
|
laPropContainer* pc=la_EnsureSubTarget(a->This->LastPs->p,a->This->EndInstance);
|
|
laPropContainer* pc=la_EnsureSubTarget(a->This->LastPs->p,a->This->EndInstance);
|
|
if(pc==TNS_PC_OBJECT_MESH){
|
|
if(pc==TNS_PC_OBJECT_MESH){
|
|
tnsMeshObject* mo=a->This->EndInstance; if(mo->CurrentMaterial){
|
|
tnsMeshObject* mo=a->This->EndInstance; if(mo->CurrentMaterial){
|
|
@@ -1944,8 +1945,7 @@ int OPINV_NewMaterial(laOperator *a, laEvent *e){
|
|
laRecordInstanceDifferences(so,"tns_shape_object"); laNotifyInstanceUsers(so);
|
|
laRecordInstanceDifferences(so,"tns_shape_object"); laNotifyInstanceUsers(so);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- laDetachedTrySet("material",mat);
|
|
|
|
- laRecordDifferences(0,"tns.world.materials"); laPushDifferences("New material",0);
|
|
|
|
|
|
+ laPushDifferences("New material",0);
|
|
return LA_FINISHED;
|
|
return LA_FINISHED;
|
|
}
|
|
}
|
|
int OPCHK_RemoveMaterial(laPropPack *This, laStringSplitor *ss){
|
|
int OPCHK_RemoveMaterial(laPropPack *This, laStringSplitor *ss){
|