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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-05-21 15:57:29 +0300
committerBastien Montagne <bastien@blender.org>2021-05-21 18:22:43 +0300
commit24deeee09e6ba8719fe69af5346eda9d521b0312 (patch)
treee85c8210b7a21e314ae5662cd08fa45ef359c368 /release/scripts/startup/bl_ui/properties_physics_common.py
parentadf2f146d89dfb508bf549737ee393d9424c646b (diff)
Fix some RNA physics accessors creating data.
Accessing data through RNA should never implicitely create it. Objects' and particles' forcefields and collision settings were doing this. Note that UI code also had to be tweaked to properly handle `None` (NULL) cases. Differential Revision: https://developer.blender.org/D11341
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_physics_common.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 7f55e4888cf..f13a808e324 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -79,7 +79,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
col = flow.column()
- if obj.field.type == 'NONE':
+ if not obj.field or obj.field.type == 'NONE':
col.operator("object.forcefield_toggle", text="Force Field", icon='FORCE_FORCE')
else:
col.operator("object.forcefield_toggle", text="Force Field", icon='X')