Fix T42829: Cycles crash rendering when file is saved to specific location

The issue was caused by the way how RNA pointer was created for the bMain:
namely Cycles was using RNA_id_pointer_create to create the pointer, which
would then try to refine the poniter based on the ID type.

This is just wrong and worked so far just because of co-incident, with the
file path from the bug report first letters in the ID name happened to be
NT which corresponds to NodeTree, and for sure refining such pointer will
fail.

Simple solution -- use proper way to create RNA pointer for non-ID block.
This commit is contained in:
Sergey Sharybin 2014-12-11 16:55:10 +05:00
parent 1999b5a814
commit cb7cf523e5
Notes: blender-bot 2023-02-14 09:44:52 +01:00
Referenced by issue #42829, This bug has existed for years in Cycles: it will cause it to crash immediately on render
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ static PyObject *create_func(PyObject *self, PyObject *args)
BL::UserPreferences userpref(userprefptr);
PointerRNA dataptr;
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pydata), &dataptr);
RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
BL::BlendData data(dataptr);
PointerRNA sceneptr;