minor changes
- remove some warnings - fix typos - cmake allow in-source build (when WITH_IN_SOURCE_BUILD is defined) - cmake, use an explicit list of rna files (don't glob)
This commit is contained in:
parent
18e4f7de4f
commit
6bb626f253
@ -31,15 +31,20 @@
|
||||
# build the libs and objects in it.
|
||||
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
message(FATAL_ERROR "CMake generation for blender is not allowed within the source directory!
|
||||
Remove the CMakeCache.txt file and try again from another folder, e.g.:
|
||||
|
||||
rm CMakeCache.txt
|
||||
cd ..
|
||||
mkdir cmake-make
|
||||
cd cmake-make
|
||||
cmake ../blender
|
||||
")
|
||||
if(NOT DEFINED WITH_IN_SOURCE_BUILD)
|
||||
message(FATAL_ERROR
|
||||
"CMake generation for blender is not allowed within the source directory!"
|
||||
"\n Remove the CMakeCache.txt file and try again from another folder, e.g.:"
|
||||
"\n "
|
||||
"\n rm CMakeCache.txt"
|
||||
"\n cd .."
|
||||
"\n mkdir cmake-make"
|
||||
"\n cd cmake-make"
|
||||
"\n cmake ../blender"
|
||||
"\n "
|
||||
"\n Alternately define WITH_IN_SOURCE_BUILD to force this option (not recommended!)"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
@ -187,7 +187,7 @@ void make_local_mball(MetaBall *mb)
|
||||
}
|
||||
|
||||
/* most simple meta-element adding function
|
||||
* dont do context menipulation here (rna uses) */
|
||||
* don't do context manipulation here (rna uses) */
|
||||
MetaElem *add_metaball_element(MetaBall *mb, const int type)
|
||||
{
|
||||
MetaElem *ml= MEM_callocN(sizeof(MetaElem), "metaelem");
|
||||
@ -237,14 +237,14 @@ MetaElem *add_metaball_element(MetaBall *mb, const int type)
|
||||
/** Compute bounding box of all MetaElems/MetaBalls.
|
||||
*
|
||||
* Bounding box is computed from polygonized surface. Object *ob is
|
||||
* basic MetaBall (usaualy with name Meta). All other MetaBalls (whith
|
||||
* basic MetaBall (usually with name Meta). All other MetaBalls (with
|
||||
* names Meta.001, Meta.002, etc) are included in this Bounding Box.
|
||||
*/
|
||||
void tex_space_mball(Object *ob)
|
||||
{
|
||||
DispList *dl;
|
||||
BoundBox *bb;
|
||||
float *data, min[3], max[3], loc[3], size[3];
|
||||
float *data, min[3], max[3] /*, loc[3], size[3] */;
|
||||
int tot, doit=0;
|
||||
|
||||
if(ob->bb==NULL) ob->bb= MEM_callocN(sizeof(BoundBox), "mb boundbox");
|
||||
@ -272,7 +272,7 @@ void tex_space_mball(Object *ob)
|
||||
min[0] = min[1] = min[2] = -1.0f;
|
||||
max[0] = max[1] = max[2] = 1.0f;
|
||||
}
|
||||
|
||||
/*
|
||||
loc[0]= (min[0]+max[0])/2.0f;
|
||||
loc[1]= (min[1]+max[1])/2.0f;
|
||||
loc[2]= (min[2]+max[2])/2.0f;
|
||||
@ -280,7 +280,7 @@ void tex_space_mball(Object *ob)
|
||||
size[0]= (max[0]-min[0])/2.0f;
|
||||
size[1]= (max[1]-min[1])/2.0f;
|
||||
size[2]= (max[2]-min[2])/2.0f;
|
||||
|
||||
*/
|
||||
boundbox_set_from_min_max(bb, min, max);
|
||||
}
|
||||
|
||||
@ -320,14 +320,14 @@ float *make_orco_mball(Object *ob, ListBase *dispbase)
|
||||
}
|
||||
|
||||
/* Note on mball basis stuff 2.5x (this is a can of worms)
|
||||
* This really needs a rewrite/refactorm its totally broken in anything other then basic cases
|
||||
* This really needs a rewrite/refactor its totally broken in anything other then basic cases
|
||||
* Multiple Scenes + Set Scenes & mixing mball basis SHOULD work but fails to update the depsgraph on rename
|
||||
* and linking into scenes or removal of basis mball. so take care when changing this code.
|
||||
*
|
||||
* Main idiot thing here is that the system returns find_basis_mball() objects which fail a is_basis_mball() test.
|
||||
*
|
||||
* Not only that but the depsgraph and ther areas depend on this behavior!, so making small fixes here isnt worth it.
|
||||
* - campbell
|
||||
* Not only that but the depsgraph and their areas depend on this behavior!, so making small fixes here isn't worth it.
|
||||
* - Campbell
|
||||
*/
|
||||
|
||||
|
||||
@ -725,7 +725,7 @@ void accum_mballfaces(int i1, int i2, int i3, int i4)
|
||||
|
||||
cur= indices+4*curindex;
|
||||
|
||||
/* diplists now support array drawing, we treat trias as fake quad */
|
||||
/* displists now support array drawing, we treat tri's as fake quad */
|
||||
|
||||
cur[0]= i1;
|
||||
cur[1]= i2;
|
||||
@ -1315,7 +1315,7 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
|
||||
dy = pos.y - neg.y;
|
||||
dz = pos.z - neg.z;
|
||||
|
||||
/* Aproximation by linear interpolation is faster then binary subdivision,
|
||||
/* Approximation by linear interpolation is faster then binary subdivision,
|
||||
* but it results sometimes (mb->thresh < 0.2) into the strange results */
|
||||
if((mb->thresh > 0.2f) && (f==1)){
|
||||
if((dy == 0.0f) && (dz == 0.0f)){
|
||||
@ -1625,7 +1625,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
|
||||
}
|
||||
}
|
||||
|
||||
/* when metaball object hase zero scale, then MetaElem ot this MetaBall
|
||||
/* when metaball object has zero scale, then MetaElem to this MetaBall
|
||||
* will not be put to mainb array */
|
||||
if(bob->size[0]==0.0f || bob->size[1]==0.0f || bob->size[2]==0.0f) {
|
||||
zero_size= 1;
|
||||
|
@ -2627,7 +2627,7 @@ void comment(Text *text)
|
||||
|
||||
if (!text) return;
|
||||
if (!text->curl) return;
|
||||
if (!text->sell) return;// Need to change this need to check if only one line is selected ot more then one
|
||||
if (!text->sell) return;// Need to change this need to check if only one line is selected to more then one
|
||||
|
||||
num = 0;
|
||||
while (TRUE)
|
||||
|
@ -86,10 +86,10 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
|
||||
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
|
||||
* */
|
||||
|
||||
int isect_line_line_v3(float v1[3], float v2[3],
|
||||
float v3[3], float v4[3], float i1[3], float i2[3]);
|
||||
int isect_line_line_strict_v3(float v1[3], float v2[3],
|
||||
float v3[3], float v4[3], float vi[3], float *lambda);
|
||||
int isect_line_line_v3(const float v1[3], const float v2[3],
|
||||
const float v3[3], const float v4[3], float i1[3], float i2[3]);
|
||||
int isect_line_line_strict_v3(const float v1[3], const float v2[3],
|
||||
const float v3[3], const float v4[3], float vi[3], float *lambda);
|
||||
|
||||
/* line/ray triangle */
|
||||
int isect_line_tri_v3(const float p1[3], const float p2[3],
|
||||
|
@ -897,7 +897,7 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3]
|
||||
* 1 - lines are coplanar, i1 is set to intersection
|
||||
* 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
|
||||
* */
|
||||
int isect_line_line_v3(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3])
|
||||
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float i1[3], float i2[3])
|
||||
{
|
||||
float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3];
|
||||
float d;
|
||||
@ -961,7 +961,7 @@ int isect_line_line_v3(float v1[3], float v2[3], float v3[3], float v4[3], float
|
||||
/* Intersection point strictly between the two lines
|
||||
* 0 when no intersection is found
|
||||
* */
|
||||
int isect_line_line_strict_v3(float v1[3], float v2[3], float v3[3], float v4[3], float vi[3], float *lambda)
|
||||
int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float vi[3], float *lambda)
|
||||
{
|
||||
float a[3], b[3], c[3], ab[3], cb[3], ca[3], dir1[3], dir2[3];
|
||||
float d;
|
||||
|
@ -515,7 +515,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac)
|
||||
|
||||
/* run the given check on the 3 handles
|
||||
* - check should be a macro, which takes the handle index as its single arg, which it substitutes later
|
||||
* - requires that a var, of type short, is named 'ok', and has been initialised ot 0
|
||||
* - requires that a var, of type short, is named 'ok', and has been initialized to 0
|
||||
*/
|
||||
#define KEYFRAME_OK_CHECKS(check) \
|
||||
{ \
|
||||
|
@ -232,7 +232,7 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
|
||||
if(type==NTREE_COMPOSIT) {
|
||||
Scene *scene= wmn->window->screen->scene;
|
||||
|
||||
/* note that NodeTagIDChanged is alredy called by BKE_image_signal() on all
|
||||
/* note that NodeTagIDChanged is already called by BKE_image_signal() on all
|
||||
* scenes so really this is just to know if the images is used in the compo else
|
||||
* painting on images could become very slow when the compositor is open. */
|
||||
if(NodeTagIDChanged(scene->nodetree, wmn->reference))
|
||||
|
@ -400,7 +400,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
|
||||
if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
||||
|
||||
if(mti->type==eModifierTypeType_OnlyDeform) {
|
||||
/* skip leading modifiers which have been alredy
|
||||
/* skip leading modifiers which have been already
|
||||
handled in sculpt_get_first_deform_matrices */
|
||||
if(mti->deformMatrices && !deformed)
|
||||
continue;
|
||||
|
@ -30,11 +30,86 @@ remove_strict_flags()
|
||||
|
||||
# message(STATUS "Configuring makesrna")
|
||||
|
||||
file(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
|
||||
file(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c")
|
||||
list(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c)
|
||||
list(REMOVE_ITEM DEFSRC ${APISRC})
|
||||
|
||||
# files rna_access.c rna_define.c makesrna.c intentionally excluded.
|
||||
set(DEFSRC
|
||||
rna_ID.c
|
||||
rna_action.c
|
||||
rna_actuator.c
|
||||
rna_animation.c
|
||||
rna_animviz.c
|
||||
rna_armature.c
|
||||
rna_boid.c
|
||||
rna_brush.c
|
||||
rna_camera.c
|
||||
rna_cloth.c
|
||||
rna_color.c
|
||||
rna_constraint.c
|
||||
rna_context.c
|
||||
rna_controller.c
|
||||
rna_curve.c
|
||||
rna_fcurve.c
|
||||
rna_fluidsim.c
|
||||
rna_gpencil.c
|
||||
rna_group.c
|
||||
rna_image.c
|
||||
rna_key.c
|
||||
rna_lamp.c
|
||||
rna_lattice.c
|
||||
rna_main.c
|
||||
rna_material.c
|
||||
rna_mesh.c
|
||||
rna_meta.c
|
||||
rna_modifier.c
|
||||
rna_nla.c
|
||||
rna_nodetree.c
|
||||
rna_object.c
|
||||
rna_object_force.c
|
||||
rna_packedfile.c
|
||||
rna_particle.c
|
||||
rna_pose.c
|
||||
rna_property.c
|
||||
rna_render.c
|
||||
rna_rna.c
|
||||
rna_scene.c
|
||||
rna_screen.c
|
||||
rna_sculpt_paint.c
|
||||
rna_sensor.c
|
||||
rna_sequencer.c
|
||||
rna_smoke.c
|
||||
rna_sound.c
|
||||
rna_space.c
|
||||
rna_test.c
|
||||
rna_text.c
|
||||
rna_texture.c
|
||||
rna_timeline.c
|
||||
rna_ui.c
|
||||
rna_userdef.c
|
||||
rna_vfont.c
|
||||
rna_wm.c
|
||||
rna_world.c
|
||||
)
|
||||
|
||||
set(APISRC
|
||||
rna_action_api.c
|
||||
rna_actuator_api.c
|
||||
rna_animation_api.c
|
||||
rna_armature_api.c
|
||||
rna_controller_api.c
|
||||
rna_fcurve_api.c
|
||||
rna_image_api.c
|
||||
rna_main_api.c
|
||||
rna_material_api.c
|
||||
rna_mesh_api.c
|
||||
rna_object_api.c
|
||||
rna_pose_api.c
|
||||
rna_scene_api.c
|
||||
rna_sensor_api.c
|
||||
rna_sequencer_api.c
|
||||
rna_text_api.c
|
||||
rna_ui_api.c
|
||||
rna_wm_api.c
|
||||
)
|
||||
|
||||
string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
|
||||
set_source_files_properties(GENSRC PROPERTIES GENERATED true)
|
||||
|
||||
|
@ -87,8 +87,8 @@ static void do_distance_matte(bNode *node, float *out, float *in)
|
||||
static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
{
|
||||
/*
|
||||
Losely based on the Sequencer chroma key plug-in, but enhanced to work in other color spaces and
|
||||
uses a differnt difference function (suggested in forums of vfxtalk.com).
|
||||
Loosely based on the Sequencer chroma key plug-in, but enhanced to work in other color spaces and
|
||||
uses a different difference function (suggested in forums of vfxtalk.com).
|
||||
*/
|
||||
CompBuf *workbuf;
|
||||
CompBuf *inbuf;
|
||||
|
@ -304,7 +304,7 @@ static PyObject *blender_reload(PyObject *UNUSED(self), PyObject * module)
|
||||
}
|
||||
else {
|
||||
/* no blender text was found that could import the module
|
||||
* rause the original error from PyImport_ImportModuleEx */
|
||||
* reuse the original error from PyImport_ImportModuleEx */
|
||||
PyErr_Restore(exception, err, tb);
|
||||
}
|
||||
|
||||
@ -326,8 +326,8 @@ PyMethodDef bpy_reload_meth= {"bpy_reload_meth", (PyCFunction)blender_reload, ME
|
||||
* it wont reload scripts between loading different blend files or while making the game.
|
||||
* - use 'clear_all' arg in this case.
|
||||
*
|
||||
* Since pythons bultins include a full path even for win32.
|
||||
* even if we remove a python module a reimport will bring it back again.
|
||||
* Since pythons built-ins include a full path even for win32.
|
||||
* even if we remove a python module a re-import will bring it back again.
|
||||
*/
|
||||
|
||||
#if 0 // not used anymore but may still come in handy later
|
||||
|
@ -129,7 +129,7 @@ static PyObject *bpy_prop_deferred_return(PyObject *func, PyObject *kw)
|
||||
}
|
||||
|
||||
/* this define runs at the start of each function and deals with
|
||||
* returning a deferred property (to be registed later) */
|
||||
* returning a deferred property (to be registered later) */
|
||||
#define BPY_PROPDEF_HEAD(_func) \
|
||||
if (PyTuple_GET_SIZE(args) == 1) { \
|
||||
PyObject *ret; \
|
||||
@ -948,7 +948,7 @@ PyObject *BPY_rna_props( void )
|
||||
|
||||
/* INCREF since its its assumed that all these functions return the
|
||||
* module with a new ref like PyDict_New, since they are passed to
|
||||
* PyModule_AddObject which steals a ref */
|
||||
* PyModule_AddObject which steals a ref */
|
||||
Py_INCREF(submodule);
|
||||
|
||||
/* api needs the PyObjects internally */
|
||||
|
@ -144,7 +144,7 @@ struct GHash *id_weakref_pool= NULL;
|
||||
static PyObject *id_free_weakref_cb(PyObject *weakinfo_pair, PyObject *weakref);
|
||||
static PyMethodDef id_free_weakref_cb_def= {"id_free_weakref_cb", (PyCFunction)id_free_weakref_cb, METH_O, NULL};
|
||||
|
||||
/* adds a reference to the list, remember ot decref */
|
||||
/* adds a reference to the list, remember to decref */
|
||||
static GHash *id_weakref_pool_get(ID *id)
|
||||
{
|
||||
GHash *weakinfo_hash= NULL;
|
||||
@ -548,7 +548,7 @@ static short pyrna_rotation_euler_order_get(PointerRNA *ptr, PropertyRNA **prop_
|
||||
#endif // USE_MATHUTILS
|
||||
|
||||
/* note that PROP_NONE is included as a vector subtype. this is because its handy to
|
||||
* have x/y access to fcurve keyframes and other fixed size float arrayas of length 2-4. */
|
||||
* have x/y access to fcurve keyframes and other fixed size float arrays of length 2-4. */
|
||||
#define PROP_ALL_VECTOR_SUBTYPES PROP_COORDS: case PROP_TRANSLATION: case PROP_DIRECTION: case PROP_VELOCITY: case PROP_ACCELERATION: case PROP_XYZ: case PROP_XYZ_LENGTH
|
||||
|
||||
PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
|
||||
@ -573,7 +573,7 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
|
||||
|
||||
if (totdim == 1 || (totdim == 2 && subtype == PROP_MATRIX)) {
|
||||
if(!is_thick)
|
||||
ret= pyrna_prop_CreatePyObject(ptr, prop); /* owned by the Mathutils PyObject */
|
||||
ret= pyrna_prop_CreatePyObject(ptr, prop); /* owned by the mathutils PyObject */
|
||||
|
||||
switch(RNA_property_subtype(prop)) {
|
||||
case PROP_ALL_VECTOR_SUBTYPES:
|
||||
@ -668,7 +668,7 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
|
||||
ret= pyrna_prop_array_subscript_slice(NULL, ptr, prop, 0, len, len);
|
||||
}
|
||||
else {
|
||||
ret= pyrna_prop_CreatePyObject(ptr, prop); /* owned by the Mathutils PyObject */
|
||||
ret= pyrna_prop_CreatePyObject(ptr, prop); /* owned by the mathutils PyObject */
|
||||
}
|
||||
}
|
||||
#else // USE_MATHUTILS
|
||||
@ -1670,7 +1670,7 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* see if we can coorce into a python type - PropertyType */
|
||||
/* see if we can coerce into a python type - PropertyType */
|
||||
switch (RNA_property_type(prop)) {
|
||||
case PROP_BOOLEAN:
|
||||
{
|
||||
@ -1744,7 +1744,7 @@ static Py_ssize_t pyrna_prop_collection_length(BPy_PropertyRNA *self)
|
||||
return RNA_property_collection_length(&self->ptr, self->prop);
|
||||
}
|
||||
|
||||
/* bool funcs are for speed, so we can avoid getting the length
|
||||
/* bool functions are for speed, so we can avoid getting the length
|
||||
* of 1000's of items in a linked list for eg. */
|
||||
static int pyrna_prop_array_bool(BPy_PropertyRNA *self)
|
||||
{
|
||||
@ -1885,7 +1885,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
|
||||
|
||||
tuple= PyTuple_New(stop - start);
|
||||
|
||||
/* PYRNA_PROP_CHECK_OBJ(self) isnt needed, internal use only */
|
||||
/* PYRNA_PROP_CHECK_OBJ(self) isn't needed, internal use only */
|
||||
|
||||
totdim= RNA_property_array_dimension(ptr, prop, NULL);
|
||||
|
||||
@ -2177,7 +2177,7 @@ static int prop_subscript_ass_array_int(BPy_PropertyArrayRNA *self, Py_ssize_t k
|
||||
if(keynum >= 0 && keynum < len)
|
||||
return pyrna_py_to_prop_array_index(self, keynum, value);
|
||||
|
||||
PyErr_SetString(PyExc_IndexError, "bpy_prop_array[index]= value: index out of range");
|
||||
PyErr_SetString(PyExc_IndexError, "bpy_prop_array[index] = value: index out of range");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2309,7 +2309,7 @@ static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value)
|
||||
}
|
||||
|
||||
if(RNA_struct_idprops_check(self->ptr.type)==0) {
|
||||
PyErr_SetString(PyExc_TypeError, "bpy_struct: this type doesnt support IDProperties");
|
||||
PyErr_SetString(PyExc_TypeError, "bpy_struct: this type doesn't support IDProperties");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2965,7 +2965,7 @@ static PyObject *pyrna_struct_meta_idprop_getattro(PyObject *cls, PyObject *attr
|
||||
* >>> bpy.types.Scene.foo= BoolProperty()
|
||||
* >>> bpy.types.Scene.foo
|
||||
* <bpy_struct, BooleanProperty("foo")>
|
||||
* ...rather then returning the defered class register tuple as checked by pyrna_is_deferred_prop()
|
||||
* ...rather then returning the deferred class register tuple as checked by pyrna_is_deferred_prop()
|
||||
*
|
||||
* Disable for now, this is faking internal behavior in a way thats too tricky to maintain well. */
|
||||
#if 0
|
||||
@ -3024,9 +3024,9 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb
|
||||
* but gets confusing from script writers POV if the assigned value cant be read back. */
|
||||
}
|
||||
else {
|
||||
/* remove existing property if its set or we also end up with confusement */
|
||||
/* remove existing property if its set or we also end up with confusion */
|
||||
const char *attr_str= _PyUnicode_AsString(attr);
|
||||
RNA_def_property_free_identifier(srna, attr_str); /* ignore on failier */
|
||||
RNA_def_property_free_identifier(srna, attr_str); /* ignore on failure */
|
||||
}
|
||||
}
|
||||
else { /* __delattr__ */
|
||||
@ -3540,7 +3540,7 @@ static int foreach_parse_args(
|
||||
}
|
||||
|
||||
/* check 'attr_tot' otherwise we dont know if any values were set
|
||||
* this isnt ideal because it means running on an empty list may fail silently when its not compatible. */
|
||||
* this isn't ideal because it means running on an empty list may fail silently when its not compatible. */
|
||||
if (*size == 0 && *attr_tot != 0) {
|
||||
PyErr_SetString(PyExc_AttributeError, "attribute does not support foreach method");
|
||||
return -1;
|
||||
@ -3705,7 +3705,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
|
||||
if(PyErr_Occurred()) {
|
||||
/* Maybe we could make our own error */
|
||||
PyErr_Print();
|
||||
PyErr_SetString(PyExc_TypeError, "could not access the py sequence");
|
||||
PyErr_SetString(PyExc_TypeError, "couldn't access the py sequence");
|
||||
return NULL;
|
||||
}
|
||||
if (!ok) {
|
||||
@ -3719,13 +3719,13 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
|
||||
static char pyrna_prop_collection_foreach_get_doc[] =
|
||||
".. method:: foreach_get(attr, seq)\n"
|
||||
"\n"
|
||||
" This is a function to give fast access to attribites within a collection.\n"
|
||||
" This is a function to give fast access to attributes within a collection.\n"
|
||||
"\n"
|
||||
" .. code-block:: python\n"
|
||||
"\n"
|
||||
" collection.foreach_get(someseq, attr)\n"
|
||||
"\n"
|
||||
" # Python equivelent\n"
|
||||
" # Python equivalent\n"
|
||||
" for i in range(len(seq)): someseq[i]= getattr(collection, attr)\n"
|
||||
"\n"
|
||||
;
|
||||
@ -3739,13 +3739,13 @@ static PyObject *pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObje
|
||||
static char pyrna_prop_collection_foreach_set_doc[] =
|
||||
".. method:: foreach_set(attr, seq)\n"
|
||||
"\n"
|
||||
" This is a function to give fast access to attribites within a collection.\n"
|
||||
" This is a function to give fast access to attributes within a collection.\n"
|
||||
"\n"
|
||||
" .. code-block:: python\n"
|
||||
"\n"
|
||||
" collection.foreach_set(seq, attr)\n"
|
||||
"\n"
|
||||
" # Python equivelent\n"
|
||||
" # Python equivalent\n"
|
||||
" for i in range(len(seq)): setattr(collection[i], attr, seq[i])\n"
|
||||
"\n"
|
||||
;
|
||||
@ -3872,7 +3872,7 @@ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *
|
||||
}
|
||||
else if (PyType_IsSubtype(Py_TYPE(base), &pyrna_struct_Type)) {
|
||||
/* this almost never runs, only when using user defined subclasses of built-in object.
|
||||
* this isnt common since its NOT related to registerable subclasses. eg:
|
||||
* this isn't common since its NOT related to registerable subclasses. eg:
|
||||
|
||||
>>> class MyObSubclass(bpy.types.Object):
|
||||
... def test_func(self):
|
||||
@ -4196,7 +4196,7 @@ static PyObject *pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
|
||||
err= pyrna_py_to_prop(&funcptr, parm, iter.data, item, "");
|
||||
|
||||
if(err!=0) {
|
||||
/* the error generated isnt that useful, so generate it again with a useful prefix
|
||||
/* the error generated isn't that useful, so generate it again with a useful prefix
|
||||
* could also write a function to prepend to error messages */
|
||||
char error_prefix[512];
|
||||
PyErr_Clear(); /* re-raise */
|
||||
@ -4214,7 +4214,7 @@ static PyObject *pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
|
||||
|
||||
RNA_parameter_list_end(&iter);
|
||||
|
||||
/* Check if we gave args that dont exist in the function
|
||||
/* Check if we gave args that don't exist in the function
|
||||
* printing the error is slow but it should only happen when developing.
|
||||
* the if below is quick, checking if it passed less keyword args then we gave.
|
||||
* (Dont overwrite the error if we have one, otherwise can skip important messages and confuse with args)
|
||||
@ -5018,7 +5018,7 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna)
|
||||
/* Not 100% needed but useful,
|
||||
* having an instance within a type looks wrong however this instance IS an rna type */
|
||||
|
||||
/* python deals with the curcular ref */
|
||||
/* python deals with the circular ref */
|
||||
RNA_pointer_create(NULL, &RNA_Struct, srna, &ptr);
|
||||
item= pyrna_struct_CreatePyObject(&ptr);
|
||||
|
||||
@ -5116,7 +5116,7 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna)
|
||||
/* stupid/simple case */
|
||||
if (srna == NULL) {
|
||||
newclass= NULL; /* Nothing to do */
|
||||
} /* the class may have alredy been declared & allocated */
|
||||
} /* the class may have already been declared & allocated */
|
||||
else if ((newclass= RNA_struct_py_type_get(srna))) {
|
||||
Py_INCREF(newclass);
|
||||
} /* check if bpy_types.py module has the class defined in it */
|
||||
@ -5124,9 +5124,9 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna)
|
||||
pyrna_subtype_set_rna(newclass, srna);
|
||||
Py_INCREF(newclass);
|
||||
} /* create a new class instance with the C api
|
||||
* maintly for the purposing of matching the C/rna type hierarchy */
|
||||
* mainly for the purposing of matching the C/rna type hierarchy */
|
||||
else {
|
||||
/* subclass equivelents
|
||||
/* subclass equivalents
|
||||
- class myClass(myBase):
|
||||
some='value' # or ...
|
||||
- myClass= type(name='myClass', bases=(myBase,), dict={'__module__':'bpy.types'})
|
||||
@ -5356,7 +5356,7 @@ PyObject *BPY_rna_doc(void)
|
||||
#endif
|
||||
|
||||
|
||||
/* pyrna_basetype_* - BPy_BaseTypeRNA is just a BPy_PropertyRNA struct with a differnt type
|
||||
/* pyrna_basetype_* - BPy_BaseTypeRNA is just a BPy_PropertyRNA struct with a different type
|
||||
* the self->ptr and self->prop are always set to the "structs" collection */
|
||||
//---------------getattr--------------------------------------------
|
||||
static PyObject *pyrna_basetype_getattro(BPy_BaseTypeRNA *self, PyObject *pyname)
|
||||
@ -5614,7 +5614,7 @@ static int pyrna_deferred_register_class_recursive(StructRNA *srna, PyTypeObject
|
||||
PyTypeObject *py_superclass= (PyTypeObject *)PyTuple_GET_ITEM(py_class->tp_bases, i);
|
||||
|
||||
/* the rules for using these base classes are not clear,
|
||||
* 'object' is ofcourse not worth looking into and
|
||||
* 'object' is of course not worth looking into and
|
||||
* existing subclasses of RNA would cause a lot more dictionary
|
||||
* looping then is needed (SomeOperator would scan Operator.__dict__)
|
||||
* which is harmless but not at all useful.
|
||||
@ -5875,7 +5875,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
* Although this is annoying to have to impliment a part of pythons typeobject.c:type_call().
|
||||
*/
|
||||
if(py_class->tp_init) {
|
||||
/* true in most cases even when the class its self doesnt define an __init__ function. */
|
||||
/* true in most cases even when the class its self doesn't define an __init__ function. */
|
||||
args= PyTuple_New(0);
|
||||
if (py_class->tp_init(py_srna, args, NULL) < 0) {
|
||||
Py_DECREF(py_srna);
|
||||
@ -5888,7 +5888,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
py_class_instance= py_srna;
|
||||
|
||||
#else
|
||||
/* 'almost' all the time calling the class isnt needed.
|
||||
/* 'almost' all the time calling the class isn't needed.
|
||||
* We could just do...
|
||||
py_class_instance= py_srna;
|
||||
Py_INCREF(py_class_instance);
|
||||
@ -5977,7 +5977,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* the error may be alredy set if the class instance couldnt be created */
|
||||
/* the error may be already set if the class instance couldn't be created */
|
||||
if(err != -1) {
|
||||
PyErr_Format(PyExc_RuntimeError, "could not create instance of %.200s to call callback function %.200s", RNA_struct_identifier(ptr->type), RNA_function_identifier(func));
|
||||
err= -1;
|
||||
@ -6140,7 +6140,7 @@ void pyrna_free_types(void)
|
||||
* There is currently a bug where moving registering a python class does
|
||||
* not properly manage refcounts from the python class, since the srna owns
|
||||
* the python class this should not be so tricky but changing the references as
|
||||
* youd expect when changing ownership crashes blender on exit so I had to comment out
|
||||
* you'd expect when changing ownership crashes blender on exit so I had to comment out
|
||||
* the decref. This is not so bad because the leak only happens when re-registering (hold F8)
|
||||
* - Should still be fixed - Campbell
|
||||
* */
|
||||
@ -6178,7 +6178,7 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
|
||||
/* fails in cases, cant use this check but would like to :| */
|
||||
/*
|
||||
if(RNA_struct_py_type_get(srna)) {
|
||||
PyErr_Format(PyExc_ValueError, "register_class(...): %.200s's parent class %.200s is alredy registered, this is not allowed", ((PyTypeObject*)py_class)->tp_name, RNA_struct_identifier(srna));
|
||||
PyErr_Format(PyExc_ValueError, "register_class(...): %.200s's parent class %.200s is already registered, this is not allowed", ((PyTypeObject*)py_class)->tp_name, RNA_struct_identifier(srna));
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
@ -6214,7 +6214,7 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
|
||||
/* old srna still references us, keep the check incase registering somehow can free it */
|
||||
if(RNA_struct_py_type_get(srna)) {
|
||||
RNA_struct_py_type_set(srna, NULL);
|
||||
// Py_DECREF(py_class); // shuld be able to do this XXX since the old rna adds a new ref.
|
||||
// Py_DECREF(py_class); // should be able to do this XXX since the old rna adds a new ref.
|
||||
}
|
||||
|
||||
/* Can't use this because it returns a dict proxy
|
||||
|
@ -98,7 +98,7 @@ short BPy_errors_to_report(ReportList *reports)
|
||||
pystring= PyC_ExceptionBuffer();
|
||||
|
||||
if(pystring==NULL) {
|
||||
BKE_report(reports, RPT_ERROR, "unknown py-exception, could not convert");
|
||||
BKE_report(reports, RPT_ERROR, "unknown py-exception, couldn't convert");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user