code cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,
authorCampbell Barton <ideasman42@gmail.com>
Fri, 15 Mar 2013 10:48:48 +0000 (10:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 15 Mar 2013 10:48:48 +0000 (10:48 +0000)
also correct odd indentation.

19 files changed:
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/rigidbody.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/AnimationExporter.h
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/MeshImporter.h
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada.h
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/python/bmesh/bmesh_py_ops_call.c
source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h

index 9b43d0f14714f52c0a2eae0eef2e693818ca1cf9..aff63eccce3b2c775477d6f54796f50abe51a4ce 100644 (file)
@@ -169,7 +169,7 @@ int BKE_mesh_nurbs_displist_to_mdata(struct Object *ob, struct ListBase *dispbas
                                      struct MLoopUV **alluv, int *_totloop, int *_totpoly);
 void BKE_mesh_from_nurbs_displist(struct Object *ob, struct ListBase *dispbase, int use_orco_uv);
 void BKE_mesh_from_nurbs(struct Object *ob);
-void BKE_mesh_to_curve_ex(struct DerivedMesh *dm, struct ListBase *nurblist);
+void BKE_mesh_to_curve_nurblist(struct DerivedMesh *dm, struct ListBase *nurblist, const int edge_users_test);
 void BKE_mesh_to_curve(struct Scene *scene, struct Object *ob);
 void BKE_mesh_delete_material_index(struct Mesh *me, short index);
 void BKE_mesh_smooth_flag_set(struct Object *meshOb, int enableSmooth);
index 77ea856d73cc74148891e9830390ae6776b16252..a7311d5efc73bb0a77ed6eea4bd2c0b02150d11c 100644 (file)
@@ -788,7 +788,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
                                                
                                                verts->goal  = powf(verts->goal, 4.0f);
                                                if ( verts->goal >= SOFTGOALSNAP )
-                                                        verts->flags |= CLOTH_VERT_FLAG_PINNED;
+                                                       verts->flags |= CLOTH_VERT_FLAG_PINNED;
                                        }
                                        
                                        if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING ) {
index cad9e8cfbc6ac35c3d1f4378d5541c9b5d6b7ce9..c27f5e625206b175974f6d755677ab116637006b 100644 (file)
@@ -1946,7 +1946,7 @@ int BKE_imbuf_write(ImBuf *ibuf, const char *name, ImageFormatData *imf)
        else if (imtype == R_IMF_IMTYPE_DPX) {
                ibuf->ftype = DPX;
                if (imf->cineon_flag & R_IMF_CINEON_FLAG_LOG) {
-                 ibuf->ftype |= CINEON_LOG;
+                       ibuf->ftype |= CINEON_LOG;
                }
                if (imf->depth == R_IMF_CHAN_DEPTH_16) {
                        ibuf->ftype |= CINEON_16BIT;
index 1b2af2fb501b90f07cb04cf437cfe1043f492547..f48e7856959392ff7c20146605a3f208504bcf9a 100644 (file)
@@ -1586,7 +1586,7 @@ static void appendPolyLineVert(ListBase *lb, unsigned int index)
        BLI_addtail(lb, vl);
 }
 
-void BKE_mesh_to_curve_ex(DerivedMesh *dm, ListBase *nurblist)
+void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int edge_users_test)
 {
        MVert *mverts = dm->getVertArray(dm);
        MEdge *med, *medge = dm->getEdgeArray(dm);
@@ -1616,10 +1616,8 @@ void BKE_mesh_to_curve_ex(DerivedMesh *dm, ListBase *nurblist)
        /* create edges from all faces (so as to find edges not in any faces) */
        med = medge;
        for (i = 0; i < totedge; i++, med++) {
-               if (edge_users[i] == 0) {
+               if (edge_users[i] == edge_users_test) {
                        EdgeLink *edl = MEM_callocN(sizeof(EdgeLink), "EdgeLink");
-
-                       // BLI_edgehash_insert(eh_edge, med->v1, med->v2, NULL);
                        edl->edge = med;
 
                        BLI_addtail(&edges, edl);   totedges++;
@@ -1728,7 +1726,7 @@ void BKE_mesh_to_curve(Scene *scene, Object *ob)
        ListBase nurblist = {NULL, NULL};
        bool needsFree = false;
 
-       BKE_mesh_to_curve_ex(dm, &nurblist);
+       BKE_mesh_to_curve_nurblist(dm, &nurblist, 0);
 
        if (nurblist.first) {
                Curve *cu = BKE_curve_add(G.main, ob->id.name + 2, OB_CURVE);
index f9bd202d64f6232a891145560f02cfe6113e7092..bccc6f9a93b68a80ee17bc3734430babc6269bdf 100644 (file)
@@ -637,12 +637,12 @@ void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, shor
                                                RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Z, 0.0f, -1.0f);
                                        break;
                                case RBC_TYPE_MOTOR:
-                                   rbc->physics_constraint = RB_constraint_new_motor(loc, rot, rb1, rb2);
+                                       rbc->physics_constraint = RB_constraint_new_motor(loc, rot, rb1, rb2);
 
-                                   RB_constraint_set_enable_motor(rbc->physics_constraint, rbc->flag & RBC_FLAG_USE_MOTOR_LIN, rbc->flag & RBC_FLAG_USE_MOTOR_ANG);
+                                       RB_constraint_set_enable_motor(rbc->physics_constraint, rbc->flag & RBC_FLAG_USE_MOTOR_LIN, rbc->flag & RBC_FLAG_USE_MOTOR_ANG);
                                        RB_constraint_set_max_impulse_motor(rbc->physics_constraint, rbc->motor_lin_max_impulse, rbc->motor_ang_max_impulse);
                                        RB_constraint_set_target_velocity_motor(rbc->physics_constraint, rbc->motor_lin_target_velocity, rbc->motor_ang_target_velocity);
-                                   break;
+                                       break;
                        }
                }
                else { /* can't create constraint without both rigid bodies */
index f2e81f0d6a4323bd8af044eb060f49d0e65f5439..9b276912087bad65c15c8f2c884d617a583554d4 100644 (file)
@@ -4072,7 +4072,7 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad
 
        if (sound == NULL || sound->playback_handle == NULL) {
 #if 0
-                if (op)
+               if (op)
                        BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
 #endif
 
index 01d4696de94dcbd4b81faec4decafe407b501534..8e5e0da20f927802c2c256037258a034389d9f3b 100644 (file)
@@ -200,18 +200,18 @@ static float sb_time_scale(Object *ob)
        SoftBody *sb= ob->soft; /* is supposed to be there */
        if (sb) {
                return(sb->physics_speed);
-               /*hrms .. this could be IPO as well :)
-                estimated range [0.001 sluggish slug - 100.0 very fast (i hope ODE solver can handle that)]
-                1 approx = a unit 1 pendulum at g = 9.8 [earth conditions]  has period 65 frames
-                theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM)
+               /* hrms .. this could be IPO as well :)
+                estimated range [0.001 sluggish slug - 100.0 very fast (i hope ODE solver can handle that)]
+                1 approx = a unit 1 pendulum at g = 9.8 [earth conditions]  has period 65 frames
+                theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM)
                 */
        }
        return (1.0f);
        /*
-       this would be frames/sec independent timing assuming 25 fps is default
-       but does not work very well with NLA
-               return (25.0f/scene->r.frs_sec)
-       */
+        * this would be frames/sec independent timing assuming 25 fps is default
+        * but does not work very well with NLA
+        * return (25.0f/scene->r.frs_sec)
+        */
 }
 /*--- frame based timing ---*/
 
@@ -1305,7 +1305,7 @@ static int sb_detect_face_collisionCached(float face_v1[3], float face_v2[3], fl
                                                normalize_v3(d_nvect);
                                                if (
                                                        /* isect_line_tri_v3(nv1, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
-                                                        we did that edge already */
+                                                        we did that edge already */
                                                        isect_line_tri_v3(nv3, nv4, face_v1, face_v2, face_v3, &t, NULL) ||
                                                        isect_line_tri_v3(nv4, nv1, face_v1, face_v2, face_v3, &t, NULL) ) {
                                                        Vec3PlusStVec(force, -0.5f, d_nvect);
index 0cf33a798f20445e19238ea6d2438f168dae329b..cef53b6339771b8313f9886682292aa4bcace259 100644 (file)
@@ -6082,7 +6082,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
                                        soops->treestore->totelem = soops->treestore->usedelem;
                                        soops->storeflag |= SO_TREESTORE_CLEANUP;       // at first draw
                                }
-                                soops->tree.first = soops->tree.last= NULL;
+                               soops->tree.first = soops->tree.last= NULL;
                        }
                        else if (sl->spacetype == SPACE_IMAGE) {
                                SpaceImage *sima = (SpaceImage *)sl;
@@ -10412,7 +10412,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                                PackedFile *pf = mainptr->curlib->packedfile;
                                                
                                                BKE_reportf_wrap(basefd->reports, RPT_INFO, TIP_("Read packed library:  '%s'"),
-                                                                                mainptr->curlib->name);
+                                                                mainptr->curlib->name);
                                                fd = blo_openblendermemory(pf->data, pf->size, basefd->reports);
                                                
                                                
@@ -10421,7 +10421,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                        }
                                        else {
                                                BKE_reportf_wrap(basefd->reports, RPT_INFO, TIP_("Read library:  '%s', '%s'"),
-                                                                                mainptr->curlib->filepath, mainptr->curlib->name);
+                                                                mainptr->curlib->filepath, mainptr->curlib->name);
                                                fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
                                        }
                                        /* allow typing in a new lib path */
index 870814ccefd4658f0c2187ad4e196782a7f29f2a..a6f1b89aedb21874e10bbac1832214d9cd855803 100644 (file)
@@ -141,7 +141,7 @@ protected:
        std::string get_semantic_suffix(COLLADASW::InputSemantic::Semantics semantic);
 
        void add_source_parameters(COLLADASW::SourceBase::ParameterNameList& param,
-                                                          COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform);
+                                  COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform);
        
        void get_source_values(BezTriple *bezt, COLLADASW::InputSemantic::Semantics semantic, bool rotation, float *values, int *length);
        
index 221a5008f10686d0617a6aa615f615a3e0a49ee9..ed84dee046fe45dd4ce108c065b448ec068ca67b 100644 (file)
@@ -134,10 +134,10 @@ void ArmatureImporter::create_bone(SkinInfo* skin, COLLADAFW::Node *node, EditBo
 
        // set parent tail
        if (parent && totchild == 1) {
-          copy_v3_v3(parent->tail, bone->head);
+               copy_v3_v3(parent->tail, bone->head);
 
                // not setting BONE_CONNECTED because this would lock child bone location with respect to parent
-                bone->flag |= BONE_CONNECTED;
+               bone->flag |= BONE_CONNECTED;
 
                // XXX increase this to prevent "very" small bones?
                const float epsilon = 0.000001f;
index 751e6faf02ba3a8f7dc65460e17cd8e118a11b3f..5275420f4b5ef9f272964e1fe2c3b59c6e966282 100644 (file)
@@ -154,22 +154,22 @@ public:
        virtual Mesh *get_mesh_by_geom_uid(const COLLADAFW::UniqueId& geom_uid);
        
        MTex *assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBinding &ctexture,
-                                                                        Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
-                                                                        MTex *color_texture);
+                                        Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
+                                        MTex *color_texture);
 
        void optimize_material_assignements();
 
        MTFace *assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial,
-                                                                       std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
-                                                                       Object *ob, const COLLADAFW::UniqueId *geom_uid, 
-                                                                       char *layername, MTFace *texture_face,
-                                                                       std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index);
+                                       std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
+                                       Object *ob, const COLLADAFW::UniqueId *geom_uid,
+                                       char *layername, MTFace *texture_face,
+                                       std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index);
        
        
        Object *create_mesh_object(COLLADAFW::Node *node, COLLADAFW::InstanceGeometry *geom,
-                                                          bool isController,
-                                                          std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
-                                                          std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map);
+                                  bool isController,
+                                  std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
+                                  std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map);
 
        // create a mesh storing a pointer in a map so it can be retrieved later by geometry UID
        bool write_geometry(const COLLADAFW::Geometry* geom);
index aa78d8b9e5d98217e50c279d0629e1f5dfedb81b..e1c324828350a35e1425553d54a1619fad2f8961 100644 (file)
@@ -56,8 +56,9 @@ void TransformWriter::add_node_transform(COLLADASW::Node& node, float mat[4][4],
                // XXX Why are joints handled differently ?
                node.addMatrix("transform", dmat);
        }
-       else
-         add_transform(node, loc, rot, scale);
+       else {
+               add_transform(node, loc, rot, scale);
+       }
 }
 
 void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob, BC_export_transformation_type transformation_type)
index 305e5a69a31aefe707c7f800284e562db12704a2..b3a8156b6fe5fc9d99a8383e468f3e502b6a2fff 100644 (file)
@@ -54,8 +54,8 @@ struct Scene;
  * both return 1 on success, 0 on error
  */
 int collada_import(bContext *C,
-                                  const char *filepath,
-                                  int import_units);
+                   const char *filepath,
+                   int import_units);
 
 int collada_export(Scene *sce,
                    const char *filepath,
@@ -68,10 +68,10 @@ int collada_export(Scene *sce,
                    int include_shapekeys,
                    int deform_bones_only,
 
-                                  int active_uv_only,
-                                  int include_uv_textures,
-                                  int include_material_textures,
-                                  int use_texture_copies,
+                   int active_uv_only,
+                   int include_uv_textures,
+                   int include_material_textures,
+                   int use_texture_copies,
 
                    int triangulate,
                    int use_object_instantiation,
index ed27e12f7ac49d37955d7a20bb0190edbf5befaf..f37b58b9cd9cc5b76d8dd7c2470cc9bc64a9ac6f 100644 (file)
@@ -287,7 +287,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve
                /* XXX: meh, this is round about because
                 * BKE_brush_jitter_pos isn't written in the best way to
                 * be reused here */
-               if(factor != 1.0) {
+               if(factor != 1.0f) {
                        sub_v2_v2v2(delta, mouse_out, mouse_in);
                        mul_v2_fl(delta, factor);
                        add_v2_v2v2(mouse_out, mouse_in, delta);
index 0368bac4fdc2ac1107d76f7353f822195f37f371..fafb5378f69b9cbb5a24efbda960fee299304fd0 100644 (file)
@@ -760,9 +760,9 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node,
        BLI_lock_thread(LOCK_CUSTOM1);
 
        if (ss->bm ||
-               ELEM(type,
-                        SCULPT_UNDO_DYNTOPO_BEGIN,
-                        SCULPT_UNDO_DYNTOPO_END))
+           ELEM(type,
+                SCULPT_UNDO_DYNTOPO_BEGIN,
+                SCULPT_UNDO_DYNTOPO_END))
        {
                /* Dynamic topology stores only one undo node per stroke,
                 * regardless of the number of PBVH nodes modified */
index 38025c771fd1bcaca0feb17c381e149e18bac293..d03d36f68ef9e91a0254ab961c347f5c67c6b5a1 100644 (file)
@@ -732,7 +732,7 @@ static void do_lasso_select_meta(ViewContext *vc, const int mcords[][2], short m
        MetaBall *mb = (MetaBall *)vc->obedit->data;
 
        if (extend == 0 && select)
-                BKE_mball_deselect_all(mb);
+               BKE_mball_deselect_all(mb);
 
        BLI_lasso_boundbox(&rect, mcords, moves);
 
index 0ce98e0b364fa0a0045bb0f89d367b4416b80c96..0204fa5367beaab3d274546216e2675b661d265e 100644 (file)
@@ -595,7 +595,7 @@ void RNA_api_ui_layout(StructRNA *srna)
 
        func = RNA_def_function(srna, "label", "rna_uiItemL");
        RNA_def_function_ui_description(func, "Item. Display text and/or icon in the layout");
-        api_ui_item_common(func);
+       api_ui_item_common(func);
        parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
        RNA_def_property_ui_text(parm, "Icon Value",
                                 "Override automatic icon of the item "
index fad3e4a35cd97baf42513319ea9551f5cfbf7ed5..4d728b76707a8acf43f5b2b1ef0e1161b30666f4 100644 (file)
@@ -727,7 +727,7 @@ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw)
                                return NULL;
                        }
 
-                        slot = BMO_slot_get(bmop.slots_in, slot_name);
+                       slot = BMO_slot_get(bmop.slots_in, slot_name);
 
                        /* now assign the value */
                        if (bpy_slot_from_py(bm, &bmop, slot, value,
index 2a96d4c521611a84e1dd0eca72f45c87a1ab10e0..0ce479cad6f6f93597bec7369022e1bc2886e67c 100644 (file)
@@ -64,7 +64,7 @@ public:
        }
 
        KX_EnumInputs ToNative(unsigned short incode) {
-                return ConvertKeyCode(incode);
+               return ConvertKeyCode(incode);
        }
 
        virtual bool    IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)=0;