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_particle.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_particle.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_particle.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index a9f040db9b5..ae15fda2c69 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -1803,9 +1803,10 @@ class PARTICLE_PT_force_fields_type1(ParticleButtonsPanel, Panel):
part = particle_get_settings(context)
- col = layout.column()
- col.prop(part.force_field_1, "type", text="Type 1")
- basic_force_field_settings_ui(self, part.force_field_1)
+ if part.force_field_1:
+ col = layout.column()
+ col.prop(part.force_field_1, "type", text="Type 1")
+ basic_force_field_settings_ui(self, part.force_field_1)
class PARTICLE_PT_force_fields_type2(ParticleButtonsPanel, Panel):
@@ -1819,9 +1820,10 @@ class PARTICLE_PT_force_fields_type2(ParticleButtonsPanel, Panel):
part = particle_get_settings(context)
- col = layout.column()
- col.prop(part.force_field_2, "type", text="Type 2")
- basic_force_field_settings_ui(self, part.force_field_2)
+ if part.force_field_2:
+ col = layout.column()
+ col.prop(part.force_field_2, "type", text="Type 2")
+ basic_force_field_settings_ui(self, part.force_field_2)
class PARTICLE_PT_force_fields_type1_falloff(ParticleButtonsPanel, Panel):
@@ -1836,7 +1838,8 @@ class PARTICLE_PT_force_fields_type1_falloff(ParticleButtonsPanel, Panel):
part = particle_get_settings(context)
- basic_force_field_falloff_ui(self, part.force_field_1)
+ if part.force_field_1:
+ basic_force_field_falloff_ui(self, part.force_field_1)
class PARTICLE_PT_force_fields_type2_falloff(ParticleButtonsPanel, Panel):
@@ -1851,7 +1854,8 @@ class PARTICLE_PT_force_fields_type2_falloff(ParticleButtonsPanel, Panel):
part = particle_get_settings(context)
- basic_force_field_falloff_ui(self, part.force_field_2)
+ if part.force_field_2:
+ basic_force_field_falloff_ui(self, part.force_field_2)
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):