CacheFile Open Operator Crashes Blender #51052

Closed
opened 2017-03-26 09:08:21 +02:00 by lvxejay · 8 comments

System Information

Blender Version

Broken: blender-2.78-34a502c16a-linux-glibc219-x86_64]

Short description of error
Running bpy.ops.cachefile.open(filepath='path/to/abc/here'), crashes Blender.

Exact steps for others to reproduce the error
Run in Blender python console or text editor:

bpy.ops.cachefile.open(filepath='path/to/abc/here')

Result = Blender Crash

**System Information** **Blender Version** Broken: blender-2.78-34a502c16a-linux-glibc219-x86_64] **Short description of error** Running bpy.ops.cachefile.open(filepath='path/to/abc/here'), crashes Blender. **Exact steps for others to reproduce the error** Run in Blender python console or text editor: ``` bpy.ops.cachefile.open(filepath='path/to/abc/here') ``` Result = Blender Crash
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @lvxejay

Added subscriber: @lvxejay
Author

When called from the Dynamic Context Menu (spacebar), it works just fine

When called from the Dynamic Context Menu (spacebar), it works just fine
Author

Operator requires an execution override to work properly:

bpy.ops.cachefile.open('INVOKE_REGION_WIN')

This should probably be the default behavior for this operator call.

Operator requires an execution override to work properly: ``` bpy.ops.cachefile.open('INVOKE_REGION_WIN') ``` This should probably be the default behavior for this operator call.
Member

Added subscriber: @scorpion81

Added subscriber: @scorpion81
Member

Seems to be an invalid pointer when this operator is directly executed from python instead of being invoked before.

P480: Possible fix for #51052 (invalid pointer when bpy.ops.cachefile.open() is called)

diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c
index c5eea94..b6aa193 100644
--- a/source/blender/editors/io/io_cache.c
+++ b/source/blender/editors/io/io_cache.c
@@ -98,6 +98,12 @@ static int cachefile_open_exec(bContext *C, wmOperator *op)
 	/* hook into UI */
 	PropertyPointerRNA *pprop = op->customdata;
 
+	/* this seems a NULL pointer here when bpy.ops.cachefile.open() is called from python... */
+	if (!pprop) {
+		cachefile_init(C, op);
+		pprop = op->customdata;
+	}
+
 	if (pprop->prop) {
 		/* when creating new ID blocks, use is already 1, but RNA
 		 * pointer se also increases user, so this compensates it */
Seems to be an invalid pointer when this operator is directly executed from python instead of being invoked before. [P480: Possible fix for #51052 (invalid pointer when bpy.ops.cachefile.open() is called)](https://archive.blender.org/developer/P480.txt) ```diff diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c index c5eea94..b6aa193 100644 --- a/source/blender/editors/io/io_cache.c +++ b/source/blender/editors/io/io_cache.c @@ -98,6 +98,12 @@ static int cachefile_open_exec(bContext *C, wmOperator *op) /* hook into UI */ PropertyPointerRNA *pprop = op->customdata; + /* this seems a NULL pointer here when bpy.ops.cachefile.open() is called from python... */ + if (!pprop) { + cachefile_init(C, op); + pprop = op->customdata; + } + if (pprop->prop) { /* when creating new ID blocks, use is already 1, but RNA * pointer se also increases user, so this compensates it */ ```

This issue was referenced by blender/blender@2c10e8a3cf

This issue was referenced by blender/blender@2c10e8a3cfff3cc3c12b0359bbfc11c0a7eadecc

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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-addons#51052
No description provided.