Python Module not appended when appending an object with bpy.obs.wm.append #53960
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#53960
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
Ubuntu Linux 16.04, 64bits
Graphic card Intel HD Graphics 530
Blender Version
Broken: 2.76b, 2.79a
Short description of error
Appending an object that has a controller using a Python module from an external file will append the object but not the Python module (the text).
Please not that if the controller is using a Python script instead of a module, the script is added correctly.
Exact steps for others to reproduce the error
Download the attached env.blend file which contains a cube with
From a new Blender file, in the Python console, append the cube with bpy.ops.wm.append
Is this the expected behaviour? I would like to know before implementing a specific workaround for our use-case (the MORSE robot simulator).
Added subscriber: @JeremyNicola
Added subscriber: @lichtwerk
I guess this is expected behaviour. A module doesnt have to be a textblock (more naturally python code would just somewhere be in a file on the Pythonpath in that case).
And afaiks the module string entry is being kept intact, so the controller should actually keep working once appended (if the module code is external).
In the special case the module is actually a real textblock in the source blenderfile: that would actually be possible to implement [I mean appending that datablock as well], but more of a TODO (which I am not even sure would be desiarable in all cases - would need more thought...)
I would tend to close this report as 'not a bug' but would like to hear a second opinion to be sure
Added subscriber: @mont29
@mont29: kindly asking for a thought
Changed status from 'Open' to: 'Archived'
Yep, as @lichtwerk said, there is absolutely no way for Blender to guess where this module would come from, it’s just assumed to be 'somewhere' in our py path, that’s all. Append/link can definitively not deal with that, they only deal with relations between actual data-blocks anyway.
But wouldn't it be sane and simple to just check :
then import the associated text?
Or at least provide an option "autoimport_modules"? I might help if needed.
From a naive user perspective, that really does not make sense to not have a Python module imported when it is written in the .blend