code cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,

also correct odd indentation.
This commit is contained in:
Campbell Barton 2013-03-15 10:48:48 +00:00
parent 9d060b0333
commit 0807c976f4
19 changed files with 51 additions and 52 deletions

@ -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);

@ -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 ) {

@ -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;

@ -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);

@ -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 */

@ -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

@ -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);

@ -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 */

@ -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);

@ -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;

@ -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);

@ -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)

@ -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,

@ -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);

@ -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 */

@ -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);

@ -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 "

@ -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,

@ -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;