Lack of bpy.props.IDProperty that could contain a reference to any Blender entity, as an object, material, scene... #34766
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#34766
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%This is not a bug, but an enhancement proposal. I could not find a better tool to propose it.
I would like to create a new bpy.types.Object property containing a link to a reference object.
As an example look at the "Object" field of the Boolean Modifier.
This is how I show the property in the panel:
row = layout.row()
row.prop_search(element,"my_reference_object",bpy.data,"objects")
This is how I create my new property:
bpy.types.Object.my_reference_object = StringProperty(name="Reference object")
This works, but if I change the name of the reference object, then the "my_reference_object" property is not updated, unlike what happens in the "Object" field of the Boolean Modifier. This is because I am just storing the name and not a pointer to the object.
I tried this:
bpy.types.Object.my_reference_object = PointerProperty(name="Reference object",type=bpy.types.Object)
but it does not work...
I thus suggest the creation of a bpy.props.IDProperty that could contain a reference to any Blender entity, as an object, material, scene...
Thank you as usual,
Emanuele Gissi%%%
Changed status to: 'Open'
%%%Hi Emanuele, first of all, this tracker is for bugs and is not really meant for feature requests.
However we're aware of this limitation and its been suggested before,
linking any data-type to any other data type adds a burden on the data manipulation functions - removing an object for eg would have to check if there is an ID in any id properly (object bones, pose bones for eg).
This could be managed by keeping track of what has ID-property references so it may be added at some point but isnt trivial.%%%
Changed status from 'Open' to: 'Resolved'
%%%Thank you Bart. What tool do you suggest for future feature proposal? ("request" is too harsh ;-)
And ok for the reply, I am going to follow the StringProperty way.
Emanuele%%%
%%%It works in C-code (see e.g. boolean modifier, object property), so couldn't C-IDProps be wrapped for python, so that it's done all in C, but looks like it's python?%%%
%%%It can work, but the obvious way to add will cause a lot of looping over data when removing ID blocks, since an id-property might contain an ID.%%%