load Text File with Python from GUI Button results in 0 User #55260
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#55260
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?
System Information
Win 7 64 - AMD R9 380
Blender Version
Broken: 2.79
Worked: (2.74)
Short description of error
A loaded Text File with Python from GUI Button results in 0 User, and the Textblock ist marked red.
Exact steps for others to reproduce the error
Here is a blend. Load Script Bug (Studie).zip
Run the Script with Alt+P. It creates a Panel in the scene context of the properties editor.
Place a TXT on the C:\ Drive to load. Load it with the Button. Maybe you need to adjust the Filename in the Script bevore.
See what happens to the loaded Text in the Text Editior.
Regards, Doc
Added subscriber: @doc_holiday
Added subscriber: @lichtwerk
I think this has to do with commit blender/blender@a9163f7d22, blender/blender@646aa40cf7 (which only ensured real user for doing it from the UI?).
Also see blender/blender@15eb83c8b3.
Doing this from python [via
bpy.ops.text.open
] would skip this step becauseSpaceText
as well asPropertyPointerRNA
are not set in this case.Doing this from python [via
bpy.data.texts.load
] would also skip this.I think something like D3447 fixes this.
Still unsure if
bpy.data.texts.load
should do the same? Or is this expected to have zero users then?(I included the fix for
bpy.data.texts.load
in D3447 as well...)Am not totally happy with it, but looks like operators creating new datablocks usually ensure they have one user, even if not actually used… Image opening one e.g., which can probably generate some usercount inconsistency in some cases. So guess we can do that unconditionally for text opening op too.
RNA
data.xxx.load
funcs do not do that though, seedata.images.load
e.g.This issue was referenced by blender/blender@7277f8973b
Changed status from 'Open' to: 'Resolved'