Custom Properties Edit popup clears bpy.types properties if value is set to different type (string / int / float / list) #38778

Closed
opened 2014-02-23 14:17:11 +01:00 by CodeManX · 11 comments
Member

ID-Properties as well as bpy.types properties show up in the Custom Properties panel, although they are separated from Python perspective (they aren't internally).

If you add a bpy.types property...

  bpy.types.Object.prop = bpy.props.StringProperty()
  bpy.context.object.prop = "foobar"

it will show in the Custom Properties panel, and you can change it there (even to 123 or [1,2,3], it will be interpreted as string).

But if you click the Edit button and type e.g. 123 into the popup's value field and confirm, the property (bpy.context.object.prop) will be cleared and disappear from panel (there's no ID property with this name either).

If the property is a bpy.types property, there shouldn't be type casting, and it would avoid losing this property.

There's another issue if you use .prop as property name:
Try to add an ID property in the panel by clicking Add - it will try to create a property with the default name prop (+number if needed). But as there's a bpy.types property with that name, it seems to name-conflict and is removed immediately.
I guess it should check for bpy.types properties and use a name not already in use?

ID-Properties as well as bpy.types properties show up in the Custom Properties panel, although they are separated from Python perspective (they aren't internally). If you add a bpy.types property... ``` bpy.types.Object.prop = bpy.props.StringProperty() bpy.context.object.prop = "foobar" ``` it will show in the Custom Properties panel, and you can change it there (even to `123` or `[1,2,3]`, it will be interpreted as string). But if you click the Edit button and type e.g. `123` into the popup's value field and confirm, the property (`bpy.context.object.prop`) will be cleared and disappear from panel (there's no ID property with this name either). If the property is a bpy.types property, there shouldn't be type casting, and it would avoid losing this property. There's another issue if you use `.prop` as property name: Try to add an ID property in the panel by clicking Add - it will try to create a property with the default name `prop` (+number if needed). But as there's a bpy.types property with that name, it seems to name-conflict and is removed immediately. I guess it should check for bpy.types properties and use a name not already in use?
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @CodeManX

Added subscriber: @CodeManX

Added subscriber: @soppera

Added subscriber: @soppera

Removed subscriber: @soppera

Removed subscriber: @soppera
Campbell Barton was assigned by Sergey Sharybin 2014-02-24 15:34:30 +01:00

Added subscribers: @ideasman42, @Sergey

Added subscribers: @ideasman42, @Sergey

@ideasman42, think this one is for you?

@ideasman42, think this one is for you?

Added subscriber: @SatishGoda

Added subscriber: @SatishGoda

This issue was referenced by blender/blender-addons-contrib@bb62f9a582

This issue was referenced by blender/blender-addons-contrib@bb62f9a582d44e347f81b11610b8e18acc590b35

This issue was referenced by blender/blender@bb62f9a582

This issue was referenced by blender/blender@bb62f9a582d44e347f81b11610b8e18acc590b35

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit blender/blender@bb62f9a582.

Closed by commit blender/blender@bb62f9a582.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#38778
No description provided.