Python: broken access of the parent of a proxy object #70283

Closed
opened 2019-09-26 19:49:30 +02:00 by lucas veber · 6 comments

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 2.81 (sub 12), branch: master, commit date: 2019-09-25 20:42, hash: ee47075449
Worked: (optional)

Short description of error
Accessing the parent object of a proxy is broken if it belongs to a collection with the same name.

Exact steps for others to reproduce the error

  • Link the collection of the following blend in a new file:
    box.blend

(It contains one cube ("Box") parented to an empty, contained in a collection name "Box")

  • Make a proxy (F3 > Make proxy > Box)
  • Run this code in the text editor:
import bpy

box_proxy_name = bpy.context.active_object.proxy.name
print(box_proxy_name)
box = bpy.data.objects[box_proxy_name]
print(box.parent.name)
  • Error, box.parent = None
  • Now open the box.blend file, and rename the box "box1"
  • Link it again
  • Run the script
  • It works

Note that it works in the first case, if we access directly the parent this way:

bpy.context.active_object.proxy.parent

Thanks for your work!

**System Information** Operating system: Windows-10-10.0.18362 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86 **Blender Version** Broken: version: 2.81 (sub 12), branch: master, commit date: 2019-09-25 20:42, hash: `ee47075449` Worked: (optional) **Short description of error** Accessing the parent object of a proxy is broken if it belongs to a collection with the same name. **Exact steps for others to reproduce the error** * Link the collection of the following blend in a new file: [box.blend](https://archive.blender.org/developer/F7776038/box.blend) (It contains one cube ("Box") parented to an empty, contained in a collection name "Box") * Make a proxy (F3 > Make proxy > Box) * Run this code in the text editor: ``` import bpy box_proxy_name = bpy.context.active_object.proxy.name print(box_proxy_name) box = bpy.data.objects[box_proxy_name] print(box.parent.name) ``` * Error, box.parent = None * Now open the box.blend file, and rename the box "box1" * Link it again * Run the script * It works Note that it works in the first case, if we access directly the parent this way: ``` bpy.context.active_object.proxy.parent ``` Thanks for your work!
Author

Added subscriber: @LucasVeber

Added subscriber: @LucasVeber

Added subscribers: @mont29, @mano-wii

Added subscribers: @mont29, @mano-wii
Bastien Montagne was assigned by Germano Cavalcante 2019-09-27 19:39:41 +02:00

@mont29, looks like this involves Append & Link & Override so that's your area, right?

@mont29, looks like this involves `Append & Link & Override` so that's your area, right?

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

This has nothing to do with data management, or collection name, it’s just plain old collision when linked data block and local one (the proxy) have the exact same name, see the doc.

This has nothing to do with data management, or collection name, it’s just plain old collision when linked data block and local one (the proxy) have the exact same name, see [the doc](https://docs.blender.org/api/current/info_gotcha.html#library-collisions).
Author

Ah! Bummer. Well I guess we have to deal with it, thanks for letting me know... Will static overrides overcome this issue?

Ah! Bummer. Well I guess we have to deal with it, thanks for letting me know... Will static overrides overcome this issue?
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
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#70283
No description provided.