B3d 2.8 can't import textblock as module in interactive console. #65855

Closed
opened 2019-06-16 16:17:06 +02:00 by Patrick Crawford · 5 comments

System Information
Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits
Graphics card: Intel HD Graphics 5000 OpenGL Engine Intel Inc. 4.1 INTEL-10.36.23

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-06-02 21:33, hash: 19dcb22a88
Worked: Have not seen this working in any version of Blender 2.8, but worked in Blender 2.7

Short description of error
In Blender 2.7, you could have a python module textblock imported into the into the interactive console and able to call functions/variable names dynamically from those defined in that module, which is a very useful resource for quick and realtime python development.

Exact steps for others to reproduce the error

  1. Create text block, type in simple function (e.g. def myfunc():; print("HI"))
  2. Rename the block to be e.g. mod.py
  3. In the interactive python console, type import mod
  4. note how it fails to import on blender 2.8, but works in 2.7 (being able to call mod.myfunc() and it printing "HI")

Tested to find this not working on both mac OSX and Linux in blender 2.8.

Supporting video: https://twitter.com/TheDuckCow/status/1139503693794091008

**System Information** Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits Graphics card: Intel HD Graphics 5000 OpenGL Engine Intel Inc. 4.1 INTEL-10.36.23 **Blender Version** Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-06-02 21:33, hash: `19dcb22a88` Worked: Have not seen this working in any version of Blender 2.8, but worked in Blender 2.7 **Short description of error** In Blender 2.7, you could have a python module textblock imported into the into the interactive console and able to call functions/variable names dynamically from those defined in that module, which is a very useful resource for quick and realtime python development. **Exact steps for others to reproduce the error** 1) Create text block, type in simple function (e.g. def myfunc():; print("HI")) 2) Rename the block to be e.g. mod.py 3) In the interactive python console, type import mod 4) note how it fails to import on blender 2.8, but works in 2.7 (being able to call mod.myfunc() and it printing "HI") Tested to find this not working on both mac OSX and Linux in blender 2.8. Supporting video: https://twitter.com/TheDuckCow/status/1139503693794091008

Added subscriber: @PatrickCrawford

Added subscriber: @PatrickCrawford
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2019-06-16 20:50:32 +02:00
See: https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API#Importing_Text
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#65855
No description provided.