revert "only selectable"

Because the same effect can be done with an object or plane with fully
transparent texture.
This commit is contained in:
titiger 2021-04-10 22:43:28 +02:00
parent d873d91660
commit 69b379201c
5 changed files with 2 additions and 28 deletions

View File

@ -74,7 +74,6 @@ private:
bool customColor;
bool noSelect;
bool glow;
bool onlySelect;
uint32 textureFlags;
@ -137,7 +136,6 @@ public:
bool getCustomTexture() const {return customColor;}
bool getNoSelect() const {return noSelect;}
bool getGlow() const {return glow;}
bool getOnlySelect() const {return onlySelect;}
string getName() const {return name;}
uint32 getTextureFlags() const { return textureFlags; }

View File

@ -44,8 +44,7 @@ enum MeshPropertyFlag{
mpfCustomColor= 1,
mpfTwoSided= 2,
mpfNoSelect= 4,
mpfGlow= 8,
mpfOnlySelect= 16
mpfGlow= 8
};
enum MeshTexture{

View File

@ -163,11 +163,7 @@ void ModelRendererGl::renderMesh(Mesh *mesh,int renderMode) {
{// don't render this and do nothing
return;
}
if(renderMode!=rmSelection){
if(mesh->getOnlySelect()) {
return;
}
}
//assertions
assertGl();

View File

@ -226,7 +226,6 @@ Mesh::Mesh() {
customColor= false;
noSelect= false;
glow= false;
onlySelect=false;
textureFlags=0;
@ -449,7 +448,6 @@ void Mesh::loadV2(int meshIndex, const string &dir, FILE *f, TextureManager *tex
customColor= false;
noSelect= false;
glow= false;
onlySelect= false;
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Load v2, this = %p Found meshHeader.hasTexture = %d, texName [%s] mtDiffuse = %d meshIndex = %d modelFile [%s]\n",this,meshHeader.hasTexture,toLower(reinterpret_cast<char*>(meshHeader.texName)).c_str(),mtDiffuse,meshIndex,modelFile.c_str());
@ -591,7 +589,6 @@ void Mesh::loadV3(int meshIndex, const string &dir, FILE *f,
customColor= (meshHeader.properties & mp3CustomColor) != 0;
noSelect = false;
glow = false;
onlySelect=false;
textureFlags= 0;
if((meshHeader.properties & mp3NoTexture) != mp3NoTexture) {
@ -788,7 +785,6 @@ void Mesh::load(int meshIndex, const string &dir, FILE *f, TextureManager *textu
twoSided= (meshHeader.properties & mpfTwoSided) != 0;
noSelect= (meshHeader.properties & mpfNoSelect) != 0;
glow= (meshHeader.properties & mpfGlow) != 0;
onlySelect= (meshHeader.properties & mpfOnlySelect) != 0;
//material
diffuseColor= Vec3f(meshHeader.diffuseColor);
@ -920,9 +916,6 @@ void Mesh::save(int meshIndex, const string &dir, FILE *f, TextureManager *textu
if(glow) {
meshHeader.properties |= mpfGlow;
}
if(onlySelect){
meshHeader.properties|= mpfOnlySelect;
}
meshHeader.textures = textureFlags;
fwrite(&meshHeader, sizeof(MeshHeader), 1, f);
@ -1557,7 +1550,6 @@ void Mesh::copyInto(Mesh *dest, bool ignoreInterpolationData,
dest->customColor = this->customColor;
dest->noSelect = this->noSelect;
dest->glow = this->glow;
dest->onlySelect = this->onlySelect;
dest->textureFlags = this->textureFlags;

View File

@ -255,7 +255,6 @@ class G3DMeshHeaderv4: # Read Meshheader
self.istwosided = bool(self.properties & 2)
self.noselect = bool(self.properties & 4)
self.glow = bool(self.properties & 8)
self.onlySelect = bool(self.properties & 16)
self.hastexture = False
self.diffusetexture = None
@ -437,11 +436,9 @@ def createMesh(filename, header, data, toblender, operator):
if header.isv4:
mesh.g3d_noSelect = header.noselect
mesh.g3d_glow = header.glow
mesh.g3d_onlySelect = header.onlySelect
else:
mesh.g3d_noSelect = False
mesh.glow = False
#mesh.g3d_onlySelect = False
# ===================================================================================================
# Material Setup
@ -898,8 +895,6 @@ def G3DSaver(filepath, context, toglest, operator):
properties |= 4
if mesh.g3d_glow:
properties |= 8
if mesh.g3d_onlySelect:
properties |= 16
#MeshData
vertices = []
@ -932,8 +927,6 @@ def G3DSaver(filepath, context, toglest, operator):
context.scene.frame_set(fcurrent)
if mesh.g3d_onlySelect:
opacity = 1.0
# MeshHeader
fileID.write(
@ -987,7 +980,6 @@ class G3DPanel(bpy.types.Panel):
"show_double_sided",
text="double sided")
self.layout.prop(context.object.data, "g3d_noSelect")
self.layout.prop(context.object.data, "g3d_onlySelect")
self.layout.prop(context.object.data, "g3d_glow")
@ -1094,9 +1086,6 @@ def register():
description="replace alpha channel of texture with team color")
bpy.types.Mesh.g3d_noSelect = bpy.props.BoolProperty(
name="non-selectable", description="click on mesh doesn't select unit")
bpy.types.Mesh.g3d_onlySelect = bpy.props.BoolProperty(
name="only-selectable",
description="this mesh is not visible, only selectable")
bpy.types.Mesh.g3d_glow = bpy.props.BoolProperty(
name="glow", description="let objects glow like particles")
bpy.types.Mesh.show_double_sided = bpy.props.BoolProperty(