Fix T40520: Properties panel in properties region in 3D view does not go away.

Ignore '_RNA_UI' IDP...
This commit is contained in:
Bastien Montagne 2014-06-06 14:38:07 +02:00
parent a98c27f64e
commit 553264ff8e
Notes: blender-bot 2023-02-14 10:31:55 +01:00
Referenced by issue #40520, Properties panel in properties region in 3D view does not go away
2 changed files with 8 additions and 3 deletions

View File

@ -57,7 +57,6 @@ def rna_idprop_ui_prop_clear(item, prop):
except:
pass
def rna_idprop_context_value(context, context_member, property_type):
space = context.space_data
@ -74,6 +73,10 @@ def rna_idprop_context_value(context, context_member, property_type):
return rna_item, context_member
def rna_idprop_has_properties(rna_item):
keys = rna_item.keys()
nbr_props = len(keys)
return (nbr_props > 1) or (nbr_props and '_RNA_UI' not in keys)
def draw(layout, context, context_member, property_type, use_edit=True):

View File

@ -3223,10 +3223,12 @@ class VIEW3D_PT_context_properties(Panel):
@classmethod
def poll(cls, context):
import rna_prop_ui
member = cls._active_context_member(context)
if member:
context_member = getattr(context, member)
return context_member and context_member.keys()
context_member, member = rna_prop_ui.rna_idprop_context_value(context, member, object)
return context_member and rna_prop_ui.rna_idprop_has_properties(context_member)
return False