revert "only selectable"
Because the same effect can be done with an object or plane with fully transparent texture.
This commit is contained in:
parent
d873d91660
commit
69b379201c
|
@ -74,7 +74,6 @@ private:
|
||||||
bool customColor;
|
bool customColor;
|
||||||
bool noSelect;
|
bool noSelect;
|
||||||
bool glow;
|
bool glow;
|
||||||
bool onlySelect;
|
|
||||||
|
|
||||||
uint32 textureFlags;
|
uint32 textureFlags;
|
||||||
|
|
||||||
|
@ -137,7 +136,6 @@ public:
|
||||||
bool getCustomTexture() const {return customColor;}
|
bool getCustomTexture() const {return customColor;}
|
||||||
bool getNoSelect() const {return noSelect;}
|
bool getNoSelect() const {return noSelect;}
|
||||||
bool getGlow() const {return glow;}
|
bool getGlow() const {return glow;}
|
||||||
bool getOnlySelect() const {return onlySelect;}
|
|
||||||
string getName() const {return name;}
|
string getName() const {return name;}
|
||||||
|
|
||||||
uint32 getTextureFlags() const { return textureFlags; }
|
uint32 getTextureFlags() const { return textureFlags; }
|
||||||
|
|
|
@ -44,8 +44,7 @@ enum MeshPropertyFlag{
|
||||||
mpfCustomColor= 1,
|
mpfCustomColor= 1,
|
||||||
mpfTwoSided= 2,
|
mpfTwoSided= 2,
|
||||||
mpfNoSelect= 4,
|
mpfNoSelect= 4,
|
||||||
mpfGlow= 8,
|
mpfGlow= 8
|
||||||
mpfOnlySelect= 16
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MeshTexture{
|
enum MeshTexture{
|
||||||
|
|
|
@ -163,11 +163,7 @@ void ModelRendererGl::renderMesh(Mesh *mesh,int renderMode) {
|
||||||
{// don't render this and do nothing
|
{// don't render this and do nothing
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(renderMode!=rmSelection){
|
|
||||||
if(mesh->getOnlySelect()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//assertions
|
//assertions
|
||||||
assertGl();
|
assertGl();
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,6 @@ Mesh::Mesh() {
|
||||||
customColor= false;
|
customColor= false;
|
||||||
noSelect= false;
|
noSelect= false;
|
||||||
glow= false;
|
glow= false;
|
||||||
onlySelect=false;
|
|
||||||
|
|
||||||
textureFlags=0;
|
textureFlags=0;
|
||||||
|
|
||||||
|
@ -449,7 +448,6 @@ void Mesh::loadV2(int meshIndex, const string &dir, FILE *f, TextureManager *tex
|
||||||
customColor= false;
|
customColor= false;
|
||||||
noSelect= false;
|
noSelect= false;
|
||||||
glow= 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());
|
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;
|
customColor= (meshHeader.properties & mp3CustomColor) != 0;
|
||||||
noSelect = false;
|
noSelect = false;
|
||||||
glow = false;
|
glow = false;
|
||||||
onlySelect=false;
|
|
||||||
|
|
||||||
textureFlags= 0;
|
textureFlags= 0;
|
||||||
if((meshHeader.properties & mp3NoTexture) != mp3NoTexture) {
|
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;
|
twoSided= (meshHeader.properties & mpfTwoSided) != 0;
|
||||||
noSelect= (meshHeader.properties & mpfNoSelect) != 0;
|
noSelect= (meshHeader.properties & mpfNoSelect) != 0;
|
||||||
glow= (meshHeader.properties & mpfGlow) != 0;
|
glow= (meshHeader.properties & mpfGlow) != 0;
|
||||||
onlySelect= (meshHeader.properties & mpfOnlySelect) != 0;
|
|
||||||
|
|
||||||
//material
|
//material
|
||||||
diffuseColor= Vec3f(meshHeader.diffuseColor);
|
diffuseColor= Vec3f(meshHeader.diffuseColor);
|
||||||
|
@ -920,9 +916,6 @@ void Mesh::save(int meshIndex, const string &dir, FILE *f, TextureManager *textu
|
||||||
if(glow) {
|
if(glow) {
|
||||||
meshHeader.properties |= mpfGlow;
|
meshHeader.properties |= mpfGlow;
|
||||||
}
|
}
|
||||||
if(onlySelect){
|
|
||||||
meshHeader.properties|= mpfOnlySelect;
|
|
||||||
}
|
|
||||||
|
|
||||||
meshHeader.textures = textureFlags;
|
meshHeader.textures = textureFlags;
|
||||||
fwrite(&meshHeader, sizeof(MeshHeader), 1, f);
|
fwrite(&meshHeader, sizeof(MeshHeader), 1, f);
|
||||||
|
@ -1557,7 +1550,6 @@ void Mesh::copyInto(Mesh *dest, bool ignoreInterpolationData,
|
||||||
dest->customColor = this->customColor;
|
dest->customColor = this->customColor;
|
||||||
dest->noSelect = this->noSelect;
|
dest->noSelect = this->noSelect;
|
||||||
dest->glow = this->glow;
|
dest->glow = this->glow;
|
||||||
dest->onlySelect = this->onlySelect;
|
|
||||||
|
|
||||||
dest->textureFlags = this->textureFlags;
|
dest->textureFlags = this->textureFlags;
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,6 @@ class G3DMeshHeaderv4: # Read Meshheader
|
||||||
self.istwosided = bool(self.properties & 2)
|
self.istwosided = bool(self.properties & 2)
|
||||||
self.noselect = bool(self.properties & 4)
|
self.noselect = bool(self.properties & 4)
|
||||||
self.glow = bool(self.properties & 8)
|
self.glow = bool(self.properties & 8)
|
||||||
self.onlySelect = bool(self.properties & 16)
|
|
||||||
|
|
||||||
self.hastexture = False
|
self.hastexture = False
|
||||||
self.diffusetexture = None
|
self.diffusetexture = None
|
||||||
|
@ -437,11 +436,9 @@ def createMesh(filename, header, data, toblender, operator):
|
||||||
if header.isv4:
|
if header.isv4:
|
||||||
mesh.g3d_noSelect = header.noselect
|
mesh.g3d_noSelect = header.noselect
|
||||||
mesh.g3d_glow = header.glow
|
mesh.g3d_glow = header.glow
|
||||||
mesh.g3d_onlySelect = header.onlySelect
|
|
||||||
else:
|
else:
|
||||||
mesh.g3d_noSelect = False
|
mesh.g3d_noSelect = False
|
||||||
mesh.glow = False
|
mesh.glow = False
|
||||||
#mesh.g3d_onlySelect = False
|
|
||||||
|
|
||||||
# ===================================================================================================
|
# ===================================================================================================
|
||||||
# Material Setup
|
# Material Setup
|
||||||
|
@ -898,8 +895,6 @@ def G3DSaver(filepath, context, toglest, operator):
|
||||||
properties |= 4
|
properties |= 4
|
||||||
if mesh.g3d_glow:
|
if mesh.g3d_glow:
|
||||||
properties |= 8
|
properties |= 8
|
||||||
if mesh.g3d_onlySelect:
|
|
||||||
properties |= 16
|
|
||||||
|
|
||||||
#MeshData
|
#MeshData
|
||||||
vertices = []
|
vertices = []
|
||||||
|
@ -932,8 +927,6 @@ def G3DSaver(filepath, context, toglest, operator):
|
||||||
|
|
||||||
context.scene.frame_set(fcurrent)
|
context.scene.frame_set(fcurrent)
|
||||||
|
|
||||||
if mesh.g3d_onlySelect:
|
|
||||||
opacity = 1.0
|
|
||||||
|
|
||||||
# MeshHeader
|
# MeshHeader
|
||||||
fileID.write(
|
fileID.write(
|
||||||
|
@ -987,7 +980,6 @@ class G3DPanel(bpy.types.Panel):
|
||||||
"show_double_sided",
|
"show_double_sided",
|
||||||
text="double sided")
|
text="double sided")
|
||||||
self.layout.prop(context.object.data, "g3d_noSelect")
|
self.layout.prop(context.object.data, "g3d_noSelect")
|
||||||
self.layout.prop(context.object.data, "g3d_onlySelect")
|
|
||||||
self.layout.prop(context.object.data, "g3d_glow")
|
self.layout.prop(context.object.data, "g3d_glow")
|
||||||
|
|
||||||
|
|
||||||
|
@ -1094,9 +1086,6 @@ def register():
|
||||||
description="replace alpha channel of texture with team color")
|
description="replace alpha channel of texture with team color")
|
||||||
bpy.types.Mesh.g3d_noSelect = bpy.props.BoolProperty(
|
bpy.types.Mesh.g3d_noSelect = bpy.props.BoolProperty(
|
||||||
name="non-selectable", description="click on mesh doesn't select unit")
|
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(
|
bpy.types.Mesh.g3d_glow = bpy.props.BoolProperty(
|
||||||
name="glow", description="let objects glow like particles")
|
name="glow", description="let objects glow like particles")
|
||||||
bpy.types.Mesh.show_double_sided = bpy.props.BoolProperty(
|
bpy.types.Mesh.show_double_sided = bpy.props.BoolProperty(
|
||||||
|
|
Loading…
Reference in New Issue