branches/blender-2.47
Merge from trunk: Revision: 16075 Revision: 16081
This commit is contained in:
parent
c8e22c3a6b
commit
b5cd4739d8
|
@ -5077,7 +5077,7 @@ static char *snapmode_pup(void)
|
|||
static char string[512];
|
||||
char *str = string;
|
||||
|
||||
str += sprintf(str, "%s", "Snap Mode: %t");
|
||||
str += sprintf(str, "%s", "Snap Element: %t");
|
||||
str += sprintf(str, "%s", "|Vertex%x0");
|
||||
str += sprintf(str, "%s", "|Edge%x1");
|
||||
str += sprintf(str, "%s", "|Face%x2");
|
||||
|
@ -5715,7 +5715,7 @@ void view3d_buttons(void)
|
|||
xco+= XIC;
|
||||
uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_VERTEXSEL, snapmode_pup(), xco,0,XIC+10,YIC, &(G.scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode");
|
||||
xco+= XIC;
|
||||
uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode");
|
||||
uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode");
|
||||
xco+= 70;
|
||||
} else {
|
||||
uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)");
|
||||
|
|
|
@ -273,36 +273,16 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
|
|||
* break it by hand, then DECREF (which in this case
|
||||
* should always ensure excdict is cleared).
|
||||
*/
|
||||
/* PyObject *excdict= myPyDict_Copy(m_pythondictionary);
|
||||
struct _object* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
|
||||
excdict,
|
||||
excdict
|
||||
);
|
||||
PyDict_Clear(excdict);
|
||||
Py_DECREF(excdict);*/
|
||||
|
||||
|
||||
#if 1
|
||||
PyObject *excdict= PyDict_Copy(m_pythondictionary);
|
||||
PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
|
||||
excdict,
|
||||
excdict
|
||||
);
|
||||
PyDict_Clear(excdict);
|
||||
Py_DECREF(excdict);
|
||||
#else
|
||||
|
||||
PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
|
||||
m_pythondictionary,
|
||||
m_pythondictionary
|
||||
);
|
||||
|
||||
#endif
|
||||
excdict, excdict);
|
||||
|
||||
if (resultobj)
|
||||
{
|
||||
Py_DECREF(resultobj);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// something is wrong, tell the user what went wrong
|
||||
printf("PYTHON SCRIPT ERROR:\n");
|
||||
|
@ -310,6 +290,11 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
|
|||
//PyRun_SimpleString(m_scriptText.Ptr());
|
||||
}
|
||||
|
||||
// clear after PyErrPrint - seems it can be using
|
||||
// something in this dictionary and crash?
|
||||
PyDict_Clear(excdict);
|
||||
Py_DECREF(excdict);
|
||||
|
||||
m_sCurrentController = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue