Script autorun closes immediately on Windows #45699
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#45699
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
Windows 7, Intel HD Graphics 4000
Bug has been confirmed to appear with other (unkown) graphics cards
Blender Version
Broken: from 2.68
Worked: until 2.67b
Short description of error
On Windows, from Blender 2.68, when running a python script from the command line the blender game engine closes as soon as it starts: the Blender game engine starts, the scene is shown, and it closes and the terminal says "Blender Game engine Stopped".
In the same conditions, the Blender Game Engine runs fine on OSX and Linux.
Exact steps for others to reproduce the error
In a console, in the same folder as the Blender executable, autorun.blend and test.py:
blender -d autorun.blend -y -P test.py
I think the bug was introduced in commit
412c043474
, but I can't confirm.We are using this option to run robotics simulation using the Game Engine with MORSE (https://www.openrobots.org/morse/doc/latest/morse.html).
A work around on Windows is to uncheck the "Auto start" property of the autorun.blend file in the Game menu, launch the same command as above and then press "p" to launch the simulation (which works).
We would really appreciate if this bug can be fixed, let me know how I can help.
Jeremy Nicola
Changed status to: 'Open'
Added subscriber: @JeremyNicola
Added subscriber: @sindra1961
The Game Engine runs in my environment (win32), and the cube is shown.
{F220478}autorun.log
version 2.75 (sub 4), branch b'master', commit date b'2015-08-04' b'19:56', hash b'd39e188', b'Release'
Well, too bad for the reproductibility :-/...
here is my log with 2.75 on Windows:
debug2.75_windows.txt
you can see that the script "test.py" was not executed as "Hello Blender" does not appear, contrarily to your log.
Added subscriber: @hg1
The way you are running the script is for Blender scripts not for BGE. So basically it would be a Blender and not a BGE bug if there is really a bug.
Because on my Windows 7 PC with Blender 32 bit version 2.75a it will work and will print "Hello Blender".
Console Output.txt
Please read the documentation about Scripting & Security. Maybe you have to activate Auto Run Python Scripts once to add the parameter to the settings. After that you can disable it and use -y or --enable-autoexec if you want.
http://wiki.blender.org/index.php/Doc%3A2.6/Manual/Extensions/Python/Security
http://wiki.blender.org/index.php/Doc:2.4/Manual/Render/Command_Line
But basically this is not the right way to run a BGE script. The way you are using is to run a Blender script (bpy). And will only run once at startup and will be not called while the the BGE is running. The normal way to run a BGE script is to use a Python module controller and a always sensor.
If you want to start the BGE game from the console you have have to use the Blenderplayer.
"blender -d autorun.blend -y -P test.py" -y and -P are not existing for the Blenderplayer and you can't load a python script like blender Blender script.
So you have to use "blenderplayer -d autorun.blend"
Added subscribers: @JorgeBernalMartinez, @ideasman42
Added subscriber: @Sergey
@ideasman42, seems we just need to disable safety features for game engine?
I am able to build from 2.67b (doesn't show the bad behavior) to current release (shows the bad behavior) on Windows.
I am pretty busy at the moment, by the end of the month I will git bisect and report what I found.
This issue was referenced by
5611237391
Changed status from 'Open' to: 'Resolved'
Changed status from 'Resolved' to: 'Open'
Accidentally pasted in wrong tracker number!
Confirmed the bug, looking into a fix.
Update, its caused by:
24321d4891
Whats happening is the BGE is checking the window is still set in
BL_KetsjiNextFrame
, see/* window closed while bge runs */
.From commit
24321d4891
, the added call towm_event_do_handlers
which sets the window context toNULL
.This issue was referenced by
3056add0e0
Changed status from 'Open' to: 'Resolved'
Great, thank you!