From 69b379201c79a04c27f489906814efae8e8f0092 Mon Sep 17 00:00:00 2001 From: titiger Date: Sat, 10 Apr 2021 22:43:28 +0200 Subject: [PATCH] revert "only selectable" Because the same effect can be done with an object or plane with fully transparent texture. --- source/shared_lib/include/graphics/model.h | 2 -- source/shared_lib/include/graphics/model_header.h | 3 +-- .../sources/graphics/gl/model_renderer_gl.cpp | 6 +----- source/shared_lib/sources/graphics/model.cpp | 8 -------- source/tools/glexemel/g3d_support_b290.py | 11 ----------- 5 files changed, 2 insertions(+), 28 deletions(-) diff --git a/source/shared_lib/include/graphics/model.h b/source/shared_lib/include/graphics/model.h index e81cc1d3..eee2ff3a 100644 --- a/source/shared_lib/include/graphics/model.h +++ b/source/shared_lib/include/graphics/model.h @@ -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; } diff --git a/source/shared_lib/include/graphics/model_header.h b/source/shared_lib/include/graphics/model_header.h index 6eea67ee..efe277a1 100644 --- a/source/shared_lib/include/graphics/model_header.h +++ b/source/shared_lib/include/graphics/model_header.h @@ -44,8 +44,7 @@ enum MeshPropertyFlag{ mpfCustomColor= 1, mpfTwoSided= 2, mpfNoSelect= 4, - mpfGlow= 8, - mpfOnlySelect= 16 + mpfGlow= 8 }; enum MeshTexture{ diff --git a/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp b/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp index 1ac32811..32fda77d 100644 --- a/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp @@ -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(); diff --git a/source/shared_lib/sources/graphics/model.cpp b/source/shared_lib/sources/graphics/model.cpp index 4c389ad2..ddfe68f5 100644 --- a/source/shared_lib/sources/graphics/model.cpp +++ b/source/shared_lib/sources/graphics/model.cpp @@ -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(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; diff --git a/source/tools/glexemel/g3d_support_b290.py b/source/tools/glexemel/g3d_support_b290.py index 11cf48be..487aa69e 100644 --- a/source/tools/glexemel/g3d_support_b290.py +++ b/source/tools/glexemel/g3d_support_b290.py @@ -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(