[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54435] trunk/blender/source/blender: style cleanup
Campbell Barton
ideasman42 at gmail.com
Sun Feb 10 18:06:06 CET 2013
Revision: 54435
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54435
Author: campbellbarton
Date: 2013-02-10 17:06:05 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
style cleanup
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/scanfill.c
trunk/blender/source/blender/collada/AnimationExporter.cpp
trunk/blender/source/blender/collada/ArmatureExporter.cpp
trunk/blender/source/blender/collada/ArmatureImporter.cpp
trunk/blender/source/blender/collada/ControllerExporter.cpp
trunk/blender/source/blender/collada/DocumentImporter.cpp
trunk/blender/source/blender/collada/GeometryExporter.cpp
trunk/blender/source/blender/collada/MeshImporter.h
trunk/blender/source/blender/collada/SceneExporter.cpp
trunk/blender/source/blender/collada/TransformReader.cpp
trunk/blender/source/blender/collada/collada_utils.cpp
trunk/blender/source/blender/editors/io/io_collada.c
trunk/blender/source/blender/editors/sculpt_paint/sculpt_intern.h
trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
trunk/blender/source/blender/imbuf/intern/colormanagement.c
Modified: trunk/blender/source/blender/blenlib/intern/scanfill.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/scanfill.c 2013-02-10 15:59:29 UTC (rev 54434)
+++ trunk/blender/source/blender/blenlib/intern/scanfill.c 2013-02-10 17:06:05 UTC (rev 54435)
@@ -325,7 +325,9 @@
fac1 = 1.0e10f * (eed->v2->xy[0] - x);
}
- else fac1 = (x - eed->v2->xy[0]) / fac1;
+ else {
+ fac1 = (x - eed->v2->xy[0]) / fac1;
+ }
for (ed = sc->edge_first; ed; ed = ed->next) {
@@ -649,7 +651,9 @@
if (ed1->v1->h > 1) ed1->v1->h--;
if (ed1->v2->h > 1) ed1->v2->h--;
}
- else ed1->v2->f = SF_VERT_UNKNOWN;
+ else {
+ ed1->v2->f = SF_VERT_UNKNOWN;
+ }
ed1 = nexted;
}
@@ -682,7 +686,6 @@
if (v1 == v2 || v2 == v3) break;
/* printf("test verts %x %x %x\n", v1, v2, v3); */
miny = min_ff(v1->xy[1], v3->xy[1]);
- /* miny = min_ff(v1->xy[1], v3->xy[1]); */
sc1 = sc + 1;
test = 0;
Modified: trunk/blender/source/blender/collada/AnimationExporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/AnimationExporter.cpp 2013-02-10 15:59:29 UTC (rev 54434)
+++ trunk/blender/source/blender/collada/AnimationExporter.cpp 2013-02-10 17:06:05 UTC (rev 54435)
@@ -161,9 +161,9 @@
FCurve *fcu;
char *transformName;
Key *key = BKE_key_from_object(ob);
- if(!key) return;
+ if (!key) return;
- if(key->adt && key->adt->action){
+ if (key->adt && key->adt->action) {
fcu = (FCurve *)key->adt->action->curves.first;
while (fcu) {
@@ -177,17 +177,17 @@
}
-void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<float> &frames ){
-
+void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<float> &frames )
+{
ListBase *conlist = get_active_constraints(ob);
- if(conlist == NULL) return;
+ if (conlist == NULL) return;
bConstraint *con;
for (con = (bConstraint*)conlist->first; con; con = con->next) {
ListBase targets = {NULL, NULL};
bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
- if(!validateConstraints(con)) continue;
+ if (!validateConstraints(con)) continue;
if (cti && cti->get_constraint_targets) {
bConstraintTarget *ct;
@@ -197,8 +197,8 @@
* - ct->matrix members have not yet been calculated here!
*/
cti->get_constraint_targets(con, &targets);
- if(cti){
- for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next){
+ if (cti) {
+ for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
obtar = ct->tar;
find_frames(obtar, frames);
}
@@ -901,7 +901,7 @@
bPoseChannel *parchan = NULL;
bPoseChannel *pchan = NULL;
- if (ob->type == OB_ARMATURE ){
+ if (ob->type == OB_ARMATURE ) {
bPose *pose = ob->pose;
pchan = BKE_pose_channel_find_name(pose, bone->name);
if (!pchan)
@@ -922,15 +922,15 @@
//BKE_scene_update_for_newframe(G.main,scene,scene->lay);
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL);
- if (bone){
- if( pchan->flag & POSE_CHAIN)
- {
+ if (bone) {
+ if (pchan->flag & POSE_CHAIN) {
enable_fcurves(ob->adt->action, NULL);
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL);
BKE_pose_where_is(scene, ob);
}
- else
- BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
+ else {
+ BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
+ }
// compute bone local mat
if (bone->parent) {
@@ -1324,9 +1324,9 @@
}
//check shape key animation
- if(!fcu){
+ if (!fcu) {
Key *key = BKE_key_from_object(ob);
- if(key && key->adt && key->adt->action)
+ if (key && key->adt && key->adt->action)
fcu = (FCurve *)key->adt->action->curves.first;
}
if (fcu)
@@ -1497,8 +1497,8 @@
enable_fcurves(ob_arm->adt->action, NULL);
}
-bool AnimationExporter::validateConstraints(bConstraint *con){
-
+bool AnimationExporter::validateConstraints(bConstraint *con)
+{
bool valid = true;
bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
/* these we can skip completely (invalid constraints...) */
@@ -1512,7 +1512,8 @@
return valid;
}
-void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[][4]){
+void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[][4])
+{
ListBase *conlist = get_active_constraints(ob);
bConstraint *con;
for (con = (bConstraint*)conlist->first; con; con = con->next) {
@@ -1524,7 +1525,7 @@
bConstraintTarget *ct;
Object *obtar;
cti->get_constraint_targets(con, &targets);
- for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next){
+ for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
obtar = ct->tar;
BKE_animsys_evaluate_animdata(scene, &obtar->id, obtar->adt, ctime, ADT_RECALC_ANIM);
BKE_object_where_is_calc_time(scene, obtar, ctime);
Modified: trunk/blender/source/blender/collada/ArmatureExporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/ArmatureExporter.cpp 2013-02-10 15:59:29 UTC (rev 54434)
+++ trunk/blender/source/blender/collada/ArmatureExporter.cpp 2013-02-10 17:06:05 UTC (rev 54435)
@@ -273,7 +273,7 @@
}
// SECOND_LIFE_COMPATIBILITY
- if (export_settings->second_life) {
+ if (export_settings->second_life) {
// Remove rotations vs armature from transform
// parent_rest_rot * mat * irest_rot
float temp[4][4];
Modified: trunk/blender/source/blender/collada/ArmatureImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/ArmatureImporter.cpp 2013-02-10 15:59:29 UTC (rev 54434)
+++ trunk/blender/source/blender/collada/ArmatureImporter.cpp 2013-02-10 17:06:05 UTC (rev 54435)
@@ -106,13 +106,14 @@
else {
// bone-space
get_node_mat(obmat, node, NULL, NULL);
-
+
// get world-space
- if (parent){
+ if (parent) {
mult_m4_m4m4(mat, parent_mat, obmat);
}
- else
+ else {
copy_m4_m4(mat, obmat);
+ }
}
if (parent) bone->parent = parent;
@@ -645,7 +646,8 @@
return true;
}
-void ArmatureImporter::make_shape_keys(){
+void ArmatureImporter::make_shape_keys()
+{
std::vector<COLLADAFW::MorphController *>::iterator mc;
float weight;
@@ -668,12 +670,12 @@
BKE_key_convert_from_mesh(source_me, kb);
//insert other shape keys
- for ( int i = 0 ; i < morphTargetIds.getCount() ; i++ ){
+ for (int i = 0 ; i < morphTargetIds.getCount() ; i++ ) {
//better to have a seperate map of morph objects,
//This'll do for now since only mesh morphing is imported
Mesh *me = this->mesh_importer->get_mesh_by_geom_uid(morphTargetIds[i]);
- if(me){
+ if (me) {
me->key = key;
kb = BKE_keyblock_add_ctime(key, me->id.name, FALSE);
BKE_key_convert_from_mesh(me, kb);
@@ -682,8 +684,9 @@
weight = morphWeights.getFloatValues()->getData()[i];
kb->curval = weight;
}
- else
+ else {
fprintf(stderr, "Morph target geometry not found.\n");
+ }
}
}
}
Modified: trunk/blender/source/blender/collada/ControllerExporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/ControllerExporter.cpp 2013-02-10 15:59:29 UTC (rev 54434)
+++ trunk/blender/source/blender/collada/ControllerExporter.cpp 2013-02-10 17:06:05 UTC (rev 54435)
@@ -120,9 +120,10 @@
Object *ob_arm = bc_get_assigned_armature(ob);
Key *key = BKE_key_from_object(ob);
- if (ob_arm)
+ if (ob_arm) {
export_skin_controller(ob, ob_arm);
- if(key){
+ }
+ if (key) {
export_morph_controller(ob, key);
}
}
@@ -388,7 +389,8 @@
}
//Added to implemente support for animations.
-void ControllerExporter::add_weight_extras(Key *key){
+void ControllerExporter::add_weight_extras(Key *key)
+{
// can also try the base element and param alternative
COLLADASW::BaseExtraTechnique extra;
Modified: trunk/blender/source/blender/collada/DocumentImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/DocumentImporter.cpp 2013-02-10 15:59:29 UTC (rev 54434)
+++ trunk/blender/source/blender/collada/DocumentImporter.cpp 2013-02-10 17:06:05 UTC (rev 54435)
@@ -100,7 +100,7 @@
// #define ARMATURE_TEST
DocumentImporter::DocumentImporter(bContext *C, const ImportSettings *import_settings) :
- import_settings(import_settings),
+ import_settings(import_settings),
mImportStage(General),
mContext(C),
armature_importer(&unit_converter, &mesh_importer, &anim_importer, CTX_data_scene(C)),
@@ -432,8 +432,9 @@
// to create constraints off node <extra> tags. Assumes only constraint data in
// current <extra> with blender profile.
-void DocumentImporter::create_constraints(ExtraTags *et, Object *ob){
- if ( et && et->isProfile("blender")){
+void DocumentImporter::create_constraints(ExtraTags *et, Object *ob)
+{
+ if (et && et->isProfile("blender")) {
std::string name;
short* type = 0;
et->setData("type", type);
@@ -536,9 +537,12 @@
// XXX empty node may not mean it is empty object, not sure about this
if ( (geom_done + camera_done + lamp_done + controller_done + inst_done) < 1) {
//Check if Object is armature, by checking if immediate child is a JOINT node.
- if(is_armature(node))
+ if (is_armature(node)) {
ob = bc_add_object(sce, OB_ARMATURE, NULL);
- else ob = bc_add_object(sce, OB_EMPTY, NULL);
+ }
+ else {
+ ob = bc_add_object(sce, OB_EMPTY, NULL);
+ }
objects_done->push_back(ob);
}
@@ -1238,15 +1242,18 @@
return true;
}
-bool DocumentImporter::is_armature(COLLADAFW::Node *node){
+bool DocumentImporter::is_armature(COLLADAFW::Node *node)
+{
COLLADAFW::NodePointerArray &child_nodes = node->getChildNodes();
- for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
- if(child_nodes[i]->getType() == COLLADAFW::Node::JOINT) return true;
- else continue;
+ for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
+ if (child_nodes[i]->getType() == COLLADAFW::Node::JOINT) {
+ return true;
+ }
+ else {
+ continue;
+ }
}
//no child is JOINT
return false;
-
}
-
Modified: trunk/blender/source/blender/collada/GeometryExporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/GeometryExporter.cpp 2013-02-10 15:59:29 UTC (rev 54434)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list