[Bf-blender-cvs] [45997489622] master: UI: hide object instancing panel for object types that dont support instancing

Philipp Oeser noreply at git.blender.org
Tue Aug 10 16:10:38 CEST 2021


Commit: 45997489622869b206b8fdacba0586e14f402722
Author: Philipp Oeser
Date:   Fri May 21 18:08:51 2021 +0200
Branches: master
https://developer.blender.org/rB45997489622869b206b8fdacba0586e14f402722

UI: hide object instancing panel for object types that dont support instancing

Basically, only meshes, empties and pointclouds support direct
instancing atm., no need to have the panel for other types.

note: prior to rB2eca054e14b1, collection instancing was possible on all
types (but that was removed in said commit)

note2: for empties, rna_Object_instance_type_itemf should also be
tweaked so we dont get "Vertices" and "Faces" options, but that can be
done in a separate commit

Maniphest Tasks: T88443

Differential Revision: https://developer.blender.org/D11348

===================================================================

M	release/scripts/startup/bl_ui/properties_object.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 46a16a70dca..e93b0b0d0a1 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -262,6 +262,11 @@ class OBJECT_PT_instancing(ObjectButtonsPanel, Panel):
     bl_label = "Instancing"
     bl_options = {'DEFAULT_CLOSED'}
 
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        return (ob.type in {'MESH', 'EMPTY', 'POINTCLOUD'})
+
     def draw(self, context):
         layout = self.layout



More information about the Bf-blender-cvs mailing list