Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guetzkow <rjg>2020-11-06 13:47:35 +0300
committerRobert Guetzkow <gitcommit@outlook.de>2020-11-06 13:52:09 +0300
commit69751991311a165e97a48ea67ed60e2c6022ee63 (patch)
tree43542749114b17c7b2f642ef8b59c82cc18af2e9
parent40e0792c3cae2cb95eef8d08d23364ca2e091eca (diff)
Fix T82405: Check if active object's data is None
Check if the active object's data is `None` before attempting to call functions on it. It is `None` if the object is an empty. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D9456
-rw-r--r--add_mesh_BoltFactory/Boltfactory.py3
-rw-r--r--add_mesh_extra_objects/Wallfactory.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_beam_builder.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_gears.py6
-rw-r--r--add_mesh_extra_objects/add_mesh_gemstones.py6
-rw-r--r--add_mesh_extra_objects/add_mesh_honeycomb.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_pipe_joint.py15
-rw-r--r--add_mesh_extra_objects/add_mesh_pyramid.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_round_brilliant.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_round_cube.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_star.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_supertoroid.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_torusknot.py3
-rw-r--r--add_mesh_extra_objects/add_mesh_twisted_torus.py3
-rw-r--r--add_mesh_geodesic_domes/third_domes_panel_271.py3
15 files changed, 42 insertions, 21 deletions
diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py
index 244d9720..330df8ae 100644
--- a/add_mesh_BoltFactory/Boltfactory.py
+++ b/add_mesh_BoltFactory/Boltfactory.py
@@ -428,7 +428,8 @@ class add_mesh_bolt(Operator, AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Bolt' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Bolt' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/Wallfactory.py b/add_mesh_extra_objects/Wallfactory.py
index 4b15b62a..9ed8cb84 100644
--- a/add_mesh_extra_objects/Wallfactory.py
+++ b/add_mesh_extra_objects/Wallfactory.py
@@ -885,7 +885,8 @@ class add_mesh_wallb(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Wall' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Wall' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_beam_builder.py b/add_mesh_extra_objects/add_mesh_beam_builder.py
index 5bb1bceb..0cc43e0f 100644
--- a/add_mesh_extra_objects/add_mesh_beam_builder.py
+++ b/add_mesh_extra_objects/add_mesh_beam_builder.py
@@ -761,7 +761,8 @@ class addBeam(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Beam' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Beam' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_gears.py b/add_mesh_extra_objects/add_mesh_gears.py
index 9655dea9..1d3bc70e 100644
--- a/add_mesh_extra_objects/add_mesh_gears.py
+++ b/add_mesh_extra_objects/add_mesh_gears.py
@@ -689,7 +689,8 @@ class AddGear(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Gear' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Gear' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -910,7 +911,8 @@ class AddWormGear(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('WormGear' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('WormGear' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_gemstones.py b/add_mesh_extra_objects/add_mesh_gemstones.py
index fe31675d..dc505b0f 100644
--- a/add_mesh_extra_objects/add_mesh_gemstones.py
+++ b/add_mesh_extra_objects/add_mesh_gemstones.py
@@ -284,7 +284,8 @@ class AddDiamond(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Diamond' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Diamond' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -433,7 +434,8 @@ class AddGem(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Gem' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Gem' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_honeycomb.py b/add_mesh_extra_objects/add_mesh_honeycomb.py
index 48a71940..bb6734a4 100644
--- a/add_mesh_extra_objects/add_mesh_honeycomb.py
+++ b/add_mesh_extra_objects/add_mesh_honeycomb.py
@@ -278,7 +278,8 @@ class add_mesh_honeycomb(bpy.types.Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('HoneyComb' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('HoneyComb' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_pipe_joint.py b/add_mesh_extra_objects/add_mesh_pipe_joint.py
index 98421331..91c64e2f 100644
--- a/add_mesh_extra_objects/add_mesh_pipe_joint.py
+++ b/add_mesh_extra_objects/add_mesh_pipe_joint.py
@@ -230,7 +230,8 @@ class AddElbowJoint(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
- ('ElbowJoint' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('ElbowJoint' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -496,7 +497,8 @@ class AddTeeJoint(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
- ('TeeJoint' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('TeeJoint' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -779,7 +781,8 @@ class AddWyeJoint(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
- ('WyeJoint' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('WyeJoint' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -1126,7 +1129,8 @@ class AddCrossJoint(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
- ('CrossJoint' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('CrossJoint' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -1370,7 +1374,8 @@ class AddNJoint(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
- ('NJoint' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('NJoint' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_pyramid.py b/add_mesh_extra_objects/add_mesh_pyramid.py
index 405e6eaf..58fafb04 100644
--- a/add_mesh_extra_objects/add_mesh_pyramid.py
+++ b/add_mesh_extra_objects/add_mesh_pyramid.py
@@ -168,7 +168,8 @@ class AddPyramid(bpy.types.Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Pyramid' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Pyramid' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_round_brilliant.py b/add_mesh_extra_objects/add_mesh_round_brilliant.py
index e50a1dbe..874a26db 100644
--- a/add_mesh_extra_objects/add_mesh_round_brilliant.py
+++ b/add_mesh_extra_objects/add_mesh_round_brilliant.py
@@ -428,7 +428,8 @@ class MESH_OT_primitive_brilliant_add(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Brilliant' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Brilliant' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_round_cube.py b/add_mesh_extra_objects/add_mesh_round_cube.py
index 1190be93..b48e9a69 100644
--- a/add_mesh_extra_objects/add_mesh_round_cube.py
+++ b/add_mesh_extra_objects/add_mesh_round_cube.py
@@ -405,7 +405,8 @@ class AddRoundCube(Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Roundcube' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Roundcube' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_star.py b/add_mesh_extra_objects/add_mesh_star.py
index b5d515c6..2bede081 100644
--- a/add_mesh_extra_objects/add_mesh_star.py
+++ b/add_mesh_extra_objects/add_mesh_star.py
@@ -208,7 +208,8 @@ class AddStar(bpy.types.Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('Star' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('Star' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_supertoroid.py b/add_mesh_extra_objects/add_mesh_supertoroid.py
index fabc8147..8a87a289 100644
--- a/add_mesh_extra_objects/add_mesh_supertoroid.py
+++ b/add_mesh_extra_objects/add_mesh_supertoroid.py
@@ -223,7 +223,8 @@ class add_supertoroid(bpy.types.Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('SuperToroid' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('SuperToroid' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_torusknot.py b/add_mesh_extra_objects/add_mesh_torusknot.py
index 30957f7a..39e985c3 100644
--- a/add_mesh_extra_objects/add_mesh_torusknot.py
+++ b/add_mesh_extra_objects/add_mesh_torusknot.py
@@ -144,7 +144,8 @@ class AddTorusKnot(bpy.types.Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('TorusKnot' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('TorusKnot' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_extra_objects/add_mesh_twisted_torus.py b/add_mesh_extra_objects/add_mesh_twisted_torus.py
index 0502a189..bb3bd483 100644
--- a/add_mesh_extra_objects/add_mesh_twisted_torus.py
+++ b/add_mesh_extra_objects/add_mesh_twisted_torus.py
@@ -236,7 +236,8 @@ class AddTwistedTorus(bpy.types.Operator, object_utils.AddObjectHelper):
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('TwistedTorus' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and ('TwistedTorus' in context.active_object.data.keys()) and \
+ (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
diff --git a/add_mesh_geodesic_domes/third_domes_panel_271.py b/add_mesh_geodesic_domes/third_domes_panel_271.py
index 98add45f..d95de427 100644
--- a/add_mesh_geodesic_domes/third_domes_panel_271.py
+++ b/add_mesh_geodesic_domes/third_domes_panel_271.py
@@ -1293,7 +1293,8 @@ class GenerateGeodesicDome(Operator, object_utils.AddObjectHelper):
if mesh != None:
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
- ('GeodesicDome' in context.active_object.data.keys()) and (self.change == True):
+ (context.active_object.data is not None) and \
+ ('GeodesicDome' in context.active_object.data.keys()) and (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name