[Bf-extensions-cvs] [8b32385c] blender2.8: Snap Utilities Line: Fix crash due to difference in the basic size of an object in python in different build solutions.
mano-wii
noreply at git.blender.org
Tue Oct 30 06:13:10 CET 2018
Commit: 8b32385cf00e2fa7280c7ab6c3ac2a3bdf837eb2
Author: mano-wii
Date: Tue Oct 30 02:11:50 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBA8b32385cf00e2fa7280c7ab6c3ac2a3bdf837eb2
Snap Utilities Line: Fix crash due to difference in the basic size of an object in python in different build solutions.
And add comments
===================================================================
M mesh_snap_utilities_line/ops_line.py
===================================================================
diff --git a/mesh_snap_utilities_line/ops_line.py b/mesh_snap_utilities_line/ops_line.py
index 427b0b30..f8375607 100644
--- a/mesh_snap_utilities_line/ops_line.py
+++ b/mesh_snap_utilities_line/ops_line.py
@@ -43,8 +43,11 @@ def Bpy_Area_header_text_clear(area):
#HACK
import ctypes
func = area.header_text_set
- c_func = ctypes.c_void_p.from_address(id(func) + 56).value
+ #(int)(&((struct BPy_FunctionRNA *)0)->func) == object.__basicsize__ + 24
+ c_func = ctypes.c_void_p.from_address(id(func) + object.__basicsize__ + 24).value
+ #(int)(&((struct FunctionRNA *)0)->cont.properties.first) == 24
c_param = ctypes.c_void_p.from_address(c_func + 24).value
+ #(int)(&((struct PropertyRNA *)0)->flag_parameter) == 40
flag_parameter = ctypes.c_void_p.from_address(c_param + 40)
previous_value = flag_parameter.value
flag_parameter.value = 0
More information about the Bf-extensions-cvs
mailing list