BGE import bpy #38331

Closed
opened 2014-01-23 12:46:42 +01:00 by Marcin Nijaki · 11 comments

System Information
Windows 8.1 Intel HD4400

Blender Version
Broken: 2.69

Short description of error
In BGE debug mode is possible to import bpy in script called from controller
(in standalone player it impossible). It makes harder to finds bugs.

Exact steps for others to reproduce the error

import_bpy_error.blend
Run in debug and standalone player and see console.

**System Information** Windows 8.1 Intel HD4400 **Blender Version** Broken: 2.69 **Short description of error** In BGE debug mode is possible to import bpy in script called from controller (in standalone player it impossible). It makes harder to finds bugs. **Exact steps for others to reproduce the error** [import_bpy_error.blend](https://archive.blender.org/developer/F73782/import_bpy_error.blend) Run in debug and standalone player and see console.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @marcino15

Added subscriber: @marcino15

Added subscriber: @solarlune

Added subscriber: @solarlune

It's impossible to import bpy from the standalone player because it's not a Python module you can import from the BGE. It's Blender specific. You can't use bpy in a standalone game, basically; just BGE python modules, external Python modules, and standalone modules (like Audaspace (aud) and mathutils).

This isn't a bug so much as just a feature that isn't implemented.

It's impossible to import bpy from the standalone player because it's not a Python module you can import from the BGE. It's Blender specific. You can't use bpy in a standalone game, basically; just BGE python modules, external Python modules, and standalone modules (like Audaspace (aud) and mathutils). This isn't a bug so much as just a feature that isn't implemented.
Author

OK. You are right, but in debug mode import bpy should be blocked.

OK. You are right, but in debug mode import bpy should be blocked.

Added subscriber: @NickPolet

Added subscriber: @NickPolet

Really don't think it needs to be blocked at all. Can you explain how it makes it harder to debug projects? You just don't use the bpy module and you will not have problems.

Really don't think it needs to be blocked at all. Can you explain how it makes it harder to debug projects? You just don't use the bpy module and you will not have problems.

Added subscriber: @AngusHollands-4

Added subscriber: @AngusHollands-4

In Python we tend to encourage an "EAFP" mentality, and in general it is best to allow people to do things their own way. On BlenderArtists we're used to simply shouting "Don't use BPY". This would be alleviated with a greater breadth of examples for achieving tasks.

In Python we tend to encourage an "EAFP" mentality, and in general it is best to allow people to do things their own way. On BlenderArtists we're used to simply shouting "Don't use BPY". This would be alleviated with a greater breadth of examples for achieving tasks.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2014-01-28 15:33:01 +01:00

This is intentional and not a bug, bpy is for blender application, not the blenderplayer.

This is intentional and not a bug, `bpy` is for blender application, not the blenderplayer.
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
5 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#38331
No description provided.