diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-12-12 13:15:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-12-12 13:18:03 +0300 |
commit | cea086dd97ce9794bed0c9e6293031b6cf2fc9d9 (patch) | |
tree | 9cfd4865bbae1c88946097b120ef50fa637e9d10 /source | |
parent | 19eb700fefa3d6f1151bae8078edeabd75f11dc2 (diff) |
cleanup: disallow NULL arg to uvedit_aspect
also some typo's
Diffstat (limited to 'source')
4 files changed, 14 insertions, 17 deletions
diff --git a/source/blender/editors/mesh/editmesh_intersect.c b/source/blender/editors/mesh/editmesh_intersect.c index 64d31637b52..e2e4638254b 100644 --- a/source/blender/editors/mesh/editmesh_intersect.c +++ b/source/blender/editors/mesh/editmesh_intersect.c @@ -333,7 +333,7 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op)) BMVert *v_other = BM_edge_other_vert(e, v); float e_dir[3]; - /* we wan't closest to zero */ + /* we want closest to zero */ float dot_best = FLT_MAX; sub_v3_v3v3(e_dir, v_other->co, v->co); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 63808704781..8ab9feb5b0a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1288,7 +1288,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag) /** * \note regarding hashing dupli-objects, skip the first member of #DupliObject.persistent_id - * since its a unique index and we only wan't to know if the group objects are from the same dupli-group instance. + * since its a unique index and we only want to know if the group objects are from the same dupli-group instance. */ static unsigned int dupliobject_hash(const void *ptr) { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index ca19bb74472..79262396fb4 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -733,7 +733,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], v_pair_swap = true; } else if (eed && BM_edge_is_boundary(eed)) { - /* pradictable direction for boundary edges */ + /* predictable direction for boundary edges */ if (eed->l->v != v_pair[0]) { v_pair_swap = true; } diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index ed5919149f4..be618c5d1a3 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -94,19 +94,16 @@ static void rna_Scene_frame_set(Scene *scene, int frame, float subframe) static void rna_Scene_uvedit_aspect(Scene *scene, Object *ob, float *aspect) { - BMEditMesh *em; - if (!(ob && ob->type == OB_MESH && ob->mode == OB_MODE_EDIT)) { - aspect[0] = aspect[1]= 1.0f; - return; + if ((ob->type == OB_MESH) && (ob->mode == OB_MODE_EDIT)) { + BMEditMesh *em; + em = BKE_editmesh_from_object(ob); + if (EDBM_mtexpoly_check(em)) { + ED_uvedit_get_aspect(scene, ob, em->bm, aspect, aspect + 1); + return; + } } - - em = BKE_editmesh_from_object(ob); - if (!EDBM_mtexpoly_check(em)) { - aspect[0] = aspect[1]= 1.0f; - return; - } - - ED_uvedit_get_aspect(scene, ob, em->bm, aspect, aspect + 1); + + aspect[0] = aspect[1] = 1.0f; } static void rna_Scene_update_tagged(Scene *scene) @@ -213,9 +210,9 @@ void RNA_api_scene(StructRNA *srna) func = RNA_def_function(srna, "uvedit_aspect", "rna_Scene_uvedit_aspect"); RNA_def_function_ui_description(func, "Get uv aspect for current object"); parm = RNA_def_pointer(func, "object", "Object", "", "Object"); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); - parm = RNA_def_float_vector(func, "aspect", 2, NULL, 0.0f, FLT_MAX, "", "aspect", 0.0f, FLT_MAX); + parm = RNA_def_float_vector(func, "result", 2, NULL, 0.0f, FLT_MAX, "", "aspect", 0.0f, FLT_MAX); RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_function_output(func, parm); |