bpy.ops.rigidbody.bake_to_keyframes() and bpy.ops.object.visual_transform_apply() crash blender ( runing outside blender) #97326

Closed
opened 2022-04-14 17:24:51 +02:00 by bar · 9 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65

Blender Version
Broken: version: 3.1.2, branch: master, commit date: 2022-03-31 17:40, hash: cc66d1020c
Worked: (newest version of Blender that worked as expected)

Short description of error
failing to create low level of bpy.ops.object.visual_transform_apply()
I had to use the ops way - but it crashes blender.
I also notice this post
no proper answers available .

thank you for the help,
Keep up the great work !

bpy.ops.rigidbody.bake_to_keyframes() crash blender{F13001578}

for obj in simulation_objects_collection.objects:
    if obj.type == 'MESH' and obj.rigid_body :

        obj.select_set(True)
        print(obj.name)
        #bpy.ops.object.visual_transform_apply() # not working and sometime causing crash
        bpy.ops.rigidbody.bake_to_keyframes(frame_start=249, frame_end=249, step=1)

        obj.select_set(False)
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF63349B094
Module  : blender.exe
Thread  : 000056c8

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]
bug_test_case.blend

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65 **Blender Version** Broken: version: 3.1.2, branch: master, commit date: 2022-03-31 17:40, hash: `cc66d1020c` Worked: (newest version of Blender that worked as expected) **Short description of error** failing to create [low level of bpy.ops.object.visual_transform_apply() ](https://blender.stackexchange.com/questions/260553/low-level-version-for-bpy-ops-object-visual-transform-apply) I had to use the ops way - but it crashes blender. I also notice [this post ](https://blender.stackexchange.com/questions/16167/visual-transform-apply-doesnt-affect-object-in-python-script) no proper answers available . thank you for the help, Keep up the great work ! bpy.ops.rigidbody.bake_to_keyframes() crash blender{[F13001578](https://archive.blender.org/developer/F13001578/blender.crash.txt)} ``` for obj in simulation_objects_collection.objects: if obj.type == 'MESH' and obj.rigid_body : obj.select_set(True) print(obj.name) #bpy.ops.object.visual_transform_apply() # not working and sometime causing crash bpy.ops.rigidbody.bake_to_keyframes(frame_start=249, frame_end=249, step=1) obj.select_set(False) ``` ``` Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF63349B094 Module : blender.exe Thread : 000056c8 ``` **Exact steps for others to reproduce the error** [Please describe the exact steps needed to reproduce the issue] [Based on the default startup or an attached .blend file (as simple as possible)] [bug_test_case.blend](https://archive.blender.org/developer/F13001582/bug_test_case.blend)
Author

Added subscriber: @barakooda

Added subscriber: @barakooda
bar changed title from bpy.ops.rigidbody.bake_to_keyframes() crash blender ( runing outside blender) to bpy.ops.rigidbody.bake_to_keyframes() and bpy.ops.object.visual_transform_apply() crash blender ( runing outside blender) 2022-04-14 17:49:34 +02:00

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

I do get incorrect context error with your script. Please provide complete operator or script that crashes Blender.

I do get incorrect context error with your script. Please provide complete operator or script that crashes Blender.
Author

Im not able to pack bug example for you as Im using visual studio code blender plugin.

[URL ]] | In the video you can see example for inconsistency of the same code: ]([[ http://www.youtube.com/watch?v=JsNPAgQyJC4)

  1. with visual studio bpy.ops.object.visual_transform_apply() does not work
    2.ruining the script with blender from cmd works as expected
    working_version.blend

working_version.py

I`m not able to pack bug example for you as I`m using visual studio code blender plugin. [URL ]] | In the video you can see example for inconsistency of the same code: ]([[ http://www.youtube.com/watch?v=JsNPAgQyJC4) 1. with visual studio bpy.ops.object.visual_transform_apply() does not work 2.ruining the script with blender from cmd works as expected [working_version.blend](https://archive.blender.org/developer/F13003132/working_version.blend) [working_version.py](https://archive.blender.org/developer/F13003133/working_version.py)

I am affraid we can't help with this issue if running script "normally" does not cause the crash. It's more likely that this is problem with visual studio code blender plugin itself. Can you contact their developers?

I am affraid we can't help with this issue if running script "normally" does not cause the crash. It's more likely that this is problem with visual studio code blender plugin itself. Can you contact their developers?
Author

The crash happens in rigidbody.py
line 121
Capture.PNG

I dont think its Visual studio plugin code but maybe a corner case.
I tried to avoid ops ,
if you know how I would start to write my own bpy.ops.object.visual_transform_apply() and bpy.ops.rigidbody.bake_to_keyframes()
using the python api it will be better workaround.

testing more as i`m writing this reply.
focus on context area type maybe.

Update:
crash also here:
ops.py
image.png

The crash happens in rigidbody.py line 121 ![Capture.PNG](https://archive.blender.org/developer/F13003831/Capture.PNG) I dont think its Visual studio plugin code but maybe a corner case. I tried to avoid ops , if you know how I would start to write my own bpy.ops.object.visual_transform_apply() and bpy.ops.rigidbody.bake_to_keyframes() using the python api it will be better workaround. testing more as i`m writing this reply. focus on context area type maybe. Update: crash also here: ops.py ![image.png](https://archive.blender.org/developer/F13003865/image.png)

If script works when running it from commandline and not in IDE, I must suspect the IDE is doing something incorrect. In any case, to fix the issue a developer must be able to reproduce it, so that's why we need exact steps or sample files. If you can't provide these resources, we will have to close this report.

If script works when running it from commandline and not in IDE, I must suspect the IDE is doing something incorrect. In any case, to fix the issue a developer must be able to reproduce it, so that's why we need exact steps or sample files. If you can't provide these resources, we will have to close this report.
Author

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
bar closed this issue 2022-04-26 20:23:45 +02:00
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
2 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#97326
No description provided.