Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 09:24:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 09:24:14 +0300
commit41d4a1986548e66a652221e4a68c52900474eeff (patch)
tree26acf937ea0b762977f89adcc4e74a3ec9ecee62 /source
parent108045faa01849115c54190ebed788faf36dcb56 (diff)
ClangFormat: format '#if 0' code in source/
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_data_transfer.h2
-rw-r--r--source/blender/blenkernel/BKE_sound.h5
-rw-r--r--source/blender/blenkernel/BKE_undo_system.h4
-rw-r--r--source/blender/blenkernel/intern/armature_update.c3
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c15
-rw-r--r--source/blender/blenkernel/intern/constraint.c24
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c14
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c30
-rw-r--r--source/blender/blenkernel/intern/ipo.c81
-rw-r--r--source/blender/blenkernel/intern/library_query.c14
-rw-r--r--source/blender/blenkernel/intern/mask_evaluate.c3
-rw-r--r--source/blender/blenkernel/intern/mask_rasterize.c9
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c4
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c24
-rw-r--r--source/blender/blenkernel/intern/pointcache.c4
-rw-r--r--source/blender/blenkernel/intern/sequencer.c21
-rw-r--r--source/blender/blenkernel/intern/softbody.c80
-rw-r--r--source/blender/blenkernel/intern/studiolight.c24
-rw-r--r--source/blender/blenkernel/intern/text.c97
-rw-r--r--source/blender/blenlib/BLI_fileops.h6
-rw-r--r--source/blender/blenlib/intern/BLI_mempool.c8
-rw-r--r--source/blender/blenlib/intern/fileops.c2
-rw-r--r--source/blender/blenlib/intern/math_geom.c64
-rw-r--r--source/blender/blenlib/intern/math_interp.c6
-rw-r--r--source/blender/blenloader/intern/readfile.c3
-rw-r--r--source/blender/blenloader/intern/versioning_270.c9
-rw-r--r--source/blender/bmesh/intern/bmesh_log.c6
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c32
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c10
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c6
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_query.c1
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c5
-rw-r--r--source/blender/bmesh/tools/bmesh_beautify.c27
-rw-r--r--source/blender/collada/AnimationImporter.cpp31
-rw-r--r--source/blender/collada/AnimationImporter.h3
-rw-r--r--source/blender/collada/ArmatureExporter.cpp10
-rw-r--r--source/blender/collada/ArmatureExporter.h2
-rw-r--r--source/blender/collada/ArmatureImporter.cpp29
-rw-r--r--source/blender/collada/ArmatureImporter.h8
-rw-r--r--source/blender/collada/BCAnimationSampler.cpp7
-rw-r--r--source/blender/collada/ControllerExporter.cpp13
-rw-r--r--source/blender/collada/ControllerExporter.h2
-rw-r--r--source/blender/collada/DocumentImporter.cpp8
-rw-r--r--source/blender/collada/EffectExporter.cpp13
-rw-r--r--source/blender/collada/collada_utils.cpp25
-rw-r--r--source/blender/collada/collada_utils.h5
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_RenderLayersProg.cpp2
-rw-r--r--source/blender/draw/engines/eevee/eevee_effects.c3
-rw-r--r--source/blender/draw/engines/eevee/eevee_materials.c69
-rw-r--r--source/blender/draw/engines/eevee/eevee_motion_blur.c6
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_dof.c42
-rw-r--r--source/blender/draw/engines/workbench/workbench_studiolight.c12
-rw-r--r--source/blender/draw/intern/draw_cache.c112
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c9
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c3
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c50
-rw-r--r--source/blender/editors/animation/anim_deps.c5
-rw-r--r--source/blender/editors/armature/armature_utils.c2
-rw-r--r--source/blender/editors/armature/meshlaplacian.c5
-rw-r--r--source/blender/editors/armature/pose_edit.c3
-rw-r--r--source/blender/editors/armature/pose_lib.c12
-rw-r--r--source/blender/editors/curve/editcurve.c6
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c8
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c4
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c4
-rw-r--r--source/blender/editors/include/ED_view3d.h5
-rw-r--r--source/blender/editors/include/UI_interface.h17
-rw-r--r--source/blender/editors/interface/interface.c3
-rw-r--r--source/blender/editors/interface/interface_context_menu.c48
-rw-r--r--source/blender/editors/interface/interface_draw.c68
-rw-r--r--source/blender/editors/interface/interface_layout.c5
-rw-r--r--source/blender/editors/interface/interface_templates.c10
-rw-r--r--source/blender/editors/lattice/editlattice_undo.c3
-rw-r--r--source/blender/editors/mesh/editmesh_rip.c3
-rw-r--r--source/blender/editors/mesh/editmesh_select.c7
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c6
-rw-r--r--source/blender/editors/mesh/meshtools.c13
-rw-r--r--source/blender/editors/object/object_data_transfer.c4
-rw-r--r--source/blender/editors/object/object_relations.c8
-rw-r--r--source/blender/editors/physics/particle_edit.c8
-rw-r--r--source/blender/editors/render/render_preview.c2
-rw-r--r--source/blender/editors/screen/area.c7
-rw-r--r--source/blender/editors/screen/screen_ops.c6
-rw-r--r--source/blender/editors/screen/workspace_edit.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c10
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c9
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_undo.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c8
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c5
-rw-r--r--source/blender/editors/space_action/action_select.c6
-rw-r--r--source/blender/editors/space_console/console_ops.c2
-rw-r--r--source/blender/editors/space_file/filelist.c25
-rw-r--r--source/blender/editors/space_graph/graph_draw.c4
-rw-r--r--source/blender/editors/space_image/image_buttons.c96
-rw-r--r--source/blender/editors/space_image/image_ops.c15
-rw-r--r--source/blender/editors/space_image/space_image.c3
-rw-r--r--source/blender/editors/space_info/info_report.c21
-rw-r--r--source/blender/editors/space_node/drawnode.c3
-rw-r--r--source/blender/editors/space_node/node_edit.c15
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c23
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c33
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c24
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c36
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c4
-rw-r--r--source/blender/editors/space_text/text_draw.c39
-rw-r--r--source/blender/editors/space_text/text_header.c31
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c3
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c5
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c13
-rw-r--r--source/blender/editors/transform/transform.c3
-rw-r--r--source/blender/editors/transform/transform_conversions.c3
-rw-r--r--source/blender/editors/transform/transform_orientations.c3
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c6
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c16
-rw-r--r--source/blender/freestyle/intern/application/AppCanvas.cpp28
-rw-r--r--source/blender/freestyle/intern/application/Controller.cpp34
-rw-r--r--source/blender/freestyle/intern/application/Controller.h22
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp10
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h5
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp5
-rw-r--r--source/blender/freestyle/intern/geometry/GeomCleaner.h2
-rw-r--r--source/blender/freestyle/intern/geometry/Grid.cpp3
-rw-r--r--source/blender/freestyle/intern/geometry/Polygon.h4
-rw-r--r--source/blender/freestyle/intern/geometry/SweepLine.h8
-rw-r--r--source/blender/freestyle/intern/geometry/VecMat.h24
-rw-r--r--source/blender/freestyle/intern/image/ImagePyramid.cpp4
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeCamera.cpp2
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeCamera.h2
-rw-r--r--source/blender/freestyle/intern/stroke/Curve.cpp47
-rw-r--r--source/blender/freestyle/intern/stroke/Curve.h2
-rw-r--r--source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h5
-rw-r--r--source/blender/freestyle/intern/stroke/Operators.cpp18
-rw-r--r--source/blender/freestyle/intern/stroke/Stroke.cpp10
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRep.cpp16
-rw-r--r--source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp27
-rw-r--r--source/blender/freestyle/intern/view_map/FEdgeXDetector.h2
-rw-r--r--source/blender/freestyle/intern/view_map/Silhouette.cpp14
-rw-r--r--source/blender/freestyle/intern/view_map/Silhouette.h18
-rw-r--r--source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp3
-rw-r--r--source/blender/freestyle/intern/view_map/SteerableViewMap.cpp2
-rw-r--r--source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.cpp2
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.h4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h5
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp22
-rw-r--r--source/blender/freestyle/intern/winged_edge/Curvature.cpp6
-rw-r--r--source/blender/freestyle/intern/winged_edge/WEdge.cpp2
-rw-r--r--source/blender/freestyle/intern/winged_edge/WEdge.h16
-rw-r--r--source/blender/freestyle/intern/winged_edge/WXEdge.cpp9
-rw-r--r--source/blender/freestyle/intern/winged_edge/WXEdge.h2
-rw-r--r--source/blender/gpu/GPU_batch.h6
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c6
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.c2
-rw-r--r--source/blender/gpu/intern/gpu_select_pick.c5
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp4
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c3
-rw-r--r--source/blender/imbuf/intern/dds/BlockDXT.h24
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.cpp136
-rw-r--r--source/blender/imbuf/intern/dds/PixelFormat.h22
-rw-r--r--source/blender/imbuf/intern/filter.c2
-rw-r--r--source/blender/imbuf/intern/jpeg.c7
-rw-r--r--source/blender/imbuf/intern/png.c12
-rw-r--r--source/blender/makesdna/DNA_action_types.h2
-rw-r--r--source/blender/makesdna/DNA_curve_types.h4
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h2
-rw-r--r--source/blender/makesrna/intern/makesrna.c51
-rw-r--r--source/blender/makesrna/intern/rna_boid.c26
-rw-r--r--source/blender/makesrna/intern/rna_wm.c10
-rw-r--r--source/blender/modifiers/intern/MOD_armature.c2
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c2
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c11
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c3
-rw-r--r--source/blender/modifiers/intern/MOD_skin.c4
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c11
-rw-r--r--source/blender/modifiers/intern/MOD_subsurf.c2
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgmix.c3
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_particle_info.c2
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp24
-rw-r--r--source/blender/physics/intern/ConstrainedConjugateGradient.h20
-rw-r--r--source/blender/physics/intern/hair_volume.cpp123
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c5
-rw-r--r--source/blender/python/generic/idprop_py_api.c12
-rw-r--r--source/blender/python/gpu/gpu_py_matrix.c9
-rw-r--r--source/blender/python/intern/bpy_capi_utils.c7
-rw-r--r--source/blender/python/intern/bpy_interface.c17
-rw-r--r--source/blender/python/intern/bpy_operator.c4
-rw-r--r--source/blender/python/intern/bpy_props.c9
-rw-r--r--source/blender/python/intern/bpy_rna.c58
-rw-r--r--source/blender/python/intern/bpy_rna_array.c13
-rw-r--r--source/blender/python/intern/bpy_rna_callback.c18
-rw-r--r--source/blender/render/intern/source/multires_bake.c60
-rw-r--r--source/blender/render/intern/source/pipeline.c1
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c4
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c24
-rw-r--r--source/blender/windowmanager/intern/wm_gesture_ops.c4
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c27
203 files changed, 1875 insertions, 1196 deletions
diff --git a/source/blender/blenkernel/BKE_data_transfer.h b/source/blender/blenkernel/BKE_data_transfer.h
index a909328ac9c..79ef512bc1f 100644
--- a/source/blender/blenkernel/BKE_data_transfer.h
+++ b/source/blender/blenkernel/BKE_data_transfer.h
@@ -119,7 +119,7 @@ enum {
DT_LAYERS_NAME_DST = -2,
DT_LAYERS_INDEX_DST = -3,
#if 0 /* TODO */
- DT_LAYERS_CREATE_DST = -4, /* Never replace existing data in dst, always create new layers. */
+ DT_LAYERS_CREATE_DST = -4, /* Never replace existing data in dst, always create new layers. */
#endif
};
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index 9d917f0e420..91e23d35f0e 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -61,7 +61,10 @@ struct bSound *BKE_sound_new_file_exists(struct Main *bmain, const char *filepat
#if 0
struct bSound *BKE_sound_new_buffer(struct Main *bmain, struct bSound *source);
-struct bSound *BKE_sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end);
+struct bSound *BKE_sound_new_limiter(struct Main *bmain,
+ struct bSound *source,
+ float start,
+ float end);
#endif
void BKE_sound_cache(struct bSound *sound);
diff --git a/source/blender/blenkernel/BKE_undo_system.h b/source/blender/blenkernel/BKE_undo_system.h
index 6852c3ee970..fc6fc6ff336 100644
--- a/source/blender/blenkernel/BKE_undo_system.h
+++ b/source/blender/blenkernel/BKE_undo_system.h
@@ -187,7 +187,9 @@ void BKE_undosys_type_free_all(void);
/* ID Accessor */
#if 0 /* functionality is only used internally for now. */
-void BKE_undosys_foreach_ID_ref(UndoStack *ustack, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data);
+void BKE_undosys_foreach_ID_ref(UndoStack *ustack,
+ UndoTypeForEachIDRefFn foreach_ID_ref_fn,
+ void *user_data);
#endif
/* Use when the undo step stores many arbitrary pointers. */
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index 6d51c7f5108..917d29a9bbf 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -869,8 +869,7 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph, Object *object,
* around for the time while proxies are evaluating.
*/
#if 0
- bPoseChannel *pchan_from = pose_pchan_get_indexed(
- object->proxy_from, pchan_index);
+ bPoseChannel *pchan_from = pose_pchan_get_indexed(object->proxy_from, pchan_index);
#else
bPoseChannel *pchan_from = BKE_pose_channel_find_name(object->proxy_from->pose, pchan->name);
#endif
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index ada746d3fcc..debdedabadb 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1149,9 +1149,10 @@ void CDDM_calc_normals_mapping(DerivedMesh *dm)
void CDDM_calc_normals(DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
- float (*poly_nors)[3];
+ float(*poly_nors)[3];
- if (dm->numVertData == 0) return;
+ if (dm->numVertData == 0)
+ return;
/* we don't want to overwrite any referenced layers */
cddm->mvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT, dm->numVertData);
@@ -1162,8 +1163,14 @@ void CDDM_calc_normals(DerivedMesh *dm)
poly_nors = CustomData_add_layer(&dm->polyData, CD_NORMAL, CD_CALLOC, NULL, dm->numPolyData);
}
- BKE_mesh_calc_normals_poly(cddm->mvert, dm->numVertData, CDDM_get_loops(dm), CDDM_get_polys(dm),
- dm->numLoopData, dm->numPolyData, poly_nors, false);
+ BKE_mesh_calc_normals_poly(cddm->mvert,
+ dm->numVertData,
+ CDDM_get_loops(dm),
+ CDDM_get_polys(dm),
+ dm->numLoopData,
+ dm->numPolyData,
+ poly_nors,
+ false);
cddm->dm.dirty &= ~DM_DIRTY_NORMALS;
}
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 114bf5ec1e6..01dc7c6b3ad 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -665,18 +665,18 @@ static void constraint_target_to_mat4(Object *ob,
*/
#if 0
static bConstraintTypeInfo CTI_CONSTRNAME = {
- CONSTRAINT_TYPE_CONSTRNAME, /* type */
- sizeof(bConstrNameConstraint), /* size */
- "ConstrName", /* name */
- "bConstrNameConstraint", /* struct name */
- constrname_free, /* free data */
- constrname_id_looper, /* id looper */
- constrname_copy, /* copy data */
- constrname_new_data, /* new data */
- constrname_get_tars, /* get constraint targets */
- constrname_flush_tars, /* flush constraint targets */
- constrname_get_tarmat, /* get target matrix */
- constrname_evaluate, /* evaluate */
+ CONSTRAINT_TYPE_CONSTRNAME, /* type */
+ sizeof(bConstrNameConstraint), /* size */
+ "ConstrName", /* name */
+ "bConstrNameConstraint", /* struct name */
+ constrname_free, /* free data */
+ constrname_id_looper, /* id looper */
+ constrname_copy, /* copy data */
+ constrname_new_data, /* new data */
+ constrname_get_tars, /* get constraint targets */
+ constrname_flush_tars, /* flush constraint targets */
+ constrname_get_tarmat, /* get target matrix */
+ constrname_evaluate, /* evaluate */
};
#endif
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 7bbdfa6c52d..2d4f1607fe4 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -3064,10 +3064,18 @@ int dynamicPaint_createUVSurface(Scene *scene,
if (tempPoints[index].tri_index != -1) {
int nidx = tempPoints[index].neighbour_pixel;
- fprintf(dump_file, "%d\t%d,%d\t%u\t%d,%d\t%d\t", fidx, tx, h-1-ty, tempPoints[index].tri_index, nidx<0?-1:(nidx%w), nidx<0?-1:h-1-(nidx/w), ed->flags[fidx]);
+ fprintf(dump_file,
+ "%d\t%d,%d\t%u\t%d,%d\t%d\t",
+ fidx,
+ tx,
+ h - 1 - ty,
+ tempPoints[index].tri_index,
+ nidx < 0 ? -1 : (nidx % w),
+ nidx < 0 ? -1 : h - 1 - (nidx / w),
+ ed->flags[fidx]);
for (int i = 0; i < ed->n_num[fidx]; i++) {
- int tgt = tmp[ed->n_target[ed->n_index[fidx]+i]];
- fprintf(dump_file, "%s%d,%d", i?" ":"", tgt%w, h-1-tgt/w);
+ int tgt = tmp[ed->n_target[ed->n_index[fidx] + i]];
+ fprintf(dump_file, "%s%d,%d", i ? " " : "", tgt % w, h - 1 - tgt / w);
}
fprintf(dump_file, "\n");
}
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index d54a3bdaa37..3cecfb8aa17 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -79,21 +79,21 @@ void *fmodifiers_storage_get(FModifierStackStorage *storage, FModifier *fcm);
*/
#if 0
static FModifierTypeInfo FMI_MODNAME = {
- FMODIFIER_TYPE_MODNAME, /* type */
- sizeof(FMod_ModName), /* size */
- FMI_TYPE_SOME_ACTION, /* action type */
- FMI_REQUIRES_SOME_REQUIREMENT, /* requirements */
- "Modifier Name", /* name */
- "FMod_ModName", /* struct name */
- fcm_modname_free, /* free data */
- fcm_modname_relink, /* relink data */
- fcm_modname_copy, /* copy data */
- fcm_modname_new_data, /* new data */
- fcm_modname_verify, /* verify */
- fcm_modname_time, /* evaluate time */
- fcm_modname_evaluate, /* evaluate */
- fcm_modname_time_storage, /* evaluate time with storage */
- fcm_modname_evaluate_storage, /* evaluate with storage */
+ FMODIFIER_TYPE_MODNAME, /* type */
+ sizeof(FMod_ModName), /* size */
+ FMI_TYPE_SOME_ACTION, /* action type */
+ FMI_REQUIRES_SOME_REQUIREMENT, /* requirements */
+ "Modifier Name", /* name */
+ "FMod_ModName", /* struct name */
+ fcm_modname_free, /* free data */
+ fcm_modname_relink, /* relink data */
+ fcm_modname_copy, /* copy data */
+ fcm_modname_new_data, /* new data */
+ fcm_modname_verify, /* verify */
+ fcm_modname_time, /* evaluate time */
+ fcm_modname_evaluate, /* evaluate */
+ fcm_modname_time_storage, /* evaluate time with storage */
+ fcm_modname_evaluate_storage, /* evaluate with storage */
};
#endif
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 8f3b1fed692..c2c8fb78a32 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -235,22 +235,28 @@ static const char *ob_adrcodes_to_paths(int adrcode, int *array_index)
return "color";
#if 0
case OB_PD_FSTR:
- if (ob->pd) poin = &(ob->pd->f_strength);
+ if (ob->pd)
+ poin = &(ob->pd->f_strength);
break;
case OB_PD_FFALL:
- if (ob->pd) poin = &(ob->pd->f_power);
+ if (ob->pd)
+ poin = &(ob->pd->f_power);
break;
case OB_PD_SDAMP:
- if (ob->pd) poin = &(ob->pd->pdef_damp);
+ if (ob->pd)
+ poin = &(ob->pd->pdef_damp);
break;
case OB_PD_RDAMP:
- if (ob->pd) poin = &(ob->pd->pdef_rdamp);
+ if (ob->pd)
+ poin = &(ob->pd->pdef_rdamp);
break;
case OB_PD_PERM:
- if (ob->pd) poin = &(ob->pd->pdef_perm);
+ if (ob->pd)
+ poin = &(ob->pd->pdef_perm);
break;
case OB_PD_FMAXD:
- if (ob->pd) poin = &(ob->pd->maxdist);
+ if (ob->pd)
+ poin = &(ob->pd->maxdist);
break;
#endif
}
@@ -414,31 +420,44 @@ static const char *mtex_adrcodes_to_paths(int adrcode, int *UNUSED(array_index))
switch (adrcode) {
#if 0 // XXX these are not wrapped in RNA yet!
case MAP_OFS_X:
- poin = &(mtex->ofs[0]); break;
+ poin = &(mtex->ofs[0]);
+ break;
case MAP_OFS_Y:
- poin = &(mtex->ofs[1]); break;
+ poin = &(mtex->ofs[1]);
+ break;
case MAP_OFS_Z:
- poin = &(mtex->ofs[2]); break;
+ poin = &(mtex->ofs[2]);
+ break;
case MAP_SIZE_X:
- poin = &(mtex->size[0]); break;
+ poin = &(mtex->size[0]);
+ break;
case MAP_SIZE_Y:
- poin = &(mtex->size[1]); break;
+ poin = &(mtex->size[1]);
+ break;
case MAP_SIZE_Z:
- poin = &(mtex->size[2]); break;
+ poin = &(mtex->size[2]);
+ break;
case MAP_R:
- poin = &(mtex->r); break;
+ poin = &(mtex->r);
+ break;
case MAP_G:
- poin = &(mtex->g); break;
+ poin = &(mtex->g);
+ break;
case MAP_B:
- poin = &(mtex->b); break;
+ poin = &(mtex->b);
+ break;
case MAP_DVAR:
- poin = &(mtex->def_var); break;
+ poin = &(mtex->def_var);
+ break;
case MAP_COLF:
- poin = &(mtex->colfac); break;
+ poin = &(mtex->colfac);
+ break;
case MAP_NORF:
- poin = &(mtex->norfac); break;
+ poin = &(mtex->norfac);
+ break;
case MAP_VARF:
- poin = &(mtex->varfac); break;
+ poin = &(mtex->varfac);
+ break;
#endif
case MAP_DISP:
prop = "warp_factor";
@@ -659,9 +678,11 @@ static const char *camera_adrcodes_to_paths(int adrcode, int *array_index)
#if 0 // XXX these are not defined in RNA
case CAM_YF_APERT:
- poin = &(ca->YF_aperture); break;
+ poin = &(ca->YF_aperture);
+ break;
case CAM_YF_FDIST:
- poin = &(ca->dof_distance); break;
+ poin = &(ca->dof_distance);
+ break;
#endif // XXX these are not defined in RNA
case CAM_SHIFT_X:
@@ -837,22 +858,28 @@ static const char *particle_adrcodes_to_paths(int adrcode, int *array_index)
* as the similar object forces */
#if 0
case PART_PD_FSTR:
- if (part->pd) poin = &(part->pd->f_strength);
+ if (part->pd)
+ poin = &(part->pd->f_strength);
break;
case PART_PD_FFALL:
- if (part->pd) poin = &(part->pd->f_power);
+ if (part->pd)
+ poin = &(part->pd->f_power);
break;
case PART_PD_FMAXD:
- if (part->pd) poin = &(part->pd->maxdist);
+ if (part->pd)
+ poin = &(part->pd->maxdist);
break;
case PART_PD2_FSTR:
- if (part->pd2) poin = &(part->pd2->f_strength);
+ if (part->pd2)
+ poin = &(part->pd2->f_strength);
break;
case PART_PD2_FFALL:
- if (part->pd2) poin = &(part->pd2->f_power);
+ if (part->pd2)
+ poin = &(part->pd2->f_power);
break;
case PART_PD2_FMAXD:
- if (part->pd2) poin = &(part->pd2->maxdist);
+ if (part->pd2)
+ poin = &(part->pd2->maxdist);
break;
#endif
}
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index 7152c9786fb..a87f8a4969a 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -1240,10 +1240,16 @@ static int foreach_libblock_id_users_callback(void *user_data,
if (*id_p == iter->id) {
#if 0
- printf("%s uses %s (refcounted: %d, userone: %d, used_one: %d, used_one_active: %d, indirect_usage: %d)\n",
- iter->curr_id->name, iter->id->name, (cb_flag & IDWALK_USER) ? 1 : 0, (cb_flag & IDWALK_USER_ONE) ? 1 : 0,
- (iter->id->tag & LIB_TAG_EXTRAUSER) ? 1 : 0, (iter->id->tag & LIB_TAG_EXTRAUSER_SET) ? 1 : 0,
- (cb_flag & IDWALK_INDIRECT_USAGE) ? 1 : 0);
+ printf(
+ "%s uses %s (refcounted: %d, userone: %d, used_one: %d, used_one_active: %d, "
+ "indirect_usage: %d)\n",
+ iter->curr_id->name,
+ iter->id->name,
+ (cb_flag & IDWALK_USER) ? 1 : 0,
+ (cb_flag & IDWALK_USER_ONE) ? 1 : 0,
+ (iter->id->tag & LIB_TAG_EXTRAUSER) ? 1 : 0,
+ (iter->id->tag & LIB_TAG_EXTRAUSER_SET) ? 1 : 0,
+ (cb_flag & IDWALK_INDIRECT_USAGE) ? 1 : 0);
#endif
if (cb_flag & IDWALK_CB_INDIRECT_USAGE) {
iter->count_indirect++;
diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c
index 2b84c1f32c1..d3e43a60565 100644
--- a/source/blender/blenkernel/intern/mask_evaluate.c
+++ b/source/blender/blenkernel/intern/mask_evaluate.c
@@ -879,7 +879,8 @@ void BKE_mask_layer_evaluate_animation(MaskLayer *masklay, const float ctime)
__func__,
(int)ctime,
BLI_listbase_count(&masklay->splines_shapes),
- masklay_shape_a->frame, masklay_shape_b->frame);
+ masklay_shape_a->frame,
+ masklay_shape_b->frame);
#endif
BKE_mask_layer_shape_to_mask_interp(
masklay, masklay_shape_a, masklay_shape_b, (ctime - masklay_shape_a->frame) / w);
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 24137b680ba..0f5fd89d833 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -1212,7 +1212,9 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle,
/* 2D ray test */
#if 0
static float maskrasterize_layer_z_depth_tri(const float pt[2],
- const float v1[3], const float v2[3], const float v3[3])
+ const float v1[3],
+ const float v2[3],
+ const float v3[3])
{
float w[3];
barycentric_weights_v2(v1, v2, v3, pt, w);
@@ -1240,10 +1242,7 @@ static float maskrasterize_layer_isect(unsigned int *face,
#if 0
/* not essential but avoids unneeded extra lookups */
- if ((cos[0][2] < dist_orig) ||
- (cos[1][2] < dist_orig) ||
- (cos[2][2] < dist_orig))
- {
+ if ((cos[0][2] < dist_orig) || (cos[1][2] < dist_orig) || (cos[2][2] < dist_orig)) {
if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) {
/* we know all tris are close for now */
return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]);
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 2ef1a009321..3982339d501 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -1119,7 +1119,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon *common_data, LoopSpli
MLoopNorSpace *lnor_space = data->lnor_space;
#if 0 /* Not needed for 'fan' loops. */
- float (*lnor)[3] = data->lnor;
+ float(*lnor)[3] = data->lnor;
#endif
const MLoop *ml_curr = data->ml_curr;
const MLoop *ml_prev = data->ml_prev;
@@ -1537,7 +1537,7 @@ static void loop_split_generator(TaskPool *pool, LoopSplitTaskDataCommon *common
data->ml_curr_index = ml_curr_index;
#if 0 /* Not needed for 'single' loop. */
data->ml_prev_index = ml_prev_index;
- data->e2l_prev = NULL; /* Tag as 'single' task. */
+ data->e2l_prev = NULL; /* Tag as 'single' task. */
#endif
data->mp_index = mp_index;
if (lnors_spacearr) {
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index c007d5e3df7..40172a4778c 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -431,7 +431,6 @@ static int pbvh_bmesh_node_offset_from_elem(PBVH *bvh, BMElem *ele)
BLI_assert(ele->head.htype == BM_FACE);
return bvh->cd_face_node_offset;
}
-
}
static int pbvh_bmesh_node_index_from_elem(PBVH *bvh, void *key)
@@ -543,7 +542,7 @@ static int pbvh_bmesh_node_vert_use_count(PBVH *bvh, PBVHNode *node, BMVert *v)
BMFace *f;
int count = 0;
- BM_FACES_OF_VERT_ITER_BEGIN(f, v) {
+ BM_FACES_OF_VERT_ITER_BEGIN (f, v) {
PBVHNode *f_node = pbvh_bmesh_node_from_face(bvh, f);
if (f_node == node) {
count++;
@@ -2105,18 +2104,14 @@ static void pbvh_bmesh_print(PBVH *bvh)
BMIter iter;
BMFace *f;
- BM_ITER_MESH(f, &iter, bvh->bm, BM_FACES_OF_MESH) {
- fprintf(stderr, " %d -> %d\n",
- BM_elem_index_get(f),
- pbvh_bmesh_node_index_from_face(bvh, f));
+ BM_ITER_MESH (f, &iter, bvh->bm, BM_FACES_OF_MESH) {
+ fprintf(stderr, " %d -> %d\n", BM_elem_index_get(f), pbvh_bmesh_node_index_from_face(bvh, f));
}
fprintf(stderr, "bm_vert_to_node:\n");
BMVert *v;
- BM_ITER_MESH(v, &iter, bvh->bm, BM_FACES_OF_MESH) {
- fprintf(stderr, " %d -> %d\n",
- BM_elem_index_get(v),
- pbvh_bmesh_node_index_from_vert(bvh, v));
+ BM_ITER_MESH (v, &iter, bvh->bm, BM_FACES_OF_MESH) {
+ fprintf(stderr, " %d -> %d\n", BM_elem_index_get(v), pbvh_bmesh_node_index_from_vert(bvh, v));
}
for (int n = 0; n < bvh->totnode; n++) {
@@ -2127,16 +2122,13 @@ static void pbvh_bmesh_print(PBVH *bvh)
GSetIterator gs_iter;
fprintf(stderr, "node %d\n faces:\n", n);
GSET_ITER (gs_iter, node->bm_faces)
- fprintf(stderr, " %d\n",
- BM_elem_index_get((BMFace *)BLI_gsetIterator_getKey(&gs_iter)));
+ fprintf(stderr, " %d\n", BM_elem_index_get((BMFace *)BLI_gsetIterator_getKey(&gs_iter)));
fprintf(stderr, " unique verts:\n");
GSET_ITER (gs_iter, node->bm_unique_verts)
- fprintf(stderr, " %d\n",
- BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
+ fprintf(stderr, " %d\n", BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
fprintf(stderr, " other verts:\n");
GSET_ITER (gs_iter, node->bm_other_verts)
- fprintf(stderr, " %d\n",
- BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
+ fprintf(stderr, " %d\n", BM_elem_index_get((BMVert *)BLI_gsetIterator_getKey(&gs_iter)));
}
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 2d3914090b1..1d0764d1f94 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1838,9 +1838,7 @@ static bool foreach_object_particle_ptcache(Object *object,
}
/* Hair needs to be included in id-list for cache edit mode to work. */
#if 0
- if ((psys->part->type == PART_HAIR) &&
- (psys->flag & PSYS_HAIR_DYNAMICS) == 0)
- {
+ if ((psys->part->type == PART_HAIR) && (psys->flag & PSYS_HAIR_DYNAMICS) == 0) {
continue;
}
#endif
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 4af06606ef0..4f50dde4bdb 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -121,12 +121,23 @@ SequencerDrawView sequencer_view3d_cb = NULL; /* NULL in background mode */
#if 0 /* unused function */
static void printf_strip(Sequence *seq)
{
- fprintf(stderr, "name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), "
+ fprintf(stderr,
+ "name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), "
"(startstill:%d, endstill:%d), machine:%d, (startdisp:%d, enddisp:%d)\n",
- seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine,
- seq->startdisp, seq->enddisp);
-
- fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0),
+ seq->name,
+ seq->len,
+ seq->start,
+ seq->startofs,
+ seq->endofs,
+ seq->startstill,
+ seq->endstill,
+ seq->machine,
+ seq->startdisp,
+ seq->enddisp);
+
+ fprintf(stderr,
+ "\tseq_tx_set_final_left: %d %d\n\n",
+ seq_tx_get_final_left(seq, 0),
seq_tx_get_final_right(seq, 0));
}
#endif
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index ba7e26e817a..65ad1c483c3 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -1804,35 +1804,36 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len
float m, delta_ij;
int i, j;
if (L < len) {
- for (i=0;i<3;i++) {
- for (j=0;j<3;j++) {
- delta_ij = (i==j ? (1.0f): (0.0f));
- m=factor*(dir[i]*dir[j] + (1-L/len)*(delta_ij - dir[i]*dir[j]));
- EIG_linear_solver_matrix_add(ia+i, op+ic+j, m);
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ delta_ij = (i == j ? (1.0f) : (0.0f));
+ m = factor * (dir[i] * dir[j] + (1 - L / len) * (delta_ij - dir[i] * dir[j]));
+ EIG_linear_solver_matrix_add(ia + i, op + ic + j, m);
}
}
}
else {
- for (i=0;i<3;i++) {
- for (j=0;j<3;j++) {
- m=factor*dir[i]*dir[j];
- EIG_linear_solver_matrix_add(ia+i, op+ic+j, m);
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ m = factor * dir[i] * dir[j];
+ EIG_linear_solver_matrix_add(ia + i, op + ic + j, m);
}
}
}
}
-
static void dfdx_goal(int ia, int ic, int op, float factor)
{
int i;
- for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, op+ic+i, factor);
+ for (i = 0; i < 3; i++)
+ EIG_linear_solver_matrix_add(ia + i, op + ic + i, factor);
}
static void dfdv_goal(int ia, int ic, float factor)
{
int i;
- for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, ic+i, factor);
+ for (i = 0; i < 3; i++)
+ EIG_linear_solver_matrix_add(ia + i, ic + i, factor);
}
#endif /* if 0 */
@@ -1852,16 +1853,16 @@ static void sb_spring_force(
bp1 = &sb->bpoint[bs->v1];
bp2 = &sb->bpoint[bs->v2];
#if 0 /* UNUSED */
- ia =3*bs->v1;
- ic =3*bs->v2;
+ ia = 3 * bs->v1;
+ ic = 3 * bs->v2;
#endif
}
else if (bpi == bs->v2) {
bp1 = &sb->bpoint[bs->v2];
bp2 = &sb->bpoint[bs->v1];
#if 0 /* UNUSED */
- ia =3*bs->v2;
- ic =3*bs->v1;
+ ia = 3 * bs->v2;
+ ic = 3 * bs->v1;
#endif
}
else {
@@ -2284,8 +2285,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* old one with homogeneous masses */
/* claim a minimum mass for vertex */
#if 0
- if (sb->nodemass > 0.009999f) timeovermass = forcetime / sb->nodemass;
- else timeovermass = forcetime / 0.009999f;
+ if (sb->nodemass > 0.009999f)
+ timeovermass = forcetime / sb->nodemass;
+ else
+ timeovermass = forcetime / 0.009999f;
#endif
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
@@ -2339,11 +2342,11 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* the freezer coming sooner or later */
#if 0
- if ((dot_v3v3(dx, dx)<freezeloc )&&(dot_v3v3(bp->force, bp->force)<freezeforce )) {
- bp->frozen /=2;
+ if ((dot_v3v3(dx, dx) < freezeloc) && (dot_v3v3(bp->force, bp->force) < freezeforce)) {
+ bp->frozen /= 2;
}
else {
- bp->frozen = min_ff(bp->frozen*1.05f, 1.0f);
+ bp->frozen = min_ff(bp->frozen * 1.05f, 1.0f);
}
mul_v3_fl(dx, bp->frozen);
#endif
@@ -2417,73 +2420,72 @@ static void softbody_restore_prev_step(Object *ob)
#if 0
static void softbody_store_step(Object *ob)
{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there*/
BodyPoint *bp;
int a;
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
copy_v3_v3(bp->prevvec, bp->vec);
copy_v3_v3(bp->prevpos, bp->pos);
}
}
-
/* used by predictors and correctors */
static void softbody_store_state(Object *ob, float *ppos, float *pvel)
{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there*/
BodyPoint *bp;
int a;
- float *pp=ppos, *pv=pvel;
+ float *pp = ppos, *pv = pvel;
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
copy_v3_v3(pv, bp->vec);
- pv+=3;
+ pv += 3;
copy_v3_v3(pp, bp->pos);
- pp+=3;
+ pp += 3;
}
}
/* used by predictors and correctors */
static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there*/
BodyPoint *bp;
int a;
- float *pp=ppos, *pv=pvel;
+ float *pp = ppos, *pv = pvel;
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
copy_v3_v3(bp->vec, pv);
- pv+=3;
+ pv += 3;
copy_v3_v3(bp->pos, pp);
- pp+=3;
+ pp += 3;
}
}
/* used by predictors and correctors */
static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
{
- SoftBody *sb= ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there*/
BodyPoint *bp;
int a;
- float *pp=ppos, *pv=pvel;
+ float *pp = ppos, *pv = pvel;
float temp[3];
- for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
copy_v3_v3(temp, bp->vec);
copy_v3_v3(bp->vec, pv);
copy_v3_v3(pv, temp);
- pv+=3;
+ pv += 3;
copy_v3_v3(temp, bp->pos);
copy_v3_v3(bp->pos, pp);
copy_v3_v3(pp, temp);
- pp+=3;
+ pp += 3;
}
}
#endif
diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c
index 7a95ec3055e..df48e505f6f 100644
--- a/source/blender/blenkernel/intern/studiolight.c
+++ b/source/blender/blenkernel/intern/studiolight.c
@@ -485,12 +485,24 @@ static void studiolight_calculate_radiance_cubemap_buffers(StudioLight *sl)
NULL, colbuf, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE);
#if 0
- IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_POS], "/tmp/studiolight_radiance_left.png", IB_rectfloat);
- IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_NEG], "/tmp/studiolight_radiance_right.png", IB_rectfloat);
- IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_POS], "/tmp/studiolight_radiance_front.png", IB_rectfloat);
- IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_NEG], "/tmp/studiolight_radiance_back.png", IB_rectfloat);
- IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_POS], "/tmp/studiolight_radiance_bottom.png", IB_rectfloat);
- IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_NEG], "/tmp/studiolight_radiance_top.png", IB_rectfloat);
+ IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_POS],
+ "/tmp/studiolight_radiance_left.png",
+ IB_rectfloat);
+ IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_X_NEG],
+ "/tmp/studiolight_radiance_right.png",
+ IB_rectfloat);
+ IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_POS],
+ "/tmp/studiolight_radiance_front.png",
+ IB_rectfloat);
+ IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Y_NEG],
+ "/tmp/studiolight_radiance_back.png",
+ IB_rectfloat);
+ IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_POS],
+ "/tmp/studiolight_radiance_bottom.png",
+ IB_rectfloat);
+ IMB_saveiff(sl->radiance_cubemap_buffers[STUDIOLIGHT_Z_NEG],
+ "/tmp/studiolight_radiance_top.png",
+ IB_rectfloat);
#endif
MEM_freeN(colbuf);
}
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index ef4b9d95324..930f9ac5ee8 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -1563,7 +1563,8 @@ static void dump_buffer(TextUndoBuf *utxt)
{
int i = 0;
- while (i++ < utxt->undo_pos) printf("%d: %d %c\n", i, utxt->buf[i], utxt->buf[i]);
+ while (i++ < utxt->undo_pos)
+ printf("%d: %d %c\n", i, utxt->buf[i], utxt->buf[i]);
}
/* Note: this function is outdated and must be updated if needed for future use */
@@ -1646,27 +1647,38 @@ void txt_print_undo(Text *text)
i++;
printf(" - Char is ");
switch (op) {
- case UNDO_INSERT_1: case UNDO_BS_1: case UNDO_DEL_1:
+ case UNDO_INSERT_1:
+ case UNDO_BS_1:
+ case UNDO_DEL_1:
printf("%c", utxt->buf[i]);
i++;
break;
- case UNDO_INSERT_2: case UNDO_BS_2: case UNDO_DEL_2:
+ case UNDO_INSERT_2:
+ case UNDO_BS_2:
+ case UNDO_DEL_2:
printf("%c%c", utxt->buf[i], utxt->buf[i + 1]);
i += 2;
break;
- case UNDO_INSERT_3: case UNDO_BS_3: case UNDO_DEL_3:
+ case UNDO_INSERT_3:
+ case UNDO_BS_3:
+ case UNDO_DEL_3:
printf("%c%c%c", utxt->buf[i], utxt->buf[i + 1], utxt->buf[i + 2]);
i += 3;
break;
- case UNDO_INSERT_4: case UNDO_BS_4: case UNDO_DEL_4:
- {
+ case UNDO_INSERT_4:
+ case UNDO_BS_4:
+ case UNDO_DEL_4: {
unsigned int uc;
char c[BLI_UTF8_MAX + 1];
size_t c_len;
- uc = utxt->buf[i]; i++;
- uc = uc + (utxt->buf[i] << 8); i++;
- uc = uc + (utxt->buf[i] << 16); i++;
- uc = uc + (utxt->buf[i] << 24); i++;
+ uc = utxt->buf[i];
+ i++;
+ uc = uc + (utxt->buf[i] << 8);
+ i++;
+ uc = uc + (utxt->buf[i] << 16);
+ i++;
+ uc = uc + (utxt->buf[i] << 24);
+ i++;
c_len = BLI_str_utf8_from_unicode(uc, c);
c[c_len] = '\0';
puts(c);
@@ -1677,49 +1689,70 @@ void txt_print_undo(Text *text)
else if (op == UNDO_DBLOCK || op == UNDO_IBLOCK) {
i++;
- linep = utxt->buf[i]; i++;
- linep = linep + (utxt->buf[i] << 8); i++;
- linep = linep + (utxt->buf[i] << 16); i++;
- linep = linep + (utxt->buf[i] << 24); i++;
+ linep = utxt->buf[i];
+ i++;
+ linep = linep + (utxt->buf[i] << 8);
+ i++;
+ linep = linep + (utxt->buf[i] << 16);
+ i++;
+ linep = linep + (utxt->buf[i] << 24);
+ i++;
printf(" (length %d) <", linep);
while (linep > 0) {
putchar(utxt->buf[i]);
- linep--; i++;
+ linep--;
+ i++;
}
- linep = utxt->buf[i]; i++;
- linep = linep + (utxt->buf[i] << 8); i++;
- linep = linep + (utxt->buf[i] << 16); i++;
- linep = linep + (utxt->buf[i] << 24); i++;
+ linep = utxt->buf[i];
+ i++;
+ linep = linep + (utxt->buf[i] << 8);
+ i++;
+ linep = linep + (utxt->buf[i] << 16);
+ i++;
+ linep = linep + (utxt->buf[i] << 24);
+ i++;
printf("> (%d)", linep);
}
else if (op == UNDO_INDENT || op == UNDO_UNINDENT) {
i++;
- charp = utxt->buf[i]; i++;
- charp = charp + (utxt->buf[i] << 8); i++;
+ charp = utxt->buf[i];
+ i++;
+ charp = charp + (utxt->buf[i] << 8);
+ i++;
- linep = utxt->buf[i]; i++;
- linep = linep + (utxt->buf[i] << 8); i++;
- linep = linep + (utxt->buf[i] << 16); i++;
- linep = linep + (utxt->buf[i] << 24); i++;
+ linep = utxt->buf[i];
+ i++;
+ linep = linep + (utxt->buf[i] << 8);
+ i++;
+ linep = linep + (utxt->buf[i] << 16);
+ i++;
+ linep = linep + (utxt->buf[i] << 24);
+ i++;
printf("to <%d, %d> ", linep, charp);
- charp = utxt->buf[i]; i++;
- charp = charp + (utxt->buf[i] << 8); i++;
+ charp = utxt->buf[i];
+ i++;
+ charp = charp + (utxt->buf[i] << 8);
+ i++;
- linep = utxt->buf[i]; i++;
- linep = linep + (utxt->buf[i] << 8); i++;
- linep = linep + (utxt->buf[i] << 16); i++;
- linep = linep + (utxt->buf[i] << 24); i++;
+ linep = utxt->buf[i];
+ i++;
+ linep = linep + (utxt->buf[i] << 8);
+ i++;
+ linep = linep + (utxt->buf[i] << 16);
+ i++;
+ linep = linep + (utxt->buf[i] << 24);
+ i++;
printf("from <%d, %d>", linep, charp);
}
- printf(" %d\n", i);
+ printf(" %d\n", i);
i++;
}
}
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
index 7787ca4cdb5..d8daa81b58d 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -51,8 +51,8 @@ int BLI_copy(const char *path, const char *to) ATTR_NONNULL();
int BLI_rename(const char *from, const char *to) ATTR_NONNULL();
int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL();
#if 0 /* Unused */
-int BLI_move(const char *path, const char *to) ATTR_NONNULL();
-int BLI_create_symlink(const char *path, const char *to) ATTR_NONNULL();
+int BLI_move(const char *path, const char *to) ATTR_NONNULL();
+int BLI_create_symlink(const char *path, const char *to) ATTR_NONNULL();
#endif
/* keep in sync with the definition of struct direntry in BLI_fileops_types.h */
@@ -113,7 +113,7 @@ bool BLI_file_is_writable(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL
bool BLI_file_touch(const char *file) ATTR_NONNULL();
#if 0 /* UNUSED */
-int BLI_file_gzip(const char *from, const char *to) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+int BLI_file_gzip(const char *from, const char *to) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
#endif
char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index 0f65f8ecbf0..4860fa6c669 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -608,11 +608,9 @@ static void *bli_mempool_iternext(BLI_mempool_iter *iter)
if (iter->curchunk == NULL) {
return ret;
}
- if (atomic_cas_ptr(
- (void **)iter->curchunk_threaded_shared,
- iter->curchunk,
- iter->curchunk->next) == iter->curchunk)
- {
+ if (atomic_cas_ptr((void **)iter->curchunk_threaded_shared,
+ iter->curchunk,
+ iter->curchunk->next) == iter->curchunk) {
break;
}
}
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 9e07b4d2836..f8a34404cc7 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -85,7 +85,7 @@ int BLI_file_gzip(const char *from, const char *to)
break;
}
else if (readsize == 0)
- break; /* done reading */
+ break; /* done reading */
if (gzwrite(gzfile, buffer, readsize) <= 0) {
rval = -1; /* error happened in writing */
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 7d7ff3f450f..af0a66503f2 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -828,14 +828,9 @@ void dist_squared_to_projected_aabb_precalc(struct DistProjectedAABBPrecalc *pre
float projmat_trans[4][4];
transpose_m4_m4(projmat_trans, projmat);
if (!isect_plane_plane_plane_v3(
- projmat_trans[0], projmat_trans[1], projmat_trans[3],
- precalc->ray_origin))
- {
+ projmat_trans[0], projmat_trans[1], projmat_trans[3], precalc->ray_origin)) {
/* Orthographic projection. */
- isect_plane_plane_v3(
- px, py,
- precalc->ray_origin,
- precalc->ray_direction);
+ isect_plane_plane_v3(px, py, precalc->ray_origin, precalc->ray_direction);
}
else {
/* Perspective projection. */
@@ -1908,8 +1903,7 @@ bool isect_ray_tri_watertight_v3(const float ray_origin[3],
* otherwise we won't match any of the other intersect functions here...
* which would be confusing */
#if 0
- ||
- (sign_T > *r_lambda * xor_signmask(det, sign_mask))
+ || (sign_T > *r_lambda * xor_signmask(det, sign_mask))
#endif
) {
return false;
@@ -1945,10 +1939,14 @@ bool isect_ray_tri_watertight_v3_simple(const float ray_origin[3],
* A version of #isect_ray_tri_v3 which takes a threshold argument
* so rays slightly outside the triangle to be considered as intersecting.
*/
-bool isect_ray_tri_threshold_v3(
- const float ray_origin[3], const float ray_direction[3],
- const float v0[3], const float v1[3], const float v2[3],
- float *r_lambda, float r_uv[2], const float threshold)
+bool isect_ray_tri_threshold_v3(const float ray_origin[3],
+ const float ray_direction[3],
+ const float v0[3],
+ const float v1[3],
+ const float v2[3],
+ float *r_lambda,
+ float r_uv[2],
+ const float threshold)
{
const float epsilon = 0.00000001f;
float p[3], s[3], e1[3], e2[3], q[3];
@@ -1960,14 +1958,16 @@ bool isect_ray_tri_threshold_v3(
cross_v3_v3v3(p, ray_direction, e2);
a = dot_v3v3(e1, p);
- if ((a > -epsilon) && (a < epsilon)) return false;
+ if ((a > -epsilon) && (a < epsilon))
+ return false;
f = 1.0f / a;
sub_v3_v3v3(s, ray_origin, v0);
cross_v3_v3v3(q, s, e1);
*r_lambda = f * dot_v3v3(e2, q);
- if ((*r_lambda < 0.0f)) return false;
+ if ((*r_lambda < 0.0f))
+ return false;
u = f * dot_v3v3(s, p);
v = f * dot_v3v3(ray_direction, q);
@@ -1978,13 +1978,19 @@ bool isect_ray_tri_threshold_v3(
dv = v - t;
}
else {
- if (u < 0) du = u;
- else if (u > 1) du = u - 1;
- else du = 0.0f;
+ if (u < 0)
+ du = u;
+ else if (u > 1)
+ du = u - 1;
+ else
+ du = 0.0f;
- if (v < 0) dv = v;
- else if (v > 1) dv = v - 1;
- else dv = 0.0f;
+ if (v < 0)
+ dv = v;
+ else if (v > 1)
+ dv = v - 1;
+ else
+ dv = 0.0f;
}
mul_v3_fl(e1, du);
@@ -5212,20 +5218,20 @@ typedef union {
static vFloat vec_splat_float(float val)
{
- return (vFloat) {val, val, val, val};
+ return (vFloat){val, val, val, val};
}
static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3)
{
vFloat vcos, rlen, vrx, vry, vrz, vsrx, vsry, vsrz, gx, gy, gz, vangle;
- vUInt8 rotate = (vUInt8) {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3};
+ vUInt8 rotate = (vUInt8){4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3};
vFloatResult vresult;
float result;
/* compute r* */
- vrx = (vFloat) {q0[0], q1[0], q2[0], q3[0]} -vec_splat_float(p[0]);
- vry = (vFloat) {q0[1], q1[1], q2[1], q3[1]} -vec_splat_float(p[1]);
- vrz = (vFloat) {q0[2], q1[2], q2[2], q3[2]} -vec_splat_float(p[2]);
+ vrx = (vFloat){q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
+ vry = (vFloat){q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
+ vrz = (vFloat){q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
/* normalize r* */
rlen = vec_rsqrte(vrx * vrx + vry * vry + vrz * vrz + vec_splat_float(1e-16f));
@@ -5255,9 +5261,9 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
vangle = vacosf(vcos);
/* dot */
- vresult.v = (vec_splat_float(n[0]) * gx +
- vec_splat_float(n[1]) * gy +
- vec_splat_float(n[2]) * gz) * vangle;
+ vresult.v = (vec_splat_float(n[0]) * gx + vec_splat_float(n[1]) * gy +
+ vec_splat_float(n[2]) * gz) *
+ vangle;
result = (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3]) * (0.5f / (float)M_PI);
result = MAX2(result, 0.0f);
diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c
index 6acfb538036..380603913f1 100644
--- a/source/blender/blenlib/intern/math_interp.c
+++ b/source/blender/blenlib/intern/math_interp.c
@@ -54,10 +54,8 @@ static float P(float k)
static float P(float k)
{
return (float)(1.0f / 6.0f) *
- (pow(MAX2(k + 2.0f, 0), 3.0f) - 4.0f *
- pow(MAX2(k + 1.0f, 0), 3.0f) + 6.0f *
- pow(MAX2(k, 0), 3.0f) - 4.0f *
- pow(MAX2(k - 1.0f, 0), 3.0f));
+ (pow(MAX2(k + 2.0f, 0), 3.0f) - 4.0f * pow(MAX2(k + 1.0f, 0), 3.0f) +
+ 6.0f * pow(MAX2(k, 0), 3.0f) - 4.0f * pow(MAX2(k - 1.0f, 0), 3.0f));
}
#endif
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e05edfdd44e..6acf0a76fa9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3724,7 +3724,8 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
bNodeInstanceHash *new_previews = BKE_node_instance_hash_new("node previews");
bNodeInstanceHashIterator iter;
- NODE_INSTANCE_HASH_ITER(iter, ntree->previews) {
+ NODE_INSTANCE_HASH_ITER(iter, ntree->previews)
+ {
bNodePreview *preview = BKE_node_instance_hash_iterator_get_value(&iter);
if (preview) {
bNodePreview *new_preview = newimaadr(fd, preview);
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index df56809869f..69416f08205 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1156,9 +1156,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
/* Copy over the settings stored in the GP datablock linked to the scene, for minimal disruption */
ts->gpencil_v3d_align = 0;
- if (gpd->flag & GP_DATA_VIEWALIGN) ts->gpencil_v3d_align |= GP_PROJECT_VIEWSPACE;
- if (gpd->flag & GP_DATA_DEPTH_VIEW) ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_VIEW;
- if (gpd->flag & GP_DATA_DEPTH_STROKE) ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE;
+ if (gpd->flag & GP_DATA_VIEWALIGN)
+ ts->gpencil_v3d_align |= GP_PROJECT_VIEWSPACE;
+ if (gpd->flag & GP_DATA_DEPTH_VIEW)
+ ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_VIEW;
+ if (gpd->flag & GP_DATA_DEPTH_STROKE)
+ ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE;
if (gpd->flag & GP_DATA_DEPTH_STROKE_ENDPOINTS)
ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE_ENDPOINTS;
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index 16a534b5e56..fd9439eb158 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -1125,11 +1125,9 @@ void bm_log_print(const BMLog *log, const char *description)
int i;
printf("%s:\n", description);
- printf(" % 2d: [ initial ]%s\n", 0,
- (!log->current_entry) ? current : "");
+ printf(" % 2d: [ initial ]%s\n", 0, (!log->current_entry) ? current : "");
for (entry = log->entries.first, i = 1; entry; entry = entry->next, i++) {
- printf(" % 2d: [%p]%s\n", i, entry,
- (entry == log->current_entry) ? current : "");
+ printf(" % 2d: [%p]%s\n", i, entry, (entry == log->current_entry) ? current : "");
}
}
#endif
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 8d445d428b2..3673c299a0c 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -1026,19 +1026,24 @@ static void bm_mesh_loops_calc_normals_no_autosmooth(BMesh *bm,
* Updates the loop normals of a mesh. Assumes vertex and face normals are valid (else call BM_mesh_normals_update()
* first)!
*/
-void BM_mesh_loop_normals_update(
- BMesh *bm, const bool use_split_normals, const float split_angle, float (*r_lnos)[3],
- MLoopNorSpaceArray *r_lnors_spacearr, short (*clnors_data)[2], const int cd_loop_clnors_offset)
+void BM_mesh_loop_normals_update(BMesh *bm,
+ const bool use_split_normals,
+ const float split_angle,
+ float (*r_lnos)[3],
+ MLoopNorSpaceArray *r_lnors_spacearr,
+ short (*clnors_data)[2],
+ const int cd_loop_clnors_offset)
{
const bool has_clnors = clnors_data || (cd_loop_clnors_offset != -1);
if (use_split_normals) {
- /* Tag smooth edges and set lnos from vnos when they might be completely smooth...
+ /* Tag smooth edges and set lnos from vnos when they might be completely smooth...
* When using custom loop normals, disable the angle feature! */
- bm_mesh_edges_sharp_tag(bm, NULL, NULL, has_clnors ? (float)M_PI : split_angle, r_lnos);
+ bm_mesh_edges_sharp_tag(bm, NULL, NULL, has_clnors ? (float)M_PI : split_angle, r_lnos);
- /* Finish computing lnos by accumulating face normals in each fan of faces defined by sharp edges. */
- bm_mesh_loops_calc_normals(bm, NULL, NULL, r_lnos, r_lnors_spacearr, clnors_data, cd_loop_clnors_offset);
+ /* Finish computing lnos by accumulating face normals in each fan of faces defined by sharp edges. */
+ bm_mesh_loops_calc_normals(
+ bm, NULL, NULL, r_lnos, r_lnors_spacearr, clnors_data, cd_loop_clnors_offset);
}
else {
BLI_assert(!r_lnors_spacearr);
@@ -1839,8 +1844,13 @@ void BM_mesh_elem_index_validate(
/* dirty may have been incorrectly set */
fprintf(stderr,
- "Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are correct, '%s', '%s'\n",
- location, func, type_names[i], msg_a, msg_b);
+ "Invalid Dirty: at %s, %s (%s), dirty flag was set but all index values are "
+ "correct, '%s', '%s'\n",
+ location,
+ func,
+ type_names[i],
+ msg_a,
+ msg_b);
#endif
}
}
@@ -1848,9 +1858,7 @@ void BM_mesh_elem_index_validate(
#if 0 /* mostly annoying, even in debug mode */
# ifdef DEBUG
if (is_any_error == 0) {
- fprintf(stderr,
- "Valid Index Success: at %s, %s, '%s', '%s'\n",
- location, func, msg_a, msg_b);
+ fprintf(stderr, "Valid Index Success: at %s, %s, '%s', '%s'\n", location, func, msg_a, msg_b);
}
# endif
#endif
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index 1075b3753da..606051ebefa 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -531,14 +531,15 @@ BMEdge *BM_vert_collapse_edge(
/* in this case we want to keep all faces and not join them,
* rather just get rid of the vertex - see bug [#28645] */
- BMVert *tv = BM_edge_other_vert(e_kill, v_kill);
+ BMVert *tv = BM_edge_other_vert(e_kill, v_kill);
if (tv) {
BMEdge *e2 = bmesh_disk_edge_next(e_kill, v_kill);
if (e2) {
BMVert *tv2 = BM_edge_other_vert(e2, v_kill);
if (tv2) {
/* only action, other calls here only get the edge to return */
- e_new = bmesh_kernel_join_edge_kill_vert(bm, e_kill, v_kill, do_del, true, kill_degenerate_faces);
+ e_new = bmesh_kernel_join_edge_kill_vert(
+ bm, e_kill, v_kill, do_del, true, kill_degenerate_faces);
}
}
}
@@ -748,11 +749,12 @@ bool BM_face_validate(BMFace *face, FILE *err)
}
BLI_array_grow_items(verts, face->len);
- BM_ITER_ELEM_INDEX (l, &iter, face, BM_LOOPS_OF_FACE, i) {
+ BM_ITER_ELEM_INDEX(l, &iter, face, BM_LOOPS_OF_FACE, i)
+ {
verts[i] = l->v;
if (l->e->v1 == l->e->v2) {
fprintf(err, "Found bmesh edge with identical verts!\n");
- fprintf(err, " edge ptr: %p, vert: %p\n", l->e, l->e->v1);
+ fprintf(err, " edge ptr: %p, vert: %p\n", l->e, l->e->v1);
fflush(err);
ret = false;
}
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index a7783084c01..0e9b615afe7 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -741,7 +741,8 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd)
if (slot->len >= slot->size) {
slot->size = (slot->size + 1 + totadd) * 2;
- allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * slot->size;
+ allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] *
+ slot->size;
tmp = slot->data.buf;
slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array");
@@ -756,7 +757,8 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd)
slot->len += totadd;
slot->size = slot->len + 2;
- allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] * slot->len;
+ allocsize = BMO_OPSLOT_TYPEINFO[bmo_opdefines[op->type]->slot_types[slot_code].type] *
+ slot->len;
tmp = slot->data.buf;
slot->data.buf = MEM_callocN(allocsize, "opslot dynamic array");
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 2a734c242ba..6f363e51b49 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -1587,7 +1587,7 @@ void BM_mesh_calc_tessellation_beauty(BMesh *bm, BMLoop *(*looptris)[3], int *r_
*/
#if 0
const bool split_13 = (BM_verts_calc_rotate_beauty(
- l_v1->v, l_v2->v, l_v3->v, l_v4->v, 0, 0) < 0.0f);
+ l_v1->v, l_v2->v, l_v3->v, l_v4->v, 0, 0) < 0.0f);
#else
float axis_mat[3][3], v_quad[4][2];
axis_dominant_v3_to_m3(axis_mat, efa->no);
diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c
index 98ad30b6a28..1986a1c782d 100644
--- a/source/blender/bmesh/intern/bmesh_query.c
+++ b/source/blender/bmesh/intern/bmesh_query.c
@@ -1917,7 +1917,6 @@ BMEdge *BM_edge_exists(BMVert *v_a, BMVert *v_b)
BMIter iter;
BMEdge *e;
-
BLI_assert(v_a != v_b);
BLI_assert(v_a->head.htype == BM_VERT && v_b->head.htype == BM_VERT);
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index c327c10226f..0097e0a3056 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -209,14 +209,13 @@ static void *bmw_VertShellWalker_step(BMWalker *walker)
BMW_state_remove(walker);
-
/* find the next edge whose other vertex has not been visite */
curedge = shellWalk.curedge;
do {
if (!BLI_gset_haskey(walker->visit_set, curedge)) {
if (!walker->restrictflag ||
- (walker->restrictflag && BMO_edge_flag_test(walker->bm, curedge, walker->restrictflag)))
- {
+ (walker->restrictflag &&
+ BMO_edge_flag_test(walker->bm, curedge, walker->restrictflag))) {
BMwShellWalker *newstate;
v_old = BM_edge_other_vert(curedge, shellWalk.base);
diff --git a/source/blender/bmesh/tools/bmesh_beautify.c b/source/blender/bmesh/tools/bmesh_beautify.c
index e8a49c895ab..be7527ae349 100644
--- a/source/blender/bmesh/tools/bmesh_beautify.c
+++ b/source/blender/bmesh/tools/bmesh_beautify.c
@@ -66,15 +66,24 @@ static int erot_gsetutil_cmp(const void *a, const void *b)
{
const EdRotState *e_state_a = (const EdRotState *)a;
const EdRotState *e_state_b = (const EdRotState *)b;
- if (e_state_a->v1 < e_state_b->v1) return -1;
- else if (e_state_a->v1 > e_state_b->v1) return 1;
- else if (e_state_a->v2 < e_state_b->v2) return -1;
- else if (e_state_a->v2 > e_state_b->v2) return 1;
- else if (e_state_a->f1 < e_state_b->f1) return -1;
- else if (e_state_a->f1 > e_state_b->f1) return 1;
- else if (e_state_a->f2 < e_state_b->f2) return -1;
- else if (e_state_a->f2 > e_state_b->f2) return 1;
- else return 0;
+ if (e_state_a->v1 < e_state_b->v1)
+ return -1;
+ else if (e_state_a->v1 > e_state_b->v1)
+ return 1;
+ else if (e_state_a->v2 < e_state_b->v2)
+ return -1;
+ else if (e_state_a->v2 > e_state_b->v2)
+ return 1;
+ else if (e_state_a->f1 < e_state_b->f1)
+ return -1;
+ else if (e_state_a->f1 > e_state_b->f1)
+ return 1;
+ else if (e_state_a->f2 < e_state_b->f2)
+ return -1;
+ else if (e_state_a->f2 > e_state_b->f2)
+ return 1;
+ else
+ return 0;
}
#endif
static GSet *erot_gset_new(void)
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index f6695db1d0a..e7a48ee27da 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -351,7 +351,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
std::vector<FCurve *> &rot_fcurves = fcurves_actionGroup_map[grp];
- if (rot_fcurves.size() > 3) continue;
+ if (rot_fcurves.size() > 3)
+ continue;
for (i = 0; i < rot_fcurves.size(); i++)
eulcu[rot_fcurves[i]->array_index] = rot_fcurves[i];
@@ -366,7 +367,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
create_fcurve(0, rna_path),
create_fcurve(1, rna_path),
create_fcurve(2, rna_path),
- create_fcurve(3, rna_path)
+ create_fcurve(3, rna_path),
};
bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, grp->name);
@@ -379,7 +380,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
FCurve *cu = eulcu[i];
- if (!cu) continue;
+ if (!cu)
+ continue;
for (int j = 0; j < cu->totvert; j++) {
float frame = cu->bezt[j].vec[1][0];
@@ -387,7 +389,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
float eul[3] = {
eulcu[0] ? evaluate_fcurve(eulcu[0], frame) : 0.0f,
eulcu[1] ? evaluate_fcurve(eulcu[1], frame) : 0.0f,
- eulcu[2] ? evaluate_fcurve(eulcu[2], frame) : 0.0f
+ eulcu[2] ? evaluate_fcurve(eulcu[2], frame) : 0.0f,
};
// make eul relative to bone rest pose
@@ -410,7 +412,8 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
// now replace old Euler curves
for (i = 0; i < 3; i++) {
- if (!eulcu[i]) continue;
+ if (!eulcu[i])
+ continue;
action_groups_remove_channel(act, eulcu[i]);
free_fcurve(eulcu[i]);
@@ -574,14 +577,13 @@ void AnimationImporter::Assign_transform_animations(
case COLLADAFW::Transformation::MATRIX:
#if 0
- {
- COLLADAFW::Matrix *mat = (COLLADAFW::Matrix*)transform;
- COLLADABU::Math::Matrix4 mat4 = mat->getMatrix();
- switch (binding->animationClass) {
- case COLLADAFW::AnimationList::TRANSFORM:
-
- }
+ {
+ COLLADAFW::Matrix *mat = (COLLADAFW::Matrix *)transform;
+ COLLADABU::Math::Matrix4 mat4 = mat->getMatrix();
+ switch (binding->animationClass) {
+ case COLLADAFW::AnimationList::TRANSFORM:
}
+ }
#endif
unused_fcurve(curves);
break;
@@ -2045,7 +2047,8 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root,
#if 0
// recursively evaluates joint tree until end is found, mat then is world-space matrix of end
// mat must be identity on enter, node must be root
-bool AnimationImporter::evaluate_joint_world_transform_at_frame(float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra)
+bool AnimationImporter::evaluate_joint_world_transform_at_frame(
+ float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra)
{
float m[4][4];
if (par) {
@@ -2062,7 +2065,7 @@ bool AnimationImporter::evaluate_joint_world_transform_at_frame(float mat[4][4],
return true;
}
else {
- COLLADAFW::NodePointerArray& children = node->getChildNodes();
+ COLLADAFW::NodePointerArray &children = node->getChildNodes();
for (int i = 0; i < children.getCount(); i++) {
if (evaluate_joint_world_transform_at_frame(mat, m, children[i], end, fra))
return true;
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index 65e9974aec1..f15c02183c7 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -238,7 +238,8 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
#if 0
// recursively evaluates joint tree until end is found, mat then is world-space matrix of end
// mat must be identity on enter, node must be root
- bool evaluate_joint_world_transform_at_frame(float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra);
+ bool evaluate_joint_world_transform_at_frame(
+ float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra);
#endif
void add_bone_fcurve(Object *ob, COLLADAFW::Node *node, FCurve *fcu);
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp
index ea1e98caf58..5abe0998470 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -119,12 +119,12 @@ bool ArmatureExporter::add_instance_controller(Object *ob)
void ArmatureExporter::operator()(Object *ob)
{
Object *ob_arm = bc_get_assigned_armature(ob);
-
}
bool ArmatureExporter::already_written(Object *ob_arm)
{
- return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) != written_armatures.end();
+ return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) !=
+ written_armatures.end();
}
void ArmatureExporter::wrote(Object *ob_arm)
@@ -132,11 +132,13 @@ void ArmatureExporter::wrote(Object *ob_arm)
written_armatures.push_back(ob_arm);
}
-void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce)
+void ArmatureExporter::find_objects_using_armature(Object *ob_arm,
+ std::vector<Object *> &objects,
+ Scene *sce)
{
objects.clear();
- Base *base = (Base *) sce->base.first;
+ Base *base = (Base *)sce->base.first;
while (base) {
Object *ob = base->object;
diff --git a/source/blender/collada/ArmatureExporter.h b/source/blender/collada/ArmatureExporter.h
index f0da8680476..6ef6007960e 100644
--- a/source/blender/collada/ArmatureExporter.h
+++ b/source/blender/collada/ArmatureExporter.h
@@ -81,7 +81,7 @@ class ArmatureExporter : public COLLADASW::LibraryControllers,
void wrote(Object *ob_arm);
- void find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce);
+ void find_objects_using_armature(Object *ob_arm, std::vector<Object *> &objects, Scene *sce);
#endif
// Scene, SceneExporter and the list of child_objects
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 038dbd0c30d..315ae91e643 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -75,11 +75,11 @@ ArmatureImporter::~ArmatureImporter()
#if 0
JointData *ArmatureImporter::get_joint_data(COLLADAFW::Node *node);
{
- const COLLADAFW::UniqueId& joint_id = node->getUniqueId();
+ const COLLADAFW::UniqueId &joint_id = node->getUniqueId();
if (joint_id_to_joint_index_map.find(joint_id) == joint_id_to_joint_index_map.end()) {
- fprintf(stderr, "Cannot find a joint index by joint id for %s.\n",
- node->getOriginalId().c_str());
+ fprintf(
+ stderr, "Cannot find a joint index by joint id for %s.\n", node->getOriginalId().c_str());
return NULL;
}
@@ -371,7 +371,7 @@ void ArmatureImporter::set_leaf_bone_shapes(Object *ob_arm)
std::vector<LeafBone>::iterator it;
for (it = leaf_bones.begin(); it != leaf_bones.end(); it++) {
- LeafBone& leaf = *it;
+ LeafBone &leaf = *it;
bPoseChannel *pchan = BKE_pose_channel_find_name(pose, leaf.name);
if (pchan) {
@@ -396,7 +396,7 @@ void ArmatureImporter::set_euler_rotmode()
std::map<COLLADAFW::UniqueId, SkinInfo>::iterator sit;
for (sit = skin_by_data_uid.begin(); sit != skin_by_data_uid.end(); sit++) {
- SkinInfo& skin = sit->second;
+ SkinInfo &skin = sit->second;
if (skin.uses_joint_or_descendant(joint)) {
bPoseChannel *pchan = skin.get_pose_channel_from_node(joint);
@@ -430,23 +430,26 @@ Object *ArmatureImporter::get_empty_for_leaves()
Object *ArmatureImporter::find_armature(COLLADAFW::Node *node)
{
JointData *jd = get_joint_data(node);
- if (jd) return jd->ob_arm;
+ if (jd)
+ return jd->ob_arm;
- COLLADAFW::NodePointerArray& children = node->getChildNodes();
+ COLLADAFW::NodePointerArray &children = node->getChildNodes();
for (int i = 0; i < children.getCount(); i++) {
Object *ob_arm = find_armature(children[i]);
- if (ob_arm) return ob_arm;
+ if (ob_arm)
+ return ob_arm;
}
return NULL;
}
-ArmatureJoints& ArmatureImporter::get_armature_joints(Object *ob_arm)
+ArmatureJoints &ArmatureImporter::get_armature_joints(Object *ob_arm)
{
// try finding it
std::vector<ArmatureJoints>::iterator it;
for (it = armature_joints.begin(); it != armature_joints.end(); it++) {
- if ((*it).ob_arm == ob_arm) return *it;
+ if ((*it).ob_arm == ob_arm)
+ return *it;
}
// not found, create one
@@ -800,7 +803,9 @@ void ArmatureImporter::make_armatures(bContext *C, std::vector<Object *> &object
#if 0
// link with meshes, create vertex groups, assign weights
-void ArmatureImporter::link_armature(Object *ob_arm, const COLLADAFW::UniqueId& geom_id, const COLLADAFW::UniqueId& controller_data_id)
+void ArmatureImporter::link_armature(Object *ob_arm,
+ const COLLADAFW::UniqueId &geom_id,
+ const COLLADAFW::UniqueId &controller_data_id)
{
Object *ob = mesh_importer->get_object_by_geom_uid(geom_id);
@@ -814,7 +819,7 @@ void ArmatureImporter::link_armature(Object *ob_arm, const COLLADAFW::UniqueId&
return;
}
- SkinInfo& skin = skin_by_data_uid[conroller_data_id];
+ SkinInfo &skin = skin_by_data_uid[conroller_data_id];
// create vertex groups
}
diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h
index cfcd9501790..19f053c61fb 100644
--- a/source/blender/collada/ArmatureImporter.h
+++ b/source/blender/collada/ArmatureImporter.h
@@ -73,7 +73,7 @@ class ArmatureImporter : private TransformReader {
#if 0
struct ArmatureJoints {
Object *ob_arm;
- std::vector<COLLADAFW::Node*> root_joints;
+ std::vector<COLLADAFW::Node *> root_joints;
};
std::vector<ArmatureJoints> armature_joints;
#endif
@@ -133,7 +133,7 @@ class ArmatureImporter : private TransformReader {
#if 0
Object *find_armature(COLLADAFW::Node *node);
- ArmatureJoints& get_armature_joints(Object *ob_arm);
+ ArmatureJoints &get_armature_joints(Object *ob_arm);
#endif
Object *create_armature_bones(Main *bmain, SkinInfo &skin);
@@ -161,7 +161,9 @@ class ArmatureImporter : private TransformReader {
#if 0
// link with meshes, create vertex groups, assign weights
- void link_armature(Object *ob_arm, const COLLADAFW::UniqueId& geom_id, const COLLADAFW::UniqueId& controller_data_id);
+ void link_armature(Object *ob_arm,
+ const COLLADAFW::UniqueId &geom_id,
+ const COLLADAFW::UniqueId &controller_data_id);
#endif
bool write_skin_controller_data(const COLLADAFW::SkinControllerData *data);
diff --git a/source/blender/collada/BCAnimationSampler.cpp b/source/blender/collada/BCAnimationSampler.cpp
index 9a281e2218b..e8b1015e1c3 100644
--- a/source/blender/collada/BCAnimationSampler.cpp
+++ b/source/blender/collada/BCAnimationSampler.cpp
@@ -332,10 +332,9 @@ bool BCAnimationSampler::get_object_samples(BCMatrixSampleMap &samples, Object *
animation_type BC_ANIMATION_EXPORT_KEYS: Only take data from matrices for keyframes
*/
-void BCAnimationSampler::add_value_set(
- BCAnimationCurve &curve,
- BCFrameSampleMap &samples,
- BC_export_animation_type animation_type)
+void BCAnimationSampler::add_value_set(BCAnimationCurve &curve,
+ BCFrameSampleMap &samples,
+ BC_export_animation_type animation_type)
{
int array_index = curve.get_array_index();
const BC_animation_transform_type tm_type = curve.get_transform_type();
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp
index dc9a701192f..0c9ca400dd2 100644
--- a/source/blender/collada/ControllerExporter.cpp
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -123,7 +123,8 @@ void ControllerExporter::operator()(Object *ob)
bool ArmatureExporter::already_written(Object *ob_arm)
{
- return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) != written_armatures.end();
+ return std::find(written_armatures.begin(), written_armatures.end(), ob_arm) !=
+ written_armatures.end();
}
void ArmatureExporter::wrote(Object *ob_arm)
@@ -131,11 +132,13 @@ void ArmatureExporter::wrote(Object *ob_arm)
written_armatures.push_back(ob_arm);
}
-void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce)
+void ArmatureExporter::find_objects_using_armature(Object *ob_arm,
+ std::vector<Object *> &objects,
+ Scene *sce)
{
objects.clear();
- Base *base = (Base *) sce->base.first;
+ Base *base = (Base *)sce->base.first;
while (base) {
Object *ob = base->object;
@@ -174,10 +177,10 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm)
#if 0
me->dvert :
- typedef struct MDeformVert {
+ typedef struct MDeformVert {
struct MDeformWeight *dw;
int totweight;
- int flag; // flag only in use for weightpaint now
+ int flag; // flag only in use for weightpaint now
} MDeformVert;
typedef struct MDeformWeight {
diff --git a/source/blender/collada/ControllerExporter.h b/source/blender/collada/ControllerExporter.h
index 50056df9f39..38d85cb7ebc 100644
--- a/source/blender/collada/ControllerExporter.h
+++ b/source/blender/collada/ControllerExporter.h
@@ -85,7 +85,7 @@ class ControllerExporter : public COLLADASW::LibraryControllers,
void wrote(Object *ob_arm);
- void find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce);
+ void find_objects_using_armature(Object *ob_arm, std::vector<Object *> &objects, Scene *sce);
#endif
std::string get_controller_id(Object *ob_arm, Object *ob);
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index d21e71bb37b..428678180f6 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -294,10 +294,10 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node,
#if 0
COLLADAFW::Transformation::TransformationType types[] = {
- COLLADAFW::Transformation::ROTATE,
- COLLADAFW::Transformation::SCALE,
- COLLADAFW::Transformation::TRANSLATE,
- COLLADAFW::Transformation::MATRIX,
+ COLLADAFW::Transformation::ROTATE,
+ COLLADAFW::Transformation::SCALE,
+ COLLADAFW::Transformation::TRANSLATE,
+ COLLADAFW::Transformation::MATRIX,
};
Object *ob;
diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp
index 58435c4551f..280a0c4b860 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -198,7 +198,8 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
Image *ima = t->tex->ima;
// Image not set for texture
- if (!ima) continue;
+ if (!ima)
+ continue;
std::string key(id_name(ima));
key = translate_id(key);
@@ -206,10 +207,9 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// create only one <sampler>/<surface> pair for each unique image
if (im_samp_map.find(key) == im_samp_map.end()) {
//<newparam> <sampler> <source>
- COLLADASW::Sampler sampler(
- COLLADASW::Sampler::SAMPLER_TYPE_2D,
- key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
- key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
+ COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
+ key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
+ key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
sampler.setImageId(key);
// copy values to arrays since they will live longer
samplers[a] = sampler;
@@ -235,7 +235,8 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
key = translate_id(key);
int i = im_samp_map[key];
std::string uvname = strlen(t->uvname) ? t->uvname : active_uv;
- COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)samp_surf[i]; // possibly uninitialised memory ...
+ COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)
+ samp_surf[i]; // possibly uninitialised memory ...
writeTextures(ep, key, sampler, t, ima, uvname);
}
#endif
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index 2e964bbf108..9ce6b399daa 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -264,13 +264,11 @@ Mesh *bc_get_mesh_copy(BlenderContext &blender_context,
if (apply_modifiers) {
#if 0 /* Not supported by new system currently... */
switch (export_mesh_type) {
- case BC_MESH_TYPE_VIEW:
- {
+ case BC_MESH_TYPE_VIEW: {
dm = mesh_create_derived_view(depsgraph, scene, ob, &mask);
break;
}
- case BC_MESH_TYPE_RENDER:
- {
+ case BC_MESH_TYPE_RENDER: {
dm = mesh_create_derived_render(depsgraph, scene, ob, &mask);
break;
}
@@ -826,18 +824,16 @@ void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4])
*/
static void bc_set_IDProperty(EditBone *ebone, const char *key, float value)
{
- if (ebone->prop == NULL)
- {
- IDPropertyTemplate val = { 0 };
+ if (ebone->prop == NULL) {
+ IDPropertyTemplate val = {0};
ebone->prop = IDP_New(IDP_GROUP, &val, "RNA_EditBone ID properties");
}
IDProperty *pgroup = (IDProperty *)ebone->prop;
- IDPropertyTemplate val = { 0 };
+ IDPropertyTemplate val = {0};
IDProperty *prop = IDP_New(IDP_FLOAT, &val, key);
IDP_Float(prop) = value;
IDP_AddToGroup(pgroup, prop);
-
}
#endif
@@ -1262,7 +1258,10 @@ bNode *bc_add_node(bContext *C, bNodeTree *ntree, int node_type, int locx, int l
#if 0
// experimental, probably not used
-static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree, bNode *to_node, int to_index, std::string label)
+static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree,
+ bNode *to_node,
+ int to_index,
+ std::string label)
{
bNodeSocket *to_socket = (bNodeSocket *)BLI_findlink(&to_node->inputs, to_index);
@@ -1278,7 +1277,10 @@ static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree, bNode *to_node,
return newsock;
}
-static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree, bNode *from_node, int from_index, std::string label)
+static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree,
+ bNode *from_node,
+ int from_index,
+ std::string label)
{
bNodeSocket *from_socket = (bNodeSocket *)BLI_findlink(&from_node->outputs, from_index);
@@ -1294,7 +1296,6 @@ static bNodeSocket *bc_group_add_output_socket(bNodeTree *ntree, bNode *from_nod
return newsock;
}
-
void bc_make_group(bContext *C, bNodeTree *ntree, std::map<std::string, bNode *> nmap)
{
bNode *gnode = node_group_make_from_selected(C, ntree, "ShaderNodeGroup", "ShaderNodeTree");
diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index 61b5e306623..dfd5519be31 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -181,9 +181,10 @@ inline bool bc_startswith(std::string const &value, std::string const &starting)
}
#if 0 /* UNUSED */
-inline bool bc_endswith(std::string const & value, std::string const & ending)
+inline bool bc_endswith(std::string const &value, std::string const &ending)
{
- if (ending.size() > value.size()) return false;
+ if (ending.size() > value.size())
+ return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}
#endif
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index 018b1662e0f..6caaf227ef2 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -181,7 +181,7 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
* Full frame
*/
- int full_width = rd->xsch * rd->size / 100;
+ int full_width = rd->xsch * rd->size / 100;
int full_height = rd->ysch * rd->size / 100;
dx = rd->border.xmin * full_width - (full_width - this->getWidth()) / 2.0f;
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp
index 0ebb60cff18..e7f33cd2c79 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp
@@ -119,7 +119,7 @@ void RenderLayersProg::executePixelSampled(float output[4], float x, float y, Pi
/* see comment in executeRegion describing coordinate mapping,
* here it simply goes other way around
*/
- int full_width = rd->xsch * rd->size / 100;
+ int full_width = rd->xsch * rd->size / 100;
int full_height = rd->ysch * rd->size / 100;
dx = rd->border.xmin * full_width - (full_width - this->getWidth()) / 2.0f;
diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c
index e77d7b16c78..79b4cb231a8 100644
--- a/source/blender/draw/engines/eevee/eevee_effects.c
+++ b/source/blender/draw/engines/eevee/eevee_effects.c
@@ -413,7 +413,8 @@ void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int l
GPU_framebuffer_texture_detach(stl->g_data->minzbuffer);
/* Create lower levels */
- GPU_framebuffer_recursive_downsample(fbl->downsample_fb, stl->g_data->minzbuffer, 8, &min_downsample_cb, vedata);
+ GPU_framebuffer_recursive_downsample(
+ fbl->downsample_fb, stl->g_data->minzbuffer, 8, &min_downsample_cb, vedata);
DRW_stats_group_end();
#endif
int minmax_size[3], depth_size[3];
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index 9268f2e8a46..0557fd11995 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -115,15 +115,15 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h))
static float samples_len = 8192.0f;
static float inv_samples_len = 1.0f / 8192.0f;
- char *lib_str = BLI_string_joinN(
- datatoc_bsdf_common_lib_glsl,
- datatoc_bsdf_sampling_lib_glsl);
+ char *lib_str = BLI_string_joinN(datatoc_bsdf_common_lib_glsl, datatoc_bsdf_sampling_lib_glsl);
- struct GPUShader *sh = DRW_shader_create_with_lib(
- datatoc_lightprobe_vert_glsl, datatoc_lightprobe_geom_glsl, datatoc_bsdf_lut_frag_glsl, lib_str,
- "#define HAMMERSLEY_SIZE 8192\n"
- "#define BRDF_LUT_SIZE 64\n"
- "#define NOISE_SIZE 64\n");
+ struct GPUShader *sh = DRW_shader_create_with_lib(datatoc_lightprobe_vert_glsl,
+ datatoc_lightprobe_geom_glsl,
+ datatoc_bsdf_lut_frag_glsl,
+ lib_str,
+ "#define HAMMERSLEY_SIZE 8192\n"
+ "#define BRDF_LUT_SIZE 64\n"
+ "#define NOISE_SIZE 64\n");
DRWPass *pass = DRW_pass_create("LightProbe Filtering", DRW_STATE_WRITE_COLOR);
DRWShadingGroup *grp = DRW_shgroup_create(sh, pass);
@@ -150,11 +150,14 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h))
glReadPixels(0, 0, w, h, GL_RGB, GL_FLOAT, data);
printf("{");
- for (int i = 0; i < w*h * 3; i+=3) {
- printf("%ff, %ff, ", data[i], data[i+1]); i+=3;
- printf("%ff, %ff, ", data[i], data[i+1]); i+=3;
- printf("%ff, %ff, ", data[i], data[i+1]); i+=3;
- printf("%ff, %ff, \n", data[i], data[i+1]);
+ for (int i = 0; i < w * h * 3; i += 3) {
+ printf("%ff, %ff, ", data[i], data[i + 1]);
+ i += 3;
+ printf("%ff, %ff, ", data[i], data[i + 1]);
+ i += 3;
+ printf("%ff, %ff, ", data[i], data[i + 1]);
+ i += 3;
+ printf("%ff, %ff, \n", data[i], data[i + 1]);
}
printf("}");
@@ -174,15 +177,13 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
static float inv_samples_len = 1.0f / 8192.0f;
char *frag_str = BLI_string_joinN(
- datatoc_bsdf_common_lib_glsl,
- datatoc_bsdf_sampling_lib_glsl,
- datatoc_btdf_lut_frag_glsl);
+ datatoc_bsdf_common_lib_glsl, datatoc_bsdf_sampling_lib_glsl, datatoc_btdf_lut_frag_glsl);
struct GPUShader *sh = DRW_shader_create_fullscreen(frag_str,
- "#define HAMMERSLEY_SIZE 8192\n"
- "#define BRDF_LUT_SIZE 64\n"
- "#define NOISE_SIZE 64\n"
- "#define LUT_SIZE 64\n");
+ "#define HAMMERSLEY_SIZE 8192\n"
+ "#define BRDF_LUT_SIZE 64\n"
+ "#define NOISE_SIZE 64\n"
+ "#define LUT_SIZE 64\n");
MEM_freeN(frag_str);
@@ -222,20 +223,28 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
# if 1
fprintf(f, "\t{\n\t\t");
- for (int i = 0; i < w*h * 3; i+=3) {
+ for (int i = 0; i < w * h * 3; i += 3) {
fprintf(f, "%ff,", data[i]);
- if (((i/3)+1) % 12 == 0) fprintf(f, "\n\t\t");
- else fprintf(f, " ");
+ if (((i / 3) + 1) % 12 == 0)
+ fprintf(f, "\n\t\t");
+ else
+ fprintf(f, " ");
}
fprintf(f, "\n\t},\n");
# else
- for (int i = 0; i < w*h * 3; i+=3) {
- if (data[i] < 0.01) printf(" ");
- else if (data[i] < 0.3) printf(".");
- else if (data[i] < 0.6) printf("+");
- else if (data[i] < 0.9) printf("%%");
- else printf("#");
- if ((i/3+1) % 64 == 0) printf("\n");
+ for (int i = 0; i < w * h * 3; i += 3) {
+ if (data[i] < 0.01)
+ printf(" ");
+ else if (data[i] < 0.3)
+ printf(".");
+ else if (data[i] < 0.6)
+ printf("+");
+ else if (data[i] < 0.9)
+ printf("%%");
+ else
+ printf("#");
+ if ((i / 3 + 1) % 64 == 0)
+ printf("\n");
}
# endif
diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c
index f2863d572c4..f8795a7ff0e 100644
--- a/source/blender/draw/engines/eevee/eevee_motion_blur.c
+++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c
@@ -165,11 +165,7 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda
#if 0 /* for future high quality blur */
/* Future matrix */
eevee_motion_blur_camera_get_matrix_at_time(
- scene,
- ar, rv3d, v3d,
- ob_camera_eval,
- ctime + delta,
- effects->future_world_to_ndc);
+ scene, ar, rv3d, v3d, ob_camera_eval, ctime + delta, effects->future_world_to_ndc);
#endif
invert_m4_m4(effects->current_ndc_to_world, effects->current_world_to_ndc);
}
diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c
index 3e35f8120d7..f55b744481e 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_dof.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c
@@ -185,9 +185,12 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata, Object *camera)
wpd->dof_blur_tx = DRW_texture_pool_query_2d(
size[0], size[1], GPU_R11F_G11F_B10F, &draw_engine_workbench_solid);
#if 0
- wpd->coc_temp_tx = DRW_texture_pool_query_2d(shrink_h_size[0], shrink_h_size[1], GPU_RG8, &draw_engine_workbench_solid);
- wpd->coc_tiles_tx[0] = DRW_texture_pool_query_2d(shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid);
- wpd->coc_tiles_tx[1] = DRW_texture_pool_query_2d(shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid);
+ wpd->coc_temp_tx = DRW_texture_pool_query_2d(
+ shrink_h_size[0], shrink_h_size[1], GPU_RG8, &draw_engine_workbench_solid);
+ wpd->coc_tiles_tx[0] = DRW_texture_pool_query_2d(
+ shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid);
+ wpd->coc_tiles_tx[1] = DRW_texture_pool_query_2d(
+ shrink_w_size[0], shrink_w_size[1], GPU_RG8, &draw_engine_workbench_solid);
#endif
GPU_framebuffer_ensure_config(&fbl->dof_downsample_fb,
@@ -197,18 +200,21 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata, Object *camera)
GPU_ATTACHMENT_TEXTURE(txl->coc_halfres_tx),
});
#if 0
- GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_h_fb, {
- GPU_ATTACHMENT_NONE,
- GPU_ATTACHMENT_TEXTURE(wpd->coc_temp_tx),
- });
- GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_v_fb, {
- GPU_ATTACHMENT_NONE,
- GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[0]),
- });
- GPU_framebuffer_ensure_config(&fbl->dof_coc_dilate_fb, {
- GPU_ATTACHMENT_NONE,
- GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[1]),
- });
+ GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_h_fb,
+ {
+ GPU_ATTACHMENT_NONE,
+ GPU_ATTACHMENT_TEXTURE(wpd->coc_temp_tx),
+ });
+ GPU_framebuffer_ensure_config(&fbl->dof_coc_tile_v_fb,
+ {
+ GPU_ATTACHMENT_NONE,
+ GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[0]),
+ });
+ GPU_framebuffer_ensure_config(&fbl->dof_coc_dilate_fb,
+ {
+ GPU_ATTACHMENT_NONE,
+ GPU_ATTACHMENT_TEXTURE(wpd->coc_tiles_tx[1]),
+ });
#endif
GPU_framebuffer_ensure_config(&fbl->dof_blur1_fb,
{
@@ -318,12 +324,14 @@ void workbench_dof_create_pass(WORKBENCH_Data *vedata,
}
#if 0
{
- DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_h_sh, psl->dof_flatten_h_ps);
+ DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_h_sh,
+ psl->dof_flatten_h_ps);
DRW_shgroup_uniform_texture(grp, "inputCocTex", txl->coc_halfres_tx);
DRW_shgroup_call_add(grp, quad, NULL);
}
{
- DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_v_sh, psl->dof_flatten_v_ps);
+ DRWShadingGroup *grp = DRW_shgroup_create(e_data.effect_dof_flatten_v_sh,
+ psl->dof_flatten_v_ps);
DRW_shgroup_uniform_texture(grp, "inputCocTex", wpd->coc_temp_tx);
DRW_shgroup_call_add(grp, quad, NULL);
}
diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c
index 5c95a835adc..3fc83fea7c6 100644
--- a/source/blender/draw/engines/workbench/workbench_studiolight.c
+++ b/source/blender/draw/engines/workbench/workbench_studiolight.c
@@ -78,12 +78,12 @@ void studiolight_update_world(WORKBENCH_PrivateData *wpd,
mul_v3_v3fl(wd->spherical_harmonics_coefs[0], sl->spherical_harmonics_coefs[0], M_1_PI);
/* Swizzle to make shader code simpler. */
for (int i = 0; i < 3; ++i) {
- copy_v3_fl3(
- wd->spherical_harmonics_coefs[i + 1],
- -sl->spherical_harmonics_coefs[3][i],
- sl->spherical_harmonics_coefs[2][i],
- -sl->spherical_harmonics_coefs[1][i]);
- mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */
+ copy_v3_fl3(wd->spherical_harmonics_coefs[i + 1],
+ -sl->spherical_harmonics_coefs[3][i],
+ sl->spherical_harmonics_coefs[2][i],
+ -sl->spherical_harmonics_coefs[1][i]);
+ mul_v3_fl(wd->spherical_harmonics_coefs[i + 1],
+ M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */
}
/* Precompute as much as we can. See shader code for derivation. */
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index 74c87162afd..7099f6ca573 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -161,9 +161,13 @@ static void UNUSED_FUNCTION(add_fancy_edge)(GPUVertBuf *vbo,
}
#if 0 /* UNUSED */
-static void add_lat_lon_vert(
- GPUVertBuf *vbo, uint pos_id, uint nor_id,
- uint *v_idx, const float rad, const float lat, const float lon)
+static void add_lat_lon_vert(GPUVertBuf *vbo,
+ uint pos_id,
+ uint nor_id,
+ uint *v_idx,
+ const float rad,
+ const float lat,
+ const float lon)
{
float pos[3], nor[3];
nor[0] = sinf(lat) * cosf(lon);
@@ -178,8 +182,10 @@ static void add_lat_lon_vert(
static GPUVertBuf *fill_arrows_vbo(const float scale)
{
/* Position Only 3D format */
- static GPUVertFormat format = { 0 };
- static struct { uint pos; } attr_id;
+ static GPUVertFormat format = {0};
+ static struct {
+ uint pos;
+ } attr_id;
if (format.attr_len == 0) {
attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
}
@@ -2039,10 +2045,10 @@ static const float bone_octahedral_verts[6][3] = {
static const float bone_octahedral_smooth_normals[6][3] = {
{0.0f, -1.0f, 0.0f},
#if 0 /* creates problems for outlines when scaled */
- { 0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2},
- { 0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2},
- {-0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2},
- {-0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2},
+ {0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2},
+ {0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2},
+ {-0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2},
+ {-0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2},
#else
{M_SQRT1_2, 0.0f, M_SQRT1_2},
{M_SQRT1_2, 0.0f, -M_SQRT1_2},
@@ -2055,17 +2061,13 @@ static const float bone_octahedral_smooth_normals[6][3] = {
#if 0 /* UNUSED */
static const uint bone_octahedral_wire[24] = {
- 0, 1, 1, 5, 5, 3, 3, 0,
- 0, 4, 4, 5, 5, 2, 2, 0,
- 1, 2, 2, 3, 3, 4, 4, 1,
+ 0, 1, 1, 5, 5, 3, 3, 0, 0, 4, 4, 5, 5, 2, 2, 0, 1, 2, 2, 3, 3, 4, 4, 1,
};
/* aligned with bone_octahedral_wire
* Contains adjacent normal index */
static const uint bone_octahedral_wire_adjacent_face[24] = {
- 0, 3, 4, 7, 5, 6, 1, 2,
- 2, 3, 6, 7, 4, 5, 0, 1,
- 0, 4, 1, 5, 2, 6, 3, 7,
+ 0, 3, 4, 7, 5, 6, 1, 2, 2, 3, 6, 7, 4, 5, 0, 1, 0, 4, 1, 5, 2, 6, 3, 7,
};
#endif
@@ -2109,15 +2111,15 @@ static const uint bone_octahedral_wire_lines_adjacency[12][4] = {
#if 0 /* UNUSED */
static const uint bone_octahedral_solid_tris_adjacency[8][6] = {
- { 0, 12, 1, 10, 2, 3},
- { 3, 15, 4, 1, 5, 6},
- { 6, 18, 7, 4, 8, 9},
- { 9, 21, 10, 7, 11, 0},
-
- {12, 22, 13, 2, 14, 17},
- {15, 13, 16, 5, 17, 20},
- {18, 16, 19, 8, 20, 23},
- {21, 19, 22, 11, 23, 14},
+ {0, 12, 1, 10, 2, 3},
+ {3, 15, 4, 1, 5, 6},
+ {6, 18, 7, 4, 8, 9},
+ {9, 21, 10, 7, 11, 0},
+
+ {12, 22, 13, 2, 14, 17},
+ {15, 13, 16, 5, 17, 20},
+ {18, 16, 19, 8, 20, 23},
+ {21, 19, 22, 11, 23, 14},
};
#endif
@@ -2219,17 +2221,13 @@ static const float bone_box_smooth_normals[8][3] = {
#if 0 /* UNUSED */
static const uint bone_box_wire[24] = {
- 0, 1, 1, 2, 2, 3, 3, 0,
- 4, 5, 5, 6, 6, 7, 7, 4,
- 0, 4, 1, 5, 2, 6, 3, 7,
+ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7,
};
/* aligned with bone_octahedral_wire
* Contains adjacent normal index */
static const uint bone_box_wire_adjacent_face[24] = {
- 0, 2, 0, 4, 1, 6, 1, 8,
- 3, 10, 5, 10, 7, 11, 9, 11,
- 3, 8, 2, 5, 4, 7, 6, 9,
+ 0, 2, 0, 4, 1, 6, 1, 8, 3, 10, 5, 10, 7, 11, 9, 11, 3, 8, 2, 5, 4, 7, 6, 9,
};
#endif
@@ -2274,23 +2272,23 @@ static const uint bone_box_wire_lines_adjacency[12][4] = {
#if 0 /* UNUSED */
static const uint bone_box_solid_tris_adjacency[12][6] = {
- { 0, 5, 1, 14, 2, 8},
- { 3, 26, 4, 20, 5, 1},
+ {0, 5, 1, 14, 2, 8},
+ {3, 26, 4, 20, 5, 1},
- { 6, 2, 7, 16, 8, 11},
- { 9, 7, 10, 32, 11, 24},
+ {6, 2, 7, 16, 8, 11},
+ {9, 7, 10, 32, 11, 24},
- {12, 0, 13, 22, 14, 17},
- {15, 13, 16, 30, 17, 6},
+ {12, 0, 13, 22, 14, 17},
+ {15, 13, 16, 30, 17, 6},
- {18, 3, 19, 28, 20, 23},
- {21, 19, 22, 33, 23, 12},
+ {18, 3, 19, 28, 20, 23},
+ {21, 19, 22, 33, 23, 12},
- {24, 4, 25, 10, 26, 29},
- {27, 25, 28, 34, 29, 18},
+ {24, 4, 25, 10, 26, 29},
+ {27, 25, 28, 34, 29, 18},
- {30, 9, 31, 15, 32, 35},
- {33, 31, 34, 21, 35, 27},
+ {30, 9, 31, 15, 32, 35},
+ {33, 31, 34, 21, 35, 27},
};
#endif
@@ -2499,8 +2497,10 @@ GPUBatch *DRW_cache_bone_point_get(void)
const float lat_inc = M_PI / lat_res;
uint v_idx = 0;
- static GPUVertFormat format = { 0 };
- static struct { uint pos, nor; } attr_id;
+ static GPUVertFormat format = {0};
+ static struct {
+ uint pos, nor;
+ } attr_id;
if (format.attr_len == 0) {
attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
attr_id.nor = GPU_vertformat_attr_add(&format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
@@ -2515,15 +2515,17 @@ GPUBatch *DRW_cache_bone_point_get(void)
float lat = 0.0f;
for (int j = 0; j < lat_res; j++, lat += lat_inc) {
if (j != lat_res - 1) { /* Pole */
- add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc);
+ add_lat_lon_vert(
+ vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc);
add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon);
- add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon);
+ add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon);
}
if (j != 0) { /* Pole */
- add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon + lon_inc);
- add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc);
- add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon);
+ add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon + lon_inc);
+ add_lat_lon_vert(
+ vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc);
+ add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon);
}
}
}
@@ -2755,10 +2757,14 @@ static float z_axis_name[10][2] = {
#define S_Y 0.007f
static float axis_marker[8][2] = {
#if 0 /* square */
- {-1.0f * S_X, 1.0f * S_Y}, { 1.0f * S_X, 1.0f * S_Y},
- { 1.0f * S_X, 1.0f * S_Y}, { 1.0f * S_X, -1.0f * S_Y},
- { 1.0f * S_X, -1.0f * S_Y}, {-1.0f * S_X, -1.0f * S_Y},
- {-1.0f * S_X, -1.0f * S_Y}, {-1.0f * S_X, 1.0f * S_Y}
+ {-1.0f * S_X, 1.0f * S_Y},
+ {1.0f * S_X, 1.0f * S_Y},
+ {1.0f * S_X, 1.0f * S_Y},
+ {1.0f * S_X, -1.0f * S_Y},
+ {1.0f * S_X, -1.0f * S_Y},
+ {-1.0f * S_X, -1.0f * S_Y},
+ {-1.0f * S_X, -1.0f * S_Y},
+ {-1.0f * S_X, 1.0f * S_Y}
#else /* diamond */
{-S_X, 0.f},
{0.f, S_Y},
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index ded9d0963b7..73c68d0d6b9 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -3128,7 +3128,8 @@ static void mesh_create_loop_uv_and_tan(MeshRenderData *rdata, GPUVertBuf *vbo)
for (uint i = 0; i < uv_len; i++) {
const char *attr_name = mesh_render_data_uv_layer_uuid_get(rdata, i);
#if 0 /* these are clamped. Maybe use them as an option in the future */
- uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_I16, 2, GPU_FETCH_INT_TO_FLOAT_UNIT);
+ uv_id[i] = GPU_vertformat_attr_add(
+ &format, attr_name, GPU_COMP_I16, 2, GPU_FETCH_INT_TO_FLOAT_UNIT);
#else
uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
#endif
@@ -4433,8 +4434,10 @@ BLI_INLINE void edit_uv_preprocess_stretch_angle(float (*auv)[2],
}
#if 0 /* here for reference, this is done in shader now. */
-BLI_INLINE float edit_uv_get_loop_stretch_angle(
- const float auv0[2], const float auv1[2], const float av0[3], const float av1[3])
+BLI_INLINE float edit_uv_get_loop_stretch_angle(const float auv0[2],
+ const float auv1[2],
+ const float av0[3],
+ const float av1[3])
{
float uvang = angle_normalized_v2v2(auv0, auv1);
float ang = angle_normalized_v3v3(av0, av1);
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index db675ee0210..79c1d77bbf1 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -498,7 +498,8 @@ static void draw_clipping_setup_from_view(void)
/* Extract Clipping Planes */
BoundBox bbox;
#if 0 /* It has accuracy problems. */
- BKE_boundbox_init_from_minmax(&bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f});
+ BKE_boundbox_init_from_minmax(
+ &bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f});
for (int i = 0; i < 8; i++) {
mul_project_m4_v3(projinv, bbox.vec[i]);
}
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 78c17ac7015..a4fc022821a 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -405,7 +405,9 @@ static bool acf_generic_idfill_name_prop(bAnimListElem *ale, PointerRNA *ptr, Pr
#if 0
/* channel type has no settings */
-static bool acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
+static bool acf_generic_none_setting_valid(bAnimContext *ac,
+ bAnimListElem *ale,
+ eAnimChannel_Settings setting)
{
return false;
}
@@ -4715,15 +4717,43 @@ void ANIM_channel_draw_widgets(const bContext *C,
RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
UI_block_align_begin(block);
- UI_block_emboss_set(block, RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
- uiDefButR(block, UI_BTYPE_COLOR, 1, "", offset, yminc, w, ICON_WIDTH,
- &ptr, "color", -1,
- 0, 0, 0, 0, gpl->info);
-
- UI_block_emboss_set(block, RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
- uiDefButR(block, UI_BTYPE_COLOR, 1, "", offset + w, yminc, w, ICON_WIDTH,
- &ptr, "fill_color", -1,
- 0, 0, 0, 0, gpl->info);
+ UI_block_emboss_set(block,
+ RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
+ uiDefButR(block,
+ UI_BTYPE_COLOR,
+ 1,
+ "",
+ offset,
+ yminc,
+ w,
+ ICON_WIDTH,
+ &ptr,
+ "color",
+ -1,
+ 0,
+ 0,
+ 0,
+ 0,
+ gpl->info);
+
+ UI_block_emboss_set(block,
+ RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
+ uiDefButR(block,
+ UI_BTYPE_COLOR,
+ 1,
+ "",
+ offset + w,
+ yminc,
+ w,
+ ICON_WIDTH,
+ &ptr,
+ "fill_color",
+ -1,
+ 0,
+ 0,
+ 0,
+ 0,
+ gpl->info);
UI_block_emboss_set(block, UI_EMBOSS_NONE);
UI_block_align_end(block);
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c
index 53fec2e1ef7..df73c78aa18 100644
--- a/source/blender/editors/animation/anim_deps.c
+++ b/source/blender/editors/animation/anim_deps.c
@@ -408,7 +408,10 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
#if 0
if (G.debug & G_DEBUG) {
printf("%s: Unhandled animchannel updates (%d) for type=%d (%p)\n",
- __func__, ale->update, ale->type, ale->data);
+ __func__,
+ ale->update,
+ ale->type,
+ ale->data);
}
#endif
/* Prevent crashes in cases where it can't be handled */
diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c
index 50289197ed4..1afcfaca8aa 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -610,7 +610,7 @@ static void armature_finalize_restpose(ListBase *bonelist, ListBase *editbonelis
print_m4("premat", premat);
print_m4("postmat", postmat);
print_m4("difmat", difmat);
- printf("Roll = %f\n", RAD2DEGF(-atan2(difmat[2][0], difmat[2][2])));
+ printf("Roll = %f\n", RAD2DEGF(-atan2(difmat[2][0], difmat[2][2])));
#endif
curBone->roll = -atan2f(difmat[2][0], difmat[2][2]);
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index febe2a49174..a9f8925febc 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -1476,7 +1476,10 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
if (fabsf(mdb->totalphi[b] - 1.0f) > 1e-4f)
printf("totalphi deficiency [%s|%d] %d: %.10f\n",
- (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR) ? "interior" : "boundary", mdb->semibound[b], mdb->varidx[b], mdb->totalphi[b]);
+ (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR) ? "interior" : "boundary",
+ mdb->semibound[b],
+ mdb->varidx[b],
+ mdb->totalphi[b]);
#endif
/* free */
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 51641041ea1..599823a6401 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -167,7 +167,8 @@ static bool pose_has_protected_selected(Object *ob, short warn)
}
}
if (pchan) {
- if (warn) error("Cannot change Proxy protected bones");
+ if (warn)
+ error("Cannot change Proxy protected bones");
return 1;
}
}
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index 443bcdde028..ce809bee71e 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -1834,9 +1834,15 @@ void POSELIB_OT_browse_interactive(wmOperatorType *ot)
// XXX: percentage vs factor?
/* not used yet */
#if 0
- RNA_def_float_factor(
- ot->srna, "blend_factor", 1.0f, 0.0f, 1.0f, "Blend Factor",
- "Amount that the pose is applied on top of the existing poses", 0.0f, 1.0f);
+ RNA_def_float_factor(ot->srna,
+ "blend_factor",
+ 1.0f,
+ 0.0f,
+ 1.0f,
+ "Blend Factor",
+ "Amount that the pose is applied on top of the existing poses",
+ 0.0f,
+ 1.0f);
#endif
}
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index c37ce4cc89d..17582da2256 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -104,11 +104,13 @@ void printknots(Object *obedit)
if (ED_curve_nurb_select_check(nu) && nu->type == CU_NURBS) {
if (nu->knotsu) {
num = KNOTSU(nu);
- for (a = 0; a < num; a++) printf("knotu %d: %f\n", a, nu->knotsu[a]);
+ for (a = 0; a < num; a++)
+ printf("knotu %d: %f\n", a, nu->knotsu[a]);
}
if (nu->knotsv) {
num = KNOTSV(nu);
- for (a = 0; a < num; a++) printf("knotv %d: %f\n", a, nu->knotsv[a]);
+ for (a = 0; a < num; a++)
+ printf("knotv %d: %f\n", a, nu->knotsv[a]);
}
}
}
diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
index 3273012930a..441ebac6017 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
@@ -338,10 +338,10 @@ static void gizmo_cage3d_draw_intern(
else {
#if 0
const rctf _r = {
- .xmin = -size_real[0],
- .ymin = -size_real[1],
- .xmax = size_real[0],
- .ymax = size_real[1],
+ .xmin = -size_real[0],
+ .ymin = -size_real[1],
+ .xmax = size_real[0],
+ .ymax = size_real[1],
};
#endif
if (draw_style == ED_GIZMO_CAGE2D_STYLE_BOX) {
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 4933f081790..b64bccdf1ce 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2429,7 +2429,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* event doesn't need to be handled */
#if 0
printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n",
- event->type, event->type == MIDDLEMOUSE, event->type==MOUSEMOVE);
+ event->type,
+ event->type == MIDDLEMOUSE,
+ event->type == MOUSEMOVE);
#endif
break;
}
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 24bdbcc4cba..2caaf7f7797 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -375,7 +375,7 @@ static int gp_set_filling_texture(Image *image, short flag)
ImBuf *ibuf;
uint *bind = &image->bindcode[TEXTARGET_TEXTURE_2D];
int error = GL_NO_ERROR;
- ImageUser iuser = { NULL };
+ ImageUser iuser = {NULL};
void *lock;
iuser.ok = true;
@@ -388,8 +388,7 @@ static int gp_set_filling_texture(Image *image, short flag)
}
GPU_create_gl_tex(
- bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D,
- false, false, image);
+ bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, false, false, image);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -452,7 +451,8 @@ static void gp_draw_stroke_fill(bGPdata *gpd,
immUniform1i("t_flip", (gp_style->flag & GP_STYLE_COLOR_FLIP_FILL) != 0);
#if 0 /* GPXX disabled, not used in annotations */
/* image texture */
- if ((gp_style->fill_style == GP_STYLE_FILL_STYLE_TEXTURE) || (gp_style->flag & GP_STYLE_COLOR_TEX_MIX)) {
+ if ((gp_style->fill_style == GP_STYLE_FILL_STYLE_TEXTURE) ||
+ (gp_style->flag & GP_STYLE_COLOR_TEX_MIX)) {
gp_set_filling_texture(gp_style->ima, gp_style->flag);
}
#endif
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index bfdfe64ed54..a12e9a357a7 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3748,7 +3748,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* event doesn't need to be handled */
#if 0
printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n",
- event->type, event->type == MIDDLEMOUSE, event->type == MOUSEMOVE);
+ event->type,
+ event->type == MIDDLEMOUSE,
+ event->type == MOUSEMOVE);
#endif
break;
}
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index e747dda95d4..fe7ccb7170c 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -707,7 +707,10 @@ void ED_scene_draw_fps(struct Scene *scene, int xoffset, int *yoffset);
#if 0
void ED_view3d_operator_properties_viewmat(struct wmOperatorType *ot);
void ED_view3d_operator_properties_viewmat_set(struct bContext *C, struct wmOperator *op);
-void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx, int *winy, float persmat[4][4]);
+void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op,
+ int *winx,
+ int *winy,
+ float persmat[4][4]);
#endif
/* render */
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index d3cce4a5dde..dd086461801 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -416,8 +416,16 @@ void UI_draw_roundbox_shade_x(bool filled,
const float col[4]);
#if 0 /* unused */
-int UI_draw_roundbox_corner_get(void);
-void UI_draw_roundbox_shade_y(bool filled, float minx, float miny, float maxx, float maxy, float rad, float shadeleft, float shaderight, const float col[4]);
+int UI_draw_roundbox_corner_get(void);
+void UI_draw_roundbox_shade_y(bool filled,
+ float minx,
+ float miny,
+ float maxx,
+ float maxy,
+ float rad,
+ float shadeleft,
+ float shaderight,
+ const float col[4]);
#endif
void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, float maxy);
@@ -587,7 +595,10 @@ void UI_popup_block_ex(struct bContext *C,
void *arg,
struct wmOperator *op);
#if 0 /* UNUSED */
-void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext);
+void uiPupBlockOperator(struct bContext *C,
+ uiBlockCreateFunc func,
+ struct wmOperator *op,
+ int opcontext);
#endif
void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 06b0634f6fb..a9079cdd021 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1274,7 +1274,8 @@ static bool ui_but_event_property_operator_string(const bContext *C,
#if 0
else {
printf("ERROR in %s(): Couldn't get path for scene property - %s\n",
- __func__, RNA_property_identifier(prop));
+ __func__,
+ RNA_property_identifier(prop));
}
#endif
}
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index afa1b5c87e1..c8800f495ce 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -655,12 +655,16 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
#if 0 /* Disabled for now. */
ot = WM_operatortype_find("UI_OT_override_type_set_button", false);
uiItemFullO_ptr(
- layout, ot, "Overrides Type", ICON_NONE,
- NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
+ layout, ot, "Overrides Type", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
RNA_boolean_set(&op_ptr, "all", true);
- uiItemFullO_ptr(
- layout, ot, "Single Override Type", ICON_NONE,
- NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
+ uiItemFullO_ptr(layout,
+ ot,
+ "Single Override Type",
+ ICON_NONE,
+ NULL,
+ WM_OP_INVOKE_DEFAULT,
+ 0,
+ &op_ptr);
RNA_boolean_set(&op_ptr, "all", false);
#endif
uiItemBooleanO(layout,
@@ -678,9 +682,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
}
else {
#if 0 /* Disabled for now. */
- uiItemFullO(
- layout, "UI_OT_override_type_set_button", "Override Type", ICON_NONE,
- NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
+ uiItemFullO(layout,
+ "UI_OT_override_type_set_button",
+ "Override Type",
+ ICON_NONE,
+ NULL,
+ WM_OP_INVOKE_DEFAULT,
+ 0,
+ &op_ptr);
RNA_boolean_set(&op_ptr, "all", false);
#endif
uiItemBooleanO(layout,
@@ -896,9 +905,15 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
if (kmi) {
if (ISKEYBOARD(kmi->type)) {
#if 0 /* would rather use a block but, but gets weirdly positioned... */
- uiDefBlockBut(
- block, menu_change_shortcut, but, "Change Shortcut",
- 0, 0, uiLayoutGetWidth(layout), UI_UNIT_Y, "");
+ uiDefBlockBut(block,
+ menu_change_shortcut,
+ but,
+ "Change Shortcut",
+ 0,
+ 0,
+ uiLayoutGetWidth(layout),
+ UI_UNIT_Y,
+ "");
#endif
but2 = uiDefIconTextBut(block,
@@ -1005,9 +1020,14 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
/* XXX inactive option, not for public! */
#if 0
- uiItemFullO(
- layout, "WM_OT_doc_edit", "Submit Description", ICON_NONE,
- NULL, WM_OP_INVOKE_DEFAULT, 0, &ptr_props);
+ uiItemFullO(layout,
+ "WM_OT_doc_edit",
+ "Submit Description",
+ ICON_NONE,
+ NULL,
+ WM_OP_INVOKE_DEFAULT,
+ 0,
+ &ptr_props);
RNA_string_set(&ptr_props, "doc_id", buf);
RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop));
#endif
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 0517278a149..efc748d39a1 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -167,8 +167,13 @@ void UI_draw_roundbox_4fv(
{
#if 0
float vec[7][2] = {
- {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805},
+ {0.195, 0.02},
+ {0.383, 0.067},
+ {0.55, 0.169},
+ {0.707, 0.293},
+ {0.831, 0.45},
+ {0.924, 0.617},
+ {0.98, 0.805},
};
int a;
@@ -270,13 +275,16 @@ void UI_draw_roundbox_4fv(
}
#if 0
-static void round_box_shade_col(uint attr, const float col1[3], float const col2[3], const float fac)
+static void round_box_shade_col(uint attr,
+ const float col1[3],
+ float const col2[3],
+ const float fac)
{
float col[4] = {
- fac * col1[0] + (1.0f - fac) * col2[0],
- fac * col1[1] + (1.0f - fac) * col2[1],
- fac * col1[2] + (1.0f - fac) * col2[2],
- 1.0f,
+ fac * col1[0] + (1.0f - fac) * col2[0],
+ fac * col1[1] + (1.0f - fac) * col2[1],
+ fac * col1[2] + (1.0f - fac) * col2[2],
+ 1.0f,
};
immAttr4fv(attr, col);
}
@@ -296,8 +304,13 @@ void UI_draw_roundbox_shade_x(bool filled,
{
#if 0
float vec[7][2] = {
- {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805},
+ {0.195, 0.02},
+ {0.383, 0.067},
+ {0.55, 0.169},
+ {0.707, 0.293},
+ {0.831, 0.45},
+ {0.924, 0.617},
+ {0.98, 0.805},
};
const float div = maxy - miny;
const float idiv = 1.0f / div;
@@ -317,9 +330,9 @@ void UI_draw_roundbox_shade_x(bool filled,
}
/* 'shade' defines strength of shading */
- coltop[0] = min_ff(1.0f, col[0] + shadetop);
- coltop[1] = min_ff(1.0f, col[1] + shadetop);
- coltop[2] = min_ff(1.0f, col[2] + shadetop);
+ coltop[0] = min_ff(1.0f, col[0] + shadetop);
+ coltop[1] = min_ff(1.0f, col[1] + shadetop);
+ coltop[2] = min_ff(1.0f, col[2] + shadetop);
coldown[0] = max_ff(0.0f, col[0] + shadedown);
coldown[1] = max_ff(0.0f, col[1] + shadedown);
coldown[2] = max_ff(0.0f, col[2] + shadedown);
@@ -440,13 +453,24 @@ void UI_draw_roundbox_shade_x(bool filled,
#if 0 /* unused */
/* linear vertical shade within button or in outline */
/* view2d scrollers use it */
-void UI_draw_roundbox_shade_y(
- bool filled, float minx, float miny, float maxx, float maxy,
- float rad, float shadeleft, float shaderight, const float col[4])
+void UI_draw_roundbox_shade_y(bool filled,
+ float minx,
+ float miny,
+ float maxx,
+ float maxy,
+ float rad,
+ float shadeleft,
+ float shaderight,
+ const float col[4])
{
float vec[7][2] = {
- {0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805},
+ {0.195, 0.02},
+ {0.383, 0.067},
+ {0.55, 0.169},
+ {0.707, 0.293},
+ {0.831, 0.45},
+ {0.924, 0.617},
+ {0.98, 0.805},
};
const float div = maxx - minx;
const float idiv = 1.0f / div;
@@ -466,14 +490,13 @@ void UI_draw_roundbox_shade_y(
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
/* 'shade' defines strength of shading */
- colLeft[0] = min_ff(1.0f, col[0] + shadeleft);
- colLeft[1] = min_ff(1.0f, col[1] + shadeleft);
- colLeft[2] = min_ff(1.0f, col[2] + shadeleft);
+ colLeft[0] = min_ff(1.0f, col[0] + shadeleft);
+ colLeft[1] = min_ff(1.0f, col[1] + shadeleft);
+ colLeft[2] = min_ff(1.0f, col[2] + shadeleft);
colRight[0] = max_ff(0.0f, col[0] + shaderight);
colRight[1] = max_ff(0.0f, col[1] + shaderight);
colRight[2] = max_ff(0.0f, col[2] + shaderight);
-
vert_count += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1;
vert_count += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1;
vert_count += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1;
@@ -2461,7 +2484,8 @@ void ui_draw_dropshadow(
/* alpha ranges from 2 to 20 or so */
#if 0 /* Old Method (pre 2.8) */
float color[4] = {0.0f, 0.0f, 0.0f, calpha};
- UI_draw_roundbox_4fv(true, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax - 10.0f + a, rad + a, color);
+ UI_draw_roundbox_4fv(
+ true, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax - 10.0f + a, rad + a, color);
#endif
/* Compute final visibility to match old method result. */
/* TODO we could just find a better fit function inside the shader instead of this. */
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 8e463bf8447..9b54192c772 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -112,7 +112,7 @@ typedef enum uiItemType {
ITEM_LAYOUT_ROOT
#if 0
- TEMPLATE_COLUMN_FLOW,
+ TEMPLATE_COLUMN_FLOW,
TEMPLATE_SPLIT,
TEMPLATE_BOX,
@@ -1538,7 +1538,8 @@ void uiItemsFullEnumO(uiLayout *layout,
* introduction of GP editing modes)
*/
#if 0
- RNA_property_enum_items_gettexted_all(block->evil_C, &ptr, prop, &item_array, &totitem, &free);
+ RNA_property_enum_items_gettexted_all(
+ block->evil_C, &ptr, prop, &item_array, &totitem, &free);
#else
RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item_array, &totitem, &free);
#endif
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6666991ad26..7e6b58ba850 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2354,8 +2354,14 @@ void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C)
/* Disable for now, doesn't fit well in popover. */
#if 0
/* Repeat button with operator name as text. */
- uiItemFullO(layout, "SCREEN_OT_repeat_last", RNA_struct_ui_name(op->type->srna),
- ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
+ uiItemFullO(layout,
+ "SCREEN_OT_repeat_last",
+ RNA_struct_ui_name(op->type->srna),
+ ICON_NONE,
+ NULL,
+ WM_OP_INVOKE_DEFAULT,
+ 0,
+ NULL);
#endif
if (WM_operator_repeat_check(C, op)) {
diff --git a/source/blender/editors/lattice/editlattice_undo.c b/source/blender/editors/lattice/editlattice_undo.c
index 9ee2e8b563b..166201adc15 100644
--- a/source/blender/editors/lattice/editlattice_undo.c
+++ b/source/blender/editors/lattice/editlattice_undo.c
@@ -102,8 +102,7 @@ static int validate_undoLatt(void *data, void *edata)
UndoLattice *ult = (UndoLattice *)data;
EditLatt *editlatt = (EditLatt *)edata;
- return (ult->pntsu == editlatt->latt->pntsu &&
- ult->pntsv == editlatt->latt->pntsv &&
+ return (ult->pntsu == editlatt->latt->pntsu && ult->pntsv == editlatt->latt->pntsv &&
ult->pntsw == editlatt->latt->pntsw);
}
#endif
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c
index 42521d04008..a341b51ebdb 100644
--- a/source/blender/editors/mesh/editmesh_rip.c
+++ b/source/blender/editors/mesh/editmesh_rip.c
@@ -86,8 +86,7 @@ static float edbm_rip_edgedist_squared(ARegion *ar,
#if 0
static float edbm_rip_linedist(
- ARegion *ar, float mat[4][4],
- const float co1[3], const float co2[3], const float mvalf[2])
+ ARegion *ar, float mat[4][4], const float co1[3], const float co2[3], const float mvalf[2])
{
float vec1[2], vec2[2];
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 94886266d24..69066adba41 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -1173,9 +1173,7 @@ bool EDBM_unified_findnearest_from_raycast(ViewContext *vc,
float point[3];
#if 0
const float dist_sq_test = dist_squared_ray_to_seg_v3(
- ray_origin, ray_direction,
- e->v1->co, e->v2->co,
- point, &depth);
+ ray_origin, ray_direction, e->v1->co, e->v2->co, point, &depth);
#else
if (coords) {
mid_v3_v3v3(
@@ -1801,7 +1799,8 @@ static bool mouse_mesh_loop(
length_2 = len_squared_v2v2(mvalf, v2_co);
}
#if 0
- printf("mouse to v1: %f\nmouse to v2: %f\n", len_squared_v2v2(mvalf, v1_co),
+ printf("mouse to v1: %f\nmouse to v2: %f\n",
+ len_squared_v2v2(mvalf, v1_co),
len_squared_v2v2(mvalf, v2_co));
#endif
BM_select_history_store(em->bm, (length_1 < length_2) ? eed->v1 : eed->v2);
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 1cb550fccc4..7d318fb16e1 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -363,10 +363,8 @@ void EDBM_mesh_load(Main *bmain, Object *ob)
* cycles.
*/
#if 0
- for (Object *other_object = bmain->objects.first;
- other_object != NULL;
- other_object = other_object->id.next)
- {
+ for (Object *other_object = bmain->objects.first; other_object != NULL;
+ other_object = other_object->id.next) {
if (other_object->data == ob->data) {
BKE_object_free_derived_caches(other_object);
}
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index ce7908bf0a3..8cc23edad16 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -900,17 +900,15 @@ int ED_mesh_mirror_get_vert(Object *ob, int index)
#if 0
-static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float *mirrCent, float *face_cent)
+static float *editmesh_get_mirror_uv(
+ BMEditMesh *em, int axis, float *uv, float *mirrCent, float *face_cent)
{
float vec[2];
float cent_vec[2];
float cent[2];
/* ignore nan verts */
- if (isnan(uv[0]) || !isfinite(uv[0]) ||
- isnan(uv[1]) || !isfinite(uv[1])
- )
- {
+ if (isnan(uv[0]) || !isfinite(uv[0]) || isnan(uv[1]) || !isfinite(uv[1])) {
return NULL;
}
@@ -937,15 +935,14 @@ static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
uv_poly_center(efa, cent, cd_loop_uv_offset);
- if ( (fabsf(cent[0] - cent_vec[0]) < 0.001f) && (fabsf(cent[1] - cent_vec[1]) < 0.001f) ) {
+ if ((fabsf(cent[0] - cent_vec[0]) < 0.001f) && (fabsf(cent[1] - cent_vec[1]) < 0.001f)) {
BMIter liter;
BMLoop *l;
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if ( (fabsf(luv->uv[0] - vec[0]) < 0.001f) && (fabsf(luv->uv[1] - vec[1]) < 0.001f) ) {
+ if ((fabsf(luv->uv[0] - vec[0]) < 0.001f) && (fabsf(luv->uv[1] - vec[1]) < 0.001f)) {
return luv->uv;
-
}
}
}
diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c
index 57c7ff1535d..986055dd88c 100644
--- a/source/blender/editors/object/object_data_transfer.c
+++ b/source/blender/editors/object/object_data_transfer.c
@@ -65,11 +65,11 @@ static const EnumPropertyItem DT_layer_items[] = {
"Vertex Group(s)",
"Transfer active or all vertex groups"},
#if 0 /* XXX For now, would like to finish/merge work from 2014 gsoc first. */
- {DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"},
+ {DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"},
#endif
#if 0 /* XXX When SkinModifier is enabled,
* it seems to erase its own CD_MVERT_SKIN layer from final DM :( */
- {DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"},
+ {DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"},
#endif
{DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"},
{0, "", 0, "Edge Data", ""},
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 3744632be3d..63cacc21d1c 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1339,11 +1339,13 @@ void OBJECT_OT_track_set(wmOperatorType *ot)
#if 0
static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr))
{
- Scene *sce = (Scene *) BLI_findlink(&bmain->scene, G.curscreen->scenenr - 1);
+ Scene *sce = (Scene *)BLI_findlink(&bmain->scene, G.curscreen->scenenr - 1);
Base *base, *nbase;
- if (sce == NULL) return;
- if (sce->id.lib) return;
+ if (sce == NULL)
+ return;
+ if (sce->id.lib)
+ return;
for (base = FIRSTBASE; base; base = base->next) {
if (BASE_SELECTED(v3d, base)) {
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 627ffd68bbb..d592bbd82b1 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -510,9 +510,11 @@ static bool key_test_depth(const PEData *data, const float co[3], const int scre
/* used to calculate here but all callers have the screen_co already, so pass as arg */
#if 0
- if (ED_view3d_project_int_global(data->vc.ar, co, screen_co,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK)
- {
+ if (ED_view3d_project_int_global(data->vc.ar,
+ co,
+ screen_co,
+ V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN |
+ V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) {
return 0;
}
#endif
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index c62d6530c6b..9b31b63edae 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -1241,7 +1241,7 @@ static void icon_preview_endjob(void *customdata)
if (prv_img->gputexture[i]) {
GPU_texture_free(prv_img->gputexture[i]);
prv_img->gputexture[i] = NULL;
- WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ip->id);
+ WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ip->id);
}
}
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 4ca26d108a2..ce952b50f9d 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -530,8 +530,11 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4f(drand48(), drand48(), drand48(), 0.1f);
- immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin,
- ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin);
+ immRectf(pos,
+ ar->drawrct.xmin - ar->winrct.xmin,
+ ar->drawrct.ymin - ar->winrct.ymin,
+ ar->drawrct.xmax - ar->winrct.xmin,
+ ar->drawrct.ymax - ar->winrct.ymin);
immUnbindProgram();
GPU_blend(false);
#endif
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 94b5f695de8..f059659806e 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3660,8 +3660,10 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
RV3D_ORTHO);
/* forcing camera is distracting */
#if 0
- if (v3d->camera) region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB);
- else region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_USER, RV3D_PERSP);
+ if (v3d->camera)
+ region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_CAMERA, RV3D_CAMOB);
+ else
+ region_quadview_init_rv3d(sa, (ar = ar->next), 0, RV3D_VIEW_USER, RV3D_PERSP);
#else
(void)v3d;
#endif
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c
index 5750a1f36a7..ce64bdc27c8 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -89,8 +89,7 @@ static void workspace_change_update(WorkSpace *workspace_new,
/* needs to be done before changing mode! (to ensure right context) */
UNUSED_VARS(workspace_old, workspace_new, C, wm);
#if 0
- Object *ob_act = CTX_data_active_object(C)
- eObjectMode mode_old = workspace_old->object_mode;
+ Object *ob_act = CTX_data_active_object(C) eObjectMode mode_old = workspace_old->object_mode;
eObjectMode mode_new = workspace_new->object_mode;
if (mode_old != mode_new) {
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 3a3f4335fd5..4c978f560b3 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -632,9 +632,15 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
/* duplicate warning, see texpaint_init */
#if 0
if (pop->s.warnmultifile)
- BKE_reportf(op->reports, RPT_WARNING, "Image requires 4 color channels to paint: %s", pop->s.warnmultifile);
+ BKE_reportf(op->reports,
+ RPT_WARNING,
+ "Image requires 4 color channels to paint: %s",
+ pop->s.warnmultifile);
if (pop->s.warnpackedfile)
- BKE_reportf(op->reports, RPT_WARNING, "Packed MultiLayer files cannot be painted: %s", pop->s.warnpackedfile);
+ BKE_reportf(op->reports,
+ RPT_WARNING,
+ "Packed MultiLayer files cannot be painted: %s",
+ pop->s.warnpackedfile);
#endif
MEM_freeN(pop);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 7a99f819913..7f8887814a1 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2351,8 +2351,10 @@ static float angle_2d_clockwise(const float p1[2], const float p2[2], const floa
{
float v1[2], v2[2];
- v1[0] = p1[0] - p2[0]; v1[1] = p1[1] - p2[1];
- v2[0] = p3[0] - p2[0]; v2[1] = p3[1] - p2[1];
+ v1[0] = p1[0] - p2[0];
+ v1[1] = p1[1] - p2[1];
+ v2[0] = p3[0] - p2[0];
+ v2[1] = p3[1] - p2[1];
return -atan2f(v1[0] * v2[1] - v1[1] * v2[0], v1[0] * v2[0] + v1[1] * v2[1]);
}
@@ -3035,8 +3037,7 @@ static void project_paint_face_init(const ProjPaintState *ps,
if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) {
#if 0
project_paint_undo_tiles_init(
- &bounds_px, ps->projImages + image_index, tmpibuf,
- tile_width, threaded, ps->do_masking);
+ &bounds_px, ps->projImages + image_index, tmpibuf, tile_width, threaded, ps->do_masking);
#endif
/* clip face and */
diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c
index 68abdfbf95b..b80144ac4af 100644
--- a/source/blender/editors/sculpt_paint/paint_image_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_image_undo.c
@@ -417,7 +417,8 @@ static void paint_undosys_step_decode_restore_ids(ImageUndoStep *us)
{
ID *image_prev[2] = {NULL};
for (UndoImageTile *tile = us->tiles.first; tile; tile = tile->next) {
- tile->ima = (Image *)BKE_undosys_ID_map_lookup_with_prev(us->id_map, &tile->ima->id, image_prev);
+ tile->ima = (Image *)BKE_undosys_ID_map_lookup_with_prev(
+ us->id_map, &tile->ima->id, image_prev);
}
}
#endif
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 4a586f4f7df..8c1ba213ba0 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -479,8 +479,7 @@ static void paint_brush_stroke_add_step(bContext *C,
if (tablet && (pressure >= 0.99f) &&
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
BKE_brush_use_alpha_pressure(scene, pop->s.brush) ||
- BKE_brush_use_size_pressure(scene, pop->s.brush)))
- {
+ BKE_brush_use_size_pressure(scene, pop->s.brush))) {
return;
}
@@ -493,8 +492,7 @@ static void paint_brush_stroke_add_step(bContext *C,
if (tablet && (pressure < 0.0002f) &&
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
BKE_brush_use_alpha_pressure(scene, pop->s.brush) ||
- BKE_brush_use_size_pressure(scene, pop->s.brush)))
- {
+ BKE_brush_use_size_pressure(scene, pop->s.brush))) {
return;
}
#endif
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 70783ff004e..291320a520f 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -565,9 +565,11 @@ static void do_weight_paint_normalize_all_locked_try_active(MDeformVert *dvert,
}
#if 0 /* UNUSED */
-static bool has_unselected_unlocked_bone_group(
- int defbase_tot, bool *defbase_sel, int selected,
- const bool *lock_flags, const bool *vgroup_validmap)
+static bool has_unselected_unlocked_bone_group(int defbase_tot,
+ bool *defbase_sel,
+ int selected,
+ const bool *lock_flags,
+ const bool *vgroup_validmap)
{
int i;
if (defbase_tot == selected) {
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 9309def4a77..6882b249f0d 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -676,7 +676,10 @@ static float frontface(const Brush *br,
#if 0
-static bool sculpt_brush_test_cyl(SculptBrushTest *test, float co[3], float location[3], const float area_no[3])
+static bool sculpt_brush_test_cyl(SculptBrushTest *test,
+ float co[3],
+ float location[3],
+ const float area_no[3])
{
if (sculpt_brush_test_sphere_fast(test, co)) {
float t1[3], t2[3], t3[3], dist;
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 7499458181e..6b37cd8fe27 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -275,8 +275,7 @@ static void box_select_action(bAnimContext *ac, const rcti rect, short mode, sho
/* loop over data selecting */
switch (ale->type) {
#if 0 /* XXX: Keyframes are not currently shown here */
- case ANIMTYPE_GPDATABLOCK:
- {
+ case ANIMTYPE_GPDATABLOCK: {
bGPdata *gpd = ale->data;
bGPDlayer *gpl;
for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
@@ -478,8 +477,7 @@ static void region_select_action_keys(
/* loop over data selecting */
switch (ale->type) {
#if 0 /* XXX: Keyframes are not currently shown here */
- case ANIMTYPE_GPDATABLOCK:
- {
+ case ANIMTYPE_GPDATABLOCK: {
bGPdata *gpd = ale->data;
bGPDlayer *gpl;
for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index a17c1b675e6..1fc218c9461 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -144,14 +144,12 @@ static void console_lb_debug__internal(ListBase *lb)
for (cl = lb->first; cl; cl = cl->next)
printf("<%s> ", cl->line);
printf("\n");
-
}
static void console_history_debug(const bContext *C)
{
SpaceConsole *sc = CTX_wm_space_console(C);
-
console_lb_debug__internal(&sc->history);
}
#endif
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 31a59f06079..21b0eefddbc 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -2420,11 +2420,13 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
BLI_assert(filelist->filelist.entries == NULL);
- if (filelist->filelist.root[0] == '/') filelist->filelist.root[0] = '\0';
+ if (filelist->filelist.root[0] == '/')
+ filelist->filelist.root[0] = '\0';
if (filelist->filelist.root[0]) {
idcode = groupname_to_code(filelist->filelist.root);
- if (idcode == 0) filelist->filelist.root[0] = '\0';
+ if (idcode == 0)
+ filelist->filelist.root[0] = '\0';
}
if (filelist->dir[0] == 0) {
@@ -2472,7 +2474,8 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
idcode = groupname_to_code(filelist->filelist.root);
lb = which_libbase(bmain, idcode);
- if (lb == NULL) return;
+ if (lb == NULL)
+ return;
filelist->filelist.nbr_entries = 0;
for (id = lb->first; id; id = id->next) {
@@ -2523,19 +2526,21 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
}
}
# endif
-// files->entry->nr = totbl + 1;
+ // files->entry->nr = totbl + 1;
files->entry->poin = id;
fake = id->flag & LIB_FAKEUSER;
- if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) {
+ if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO ||
+ idcode == ID_IM) {
files->typeflag |= FILE_TYPE_IMAGE;
}
-// if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us);
-// else if (id->lib) BLI_snprintf(files->extra, sizeof(files->entry->extra), "L %d", id->us);
-// else if (fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "F %d", id->us);
-// else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us);
+ // if (id->lib && fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "LF %d", id->us);
+ // else if (id->lib) BLI_snprintf(files->extra, sizeof(files->entry->extra), "L %d", id->us);
+ // else if (fake) BLI_snprintf(files->extra, sizeof(files->entry->extra), "F %d", id->us);
+ // else BLI_snprintf(files->extra, sizeof(files->entry->extra), " %d", id->us);
if (id->lib) {
- if (totlib == 0) firstlib = files;
+ if (totlib == 0)
+ firstlib = files;
totlib++;
}
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 5bfe1c1aadd..eb9860bcd8f 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -315,8 +315,8 @@ static bool draw_fcurve_handles_check(SpaceGraph *sipo, FCurve *fcu)
/* keyframes aren't editable */
(fcu->flag & FCURVE_PROTECTED) ||
#if 0 /* handles can still be selected and handle types set, better draw - campbell */
- /* editing the handles here will cause weird/incorrect interpolation issues */
- (fcu->flag & FCURVE_INT_VALUES) ||
+ /* editing the handles here will cause weird/incorrect interpolation issues */
+ (fcu->flag & FCURVE_INT_VALUES) ||
#endif
/* group that curve belongs to is not editable */
((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ||
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index e217987f212..66e5607b06d 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -191,7 +191,8 @@ void image_preview_event(int event)
BIF_store_spare();
/* 1 is do_previews */
- ntreeCompositExecTree(scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings);
+ ntreeCompositExecTree(
+ scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings);
G.scene->nodetree->timecursor = NULL;
G.scene->nodetree->test_break = NULL;
@@ -203,7 +204,6 @@ void image_preview_event(int event)
}
}
-
/* nothing drawn here, we use it to store values */
static void preview_cb(ScrArea *sa, struct uiBlock *block)
{
@@ -221,18 +221,24 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block)
/* while dragging we need to update the rects, otherwise it doesn't end with correct one */
- BLI_rctf_init(&dispf, 15.0f, BLI_rcti_size_x(&block->rect) - 15.0f, 15.0f, (BLI_rctf_size_y(&block->rect)) - 15.0f);
+ BLI_rctf_init(&dispf,
+ 15.0f,
+ BLI_rcti_size_x(&block->rect) - 15.0f,
+ 15.0f,
+ (BLI_rctf_size_y(&block->rect)) - 15.0f);
ui_graphics_to_window_rct(sa->win, &dispf, disprect);
/* correction for gla draw */
BLI_rcti_translate(disprect, -curarea->winrct.xmin, -curarea->winrct.ymin);
calc_image_view(sima, 'p');
-// printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax);
+ // printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax);
/* map to image space coordinates */
- mval[0] = disprect->xmin; mval[1] = disprect->ymin;
+ mval[0] = disprect->xmin;
+ mval[1] = disprect->ymin;
areamouseco_to_ipoco(v2d, mval, &dispf.xmin, &dispf.ymin);
- mval[0] = disprect->xmax; mval[1] = disprect->ymax;
+ mval[0] = disprect->xmax;
+ mval[1] = disprect->ymax;
areamouseco_to_ipoco(v2d, mval, &dispf.xmax, &dispf.ymax);
/* map to render coordinates */
@@ -245,8 +251,7 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block)
CLAMP(disprect->xmax, 0, winx);
CLAMP(disprect->ymin, 0, winy);
CLAMP(disprect->ymax, 0, winy);
-// printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax);
-
+ // printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin, disprect->xmax, disprect->ymax);
}
static bool is_preview_allowed(ScrArea *cur)
@@ -268,8 +273,7 @@ static bool is_preview_allowed(ScrArea *cur)
return 1;
}
-
-static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW
+static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW
{
uiBlock *block;
SpaceImage *sima = sa->spacedata.first;
@@ -287,10 +291,10 @@ static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PRE
ofsx = -150 + (sa->winx / 2) / sima->blockscale;
ofsy = -100 + (sa->winy / 2) / sima->blockscale;
- if (uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200) == 0) return;
+ if (uiNewPanel(C, ar, block, "Preview", "Image", ofsx, ofsy, 300, 200) == 0)
+ return;
UI_but_func_drawextra_set(block, preview_cb);
-
}
#endif
@@ -1063,17 +1067,73 @@ void uiTemplateImage(uiLayout *layout,
iuser = ntree_get_active_iuser(scene->nodetree);
if (iuser) {
UI_block_align_begin(block);
- uiDefIconTextBut(block, UI_BTYPE_BUT, B_SIMA_RECORD, ICON_REC, "Record", 10, 120, 100, 20, 0, 0, 0, 0, 0, "");
- uiDefIconTextBut(block, UI_BTYPE_BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110, 120, 100, 20, 0, 0, 0, 0, 0, "");
- but = uiDefBut(block, UI_BTYPE_BUT, B_NOP, "Free Cache", 210, 120, 100, 20, 0, 0, 0, 0, 0, "");
+ uiDefIconTextBut(block,
+ UI_BTYPE_BUT,
+ B_SIMA_RECORD,
+ ICON_REC,
+ "Record",
+ 10,
+ 120,
+ 100,
+ 20,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ "");
+ uiDefIconTextBut(block,
+ UI_BTYPE_BUT,
+ B_SIMA_PLAY,
+ ICON_PLAY,
+ "Play",
+ 110,
+ 120,
+ 100,
+ 20,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ "");
+ but = uiDefBut(
+ block, UI_BTYPE_BUT, B_NOP, "Free Cache", 210, 120, 100, 20, 0, 0, 0, 0, 0, "");
UI_but_func_set(but, image_freecache_cb, ima, NULL);
if (iuser->frames)
BLI_snprintf(str, sizeof(str), "(%d) Frames:", iuser->framenr);
- else strcpy(str, "Frames:");
+ else
+ strcpy(str, "Frames:");
UI_block_align_begin(block);
- uiDefButI(block, UI_BTYPE_NUM, imagechanged, str, 10, 90, 150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use");
- uiDefButI(block, UI_BTYPE_NUM, imagechanged, "StartFr:", 160, 90, 150, 20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie");
+ uiDefButI(block,
+ UI_BTYPE_NUM,
+ imagechanged,
+ str,
+ 10,
+ 90,
+ 150,
+ 20,
+ &iuser->frames,
+ 0.0,
+ MAXFRAMEF,
+ 0,
+ 0,
+ "Number of images of a movie to use");
+ uiDefButI(block,
+ UI_BTYPE_NUM,
+ imagechanged,
+ "StartFr:",
+ 160,
+ 90,
+ 150,
+ 20,
+ &iuser->sfra,
+ 1.0,
+ MAXFRAMEF,
+ 0,
+ 0,
+ "Global starting frame of the movie");
}
#endif
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 06bacabe6fa..086f3103523 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -3403,14 +3403,14 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event
{
ScrArea *sa, *cur = curarea;
- node_curvemap_sample(fp); /* sends global to node editor */
+ node_curvemap_sample(fp); /* sends global to node editor */
for (sa = G.curscreen->areabase.first; sa; sa = sa->next) {
if (sa->spacetype == SPACE_NODE) {
areawinset(sa->win);
scrarea_do_windraw(sa);
}
}
- node_curvemap_sample(NULL); /* clears global in node editor */
+ node_curvemap_sample(NULL); /* clears global in node editor */
curarea = cur;
}
#endif
@@ -3650,8 +3650,12 @@ static int image_record_composite_apply(bContext *C, wmOperator *op)
BKE_image_all_free_anim_ibufs(scene->r.cfra);
ntreeCompositTagAnimated(scene->nodetree);
- ntreeCompositExecTree(scene->nodetree, &scene->r, 0, scene->r.cfra != rcd->old_cfra,
- &scene->view_settings, &scene->display_settings); /* 1 is no previews */
+ ntreeCompositExecTree(scene->nodetree,
+ &scene->r,
+ 0,
+ scene->r.cfra != rcd->old_cfra,
+ &scene->view_settings,
+ &scene->display_settings); /* 1 is no previews */
ED_area_tag_redraw(CTX_wm_area(C));
@@ -3714,7 +3718,8 @@ static int image_record_composite_exec(bContext *C, wmOperator *op)
if (!image_record_composite_init(C, op))
return OPERATOR_CANCELLED;
- while (image_record_composite_apply(C, op)) {}
+ while (image_record_composite_apply(C, op)) {
+ }
image_record_composite_exit(C, op);
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index e1875fd6129..9c834f09fd4 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -745,7 +745,8 @@ static void image_main_region_draw(const bContext *C, ARegion *ar)
/* scrollers? */
#if 0
- scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+ scrollers = UI_view2d_scrollers_calc(
+ C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
UI_view2d_scrollers_draw(C, v2d, scrollers);
UI_view2d_scrollers_free(scrollers);
#endif
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index 707838cf7e5..1521a400779 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -46,11 +46,16 @@ int info_report_mask(SpaceInfo *UNUSED(sinfo))
#if 0
int report_mask = 0;
- if (sinfo->rpt_mask & INFO_RPT_DEBUG) report_mask |= RPT_DEBUG_ALL;
- if (sinfo->rpt_mask & INFO_RPT_INFO) report_mask |= RPT_INFO_ALL;
- if (sinfo->rpt_mask & INFO_RPT_OP) report_mask |= RPT_OPERATOR_ALL;
- if (sinfo->rpt_mask & INFO_RPT_WARN) report_mask |= RPT_WARNING_ALL;
- if (sinfo->rpt_mask & INFO_RPT_ERR) report_mask |= RPT_ERROR_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_DEBUG)
+ report_mask |= RPT_DEBUG_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_INFO)
+ report_mask |= RPT_INFO_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_OP)
+ report_mask |= RPT_OPERATOR_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_WARN)
+ report_mask |= RPT_WARNING_ALL;
+ if (sinfo->rpt_mask & INFO_RPT_ERR)
+ report_mask |= RPT_ERROR_ALL;
return report_mask;
#endif
@@ -71,10 +76,8 @@ static int report_replay_exec(bContext *C, wmOperator *UNUSED(op))
sc->type = CONSOLE_TYPE_PYTHON;
for (report = reports->list.last; report; report = report->prev) {
- if ((report->type & report_mask) &&
- (report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) &&
- (report->flag & SELECT))
- {
+ if ((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL | RPT_PROPERTY_ALL) &&
+ (report->flag & SELECT)) {
console_history_add_str(sc, report->message, 0);
WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL);
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 7072f34ee4d..327aa94ca3e 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -204,7 +204,8 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
bNode *node = node_v;
Tex *tex;
- if (node->menunr < 1) return;
+ if (node->menunr < 1)
+ return;
if (node->id) {
id_us_min(node->id);
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 84f512957c7..09af141b026 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -752,8 +752,8 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node)
#if 0
if (node->id)
; // XXX BIF_preview_changed(-1);
- // allqueue(REDRAWBUTSSHADING, 1);
- // allqueue(REDRAWIPO, 0);
+ // allqueue(REDRAWBUTSSHADING, 1);
+ // allqueue(REDRAWIPO, 0);
#endif
}
}
@@ -804,7 +804,8 @@ static int edit_node_invoke_properties(bContext *C, wmOperator *op)
return 1;
}
-static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **rnode, bNodeSocket **rsock, int *rin_out)
+static void edit_node_properties_get(
+ wmOperator *op, bNodeTree *ntree, bNode **rnode, bNodeSocket **rsock, int *rin_out)
{
bNode *node;
bNodeSocket *sock = NULL;
@@ -819,8 +820,12 @@ static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **r
sockindex = RNA_int_get(op->ptr, "socket");
switch (in_out) {
- case SOCK_IN: sock = BLI_findlink(&node->inputs, sockindex); break;
- case SOCK_OUT: sock = BLI_findlink(&node->outputs, sockindex); break;
+ case SOCK_IN:
+ sock = BLI_findlink(&node->inputs, sockindex);
+ break;
+ case SOCK_OUT:
+ sock = BLI_findlink(&node->outputs, sockindex);
+ break;
}
if (rnode)
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 2d33c5db49d..f0dface1e32 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -100,7 +100,7 @@ static void outliner_width(SpaceOutliner *soops, ListBase *lb, int *w)
{
TreeElement *te = lb->first;
while (te) {
-// TreeStoreElem *tselem = TREESTORE(te);
+ // TreeStoreElem *tselem = TREESTORE(te);
// XXX fixme... te->xend is not set yet
if (!TSELEM_OPEN(tselem, soops)) {
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 11d01931945..6cfb5ce8202 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1296,8 +1296,8 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot)
#if 0
/* find next element that has this name */
-static TreeElement *outliner_find_name(SpaceOutliner *soops, ListBase *lb, char *name, int flags,
- TreeElement *prev, int *prevFound)
+static TreeElement *outliner_find_name(
+ SpaceOutliner *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
{
TreeElement *te, *tes;
@@ -1318,16 +1318,18 @@ static TreeElement *outliner_find_name(SpaceOutliner *soops, ListBase *lb, char
}
tes = outliner_find_name(soops, &te->subtree, name, flags, prev, prevFound);
- if (tes) return tes;
+ if (tes)
+ return tes;
}
/* nothing valid found */
return NULL;
}
-static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner *soops, int again, int flags)
+static void outliner_find_panel(
+ Scene *UNUSED(scene), ARegion *ar, SpaceOutliner *soops, int again, int flags)
{
- ReportList *reports = NULL; // CTX_wm_reports(C);
+ ReportList *reports = NULL; // CTX_wm_reports(C);
TreeElement *te = NULL;
TreeElement *last_find;
TreeStoreElem *tselem;
@@ -1354,10 +1356,10 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner
else {
/* pop up panel - no previous, or user didn't want search after previous */
name[0] = '\0';
-// XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) {
-// te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
-// }
-// else return; /* XXX RETURN! XXX */
+ // XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) {
+ // te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
+ // }
+ // else return; /* XXX RETURN! XXX */
}
/* do selection and reveal */
@@ -1374,7 +1376,8 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOutliner
/* make te->ys center of view */
ytop = (int)(te->ys + BLI_rctf_size_y(&ar->v2d.mask) / 2);
- if (ytop > 0) ytop = 0;
+ if (ytop > 0)
+ ytop = 0;
ar->v2d.cur.ymax = (float)ytop;
ar->v2d.cur.ymin = (float)(ytop - BLI_rctf_size_y(&ar->v2d.mask));
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index a03d9b6fb6d..6b24e83e8ee 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -372,9 +372,12 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index);
#if 0 /* disabled as it needs to be reworked for recoded constraints system */
target = get_constraint_target(con, &str);
- if (str && str[0]) ten1->name = str;
- else if (target) ten1->name = target->id.name + 2;
- else ten1->name = con->name;
+ if (str && str[0])
+ ten1->name = str;
+ else if (target)
+ ten1->name = target->id.name + 2;
+ else
+ ten1->name = con->name;
#endif
ten1->name = con->name;
ten1->directdata = con;
@@ -434,9 +437,12 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
ten = outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_CONSTRAINT, a);
#if 0 /* disabled due to constraints system targets recode... code here needs review */
target = get_constraint_target(con, &str);
- if (str && str[0]) ten->name = str;
- else if (target) ten->name = target->id.name + 2;
- else ten->name = con->name;
+ if (str && str[0])
+ ten->name = str;
+ else if (target)
+ ten->name = target->id.name + 2;
+ else
+ ten->name = con->name;
#endif
ten->name = con->name;
ten->directdata = con;
@@ -1548,15 +1554,20 @@ static int treesort_obtype_alpha(const void *v1, const void *v2)
else {
/* 2nd we check ob type */
if (x1->idcode == ID_OB && x2->idcode == ID_OB) {
- if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1;
- else if (((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1;
- else return 0;
+ if (((Object *)x1->id)->type > ((Object *)x2->id)->type)
+ return 1;
+ else if (((Object *)x1->id)->type > ((Object *)x2->id)->type)
+ return -1;
+ else
+ return 0;
}
else {
int comp = strcmp(x1->name, x2->name);
- if (comp > 0) return 1;
- else if (comp < 0) return -1;
+ if (comp > 0)
+ return 1;
+ else if (comp < 0)
+ return -1;
return 0;
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index e2140fba1f6..628d487210a 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1201,13 +1201,19 @@ void sequencer_draw_maskedit(const bContext *C, Scene *scene, ARegion *ar, Space
width = (scene->r.size * scene->r.xsch) / 100;
height = (scene->r.size * scene->r.ysch) / 100;
- ED_mask_draw_region(
- mask, ar,
- 0, 0, 0, /* TODO */
- width, height,
- aspx, aspy,
- false, true,
- NULL, C);
+ ED_mask_draw_region(mask,
+ ar,
+ 0,
+ 0,
+ 0, /* TODO */
+ width,
+ height,
+ aspx,
+ aspy,
+ false,
+ true,
+ NULL,
+ C);
}
}
}
@@ -1623,9 +1629,7 @@ void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq)
recty = (render_size * scene->r.ysch) / 100;
if (sseq->mainb != SEQ_DRAW_SEQUENCE) {
- give_ibuf_prefetch_request(
- rectx, recty, (scene->r.cfra), sseq->chanshown,
- proxy_size);
+ give_ibuf_prefetch_request(rectx, recty, (scene->r.cfra), sseq->chanshown, proxy_size);
}
}
#endif
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index cf07e252404..c94da4afa52 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1036,22 +1036,22 @@ static void set_filter_seq(Scene *scene)
Sequence *seq;
Editing *ed = BKE_sequencer_editing_get(scene, false);
+ if (ed == NULL)
+ return;
- if (ed == NULL) return;
-
- if (okee("Set Deinterlace") == 0) return;
+ if (okee("Set Deinterlace") == 0)
+ return;
- SEQP_BEGIN (ed, seq)
- {
+ SEQP_BEGIN (ed, seq) {
if (seq->flag & SELECT) {
if (seq->type == SEQ_TYPE_MOVIE) {
seq->flag |= SEQ_FILTERY;
BKE_sequence_reload_new_file(scene, seq, false);
BKE_sequence_calc(scene, seq);
}
-
}
- } SEQ_END;
+ }
+ SEQ_END;
}
#endif
@@ -1228,7 +1228,8 @@ bool sequencer_edit_poll(bContext *C)
bool sequencer_strip_poll(bContext *C)
{
Editing *ed;
- return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), false)) != NULL) && (ed->act_seq != NULL));
+ return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), false)) != NULL) &&
+ (ed->act_seq != NULL));
}
#endif
@@ -2886,9 +2887,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
/* Apply aspect, dosnt need to be that accurate */
imgwidth = (int)(imgwidth * (scene->r.xasp / scene->r.yasp));
- if (((imgwidth >= width) || (imgheight >= height)) &&
- ((width > 0) && (height > 0)))
- {
+ if (((imgwidth >= width) || (imgheight >= height)) && ((width > 0) && (height > 0))) {
/* Find the zoom value that will fit the image in the image space */
zoomX = ((float)width) / ((float)imgwidth);
zoomY = ((float)height) / ((float)imgheight);
@@ -2965,10 +2964,14 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot)
#if 0
static const EnumPropertyItem view_type_items[] = {
- {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
- {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
- {SEQ_VIEW_SEQUENCE_PREVIEW, "SEQUENCER_PREVIEW", ICON_SEQ_SEQUENCER, "Sequencer and Image Preview", ""},
- {0, NULL, 0, NULL, NULL},
+ {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
+ {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
+ {SEQ_VIEW_SEQUENCE_PREVIEW,
+ "SEQUENCER_PREVIEW",
+ ICON_SEQ_SEQUENCER,
+ "Sequencer and Image Preview",
+ ""},
+ {0, NULL, 0, NULL, NULL},
};
#endif
@@ -3169,7 +3172,8 @@ static Sequence *sequence_find_parent(Scene *scene, Sequence *child)
Sequence *parent = NULL;
Sequence *seq;
- if (ed == NULL) return NULL;
+ if (ed == NULL)
+ return NULL;
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if ((seq != child) && seq_is_parent(seq, child)) {
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index a59a3b830e3..09cc4635254 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -541,12 +541,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
#if 0 // XXX probably need to redo this differently for 2.5
if (marker) {
int mval[2], xo, yo;
-// getmouseco_areawin(mval);
+ // getmouseco_areawin(mval);
xo = mval[0];
yo = mval[1];
while (get_mbut()) {
-// getmouseco_areawin(mval);
+ // getmouseco_areawin(mval);
if (abs(mval[0] - xo) + abs(mval[1] - yo) > 4) {
transform_markers('g', 0);
return;
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index dadb86f439b..b2c5f42adb4 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -107,7 +107,8 @@ static void txt_format_text(SpaceText *st)
{
TextLine *linep;
- if (!st->text) return;
+ if (!st->text)
+ return;
for (linep = st->text->lines.first; linep; linep = linep->next)
txt_format_line(st, linep, 0);
@@ -989,18 +990,23 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
int i, br, lines;
int boxw, boxh, l, x, y /* , top */ /* UNUSED */;
- if (!st || !st->text) return;
- if (!texttool_text_is_active(st->text)) return;
+ if (!st || !st->text)
+ return;
+ if (!texttool_text_is_active(st->text))
+ return;
docs = texttool_docs_get();
- if (!docs) return;
+ if (!docs)
+ return;
text_draw_context_init(st, &tdc);
/* Count the visible lines to the cursor */
- for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++) ;
- if (l < 0) return;
+ for (tmp = st->text->curl, l = -st->top; tmp; tmp = tmp->prev, l++)
+ ;
+ if (l < 0)
+ return;
if (st->showlinenrs) {
x = st->cwidth * (st->text->curc - st->left) + TXT_OFFSET + TEXTXLOC - 4;
@@ -1017,7 +1023,8 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
boxh = (DOC_HEIGHT + 1) * (st->lheight_dpi + TXT_LINE_SPACING);
/* Draw panel */
- uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
+ uint pos = GPU_vertformat_attr_add(
+ immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformThemeColor(TH_BACK);
@@ -1044,9 +1051,12 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
UI_FontThemeColor(tdc.font_id, TH_TEXT);
- i = 0; br = DOC_WIDTH; lines = 0; // XXX -doc_scroll;
+ i = 0;
+ br = DOC_WIDTH;
+ lines = 0; // XXX -doc_scroll;
for (p = docs; *p; p++) {
- if (*p == '\r' && *(++p) != '\n') *(--p) = '\n'; /* Fix line endings */
+ if (*p == '\r' && *(++p) != '\n')
+ *(--p) = '\n'; /* Fix line endings */
if (*p == ' ' || *p == '\t')
br = i;
else if (*p == '\n') {
@@ -1055,7 +1065,9 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
y -= st->lheight_dpi;
text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL);
}
- i = 0; br = DOC_WIDTH; lines++;
+ i = 0;
+ br = DOC_WIDTH;
+ lines++;
}
buf[i++] = *p;
if (i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */
@@ -1065,9 +1077,12 @@ static void draw_documentation(const SpaceText *st, ARegion *ar)
text_draw(st, &tdc, buf, 0, 0, x + 4, y - 3, NULL);
}
p -= i - br - 1; /* Rewind pointer to last break */
- i = 0; br = DOC_WIDTH; lines++;
+ i = 0;
+ br = DOC_WIDTH;
+ lines++;
}
- if (lines >= DOC_HEIGHT) break;
+ if (lines >= DOC_HEIGHT)
+ break;
}
}
#endif
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c
index 435a6fd67de..cbb3be0f1c8 100644
--- a/source/blender/editors/space_text/text_header.c
+++ b/source/blender/editors/space_text/text_header.c
@@ -195,13 +195,30 @@ void TEXT_OT_start_find(wmOperatorType *ot)
uiPopupMenu *pup;
pup = UI_popup_menu_begin(C, IFACE_("Text"), ICON_NONE);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
- 0, "type", FILE_TOP);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"),
- 0, "type", FILE_BOTTOM);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"), 0, "type", PREV_PAGE);
- uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"),
- 0, "type", NEXT_PAGE);
+ uiItemEnumO(layout,
+ "TEXT_OT_move",
+ CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
+ 0,
+ "type",
+ FILE_TOP);
+ uiItemEnumO(layout,
+ "TEXT_OT_move",
+ CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"),
+ 0,
+ "type",
+ FILE_BOTTOM);
+ uiItemEnumO(layout,
+ "TEXT_OT_move",
+ CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"),
+ 0,
+ "type",
+ PREV_PAGE);
+ uiItemEnumO(layout,
+ "TEXT_OT_move",
+ CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"),
+ 0,
+ "type",
+ NEXT_PAGE);
UI_popup_menu_end(C, pup);
}
#endif
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 1d2d361d868..84ebacc0a2f 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1646,7 +1646,8 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
#if 0
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ZOOM);
- WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
+ WM_modalkeymap_add_item(
+ keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, VIEWROT_MODAL_SWITCH_ROTATE);
#endif
/* assign map to operators */
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index 6932e94e78d..f50f6f81087 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -498,7 +498,10 @@ void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3],
/* very similar to ED_view3d_win_to_3d() but has no advantage, de-duplicating */
#if 0
-bool view3d_get_view_aligned_coordinate(ARegion *ar, float fp[3], const int mval[2], const bool do_fallback)
+bool view3d_get_view_aligned_coordinate(ARegion *ar,
+ float fp[3],
+ const int mval[2],
+ const bool do_fallback)
{
RegionView3D *rv3d = ar->regiondata;
float dvec[3];
@@ -508,8 +511,7 @@ bool view3d_get_view_aligned_coordinate(ARegion *ar, float fp[3], const int mval
ret = ED_view3d_project_int_global(ar, fp, mval_cpy, V3D_PROJ_TEST_NOP);
if (ret == V3D_PROJ_RET_OK) {
- const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]),
- (float)(mval_cpy[1] - mval[1])};
+ const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]), (float)(mval_cpy[1] - mval[1])};
const float zfac = ED_view3d_calc_zfac(rv3d, fp, NULL);
ED_view3d_win_to_delta(ar, mval_f, dvec, zfac);
sub_v3_v3(fp, dvec);
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index c0f2e563365..088b611a0e8 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1080,9 +1080,8 @@ static void do_lasso_select_node(int mcords[][2], short moves, const eSelectOp s
ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent);
const bool is_select = node->flag & SELECT;
- const bool is_inside = (
- BLI_rcti_isect_pt_v(&rect, node_cent) &&
- BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1]));
+ const bool is_inside = (BLI_rcti_isect_pt_v(&rect, node_cent) &&
+ BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1]));
const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside);
if (sel_op_result != -1) {
SET_FLAG_FROM_TEST(node->flag, sel_op_result, SELECT);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index e313ed39c49..0738703d1b0 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -739,9 +739,16 @@ void view3d_winmatrix_set(Depsgraph *depsgraph, ARegion *ar, const View3D *v3d,
rv3d->is_persp = !is_ortho;
#if 0
- printf("%s: %d %d %f %f %f %f %f %f\n", __func__, winx, winy,
- viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax,
- clipsta, clipend);
+ printf("%s: %d %d %f %f %f %f %f %f\n",
+ __func__,
+ winx,
+ winy,
+ viewplane.xmin,
+ viewplane.ymin,
+ viewplane.xmax,
+ viewplane.ymax,
+ clipsta,
+ clipend);
#endif
if (rect) { /* picking */
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 944c6436dfb..76bd66f87b5 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -6731,7 +6731,8 @@ static BMLoop *get_next_loop(
cross_v3_v3v3(vec_accum, l_tmp->f->no, tdir);
#if 0
/* rough guess, we can do better! */
- normalize_v3_length(vec_accum, (BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f);
+ normalize_v3_length(vec_accum,
+ (BM_edge_calc_length(e_prev) + BM_edge_calc_length(e_next)) / 2.0f);
#else
/* be clever, check the opposite ngon edge to slide into.
* this gives best results */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index b682617f348..ef8089b8225 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -6932,7 +6932,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
#if 0
if (ELEM(t->frame_side, 'L', 'R')) { /* TFM_TIME_EXTEND */
/* same as below */
- ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side);
+ ED_markers_post_apply_transform(
+ ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side);
}
else /* TFM_TIME_TRANSLATE */
#endif
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 18b19d903c4..8b4c1c30959 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -587,8 +587,7 @@ static unsigned int bm_mesh_edges_select_get_n(BMesh *bm, BMEdge **elems, const
static unsigned int bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const unsigned int n)
{
return bm_mesh_elems_select_get_n__internal(
- bm, (BMElem **)elems, min_ii(n, bm->totfacesel),
- BM_FACES_OF_MESH, BM_FACE);
+ bm, (BMElem **)elems, min_ii(n, bm->totfacesel), BM_FACES_OF_MESH, BM_FACE);
}
#endif
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 291dbdf6942..d1e63ad2986 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -2649,8 +2649,10 @@ static int uv_mouse_select_multi(
/* before bmesh */
#if 0
if (ts->selectmode != SCE_SELECT_FACE) {
- if (flush == 1) EDBM_select_flush(em);
- else if (flush == -1) EDBM_deselect_flush(em);
+ if (flush == 1)
+ EDBM_select_flush(em);
+ else if (flush == -1)
+ EDBM_deselect_flush(em);
}
#else
if (flush != 0) {
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 69183d02ab9..913aacec4c8 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -1393,7 +1393,12 @@ static int p_polygon_point_in(float *cp1, float *cp2, float *p)
return (p_area_signed(cp1, cp2, p) >= 0.0f);
}
-static void p_polygon_kernel_clip(float (*oldpoints)[2], int noldpoints, float (*newpoints)[2], int *nnewpoints, float *cp1, float *cp2)
+static void p_polygon_kernel_clip(float (*oldpoints)[2],
+ int noldpoints,
+ float (*newpoints)[2],
+ int *nnewpoints,
+ float *cp1,
+ float *cp2)
{
float *p2, *p1, isect[2];
int i, p2in, p1in;
@@ -1438,7 +1443,7 @@ static void p_polygon_kernel_clip(float (*oldpoints)[2], int noldpoints, float (
static void p_polygon_kernel_center(float (*points)[2], int npoints, float *center)
{
int i, size, nnewpoints = npoints;
- float (*oldpoints)[2], (*newpoints)[2], *p1, *p2;
+ float(*oldpoints)[2], (*newpoints)[2], *p1, *p2;
size = npoints * 3;
oldpoints = MEM_mallocN(sizeof(float) * 2 * size, "PPolygonOldPoints");
@@ -1477,7 +1482,7 @@ static void p_polygon_kernel_center(float (*points)[2], int npoints, float *cent
newpoints = MEM_mallocN(sizeof(float) * 2 * size, "newpoints");
}
else {
- float (*sw_points)[2] = oldpoints;
+ float(*sw_points)[2] = oldpoints;
oldpoints = newpoints;
newpoints = sw_points;
}
@@ -1616,7 +1621,7 @@ static void p_vert_harmonic_insert(PVert *v)
* weights fails */
int npoints = 0, i;
- float (*points)[2];
+ float(*points)[2];
e = v->edge;
do {
@@ -1939,8 +1944,7 @@ static PBool p_collapse_allowed(PEdge *edge, PEdge *pair)
if (oldv->flag & PVERT_PIN)
return P_FALSE;
- return (p_collapse_allowed_topologic(edge, pair) &&
- p_collapse_allowed_geometric(edge, pair));
+ return (p_collapse_allowed_topologic(edge, pair) && p_collapse_allowed_geometric(edge, pair));
}
static float p_collapse_cost(PEdge *edge, PEdge *pair)
diff --git a/source/blender/freestyle/intern/application/AppCanvas.cpp b/source/blender/freestyle/intern/application/AppCanvas.cpp
index 8248266bbf5..ab1da79a77f 100644
--- a/source/blender/freestyle/intern/application/AppCanvas.cpp
+++ b/source/blender/freestyle/intern/application/AppCanvas.cpp
@@ -135,8 +135,18 @@ void AppCanvas::readColorPixels(int x, int y, int w, int h, RGBImage &oImage) co
float yfac = ((float)recty) / ((float)(ymax - ymin));
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
- printf("readColorPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n", w, h, x, y,
- xsch, ysch, xmax - xmin, ymax - ymin, rectx, recty, (int)(xfac * 100.0f));
+ printf("readColorPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n",
+ w,
+ h,
+ x,
+ y,
+ xsch,
+ ysch,
+ xmax - xmin,
+ ymax - ymin,
+ rectx,
+ recty,
+ (int)(xfac * 100.0f));
}
#endif
int ii, jj;
@@ -173,8 +183,18 @@ void AppCanvas::readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) c
float yfac = ((float)recty) / ((float)(ymax - ymin));
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
- printf("readDepthPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n", w, h, x, y,
- xsch, ysch, xmax - xmin, ymax - ymin, rectx, recty, (int)(xfac * 100.0f));
+ printf("readDepthPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n",
+ w,
+ h,
+ x,
+ y,
+ xsch,
+ ysch,
+ xmax - xmin,
+ ymax - ymin,
+ rectx,
+ recty,
+ (int)(xfac * 100.0f));
}
#endif
int ii, jj;
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp
index e6066123a33..d516b865eab 100644
--- a/source/blender/freestyle/intern/application/Controller.cpp
+++ b/source/blender/freestyle/intern/application/Controller.cpp
@@ -76,8 +76,8 @@ Controller::Controller()
{
const string sep(Config::DIR_SEP.c_str());
#if 0
- const string filename = Config::Path::getInstance()->getHomeDir() + sep + Config::OPTIONS_DIR + sep +
- Config::OPTIONS_CURRENT_DIRS_FILE;
+ const string filename = Config::Path::getInstance()->getHomeDir() + sep + Config::OPTIONS_DIR +
+ sep + Config::OPTIONS_CURRENT_DIRS_FILE;
_current_dirs = new ConfigIO(filename, Config::APPLICATION_NAME + "CurrentDirs", true);
#endif
@@ -337,7 +337,7 @@ int Controller::LoadMesh(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph
}
soc QFileInfo qfi(iFileName);
- soc string basename((const char*)qfi.fileName().toAscii().data());
+ soc string basename((const char *)qfi.fileName().toAscii().data());
char cleaned[FILE_MAX];
BLI_strncpy(cleaned, iFileName, FILE_MAX);
BLI_cleanup_file(NULL, cleaned);
@@ -633,31 +633,31 @@ void Controller::ComputeSteerableViewMap()
// Build 4 nodes containing the edges in the 4 directions
NodeGroup *ng[Canvas::NB_STEERABLE_VIEWMAP];
unsigned i;
- real c = 32.0f/255.0f; // see SteerableViewMap::readSteerableViewMapPixel() for information about this 32.
+ real c =
+ 32.0f /
+ 255.0f; // see SteerableViewMap::readSteerableViewMapPixel() for information about this 32.
for (i = 0; i < Canvas::NB_STEERABLE_VIEWMAP; ++i) {
ng[i] = new NodeGroup;
}
NodeShape *completeNS = new NodeShape;
- completeNS->material().setDiffuse(c,c,c,1);
- ng[Canvas::NB_STEERABLE_VIEWMAP-1]->AddChild(completeNS);
+ completeNS->material().setDiffuse(c, c, c, 1);
+ ng[Canvas::NB_STEERABLE_VIEWMAP - 1]->AddChild(completeNS);
SteerableViewMap *svm = _Canvas->getSteerableViewMap();
svm->Reset();
- ViewMap::fedges_container& fedges = _ViewMap->FEdges();
+ ViewMap::fedges_container &fedges = _ViewMap->FEdges();
LineRep *fRep;
NodeShape *ns;
- for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end();
- f != fend;
- ++f)
- {
+ for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend;
+ ++f) {
if ((*f)->viewedge()->qi() != 0)
continue;
fRep = new LineRep((*f)->vertexA()->point2d(), (*f)->vertexB()->point2d());
- completeNS->AddRep(fRep); // add to the complete map anyway
+ completeNS->AddRep(fRep); // add to the complete map anyway
double *oweights = svm->AddFEdge(*f);
for (i = 0; i < (Canvas::NB_STEERABLE_VIEWMAP - 1); ++i) {
ns = new NodeShape;
- double wc = oweights[i]*c;
+ double wc = oweights[i] * c;
if (oweights[i] == 0)
continue;
ns->material().setDiffuse(wc, wc, wc, 1);
@@ -713,7 +713,6 @@ void Controller::ComputeSteerableViewMap()
# endif
}
-
svm->buildImagesPyramids(img, false, 0, 1.0f);
#endif
}
@@ -1085,10 +1084,11 @@ void Controller::displayDensityCurves(int x, int y)
// display the curves
#if 0
for (i = 0; i < nbCurves; ++i)
- _pDensityCurvesWindow->setOrientationCurve(i, Vec2d(0, 0), Vec2d(nbPoints, 1), curves[i], "scale", "density");
+ _pDensityCurvesWindow->setOrientationCurve(
+ i, Vec2d(0, 0), Vec2d(nbPoints, 1), curves[i], "scale", "density");
for (i = 1; i <= 8; ++i)
- _pDensityCurvesWindow->setLevelCurve(i, Vec2d(0, 0), Vec2d(nbCurves, 1), curvesDirection[i],
- "orientation", "density");
+ _pDensityCurvesWindow->setLevelCurve(
+ i, Vec2d(0, 0), Vec2d(nbCurves, 1), curvesDirection[i], "orientation", "density");
_pDensityCurvesWindow->show();
#endif
}
diff --git a/source/blender/freestyle/intern/application/Controller.h b/source/blender/freestyle/intern/application/Controller.h
index be8553c73e1..b287a515ba1 100644
--- a/source/blender/freestyle/intern/application/Controller.h
+++ b/source/blender/freestyle/intern/application/Controller.h
@@ -94,10 +94,22 @@ class Controller {
vector<ViewEdge *>::iterator vedges_end);
#if 0
- NodeGroup *debugNode() {return _DebugNode;}
- AppView *view() {return _pView;}
- NodeGroup *debugScene() {return _DebugNode;}
- Grid& grid() {return _Grid;}
+ NodeGroup *debugNode()
+ {
+ return _DebugNode;
+ }
+ AppView *view()
+ {
+ return _pView;
+ }
+ NodeGroup *debugScene()
+ {
+ return _DebugNode;
+ }
+ Grid &grid()
+ {
+ return _Grid;
+ }
#endif
void toggleVisibilityAlgo();
@@ -192,7 +204,7 @@ class Controller {
#if 0
// Silhouette structure:
- std::vector<SShape*> _SShapes;
+ std::vector<SShape *> _SShapes;
NodeGroup *_SRoot;
// Silhouette
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
index 6b14c9ec70f..06a356dd232 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
@@ -77,9 +77,9 @@ NodeGroup *BlenderFileLoader::Load()
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
- cout << "Frustum: l " << _viewplane_left << " r " << _viewplane_right
- << " b " << _viewplane_bottom << " t " << _viewplane_top
- << " n " << _z_near << " f " << _z_far << endl;
+ cout << "Frustum: l " << _viewplane_left << " r " << _viewplane_right << " b "
+ << _viewplane_bottom << " t " << _viewplane_top << " n " << _z_near << " f " << _z_far
+ << endl;
}
#endif
@@ -143,7 +143,9 @@ int BlenderFileLoader::countClippedFaces(float v1[3], float v2[3], float v3[3],
}
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
- printf("%d %s\n", i, (clip[i] == NOT_CLIPPED) ? "not" : (clip[i] == CLIPPED_BY_NEAR) ? "near" : "far");
+ printf("%d %s\n",
+ i,
+ (clip[i] == NOT_CLIPPED) ? "not" : (clip[i] == CLIPPED_BY_NEAR) ? "near" : "far");
}
#endif
sum += clip[i];
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
index 5fe98fba0d0..dc6677bdcf4 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
@@ -98,7 +98,10 @@ class BlenderFileLoader {
#if 0
/*! Gets the smallest edge size read */
- inline real minEdgeSize() {return _minEdgeSize;}
+ inline real minEdgeSize()
+ {
+ return _minEdgeSize;
+ }
#endif
/*! Modifiers */
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index 47e2fef33e3..082ed34c353 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -190,7 +190,7 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer()
char *name = ob->id.name;
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
- cout << "removing " << name[0] << name[1] << ":" << (name+2) << endl;
+ cout << "removing " << name[0] << name[1] << ":" << (name + 2) << endl;
}
#endif
switch (ob->type) {
@@ -598,7 +598,8 @@ int BlenderStrokeRenderer::get_stroke_count() const
void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
{
#if 0
- Object *object_mesh = BKE_object_add(freestyle_bmain, freestyle_scene, (ViewLayer *)freestyle_scene->view_layers.first, OB_MESH);
+ Object *object_mesh = BKE_object_add(
+ freestyle_bmain, freestyle_scene, (ViewLayer *)freestyle_scene->view_layers.first, OB_MESH);
DEG_relations_tag_update(freestyle_bmain);
#else
Object *object_mesh = NewMesh();
diff --git a/source/blender/freestyle/intern/geometry/GeomCleaner.h b/source/blender/freestyle/intern/geometry/GeomCleaner.h
index b34828f87a9..5fedf94b479 100644
--- a/source/blender/freestyle/intern/geometry/GeomCleaner.h
+++ b/source/blender/freestyle/intern/geometry/GeomCleaner.h
@@ -240,7 +240,7 @@ class IndexedVertex {
};
#if 0
-bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2)
+bool operator<(const IndexedVertex &iv1, const IndexedVertex &iv2)
{
return iv1.operator<(iv2);
}
diff --git a/source/blender/freestyle/intern/geometry/Grid.cpp b/source/blender/freestyle/intern/geometry/Grid.cpp
index 6a95e540c79..51afb5c1a45 100644
--- a/source/blender/freestyle/intern/geometry/Grid.cpp
+++ b/source/blender/freestyle/intern/geometry/Grid.cpp
@@ -63,7 +63,8 @@ void firstIntersectionGridVisitor::examineOccluder(Polygon3r *occ)
current_cell_->getOrigin() + cell_size_)) {
#if 0
Vec3d bboxdiag(_scene3d->bbox().getMax() - _scene3d->bbox().getMin());
- if ((t > 1.0e-06 * (min(min(bboxdiag.x(), bboxdiag.y()), bboxdiag.z()))) && (t < raylength)) {
+ if ((t > 1.0e-06 * (min(min(bboxdiag.x(), bboxdiag.y()), bboxdiag.z()))) &&
+ (t < raylength)) {
#else
if (tmp_t < t_) {
#endif
diff --git a/source/blender/freestyle/intern/geometry/Polygon.h b/source/blender/freestyle/intern/geometry/Polygon.h
index ad8a947d21d..739f880443c 100644
--- a/source/blender/freestyle/intern/geometry/Polygon.h
+++ b/source/blender/freestyle/intern/geometry/Polygon.h
@@ -211,8 +211,8 @@ class Polygon3r : public Polygon<Vec3r> {
real epsilon = M_EPSILON) const
{
#if 0
- if (_vertices.size() < 3)
- return false;
+ if (_vertices.size() < 3)
+ return false;
#endif
return GeomUtils::intersectRayTriangle(
orig, dir, _vertices[0], _vertices[1], _vertices[2], t, u, v, epsilon);
diff --git a/source/blender/freestyle/intern/geometry/SweepLine.h b/source/blender/freestyle/intern/geometry/SweepLine.h
index 04797bc8998..81b0fd90d82 100644
--- a/source/blender/freestyle/intern/geometry/SweepLine.h
+++ b/source/blender/freestyle/intern/geometry/SweepLine.h
@@ -226,8 +226,8 @@ template<class T, class Point> class SweepLine {
inline void process(Point &p,
vector<Segment<T, Point> *> &segments,
#if 0
- binary_rule<Segment<T, Point>,Segment<T, Point> >& binrule = \
- binary_rule<Segment<T, Point>, Segment<T, Point> >(),
+ binary_rule<Segment<T, Point>, Segment<T, Point>> &binrule =
+ binary_rule<Segment<T, Point>, Segment<T, Point>>(),
#else
binary_rule<Segment<T, Point>, Segment<T, Point>> &binrule,
#endif
@@ -249,8 +249,8 @@ template<class T, class Point> class SweepLine {
inline void add(Segment<T, Point> *S,
#if 0
- binary_rule<Segment<T, Point>, Segment<T, Point> >& binrule = \
- binary_rule<Segment<T, Point>, Segment<T, Point> >(),
+ binary_rule<Segment<T, Point>, Segment<T, Point>> &binrule =
+ binary_rule<Segment<T, Point>, Segment<T, Point>>(),
#else
binary_rule<Segment<T, Point>, Segment<T, Point>> &binrule,
#endif
diff --git a/source/blender/freestyle/intern/geometry/VecMat.h b/source/blender/freestyle/intern/geometry/VecMat.h
index 22fcd3aef41..b9cf604fed7 100644
--- a/source/blender/freestyle/intern/geometry/VecMat.h
+++ b/source/blender/freestyle/intern/geometry/VecMat.h
@@ -796,24 +796,22 @@ template<class T, unsigned N> class SquareMatrix : public Matrix<T, N, N> {
/////////////////////////////////////////////////////////////////////////////
#if 0
-template <class T, unsigned N>
-inline Vec<T, N> operator+(const Vec<T, N>& v1, const Vec<T, N>& v2)
+template<class T, unsigned N> inline Vec<T, N> operator+(const Vec<T, N> &v1, const Vec<T, N> &v2)
{
Vec<T, N> res(v1);
res += v2;
return res;
}
-template <class T, unsigned N>
-inline Vec<T, N> operator-(const Vec<T, N>& v1, const Vec<T, N>& v2)
+template<class T, unsigned N> inline Vec<T, N> operator-(const Vec<T, N> &v1, const Vec<T, N> &v2)
{
Vec<T, N> res(v1);
res -= v2;
return res;
}
-template <class T, unsigned N>
-inline Vec<T, N> operator*(const Vec<T, N>& v, const typename Vec<T, N>::value_type r)
+template<class T, unsigned N>
+inline Vec<T, N> operator*(const Vec<T, N> &v, const typename Vec<T, N>::value_type r)
{
Vec<T, N> res(v);
res *= r;
@@ -830,8 +828,8 @@ inline Vec<T, N> operator*(const typename Vec<T, N>::value_type r, const Vec<T,
}
#if 0
-template <class T, unsigned N>
-inline Vec<T, N> operator/(const Vec<T, N>& v, const typename Vec<T, N>::value_type r)
+template<class T, unsigned N>
+inline Vec<T, N> operator/(const Vec<T, N> &v, const typename Vec<T, N>::value_type r)
{
Vec<T, N> res(v);
if (r)
@@ -840,8 +838,8 @@ inline Vec<T, N> operator/(const Vec<T, N>& v, const typename Vec<T, N>::value_t
}
// dot product
-template <class T, unsigned N>
-inline typename Vec<T, N>::value_type operator*(const Vec<T, N>& v1, const Vec<T, N>& v2)
+template<class T, unsigned N>
+inline typename Vec<T, N>::value_type operator*(const Vec<T, N> &v1, const Vec<T, N> &v2)
{
typename Vec<T, N>::value_type sum = 0;
for (unsigned int i = 0; i < N; i++)
@@ -850,10 +848,10 @@ inline typename Vec<T, N>::value_type operator*(const Vec<T, N>& v1, const Vec<T
}
// cross product for 3D Vectors
-template <typename T>
-inline Vec3<T> operator^(const Vec<T, 3>& v1, const Vec<T, 3>& v2)
+template<typename T> inline Vec3<T> operator^(const Vec<T, 3> &v1, const Vec<T, 3> &v2)
{
- Vec3<T> res(v1[1] * v2[2] - v1[2] * v2[1], v1[2] * v2[0] - v1[0] * v2[2], v1[0] * v2[1] - v1[1] * v2[0]);
+ Vec3<T> res(
+ v1[1] * v2[2] - v1[2] * v2[1], v1[2] * v2[0] - v1[0] * v2[2], v1[0] * v2[1] - v1[1] * v2[0]);
return res;
}
#endif
diff --git a/source/blender/freestyle/intern/image/ImagePyramid.cpp b/source/blender/freestyle/intern/image/ImagePyramid.cpp
index caf469328b5..12d322d7472 100644
--- a/source/blender/freestyle/intern/image/ImagePyramid.cpp
+++ b/source/blender/freestyle/intern/image/ImagePyramid.cpp
@@ -30,9 +30,9 @@ using namespace std;
namespace Freestyle {
#if 0
-ImagePyramid::ImagePyramid(const GrayImage& level0, unsigned nbLevels)
+ImagePyramid::ImagePyramid(const GrayImage &level0, unsigned nbLevels)
{
- BuildPyramid(level0,nbLevels);
+ BuildPyramid(level0, nbLevels);
}
#endif
diff --git a/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp b/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp
index 30d05ee571c..ae87b77aee7 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp
+++ b/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp
@@ -48,7 +48,7 @@ NodeCamera::NodeCamera(CameraType camera_type) : camera_type_(camera_type)
}
#if 0 /* UNUSED, gives warning in gcc */
-NodeCamera::NodeCamera(const NodeCamera& iBrother) : camera_type_(iBrother.camera_type_)
+NodeCamera::NodeCamera(const NodeCamera &iBrother) : camera_type_(iBrother.camera_type_)
{
memcpy(modelview_matrix_, iBrother.modelview_matrix_, 16 * sizeof(double));
memcpy(projection_matrix_, iBrother.projection_matrix_, 16 * sizeof(double));
diff --git a/source/blender/freestyle/intern/scene_graph/NodeCamera.h b/source/blender/freestyle/intern/scene_graph/NodeCamera.h
index c3c93fa1f88..2878e7a834e 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeCamera.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeCamera.h
@@ -47,7 +47,7 @@ class NodeCamera : public Node {
/*! Default matrices: Identity for both projection and modelview. */
NodeCamera(CameraType camera_type = GENERIC);
#if 0 /* UNUSED, gives warning in gcc */
- NodeCamera(const NodeCamera& iBrother);
+ NodeCamera(const NodeCamera &iBrother);
#endif
virtual ~NodeCamera()
diff --git a/source/blender/freestyle/intern/stroke/Curve.cpp b/source/blender/freestyle/intern/stroke/Curve.cpp
index f7309252aaf..a0709b0e2be 100644
--- a/source/blender/freestyle/intern/stroke/Curve.cpp
+++ b/source/blender/freestyle/intern/stroke/Curve.cpp
@@ -253,12 +253,18 @@ FEdge *CurvePoint::getFEdge(Interface0D &inter)
if (G.debug & G_DEBUG_FREESTYLE) {
printf("__A 0x%p p (%f, %f)\n", __A, __A->getPoint2D().x(), __A->getPoint2D().y());
printf("__B 0x%p p (%f, %f)\n", __B, __B->getPoint2D().x(), __B->getPoint2D().y());
- printf("iVertexB->A() 0x%p p (%f, %f)\n", iVertexB->A(), iVertexB->A()->getPoint2D().x(),
- iVertexB->A()->getPoint2D().y());
- printf("iVertexB->B() 0x%p p (%f, %f)\n", iVertexB->B(), iVertexB->B()->getPoint2D().x(),
- iVertexB->B()->getPoint2D().y());
+ printf("iVertexB->A() 0x%p p (%f, %f)\n",
+ iVertexB->A(),
+ iVertexB->A()->getPoint2D().x(),
+ iVertexB->A()->getPoint2D().y());
+ printf("iVertexB->B() 0x%p p (%f, %f)\n",
+ iVertexB->B(),
+ iVertexB->B()->getPoint2D().x(),
+ iVertexB->B()->getPoint2D().y());
printf("_t2d %f p (%f, %f)\n", _t2d, getPoint2D().x(), getPoint2D().y());
- printf("iVertexB->t2d() %f p (%f, %f)\n", iVertexB->t2d(), iVertexB->getPoint2D().x(),
+ printf("iVertexB->t2d() %f p (%f, %f)\n",
+ iVertexB->t2d(),
+ iVertexB->getPoint2D().x(),
iVertexB->getPoint2D().y());
}
#endif
@@ -315,7 +321,6 @@ float CurvePoint::shape_importance() const
return __A->shape_importance();
}
-
const unsigned CurvePoint::qi() const
{
if (__A == 0)
@@ -404,18 +409,18 @@ real CurvePoint::z_discontinuity() const
#if 0
float CurvePoint::local_average_depth() const
{
- return local_average_depth_function<CurvePoint >(this);
+ return local_average_depth_function<CurvePoint>(this);
}
float CurvePoint::local_depth_variance() const
{
- return local_depth_variance_function<CurvePoint >(this);
+ return local_depth_variance_function<CurvePoint>(this);
}
real CurvePoint::local_average_density(float sigma) const
{
//return local_average_density<CurvePoint >(this);
- return density_function<CurvePoint >(this);
+ return density_function<CurvePoint>(this);
}
Vec3r shaded_color() const;
@@ -484,7 +489,7 @@ real CurvePoint::curvatureFredo() const
return ((1 - _t2d) * __A->curvatureFredo() + _t2d * __B->curvatureFredo());
}
-Vec2d CurvePoint::directionFredo () const
+Vec2d CurvePoint::directionFredo() const
{
if (__A == 0)
return __B->directionFredo();
@@ -676,10 +681,9 @@ Vec3r Curve::orientation2d(point_iterator it) const
return (*it)->orientation2d();
}
-template <class BaseVertex>
-Vec3r Curve::orientation2d(int iCombination) const
+template<class BaseVertex> Vec3r Curve::orientation2d(int iCombination) const
{
- return edge_orientation2d_function<Curve >(this, iCombination);
+ return edge_orientation2d_function<Curve>(this, iCombination);
}
Vec3r Curve::orientation3d(point_iterator it) const
@@ -689,7 +693,7 @@ Vec3r Curve::orientation3d(point_iterator it) const
Vec3r Curve::orientation3d(int iCombination) const
{
- return edge_orientation3d_function<Curve >(this, iCombination);
+ return edge_orientation3d_function<Curve>(this, iCombination);
}
real curvature2d(point_iterator it) const
@@ -702,7 +706,7 @@ real curvature2d(int iCombination = 0) const;
Material Curve::material() const
{
const_vertex_iterator v = vertices_begin(), vend = vertices_end();
- const Material& mat = (*v)->material();
+ const Material &mat = (*v)->material();
for (; v != vend; ++v) {
if ((*v)->material() != mat)
Exception::raiseException();
@@ -747,7 +751,7 @@ bool Curve::occluders_empty() const
return empty;
}
-const Polygon3r& occludee() const
+const Polygon3r &occludee() const
{
return *(_FEdgeA->aFace());
}
@@ -789,7 +793,6 @@ int Curve::shape_id() const
return id.first;
}
-
const SShape *Curve::shape() const
{
const_vertex_iterator v = vertices_begin(), vend = vertices_end();
@@ -801,14 +804,12 @@ const SShape *Curve::shape() const
return sshape;
}
-
occluder_container::const_iterator Curve::occluders_begin() const
{
const_vertex_iterator v = vertices_begin();
return (*v)->occluders_begin();
}
-
occluder_container::const_iterator Curve::occluders_end() const
{
const_vertex_iterator v = vertices_end();
@@ -835,7 +836,7 @@ float Curve::local_average_depth(int iCombination) const
return local_average_depth_edge_function<Curve>(this, iCombination);
}
-float Curve::local_depth_variance(int iCombination ) const
+float Curve::local_depth_variance(int iCombination) const
{
return local_depth_variance_edge_function<Curve>(this, iCombination);
# if 0
@@ -846,7 +847,7 @@ float Curve::local_depth_variance(int iCombination ) const
# endif
}
-real Curve::local_average_density(float sigma, int iCombination ) const
+real Curve::local_average_density(float sigma, int iCombination) const
{
return density_edge_function<Curve>(this, iCombination);
# if 0
@@ -860,7 +861,7 @@ real Curve::local_average_density(float sigma, int iCombination ) const
/* UNUSED */
// #define EPS_CURVA_DIR 0.01
-void Curve::computeCurvatureAndOrientation ()
+void Curve::computeCurvatureAndOrientation()
{
const_vertex_iterator v = vertices_begin(), vend = vertices_end(), v2, prevV, v0;
Vec2d p0, p1, p2;
@@ -874,7 +875,7 @@ void Curve::computeCurvatureAndOrientation ()
p1 = Vec2d(p[0], p[1]);
Vec2d prevDir(p1 - p0);
- for (; v! = vend; ++v) {
+ for (; v ! = vend; ++v) {
v2 = v;
++v2;
if (v2 == vend)
diff --git a/source/blender/freestyle/intern/stroke/Curve.h b/source/blender/freestyle/intern/stroke/Curve.h
index 234f9df0e48..2a1d80f3029 100644
--- a/source/blender/freestyle/intern/stroke/Curve.h
+++ b/source/blender/freestyle/intern/stroke/Curve.h
@@ -525,7 +525,7 @@ class Curve : public Interface1D {
int occluders_size() const;
bool occluders_empty() const;
- const Polygon3r& occludee() const
+ const Polygon3r &occludee() const
{
return *(_FEdgeA->aFace());
}
diff --git a/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h b/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
index 3cd55facd15..f993c21ddb6 100644
--- a/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
+++ b/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
@@ -66,7 +66,7 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr
typedef __point_iterator<CurvePoint_const_traits> const_iterator;
#if 0
- typedef Vertex vertex_type ;
+ typedef Vertex vertex_type;
typedef vertex_container_iterator vertex_iterator_type;
typedef CurvePoint<Vertex> Point;
typedef Point point_type;
@@ -76,7 +76,8 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr
# if defined(__GNUC__) && (__GNUC__ < 3)
typedef bidirectional_iterator<CurvePoint<Vertex>, ptrdiff_t> bidirectional_point_iterator;
# else
- typedef iterator<bidirectional_iterator_tag, CurvePoint<Vertex>, ptrdiff_t> bidirectional_point_iterator;
+ typedef iterator<bidirectional_iterator_tag, CurvePoint<Vertex>, ptrdiff_t>
+ bidirectional_point_iterator;
# endif
#endif
friend class Curve;
diff --git a/source/blender/freestyle/intern/stroke/Operators.cpp b/source/blender/freestyle/intern/stroke/Operators.cpp
index 2c8a83e2518..fc4d099061c 100644
--- a/source/blender/freestyle/intern/stroke/Operators.cpp
+++ b/source/blender/freestyle/intern/stroke/Operators.cpp
@@ -206,7 +206,9 @@ error:
}
#if 0
-void Operators::bidirectionalChain(ViewEdgeIterator& it, UnaryPredicate1D& pred, UnaryFunction1D_void& modifier)
+void Operators::bidirectionalChain(ViewEdgeIterator &it,
+ UnaryPredicate1D &pred,
+ UnaryFunction1D_void &modifier)
{
if (_current_view_edges_set.empty())
return;
@@ -217,12 +219,11 @@ void Operators::bidirectionalChain(ViewEdgeIterator& it, UnaryPredicate1D& pred,
for (I1DContainer::iterator it_edge = _current_view_edges_set.begin();
it_edge != _current_view_edges_set.end();
- ++it_edge)
- {
+ ++it_edge) {
if (pred(**it_edge))
continue;
- edge = dynamic_cast<ViewEdge*>(*it_edge);
+ edge = dynamic_cast<ViewEdge *>(*it_edge);
it.setBegin(edge);
it.setCurrentEdge(edge);
@@ -253,7 +254,7 @@ void Operators::bidirectionalChain(ViewEdgeIterator& it, UnaryPredicate1D& pred,
_current_set = &_current_chains_set;
}
-void Operators::bidirectionalChain(ViewEdgeIterator& it, UnaryPredicate1D& pred)
+void Operators::bidirectionalChain(ViewEdgeIterator &it, UnaryPredicate1D &pred)
{
if (_current_view_edges_set.empty())
return;
@@ -267,12 +268,11 @@ void Operators::bidirectionalChain(ViewEdgeIterator& it, UnaryPredicate1D& pred)
for (I1DContainer::iterator it_edge = _current_view_edges_set.begin();
it_edge != _current_view_edges_set.end();
- ++it_edge)
- {
+ ++it_edge) {
if (pred(**it_edge) || pred_ts(**it_edge))
continue;
- edge = dynamic_cast<ViewEdge*>(*it_edge);
+ edge = dynamic_cast<ViewEdge *>(*it_edge);
it.setBegin(edge);
it.setCurrentEdge(edge);
@@ -835,7 +835,7 @@ static int __recursiveSplit(Chain *_curve,
CurveInternal::CurvePointIterator split = second;
Interface0DIterator it0d = it.castToInterface0DIterator();
#if 0
- real _min = func(it0d);
+ real _min = func(it0d);
++it;
#endif
real _min = FLT_MAX;
diff --git a/source/blender/freestyle/intern/stroke/Stroke.cpp b/source/blender/freestyle/intern/stroke/Stroke.cpp
index 7b6e53138bb..ef40865ecf1 100644
--- a/source/blender/freestyle/intern/stroke/Stroke.cpp
+++ b/source/blender/freestyle/intern/stroke/Stroke.cpp
@@ -834,7 +834,6 @@ Stroke::vertex_container::reverse_iterator Stroke::vertices_last(float sampling)
return _Vertices.rbegin();
}
-
inline Vec3r shaded_color(int iCombination = 0) const;
inline Vec<3, real> Stroke::orientation2d(const_vertex_iterator it) const
@@ -871,7 +870,7 @@ Material Stroke::material() const
int Stroke::qi() const
{
const_vertex_iterator v = vertices_begin(), vend = vertices_end();
- int qi_= (*v)->qi();
+ int qi_ = (*v)->qi();
for (; v != vend; ++v) {
if ((*v)->qi() != qi_)
Exception::raiseException();
@@ -965,10 +964,9 @@ float Stroke::shape_importance(int iCombination) const
return shape_importance_edge_function<Stroke>(*this, iCombination);
}
-
-float Stroke::local_average_depth(int iCombination ) const
+float Stroke::local_average_depth(int iCombination) const
{
- return local_average_depth_edge_function<Stroke >(*this, iCombination);
+ return local_average_depth_edge_function<Stroke>(*this, iCombination);
}
float Stroke::local_depth_variance(int iCombination) const
@@ -976,7 +974,7 @@ float Stroke::local_depth_variance(int iCombination) const
return local_depth_variance_edge_function<Stroke>(*this, iCombination);
}
-real Stroke::local_average_density(float sigma , int iCombination ) const
+real Stroke::local_average_density(float sigma, int iCombination) const
{
return density_edge_function<Stroke>(*this, iCombination);
}
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
index 026a7b2fc8f..f1483e80083 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
@@ -105,7 +105,7 @@ static bool notValid(Vec2r p)
}
#if 0
-static real crossP(const Vec2r& A, const Vec2r& B)
+static real crossP(const Vec2r &A, const Vec2r &B)
{
return A[0] * B[1] - A[1] * B[0];
}
@@ -498,8 +498,8 @@ void Strip::setVertexColor(const vector<StrokeVertex *> &iStrokeVertices)
_vertices[i]->setAlpha(sv->attribute().getAlpha());
i++;
#if 0
- cerr << "col=("<<sv->attribute().getColor()[0] << ", "
- << sv->attribute().getColor()[1] << ", " << sv->attribute().getColor()[2] << ")" << endl;
+ cerr << "col=(" << sv->attribute().getColor()[0] << ", " << sv->attribute().getColor()[1]
+ << ", " << sv->attribute().getColor()[2] << ")" << endl;
#endif
}
}
@@ -545,8 +545,8 @@ void Strip::computeTexCoordWithTips(const vector<StrokeVertex *> &iStrokeVertice
fact = (float(tiles) + 0.5) / l;
#if 0
- cerr << "l=" << l << " tiles=" << tiles << " _averageThicnkess="
- << _averageThickness << " strokeLength=" << (*v)->strokeLength() << endl;
+ cerr << "l=" << l << " tiles=" << tiles << " _averageThicnkess=" << _averageThickness
+ << " strokeLength=" << (*v)->strokeLength() << endl;
#endif
vector<StrokeVertexRep *>::iterator currentSV = _vertices.begin();
@@ -690,7 +690,7 @@ void Strip::computeTexCoordWithTips(const vector<StrokeVertex *> &iStrokeVertice
for (i = 0; i < _sizeStrip; i++)
cerr << "(" << _texCoord[i][0] << ", " << _texCoord[i][1] << ") ";
- cerr << endl;
+ cerr << endl;
Vec2r vec_tmp;
for (i = 0; i < _sizeStrip / 2; i++)
@@ -718,7 +718,7 @@ StrokeRep::StrokeRep()
if (ptm)
_textureId = ptm->getDefaultTextureId();
#if 0
- _averageTextureAlpha = 0.5; //default value
+ _averageTextureAlpha = 0.5; //default value
if (_strokeType == OIL_STROKE)
_averageTextureAlpha = 0.75;
if (_strokeType >= NO_BLEND_STROKE)
@@ -749,7 +749,7 @@ StrokeRep::StrokeRep(Stroke *iStroke)
}
#if 0
- _averageTextureAlpha = 0.5; //default value
+ _averageTextureAlpha = 0.5; //default value
if (_strokeType == OIL_STROKE)
_averageTextureAlpha = 0.75;
if (_strokeType >= NO_BLEND_STROKE)
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
index bb2b95be84e..1de4a87886c 100644
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
@@ -425,8 +425,7 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
if (flayer->nPosDotP() != numVertices) {
if ((fabs(flayer->dotP(0)) < threshold) && (fabs(flayer->dotP(1)) < threshold) &&
- (fabs(flayer->dotP(2)) < threshold))
- {
+ (fabs(flayer->dotP(2)) < threshold)) {
flayer->ReplaceDotP(0, 0);
flayer->ReplaceDotP(1, 0);
flayer->ReplaceDotP(2, 0);
@@ -443,7 +442,7 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
WVertex *v;
Vec3r v1v2;
real t;
- vector<WXFaceLayer*> SmoothLayers;
+ vector<WXFaceLayer *> SmoothLayers;
WXFaceLayer *faceLayer;
Face_Curvature_Info *layer_info;
real K1_a(0), K1_b(0);
@@ -451,7 +450,7 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
// find the ridge layer of the face
iFace->retrieveSmoothLayers(Nature::RIDGE, SmoothLayers);
- if ( SmoothLayers.size()!=1 )
+ if (SmoothLayers.size() != 1)
return;
faceLayer = SmoothLayers[0];
// retrieve the curvature info of this layer
@@ -461,27 +460,28 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
for (int i = 0; i < numVertices; i++) {
v = iFace->GetVertex(i);
// vec_curvature_info[i] contains the curvature info of this vertex
- Vec3r e2 = layer_info->vec_curvature_info[i]->K2*layer_info->vec_curvature_info[i]->e2;
- Vec3r e1 = layer_info->vec_curvature_info[i]->K1*layer_info->vec_curvature_info[i]->e1;
+ Vec3r e2 = layer_info->vec_curvature_info[i]->K2 * layer_info->vec_curvature_info[i]->e2;
+ Vec3r e1 = layer_info->vec_curvature_info[i]->K1 * layer_info->vec_curvature_info[i]->e1;
e2.normalize();
WVertex::face_iterator fit = v->faces_begin();
WVertex::face_iterator fitend = v->faces_end();
for (; fit != fitend; ++fit) {
- WXFace *wxf = dynamic_cast<WXFace*>(*fit);
+ WXFace *wxf = dynamic_cast<WXFace *>(*fit);
WOEdge *oppositeEdge;
if (!(wxf->getOppositeEdge(v, oppositeEdge)))
continue;
v1v2 = oppositeEdge->GetbVertex()->GetVertex() - oppositeEdge->GetaVertex()->GetVertex();
GeomUtils::intersection_test res;
- res = GeomUtils::intersectRayPlane(oppositeEdge->GetaVertex()->GetVertex(), v1v2, e2, -(v->GetVertex()*e2),
- t, 1.0e-06);
+ res = GeomUtils::intersectRayPlane(
+ oppositeEdge->GetaVertex()->GetVertex(), v1v2, e2, -(v->GetVertex() * e2), t, 1.0e-06);
if ((res == GeomUtils::DO_INTERSECT) && (t >= 0.0) && (t <= 1.0)) {
- vector<WXFaceLayer*> second_ridge_layer;
+ vector<WXFaceLayer *> second_ridge_layer;
wxf->retrieveSmoothLayers(Nature::RIDGE, second_ridge_layer);
if (second_ridge_layer.size() != 1)
continue;
- Face_Curvature_Info *second_layer_info = (Face_Curvature_Info*)second_ridge_layer[0]->userdata;
+ Face_Curvature_Info *second_layer_info =
+ (Face_Curvature_Info *)second_ridge_layer[0]->userdata;
unsigned index1 = wxf->GetIndex(oppositeEdge->GetaVertex());
unsigned index2 = wxf->GetIndex(oppositeEdge->GetbVertex());
@@ -566,10 +566,9 @@ void FEdgeXDetector::ProcessSuggestiveContourFace(WXFace *iFace)
#if 0 // FIXME: find a more clever way to compute the threshold
real threshold = _meanKr;
- if (faceLayer->nPosDotP()!=numVertices) {
+ if (faceLayer->nPosDotP() != numVertices) {
if ((fabs(faceLayer->dotP(0)) < threshold) && (fabs(faceLayer->dotP(1)) < threshold) &&
- (fabs(faceLayer->dotP(2)) < threshold))
- {
+ (fabs(faceLayer->dotP(2)) < threshold)) {
faceLayer->ReplaceDotP(0, 0);
faceLayer->ReplaceDotP(1, 0);
faceLayer->ReplaceDotP(2, 0);
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
index 61e0c9267a1..fafc391aa8f 100644
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
@@ -209,7 +209,7 @@ class FEdgeXDetector {
protected:
Vec3f _Viewpoint;
#if 0
- real _bbox_diagonal; // diagonal of the current processed shape bbox
+ real _bbox_diagonal; // diagonal of the current processed shape bbox
#endif
//oldtmp values
bool _computeViewIndependent;
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.cpp b/source/blender/freestyle/intern/view_map/Silhouette.cpp
index 73bf38107cd..af97efa1406 100644
--- a/source/blender/freestyle/intern/view_map/Silhouette.cpp
+++ b/source/blender/freestyle/intern/view_map/Silhouette.cpp
@@ -294,7 +294,7 @@ real FEdge::z_discontinuity() const
#if 0
real result;
z_discontinuity_functor<SVertex> _functor;
- Evaluate<SVertex, z_discontinuity_functor<SVertex> >(&_functor, iCombination, result);
+ Evaluate<SVertex, z_discontinuity_functor<SVertex>>(&_functor, iCombination, result);
#endif
Vec3r middle((_VertexB->point3d() - _VertexA->point3d()));
middle /= 2;
@@ -306,7 +306,7 @@ real FEdge::z_discontinuity() const
}
#if 0
-float FEdge::local_average_depth(int iCombination ) const
+float FEdge::local_average_depth(int iCombination) const
{
float result;
local_average_depth_functor<SVertex> functor;
@@ -315,7 +315,7 @@ float FEdge::local_average_depth(int iCombination ) const
return result;
}
-float FEdge::local_depth_variance(int iCombination ) const
+float FEdge::local_depth_variance(int iCombination) const
{
float result;
@@ -326,7 +326,7 @@ float FEdge::local_depth_variance(int iCombination ) const
return result;
}
-real FEdge::local_average_density( float sigma, int iCombination) const
+real FEdge::local_average_density(float sigma, int iCombination) const
{
float result;
@@ -337,7 +337,7 @@ real FEdge::local_average_density( float sigma, int iCombination) const
return result;
}
-Vec3r FEdge::normal(int& oException /* = Exception::NO_EXCEPTION */)
+Vec3r FEdge::normal(int &oException /* = Exception::NO_EXCEPTION */)
{
Vec3r Na = _VertexA->normal(oException);
if (oException != Exception::NO_EXCEPTION)
@@ -352,7 +352,7 @@ Vec3r FEdge::curvature2d_as_vector(int iCombination) const
{
Vec3r result;
curvature2d_as_vector_functor<SVertex> _functor;
- Evaluate<Vec3r, curvature2d_as_vector_functor<SVertex> >(&_functor, iCombination, result);
+ Evaluate<Vec3r, curvature2d_as_vector_functor<SVertex>>(&_functor, iCombination, result);
return result;
}
@@ -360,7 +360,7 @@ real FEdge::curvature2d_as_angle(int iCombination) const
{
real result;
curvature2d_as_angle_functor<SVertex> _functor;
- Evaluate<real, curvature2d_as_angle_functor<SVertex> >(&_functor, iCombination, result);
+ Evaluate<real, curvature2d_as_angle_functor<SVertex>>(&_functor, iCombination, result);
return result;
}
#endif
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h
index 510aedf6cbf..b9f84e7077f 100644
--- a/source/blender/freestyle/intern/view_map/Silhouette.h
+++ b/source/blender/freestyle/intern/view_map/Silhouette.h
@@ -333,12 +333,12 @@ class SVertex : public Interface0D {
_directionFredo = d;
}
- real curvatureFredo ()
+ real curvatureFredo()
{
return _curvatureFredo;
}
- const Vec2r directionFredo ()
+ const Vec2r directionFredo()
{
return _directionFredo;
}
@@ -657,7 +657,7 @@ class FEdge : public Interface1D {
int invisibility() const;
#if 0
- inline const vector<Polygon3r>& occluders() const
+ inline const vector<Polygon3r> &occluders() const
{
return _Occluders;
}
@@ -765,7 +765,7 @@ class FEdge : public Interface1D {
}
#if 0
- inline void AddOccluder(Polygon3r& iPolygon)
+ inline void AddOccluder(Polygon3r &iPolygon)
{
_Occluders.push_back(iPolygon);
}
@@ -783,12 +783,12 @@ class FEdge : public Interface1D {
_hasVisibilityPoint = iBool;
}
- inline void setVisibilityPointA(const Vec3r& iPoint)
+ inline void setVisibilityPointA(const Vec3r &iPoint)
{
_VisibilityPointA = iPoint;
}
- inline void setVisibilityPointB(const Vec3r& iPoint)
+ inline void setVisibilityPointB(const Vec3r &iPoint)
{
_VisibilityPointB = iPoint;
}
@@ -891,7 +891,7 @@ class FEdge : public Interface1D {
const SShape *occluded_shape() const;
#if 0
- inline const bool occludee_empty() const
+ inline const bool occludee_empty() const
{
return _occludeeEmpty;
}
@@ -904,7 +904,9 @@ class FEdge : public Interface1D {
inline float local_average_depth(int iCombination = 0) const;
inline float local_depth_variance(int iCombination = 0) const;
inline real local_average_density(float sigma = 2.3f, int iCombination = 0) const;
- inline Vec3r shaded_color(int iCombination = 0) const {}
+ inline Vec3r shaded_color(int iCombination = 0) const
+ {
+ }
#endif
int viewedge_nature() const;
diff --git a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
index 7d105a662b8..eeec347efc6 100644
--- a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
+++ b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
@@ -262,7 +262,8 @@ real SilhouetteGeomEngine::ImageToWorldParameter(FEdge *fe, real t)
}
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
- cout << "SilhouetteGeomEngine::ImageToWorldParameter(): #iters = " << i << ", dist = " << dist << "\n";
+ cout << "SilhouetteGeomEngine::ImageToWorldParameter(): #iters = " << i
+ << ", dist = " << dist << "\n";
}
#endif
if (i == max_iters && G.debug & G_DEBUG_FREESTYLE) {
diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
index 94541b2c312..d9258a05ebd 100644
--- a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
@@ -279,7 +279,7 @@ void SteerableViewMap::saveSteerableViewMap() const
GrayImage *img = _imagesPyramids[i]->getLevel(j);
int ow = img->width();
int oh = img->height();
- float coeff = 1.0f; // 100 * 255; // * pow(2, j);
+ float coeff = 1.0f; // 100 * 255; // * pow(2, j);
QImage qtmp(ow, oh, 32);
for (unsigned int y = 0; y < oh; ++y) {
for (unsigned int x = 0; x < ow; ++x) {
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
index 8896918e60d..629ec3d5d77 100644
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
@@ -229,7 +229,7 @@ ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge &iWEdge)
while (!stopSharpViewEdge(currentWEdge.e)) {
edgesChain.push_back(currentWEdge);
++size;
- currentWEdge.e->userdata = (void *)1; // processed
+ currentWEdge.e->userdata = (void *)1; // processed
// Find the next edge!
currentWEdge = FindNextWEdge(currentWEdge);
}
@@ -239,7 +239,7 @@ ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge &iWEdge)
while (!stopSharpViewEdge(currentWEdge.e)) {
edgesChain.push_front(currentWEdge);
++size;
- currentWEdge.e->userdata = (void *)1; // processed
+ currentWEdge.e->userdata = (void *)1; // processed
// Find the previous edge!
currentWEdge = FindPreviousWEdge(currentWEdge);
}
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.cpp b/source/blender/freestyle/intern/view_map/ViewMap.cpp
index 7c72e44fc10..d859f83079c 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMap.cpp
@@ -271,7 +271,7 @@ ViewVertex *ViewMap::InsertViewVertex(SVertex *iVertex, vector<ViewEdge *> &newV
}
#if 0
-FEdge *ViewMap::Connect(FEdge *ioEdge, SVertex *ioVertex, vector<ViewEdge*>& oNewVEdges)
+FEdge *ViewMap::Connect(FEdge *ioEdge, SVertex *ioVertex, vector<ViewEdge *> &oNewVEdges)
{
SShape *sshape = ioEdge->shape();
FEdge *newFEdge = sshape->SplitEdgeIn2(ioEdge, ioVertex);
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h
index b25e13d990f..96c9c3c0b4a 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.h
+++ b/source/blender/freestyle/intern/view_map/ViewMap.h
@@ -1761,7 +1761,7 @@ inline Vec3r ViewEdge::orientation2d(int iCombination) const
return edge_orientation2d_function<ViewEdge>(*this, iCombination);
}
-inline Vec3r ViewEdge::orientation3d(int iCombination) const
+inline Vec3r ViewEdge::orientation3d(int iCombination) const
{
return edge_orientation3d_function<ViewEdge>(*this, iCombination);
}
@@ -1771,7 +1771,7 @@ inline real ViewEdge::z_discontinuity(int iCombination) const
return z_discontinuity_edge_function<ViewEdge>(*this, iCombination);
}
-inline float ViewEdge::local_average_depth(int iCombination ) const
+inline float ViewEdge::local_average_depth(int iCombination) const
{
return local_average_depth_edge_function<ViewEdge>(*this, iCombination);
}
diff --git a/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h b/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
index 2c09bde487b..6af70120832 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
+++ b/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
@@ -168,8 +168,9 @@ class edge_iterator_base : public IteratorBase<Traits, InputIteratorTag_Traits>
//protected://FIXME
public:
#if 0
- inline edge_iterator_base(value_type ifeA, value_type ifeB, value_type ibeA, value_type ibeB, value_type iter)
- : parent_class()
+ inline edge_iterator_base(
+ value_type ifeA, value_type ifeB, value_type ibeA, value_type ibeB, value_type iter)
+ : parent_class()
{
_Nature = Nature::T_VERTEX;
_feA = ifeA;
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index ed0f5c9b0bd..44d840c2cc5 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -1431,7 +1431,7 @@ void ViewMapBuilder::ComputeEdgesVisibility(ViewMap *ioViewMap,
real epsilon)
{
#if 0
- iAlgo = ray_casting; // for testing algorithms equivalence
+ iAlgo = ray_casting; // for testing algorithms equivalence
#endif
switch (iAlgo) {
case ray_casting:
@@ -1780,7 +1780,7 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, real ep
++p;
#if 0
for (; p != pend; ++p) {
- WFace *f = (WFace*)((*p)->userdata);
+ WFace *f = (WFace *)((*p)->userdata);
ViewShape *vs = ioViewMap->viewShape(f->GetVertex(0)->shape()->GetId());
if (vs != vshape) {
sameShape = false;
@@ -2030,9 +2030,9 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe,
Vec3r B(fe->vertexB()->point2d());
int viewport[4];
SilhouetteGeomEngine::retrieveViewport(viewport);
- if ((A.x() < viewport[0]) || (A.x() > viewport[2]) || (A.y() < viewport[1]) || (A.y() > viewport[3]) ||
- (B.x() < viewport[0]) || (B.x() > viewport[2]) || (B.y() < viewport[1]) || (B.y() > viewport[3]))
- {
+ if ((A.x() < viewport[0]) || (A.x() > viewport[2]) || (A.y() < viewport[1]) ||
+ (A.y() > viewport[3]) || (B.x() < viewport[0]) || (B.x() > viewport[2]) ||
+ (B.y() < viewport[1]) || (B.y() > viewport[3])) {
cerr << "Warning: point is out of the grid for fedge " << fe->getId() << endl;
//return 0;
}
@@ -2206,10 +2206,10 @@ void ViewMapBuilder::ComputeIntersections(ViewMap *ioViewMap,
}
#if 0
if (_global.debug & G_DEBUG_FREESTYLE) {
- ViewMap::viewvertices_container& vvertices = ioViewMap->ViewVertices();
+ ViewMap::viewvertices_container &vvertices = ioViewMap->ViewVertices();
for (ViewMap::viewvertices_container::iterator vv = vvertices.begin(), vvend = vvertices.end();
- vv != vvend; ++vv)
- {
+ vv != vvend;
+ ++vv) {
if ((*vv)->getNature() == Nature::T_VERTEX) {
TVertex *tvertex = (TVertex *)(*vv);
cout << "TVertex " << tvertex->getId() << " has :" << endl;
@@ -2295,8 +2295,10 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi
unsigned fEdgesSize = ioViewMap->FEdges().size();
#if 0
if (_global.debug & G_DEBUG_FREESTYLE) {
- ViewMap::fedges_container& fedges = ioViewMap->FEdges();
- for (ViewMap::fedges_container::const_iterator f = fedges.begin(), end = fedges.end(); f != end; ++f) {
+ ViewMap::fedges_container &fedges = ioViewMap->FEdges();
+ for (ViewMap::fedges_container::const_iterator f = fedges.begin(), end = fedges.end();
+ f != end;
+ ++f) {
cout << (*f)->aMaterialIndex() << "-" << (*f)->bMaterialIndex() << endl;
}
}
diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.cpp b/source/blender/freestyle/intern/winged_edge/Curvature.cpp
index b42c3f9b0e6..ada1b20780a 100644
--- a/source/blender/freestyle/intern/winged_edge/Curvature.cpp
+++ b/source/blender/freestyle/intern/winged_edge/Curvature.cpp
@@ -144,7 +144,7 @@ bool gts_vertex_mean_curvature_normal(WVertex *v, Vec3r &Kh)
WOEdge *e = (*itE)->getPrevOnFace();
#if 0
if ((e->GetaVertex() == v) || (e->GetbVertex() == v))
- cerr<< "BUG ";
+ cerr << "BUG ";
#endif
WVertex *v1 = e->GetaVertex();
WVertex *v2 = e->GetbVertex();
@@ -534,8 +534,8 @@ namespace OGF {
#if 0
inline static real angle(WOEdge *h)
{
- const Vec3r& n1 = h->GetbFace()->GetNormal();
- const Vec3r& n2 = h->GetaFace()->GetNormal();
+ const Vec3r &n1 = h->GetbFace()->GetNormal();
+ const Vec3r &n2 = h->GetaFace()->GetNormal();
const Vec3r v = h->GetVec();
real sine = (n1 ^ n2) * v / v.norm();
if (sine >= 1.0) {
diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp b/source/blender/freestyle/intern/winged_edge/WEdge.cpp
index 629e8ffe901..c884c6f5df6 100644
--- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp
@@ -103,7 +103,7 @@ WFace *WVertex::face_iterator::operator*()
}
#if 0
-bool WVertex::isBoundary () const
+bool WVertex::isBoundary() const
{
return _Border;
}
diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.h b/source/blender/freestyle/intern/winged_edge/WEdge.h
index 79c6a24e6d9..f645c3d7520 100644
--- a/source/blender/freestyle/intern/winged_edge/WEdge.h
+++ b/source/blender/freestyle/intern/winged_edge/WEdge.h
@@ -368,10 +368,10 @@ class WEdge;
class WOEdge {
protected:
#if 0
- WOEdge *_paCWEdge; // edge reached when traveling clockwise on aFace from the edge
- WOEdge *_pbCWEdge; // edge reached when traveling clockwise on bFace from the edge
- WOEdge *_paCCWEdge; // edge reached when traveling counterclockwise on aFace from the edge
- WOEdge *_pbCCWEdge; // edge reached when traveling counterclockwise on bFace from the edge
+ WOEdge *_paCWEdge; // edge reached when traveling clockwise on aFace from the edge
+ WOEdge *_pbCWEdge; // edge reached when traveling clockwise on bFace from the edge
+ WOEdge *_paCCWEdge; // edge reached when traveling counterclockwise on aFace from the edge
+ WOEdge *_pbCCWEdge; // edge reached when traveling counterclockwise on bFace from the edge
#endif
WVertex *_paVertex; // starting vertex
WVertex *_pbVertex; // ending vertex
@@ -1099,7 +1099,7 @@ class WShape {
}
#if 0
- inline void bbox(Vec3f& min, Vec3f& max)
+ inline void bbox(Vec3f &min, Vec3f &max)
{
min = _min;
max = _max;
@@ -1160,7 +1160,7 @@ class WShape {
}
#if 0
- inline void setBBox(const Vec3f& min, const Vec3f& max)
+ inline void setBBox(const Vec3f &min, const Vec3f &max)
{
_min = min;
_max = max;
@@ -1275,7 +1275,9 @@ class WShape {
_max = _VertexList[0]->GetVertex();
Vec3f v;
- for (vector<WVertex *>::iterator wv = _VertexList.begin(), wvend = _VertexList.end(); wv != wvend; wv++) {
+ for (vector<WVertex *>::iterator wv = _VertexList.begin(), wvend = _VertexList.end();
+ wv != wvend;
+ wv++) {
for (unsigned int i = 0; i < 3; i++) {
v = (*wv)->GetVertex();
if (v[i] < _min[i])
diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.cpp b/source/blender/freestyle/intern/winged_edge/WXEdge.cpp
index fcac2b386ea..26c75accc12 100644
--- a/source/blender/freestyle/intern/winged_edge/WXEdge.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WXEdge.cpp
@@ -190,7 +190,8 @@ WXSmoothEdge *WXFaceLayer::BuildSmoothEdge()
for (int i = 0; i < numberOfEdges(); i++) {
WSFace *bface = (WSFace *)GetBordingFace(i);
if (bface) {
- if ((front()) ^ (bface->front())) { // fA->front XOR fB->front (true if one is 0 and the other is 1)
+ if ((front()) ^
+ (bface->front())) { // fA->front XOR fB->front (true if one is 0 and the other is 1)
// that means that the edge i of the face is a silhouette edge
// CHECK FIRST WHETHER THE EXACTSILHOUETTEEDGE HAS NOT YET BEEN BUILT ON THE OTHER FACE (1 is enough).
if (((WSExactFace *)bface)->exactSilhouetteEdge()) {
@@ -200,7 +201,7 @@ WXSmoothEdge *WXFaceLayer::BuildSmoothEdge()
// Else we must build it
WOEdge *woea, *woeb;
float ta, tb;
- if (!front()) { // is it in the right order ?
+ if (!front()) { // is it in the right order ?
// the order of the WOEdge index is wrong
woea = _OEdgeList[(i + 1) % numberOfEdges()];
if (0 == i)
@@ -288,7 +289,9 @@ WFace *WXShape::MakeFace(vector<WVertex *> &iVertexList,
#if 0
Vec3f center;
- for (vector<WVertex *>::iterator wv = iVertexList.begin(), wvend = iVertexList.end(); wv != wvend; ++wv) {
+ for (vector<WVertex *>::iterator wv = iVertexList.begin(), wvend = iVertexList.end();
+ wv != wvend;
+ ++wv) {
center += (*wv)->GetVertex();
}
center /= (float)iVertexList.size();
diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.h b/source/blender/freestyle/intern/winged_edge/WXEdge.h
index 63c2ef4f52b..01ce9bf2ea5 100644
--- a/source/blender/freestyle/intern/winged_edge/WXEdge.h
+++ b/source/blender/freestyle/intern/winged_edge/WXEdge.h
@@ -696,7 +696,7 @@ class WXFace : public WFace {
class WXShape : public WShape {
#if 0
-public:
+ public:
typedef WXShape type_name;
#endif
diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h
index b9397a61ea4..856148563f2 100644
--- a/source/blender/gpu/GPU_batch.h
+++ b/source/blender/gpu/GPU_batch.h
@@ -157,7 +157,6 @@ void GPU_draw_primitive(GPUPrimType, int v_count);
/* Can multiple batches share a GPUVertBuf? Use ref count? */
-
/* We often need a batch with its own data, to be created and discarded together. */
/* WithOwn variants reduce number of system allocations. */
@@ -179,7 +178,10 @@ typedef struct BatchWithOwnVertexBufferAndElementList {
GPUBatch *create_BatchWithOwnVertexBuffer(GPUPrimType, GPUVertFormat *, uint v_len, GPUIndexBuf *);
GPUBatch *create_BatchWithOwnElementList(GPUPrimType, GPUVertBuf *, uint prim_len);
-GPUBatch *create_BatchWithOwnVertexBufferAndElementList(GPUPrimType, GPUVertFormat *, uint v_len, uint prim_len);
+GPUBatch *create_BatchWithOwnVertexBufferAndElementList(GPUPrimType,
+ GPUVertFormat *,
+ uint v_len,
+ uint prim_len);
/* verts: shared, own */
/* elem: none, shared, own */
GPUBatch *create_BatchInGeneral(GPUPrimType, VertexBufferStuff, ElementListStuff);
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 458c0d5da85..242544ec07f 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -840,7 +840,8 @@ static char *code_generate_fragment(GPUMaterial *material,
BLI_dynstr_free(ds);
#if 0
- if (G.debug & G_DEBUG) printf("%s\n", code);
+ if (G.debug & G_DEBUG)
+ printf("%s\n", code);
#endif
return code;
@@ -1107,7 +1108,8 @@ static char *code_generate_vertex(ListBase *nodes, const char *vert_code, bool u
BLI_dynstr_free(ds);
#if 0
- if (G.debug & G_DEBUG) printf("%s\n", code);
+ if (G.debug & G_DEBUG)
+ printf("%s\n", code);
#endif
return code;
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index bd4572cc643..77ecac35835 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -140,7 +140,7 @@ static void gpu_print_framebuffer_error(GLenum status, char err_out[256])
format_status(INCOMPLETE_ATTACHMENT) format_status(INCOMPLETE_MISSING_ATTACHMENT)
format_status(UNSUPPORTED)
#if 0 /* for OpenGL ES only */
- format_status(INCOMPLETE_DIMENSIONS)
+ format_status(INCOMPLETE_DIMENSIONS)
#else /* for desktop GL only */
format_status(INCOMPLETE_DRAW_BUFFER) format_status(INCOMPLETE_READ_BUFFER)
format_status(INCOMPLETE_MULTISAMPLE) format_status(UNDEFINED)
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index 46e450d455e..253c8703234 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -348,7 +348,10 @@ void gpu_select_pick_begin(uint (*buffer)[4], uint bufsize, const rcti *input, c
/* set initial 'far' value */
#if 0
- glReadPixels(UNPACK4(ps->gl.clip_readpixels), GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, ps->gl.rect_depth->buf);
+ glReadPixels(UNPACK4(ps->gl.clip_readpixels),
+ GL_DEPTH_COMPONENT,
+ GL_UNSIGNED_INT,
+ ps->gl.rect_depth->buf);
#else
for (uint i = 0; i < rect_len; i++) {
ps->gl.rect_depth->buf[i] = DEPTH_MAX;
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index f20ecc3c11d..819ddfd31b0 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -483,7 +483,7 @@ static void RemoveEulerAngleFromMatrix(KDL::Rotation &R, double angle, int axis)
}
#if 0
-static void GetEulerXZY(const KDL::Rotation& R, double& X, double& Z, double& Y)
+static void GetEulerXZY(const KDL::Rotation &R, double &X, double &Z, double &Y)
{
if (fabs(R(0, 1)) > 1.0 - KDL::epsilon) {
X = -KDL::sign(R(0, 1)) * KDL::atan2(R(1, 2), R(1, 0));
@@ -497,7 +497,7 @@ static void GetEulerXZY(const KDL::Rotation& R, double& X, double& Z, double& Y)
}
}
-static void GetEulerXYZ(const KDL::Rotation& R, double& X, double& Y, double& Z)
+static void GetEulerXYZ(const KDL::Rotation &R, double &X, double &Y, double &Z)
{
if (fabs(R(0, 2)) > 1.0 - KDL::epsilon) {
X = KDL::sign(R(0, 2)) * KDL::atan2(-R(1, 0), R(1, 1));
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index 2c253f7f0e6..eaf3d58270a 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -587,7 +587,7 @@ ImBuf *IMB_dupImBuf(const ImBuf *ibuf1)
static void imbuf_cache_destructor(void *data)
{
- ImBuf *ibuf = (ImBuf *) data;
+ ImBuf *ibuf = (ImBuf *)data;
imb_freerectImBuf(ibuf);
imb_freerectfloatImBuf(ibuf);
@@ -598,7 +598,6 @@ static void imbuf_cache_destructor(void *data)
ibuf->c_handle = NULL;
}
-
static MEM_CacheLimiterC **get_imbuf_cache_limiter(void)
{
static MEM_CacheLimiterC *c = NULL;
diff --git a/source/blender/imbuf/intern/dds/BlockDXT.h b/source/blender/imbuf/intern/dds/BlockDXT.h
index c13fa42dcdc..b167fba71a2 100644
--- a/source/blender/imbuf/intern/dds/BlockDXT.h
+++ b/source/blender/imbuf/intern/dds/BlockDXT.h
@@ -138,22 +138,22 @@ struct AlphaBlockDXT5 {
struct {
uint64 alpha0 : 8; // 8
uint64 alpha1 : 8; // 16
- uint64 bits0 : 3; // 3 - 19
+ uint64 bits0 : 3; // 3 - 19
uint64 bits1 : 3; // 6 - 22
uint64 bits2 : 3; // 9 - 25
- uint64 bits3 : 3; // 12 - 28
- uint64 bits4 : 3; // 15 - 31
- uint64 bits5 : 3; // 18 - 34
- uint64 bits6 : 3; // 21 - 37
- uint64 bits7 : 3; // 24 - 40
- uint64 bits8 : 3; // 27 - 43
+ uint64 bits3 : 3; // 12 - 28
+ uint64 bits4 : 3; // 15 - 31
+ uint64 bits5 : 3; // 18 - 34
+ uint64 bits6 : 3; // 21 - 37
+ uint64 bits7 : 3; // 24 - 40
+ uint64 bits8 : 3; // 27 - 43
uint64 bits9 : 3; // 30 - 46
uint64 bitsA : 3; // 33 - 49
- uint64 bitsB : 3; // 36 - 52
- uint64 bitsC : 3; // 39 - 55
- uint64 bitsD : 3; // 42 - 58
- uint64 bitsE : 3; // 45 - 61
- uint64 bitsF : 3; // 48 - 64
+ uint64 bitsB : 3; // 36 - 52
+ uint64 bitsC : 3; // 39 - 55
+ uint64 bitsD : 3; // 42 - 58
+ uint64 bitsE : 3; // 45 - 61
+ uint64 bitsF : 3; // 48 - 64
};
uint64 u;
};
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp
index 73397cd036e..c392ef351ff 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.cpp
+++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp
@@ -32,17 +32,18 @@
#include <Common.h>
#if 0
- // Get approximate luminance.
- inline static uint colorLuminance(Color32 c)
- {
- return c.r + c.g + c.b;
- }
+// Get approximate luminance.
+inline static uint colorLuminance(Color32 c)
+{
+ return c.r + c.g + c.b;
+}
- // Get the euclidean distance between the given colors.
- inline static uint colorDistance(Color32 c0, Color32 c1)
- {
- return (c0.r - c1.r) * (c0.r - c1.r) + (c0.g - c1.g) * (c0.g - c1.g) + (c0.b - c1.b) * (c0.b - c1.b);
- }
+// Get the euclidean distance between the given colors.
+inline static uint colorDistance(Color32 c0, Color32 c1)
+{
+ return (c0.r - c1.r) * (c0.r - c1.r) + (c0.g - c1.g) * (c0.g - c1.g) +
+ (c0.b - c1.b) * (c0.b - c1.b);
+}
#endif
/// Default constructor.
@@ -173,18 +174,16 @@ bool ColorBlock::isSingleColorNoAlpha() const
{
Color32 c;
int i;
- for (i = 0; i < 16; i++)
- {
- if (m_color[i].a != 0) c = m_color[i];
+ for (i = 0; i < 16; i++) {
+ if (m_color[i].a != 0)
+ c = m_color[i];
}
Color32 mask(0xFF, 0xFF, 0xFF, 0x00);
uint u = c.u & mask.u;
- for (; i < 16; i++)
- {
- if (u != (m_color[i].u & mask.u))
- {
+ for (; i < 16; i++) {
+ if (u != (m_color[i].u & mask.u)) {
return false;
}
}
@@ -200,16 +199,15 @@ uint ColorBlock::countUniqueColors() const
uint count = 0;
// @@ This does not have to be o(n^2)
- for (int i = 0; i < 16; i++)
- {
+ for (int i = 0; i < 16; i++) {
bool unique = true;
for (int j = 0; j < i; j++) {
- if ( m_color[i] != m_color[j] ) {
+ if (m_color[i] != m_color[j]) {
unique = false;
}
}
- if ( unique ) {
+ if (unique) {
count++;
}
}
@@ -255,9 +253,9 @@ void ColorBlock::diameterRange(Color32 *start, Color32 *end) const
uint best_dist = 0;
for (int i = 0; i < 16; i++) {
- for (int j = i+1; j < 16; j++) {
+ for (int j = i + 1; j < 16; j++) {
uint dist = colorDistance(m_color[i], m_color[j]);
- if ( dist > best_dist ) {
+ if (dist > best_dist) {
best_dist = dist;
c0 = m_color[i];
c1 = m_color[j];
@@ -277,8 +275,7 @@ void ColorBlock::luminanceRange(Color32 *start, Color32 *end) const
maxLuminance = minLuminance = colorLuminance(m_color[0]);
- for (uint i = 1; i < 16; i++)
- {
+ for (uint i = 1; i < 16; i++) {
uint luminance = colorLuminance(m_color[i]);
if (luminance > maxLuminance) {
@@ -301,14 +298,25 @@ void ColorBlock::boundsRange(Color32 *start, Color32 *end) const
Color32 minColor(255, 255, 255);
Color32 maxColor(0, 0, 0);
- for (uint i = 0; i < 16; i++)
- {
- if (m_color[i].r < minColor.r) { minColor.r = m_color[i].r; }
- if (m_color[i].g < minColor.g) { minColor.g = m_color[i].g; }
- if (m_color[i].b < minColor.b) { minColor.b = m_color[i].b; }
- if (m_color[i].r > maxColor.r) { maxColor.r = m_color[i].r; }
- if (m_color[i].g > maxColor.g) { maxColor.g = m_color[i].g; }
- if (m_color[i].b > maxColor.b) { maxColor.b = m_color[i].b; }
+ for (uint i = 0; i < 16; i++) {
+ if (m_color[i].r < minColor.r) {
+ minColor.r = m_color[i].r;
+ }
+ if (m_color[i].g < minColor.g) {
+ minColor.g = m_color[i].g;
+ }
+ if (m_color[i].b < minColor.b) {
+ minColor.b = m_color[i].b;
+ }
+ if (m_color[i].r > maxColor.r) {
+ maxColor.r = m_color[i].r;
+ }
+ if (m_color[i].g > maxColor.g) {
+ maxColor.g = m_color[i].g;
+ }
+ if (m_color[i].b > maxColor.b) {
+ maxColor.b = m_color[i].b;
+ }
}
// Offset range by 1/16 of the extents
@@ -335,16 +343,31 @@ void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
Color32 minColor(255, 255, 255, 255);
Color32 maxColor(0, 0, 0, 0);
- for (uint i = 0; i < 16; i++)
- {
- if (m_color[i].r < minColor.r) { minColor.r = m_color[i].r; }
- if (m_color[i].g < minColor.g) { minColor.g = m_color[i].g; }
- if (m_color[i].b < minColor.b) { minColor.b = m_color[i].b; }
- if (m_color[i].a < minColor.a) { minColor.a = m_color[i].a; }
- if (m_color[i].r > maxColor.r) { maxColor.r = m_color[i].r; }
- if (m_color[i].g > maxColor.g) { maxColor.g = m_color[i].g; }
- if (m_color[i].b > maxColor.b) { maxColor.b = m_color[i].b; }
- if (m_color[i].a > maxColor.a) { maxColor.a = m_color[i].a; }
+ for (uint i = 0; i < 16; i++) {
+ if (m_color[i].r < minColor.r) {
+ minColor.r = m_color[i].r;
+ }
+ if (m_color[i].g < minColor.g) {
+ minColor.g = m_color[i].g;
+ }
+ if (m_color[i].b < minColor.b) {
+ minColor.b = m_color[i].b;
+ }
+ if (m_color[i].a < minColor.a) {
+ minColor.a = m_color[i].a;
+ }
+ if (m_color[i].r > maxColor.r) {
+ maxColor.r = m_color[i].r;
+ }
+ if (m_color[i].g > maxColor.g) {
+ maxColor.g = m_color[i].g;
+ }
+ if (m_color[i].b > maxColor.b) {
+ maxColor.b = m_color[i].b;
+ }
+ if (m_color[i].a > maxColor.a) {
+ maxColor.a = m_color[i].a;
+ }
}
// Offset range by 1/16 of the extents
@@ -374,19 +397,19 @@ void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
void ColorBlock::sortColorsByAbsoluteValue()
{
// Dummy selection sort.
- for ( uint a = 0; a < 16; a++ ) {
+ for (uint a = 0; a < 16; a++) {
uint max = a;
Color16 cmax(m_color[a]);
- for ( uint b = a+1; b < 16; b++ ) {
+ for (uint b = a + 1; b < 16; b++) {
Color16 cb(m_color[b]);
- if ( cb.u > cmax.u ) {
+ if (cb.u > cmax.u) {
max = b;
cmax = cb;
}
}
- swap( m_color[a], m_color[max] );
+ swap(m_color[a], m_color[max]);
}
}
#endif
@@ -402,16 +425,15 @@ void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) c
float min, max;
min = max = dot(Vector3(m_color[0].r, m_color[0].g, m_color[0].b), axis);
- for (uint i = 1; i < 16; i++)
- {
+ for (uint i = 1; i < 16; i++) {
const Vector3 vec(m_color[i].r, m_color[i].g, m_color[i].b);
float val = dot(vec, axis);
- if ( val < min ) {
+ if (val < min) {
mini = i;
min = val;
}
- else if ( val > max ) {
+ else if (val > max) {
maxi = i;
max = val;
}
@@ -424,7 +446,7 @@ void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) c
#if 0
/// Sort colors in the given axis.
-void ColorBlock::sortColors(const Vector3 & axis)
+void ColorBlock::sortColors(const Vector3 &axis)
{
float luma_array[16];
@@ -434,15 +456,15 @@ void ColorBlock::sortColors(const Vector3 & axis)
}
// Dummy selection sort.
- for ( uint a = 0; a < 16; a++ ) {
+ for (uint a = 0; a < 16; a++) {
uint min = a;
- for ( uint b = a+1; b < 16; b++ ) {
- if ( luma_array[b] < luma_array[min] ) {
+ for (uint b = a + 1; b < 16; b++) {
+ if (luma_array[b] < luma_array[min]) {
min = b;
}
}
- swap( luma_array[a], luma_array[min] );
- swap( m_color[a], m_color[min] );
+ swap(luma_array[a], luma_array[min]);
+ swap(m_color[a], m_color[min]);
}
}
#endif
diff --git a/source/blender/imbuf/intern/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h
index 07912b86f47..ba487afdfc1 100644
--- a/source/blender/imbuf/intern/dds/PixelFormat.h
+++ b/source/blender/imbuf/intern/dds/PixelFormat.h
@@ -112,17 +112,17 @@ inline float quantizeCeil(float f, int inbits, int outbits)
}
#if 0
- inline float quantizeRound(float f, int bits)
- {
- float scale = float(1 << bits);
- return fround(f * scale) / scale;
- }
-
- inline float quantizeFloor(float f, int bits)
- {
- float scale = float(1 << bits);
- return floor(f * scale) / scale;
- }
+inline float quantizeRound(float f, int bits)
+{
+ float scale = float(1 << bits);
+ return fround(f * scale) / scale;
+}
+
+inline float quantizeFloor(float f, int bits)
+{
+ float scale = float(1 << bits);
+ return floor(f * scale) / scale;
+}
#endif
} // namespace PixelFormat
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 2d7e90db34e..32b1c6b280e 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -438,7 +438,7 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
k = 0;
for (i = -n; i <= n; i++)
for (j = -n; j <= n; j++)
- weight[k++] = sqrt((float) i * i + j * j);
+ weight[k++] = sqrt((float)i * i + j * j);
#endif
weight[0] = 1;
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 6743fe536b1..a09f83e9b92 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -96,8 +96,8 @@ static void jpeg_error(j_common_ptr cinfo)
#if 0
typedef struct {
- unsigned char *buffer;
- int filled;
+ unsigned char *buffer;
+ int filled;
} buffer_struct;
#endif
@@ -572,7 +572,8 @@ static int init_jpeg(FILE *outfile, struct jpeg_compress_struct *cinfo, struct I
/* just write RGBA as RGB,
* unsupported feature only confuses other s/w */
- if (ibuf->planes == 32) cinfo->in_color_space = JCS_UNKNOWN;
+ if (ibuf->planes == 32)
+ cinfo->in_color_space = JCS_UNKNOWN;
#endif
switch (cinfo->in_color_space) {
case JCS_RGB:
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index 27cf30c71ba..bff2ac62fdf 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -389,13 +389,11 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
}
#if 0
- png_set_filter(png_ptr, 0,
- PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE |
- PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB |
- PNG_FILTER_UP | PNG_FILTER_VALUE_UP |
- PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG |
- PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH |
- PNG_ALL_FILTERS);
+ png_set_filter(png_ptr,
+ 0,
+ PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB |
+ PNG_FILTER_UP | PNG_FILTER_VALUE_UP | PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG |
+ PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH | PNG_ALL_FILTERS);
#endif
png_set_compression_level(png_ptr, compression);
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 3341272c10f..fd3409b266c 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -360,7 +360,7 @@ typedef enum ePchan_Flag {
POSE_IKTREE = (1 << 13),
#if 0
/* has Spline IK */
- POSE_HAS_IKS = (1 << 14),
+ POSE_HAS_IKS = (1 << 14),
#endif
/* spline IK solving */
POSE_IKSPLINE = (1 << 15),
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index 3c63f909efd..bdb3db94c89 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -313,8 +313,8 @@ enum {
#if 0 /* Moved to overlay options in 2.8 */
/* Curve.drawflag */
enum {
- CU_HIDE_HANDLES = 1 << 0,
- CU_HIDE_NORMALS = 1 << 1,
+ CU_HIDE_HANDLES = 1 << 0,
+ CU_HIDE_NORMALS = 1 << 1,
};
#endif
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index 1afb462aaa7..73e91996884 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -167,7 +167,7 @@ enum {
* And if not, should be a general flag. But seems unnecessary for now... */
#if 0
/** if viewport preview is ready */
- MOD_DPAINT_PREVIEW_READY = 1 << 0,
+ MOD_DPAINT_PREVIEW_READY = 1 << 0,
#endif
/** surface is already baking, so it wont get updated (loop) */
MOD_DPAINT_BAKING = 1 << 1,
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 30b21e131ed..168df3285b2 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1382,18 +1382,33 @@ static char *rna_def_property_lookup_int_func(FILE *f,
if (dp->dnalengthname || dp->dnalengthfixed) {
if (dp->dnalengthname)
- fprintf(f, "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), data->%s, index);\n",
- item_type, dp->dnaname, dp->dnaname, dp->dnalengthname);
+ fprintf(f,
+ "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), data->%s, "
+ "index);\n",
+ item_type,
+ dp->dnaname,
+ dp->dnaname,
+ dp->dnalengthname);
else
- fprintf(f, "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), %d, index);\n",
- item_type, dp->dnaname, dp->dnaname, dp->dnalengthfixed);
+ fprintf(
+ f,
+ "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), %d, index);\n",
+ item_type,
+ dp->dnaname,
+ dp->dnaname,
+ dp->dnalengthfixed);
}
else {
if (dp->dnapointerlevel == 0)
- fprintf(f, "\n return rna_listbase_lookup_int(ptr, &RNA_%s, &data->%s, index);\n",
- item_type, dp->dnaname);
+ fprintf(f,
+ "\n return rna_listbase_lookup_int(ptr, &RNA_%s, &data->%s, index);\n",
+ item_type,
+ dp->dnaname);
else
- fprintf(f, "\n return rna_listbase_lookup_int(ptr, &RNA_%s, data->%s, index);\n", item_type, dp->dnaname);
+ fprintf(f,
+ "\n return rna_listbase_lookup_int(ptr, &RNA_%s, data->%s, index);\n",
+ item_type,
+ dp->dnaname);
}
#endif
@@ -2275,13 +2290,23 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop;
if (cprop->type)
- fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)", (const char *)cprop->type, srna->identifier,
- prop->identifier, (cprop->length ? "true" : "false"),
- (cprop->lookupint ? "true" : "false"), (cprop->lookupstring ? "true" : "false"));
+ fprintf(f,
+ "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)",
+ (const char *)cprop->type,
+ srna->identifier,
+ prop->identifier,
+ (cprop->length ? "true" : "false"),
+ (cprop->lookupint ? "true" : "false"),
+ (cprop->lookupstring ? "true" : "false"));
else
- fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)", "UnknownType", srna->identifier,
- prop->identifier, (cprop->length ? "true" : "false"),
- (cprop->lookupint ? "true" : "false"), (cprop->lookupstring ? "true" : "false"));
+ fprintf(f,
+ "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)",
+ "UnknownType",
+ srna->identifier,
+ prop->identifier,
+ (cprop->length ? "true" : "false"),
+ (cprop->lookupint ? "true" : "false"),
+ (cprop->lookupstring ? "true" : "false"));
#endif
break;
}
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index f533a8017de..95c5a31db8e 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -75,12 +75,26 @@ const EnumPropertyItem rna_enum_boidrule_type_items[] = {
"Maintain speed, flight level or wander"},
{eBoidRuleType_Fight, "FIGHT", 0, "Fight", "Go to closest enemy and attack when in range"},
#if 0
- {eBoidRuleType_Protect, "PROTECT", 0, "Protect", "Go to enemy closest to target and attack when in range"},
- {eBoidRuleType_Hide, "HIDE", 0, "Hide", "Find a deflector move to it's other side from closest enemy"},
- {eBoidRuleType_FollowPath, "FOLLOW_PATH", 0, "Follow Path",
- "Move along a assigned curve or closest curve in a group"},
- {eBoidRuleType_FollowWall, "FOLLOW_WALL", 0, "Follow Wall",
- "Move next to a deflector object's in direction of it's tangent"},
+ {eBoidRuleType_Protect,
+ "PROTECT",
+ 0,
+ "Protect",
+ "Go to enemy closest to target and attack when in range"},
+ {eBoidRuleType_Hide,
+ "HIDE",
+ 0,
+ "Hide",
+ "Find a deflector move to it's other side from closest enemy"},
+ {eBoidRuleType_FollowPath,
+ "FOLLOW_PATH",
+ 0,
+ "Follow Path",
+ "Move along a assigned curve or closest curve in a group"},
+ {eBoidRuleType_FollowWall,
+ "FOLLOW_WALL",
+ 0,
+ "Follow Wall",
+ "Move next to a deflector object's in direction of it's tangent"},
#endif
{0, NULL, 0, NULL, NULL},
};
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 550f90d7e7d..e3c2f9d5233 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -420,11 +420,11 @@ const EnumPropertyItem rna_enum_event_type_mask_items[] = {
#if 0
static const EnumPropertyItem keymap_modifiers_items[] = {
- {KM_ANY, "ANY", 0, "Any", ""},
- {0, "NONE", 0, "None", ""},
- {1, "FIRST", 0, "First", ""},
- {2, "SECOND", 0, "Second", ""},
- {0, NULL, 0, NULL, NULL},
+ {KM_ANY, "ANY", 0, "Any", ""},
+ {0, "NONE", 0, "None", ""},
+ {1, "FIRST", 0, "First", ""},
+ {2, "SECOND", 0, "Second", ""},
+ {0, NULL, 0, NULL, NULL},
};
#endif
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index ce58fd172a2..6a01b01c0d9 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -55,7 +55,7 @@ static void initData(ModifierData *md)
static void copyData(const ModifierData *md, ModifierData *target, const int flag)
{
#if 0
- const ArmatureModifierData *amd = (const ArmatureModifierData *) md;
+ const ArmatureModifierData *amd = (const ArmatureModifierData *)md;
#endif
ArmatureModifierData *tamd = (ArmatureModifierData *)target;
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index f126adbaafd..6109db3651c 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -63,7 +63,7 @@ static void freeData(ModifierData *md)
static void copyData(const ModifierData *md, ModifierData *target, const int flag)
{
#if 0
- const ExplodeModifierData *emd = (const ExplodeModifierData *) md;
+ const ExplodeModifierData *emd = (const ExplodeModifierData *)md;
#endif
ExplodeModifierData *temd = (ExplodeModifierData *)target;
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index 547e5facbbe..8573ef14e09 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -69,7 +69,7 @@ static void freeData(ModifierData *md)
static void copyData(const ModifierData *md, ModifierData *target, const int flag)
{
#if 0
- const ParticleSystemModifierData *psmd = (const ParticleSystemModifierData *) md;
+ const ParticleSystemModifierData *psmd = (const ParticleSystemModifierData *)md;
#endif
ParticleSystemModifierData *tpsmd = (ParticleSystemModifierData *)target;
@@ -214,9 +214,12 @@ static void deformVerts(ModifierData *md,
/* disabled particles in editmode for now, until support for proper evaluated mesh
* updates is coded */
#if 0
-static void deformVertsEM(
- ModifierData *md, Object *ob, BMEditMesh *editData,
- Mesh *mesh, float (*vertexCos)[3], int numVerts)
+static void deformVertsEM(ModifierData *md,
+ Object *ob,
+ BMEditMesh *editData,
+ Mesh *mesh,
+ float (*vertexCos)[3],
+ int numVerts)
{
const bool do_temp_mesh = (mesh == NULL);
if (do_temp_mesh) {
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index e2917e2f82a..54db5bede8d 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -316,7 +316,6 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
cross_v3_v3v3(c1, cross2, axis_vec);
cross_v3_v3v3(c2, axis_vec, c1);
-
angle = angle_v3v3(cross1, c2);
cross_v3_v3v3(axis_tmp, cross1, c2);
@@ -324,7 +323,6 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
if (len_v3v3(axis_tmp, axis_vec) > 1.0f)
angle = -angle;
-
}
}
#endif
@@ -1081,7 +1079,6 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
ii = findEd(medge_new, maxEdges, ml_new[3].v, ml_new[0].v);
printf("%d %d\n", ii, ml_new[3].e);
ml_new[3].e = ii;
-
}
}
#endif
diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index ffef1197491..78f628199d3 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -965,9 +965,7 @@ static void connect_frames(SkinOutput *so, BMVert *frame1[4], BMVert *frame2[4])
/* simple method, works mostly */
float p[3], no[3];
sub_v3_v3v3(p, q[3][0]->co, q[0][0]->co);
- normal_quad_v3(no,
- q[0][0]->co, q[0][1]->co,
- q[0][2]->co, q[0][3]->co);
+ normal_quad_v3(no, q[0][0]->co, q[0][1]->co, q[0][2]->co, q[0][3]->co);
swap = dot_v3v3(no, p) > 0;
}
#else
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 9fb2e728dd9..0cf864fbf89 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -134,8 +134,8 @@ static void mesh_calc_hq_normal(Mesh *mesh, float (*poly_nors)[3], float (*r_ver
#if 0
add_v3_v3v3(edge_normal, face_nors[edge_ref->f1], face_nors[edge_ref->f2]);
normalize_v3_length(
- edge_normal,
- angle_normalized_v3v3(face_nors[edge_ref->f1], face_nors[edge_ref->f2]));
+ edge_normal,
+ angle_normalized_v3v3(face_nors[edge_ref->f1], face_nors[edge_ref->f2]));
#else
mid_v3_v3v3_angle_weighted(
edge_normal, poly_nors[edge_ref->p1], poly_nors[edge_ref->p2]);
@@ -455,8 +455,11 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
ml2 = mloop + mp->loopstart + mesh->totloop;
#if 0
for (j = 0; j < mp->totloop; j++) {
- CustomData_copy_data(&mesh->ldata, &result->ldata, mp->loopstart + j,
- mp->loopstart + (loop_end - j) + mesh->totloop, 1);
+ CustomData_copy_data(&mesh->ldata,
+ &result->ldata,
+ mp->loopstart + j,
+ mp->loopstart + (loop_end - j) + mesh->totloop,
+ 1);
}
#else
/* slightly more involved, keep the first vertex the same for the copy,
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index c03b1761251..0b1249e263c 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -64,7 +64,7 @@ static void initData(ModifierData *md)
static void copyData(const ModifierData *md, ModifierData *target, const int flag)
{
#if 0
- const SubsurfModifierData *smd = (const SubsurfModifierData *) md;
+ const SubsurfModifierData *smd = (const SubsurfModifierData *)md;
#endif
SubsurfModifierData *tsmd = (SubsurfModifierData *)target;
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 5a9c115dc12..2ee0b36edc9 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -75,7 +75,7 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
{
#if 0
- UVProjectModifierData *umd = (UVProjectModifierData *) md;
+ UVProjectModifierData *umd = (UVProjectModifierData *)md;
#endif
foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData);
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c
index ed2c2e5e940..f41689b741c 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -55,8 +55,7 @@ static float mix_weight(float weight, float weight2, char mix_mode)
* XXX Don't know why, but the switch version takes many CPU time,
* and produces lag in realtime playback...
*/
- switch (mix_mode)
- {
+ switch (mix_mode) {
case MOD_WVG_MIX_ADD:
return (weight + weight2);
case MOD_WVG_MIX_SUB:
diff --git a/source/blender/nodes/shader/nodes/node_shader_particle_info.c b/source/blender/nodes/shader/nodes/node_shader_particle_info.c
index 2b5c991161d..98d975b55f2 100644
--- a/source/blender/nodes/shader/nodes/node_shader_particle_info.c
+++ b/source/blender/nodes/shader/nodes/node_shader_particle_info.c
@@ -27,7 +27,7 @@ static bNodeSocketTemplate outputs[] = {
{SOCK_FLOAT, 0, "Lifetime"},
{SOCK_VECTOR, 0, "Location"},
#if 0 /* quaternion sockets not yet supported */
- { SOCK_QUATERNION, 0, "Rotation" },
+ {SOCK_QUATERNION, 0, "Rotation"},
#endif
{SOCK_FLOAT, 0, "Size"},
{SOCK_VECTOR, 0, "Velocity"},
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index fa204e8a7f9..d035a8cc7af 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -589,7 +589,8 @@ static void cloth_calc_force(
if (hairdata) {
hair_ij = &hairdata[spring->ij];
hair_kl = &hairdata[spring->kl];
- BPH_mass_spring_force_edge_wind(data, spring->ij, spring->kl, hair_ij->radius, hair_kl->radius, winvec);
+ BPH_mass_spring_force_edge_wind(
+ data, spring->ij, spring->kl, hair_ij->radius, hair_kl->radius, winvec);
}
else
BPH_mass_spring_force_edge_wind(data, spring->ij, spring->kl, 1.0f, 1.0f, winvec);
@@ -842,8 +843,10 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt)
zero_v3(b);
offset[axis] = shift * clmd->hair_grid_cellsize;
- a[(axis + 1) % 3] = clmd->hair_grid_max[(axis + 1) % 3] - clmd->hair_grid_min[(axis + 1) % 3];
- b[(axis + 2) % 3] = clmd->hair_grid_max[(axis + 2) % 3] - clmd->hair_grid_min[(axis + 2) % 3];
+ a[(axis + 1) % 3] = clmd->hair_grid_max[(axis + 1) % 3] -
+ clmd->hair_grid_min[(axis + 1) % 3];
+ b[(axis + 2) % 3] = clmd->hair_grid_max[(axis + 2) % 3] -
+ clmd->hair_grid_min[(axis + 2) % 3];
BKE_sim_debug_data_clear_category(clmd->debug_data, "grid velocity");
for (j = 0; j < size; ++j) {
@@ -856,13 +859,14 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt)
BPH_hair_volume_grid_interpolate(grid, x, &gdensity, gvel, gvel_smooth, NULL, NULL);
-// BKE_sim_debug_data_add_circle(clmd->debug_data, x, gdensity, 0.7, 0.3, 1, "grid density", i, j, 3111);
+ // BKE_sim_debug_data_add_circle(clmd->debug_data, x, gdensity, 0.7, 0.3, 1, "grid density", i, j, 3111);
if (!is_zero_v3(gvel) || !is_zero_v3(gvel_smooth)) {
float dvel[3];
sub_v3_v3v3(dvel, gvel_smooth, gvel);
-// BKE_sim_debug_data_add_vector(clmd->debug_data, x, gvel, 0.4, 0, 1, "grid velocity", i, j, 3112);
-// BKE_sim_debug_data_add_vector(clmd->debug_data, x, gvel_smooth, 0.6, 1, 1, "grid velocity", i, j, 3113);
- BKE_sim_debug_data_add_vector(clmd->debug_data, x, dvel, 0.4, 1, 0.7, "grid velocity", i, j, 3114);
+ // BKE_sim_debug_data_add_vector(clmd->debug_data, x, gvel, 0.4, 0, 1, "grid velocity", i, j, 3112);
+ // BKE_sim_debug_data_add_vector(clmd->debug_data, x, gvel_smooth, 0.6, 1, 1, "grid velocity", i, j, 3113);
+ BKE_sim_debug_data_add_vector(
+ clmd->debug_data, x, dvel, 0.4, 1, 0.7, "grid velocity", i, j, 3114);
# if 0
if (gdensity > 0.0f) {
float col0[3] = {0.0, 0.0, 0.0};
@@ -906,7 +910,8 @@ static void cloth_calc_volume_force(ClothModifierData *clmd)
/* gather velocities & density */
if (smoothfac > 0.0f || pressfac > 0.0f) {
- HairVertexGrid *vertex_grid = BPH_hair_volume_create_vertex_grid(clmd->sim_parms->voxel_res, gmin, gmax);
+ HairVertexGrid *vertex_grid = BPH_hair_volume_create_vertex_grid(
+ clmd->sim_parms->voxel_res, gmin, gmax);
vert = cloth->verts;
for (i = 0; i < mvert_num; i++, vert++) {
@@ -932,7 +937,8 @@ static void cloth_calc_volume_force(ClothModifierData *clmd)
/* calculate volumetric forces */
BPH_mass_spring_get_motion_state(data, vert->solver_index, x, v);
- BPH_hair_volume_vertex_grid_forces(vertex_grid, x, v, smoothfac, pressfac, minpress, f, dfdx, dfdv);
+ BPH_hair_volume_vertex_grid_forces(
+ vertex_grid, x, v, smoothfac, pressfac, minpress, f, dfdx, dfdv);
/* apply on hair data */
BPH_mass_spring_force_extern(data, vert->solver_index, f, dfdx, dfdv);
}
diff --git a/source/blender/physics/intern/ConstrainedConjugateGradient.h b/source/blender/physics/intern/ConstrainedConjugateGradient.h
index 0d361f98f4e..c7808c34ecf 100644
--- a/source/blender/physics/intern/ConstrainedConjugateGradient.h
+++ b/source/blender/physics/intern/ConstrainedConjugateGradient.h
@@ -112,28 +112,26 @@ EIGEN_DONT_INLINE void constrained_conjugate_gradient(const MatrixType &mat,
} // namespace internal
#if 0 /* unused */
-template<typename MatrixType>
-struct MatrixFilter
-{
- MatrixFilter() :
- m_cmat(NULL)
+template<typename MatrixType> struct MatrixFilter {
+ MatrixFilter() : m_cmat(NULL)
{
}
- MatrixFilter(const MatrixType &cmat) :
- m_cmat(&cmat)
+ MatrixFilter(const MatrixType &cmat) : m_cmat(&cmat)
{
}
- void setMatrix(const MatrixType &cmat) { m_cmat = &cmat; }
+ void setMatrix(const MatrixType &cmat)
+ {
+ m_cmat = &cmat;
+ }
- template <typename VectorType>
- void apply(VectorType v) const
+ template<typename VectorType> void apply(VectorType v) const
{
v = (*m_cmat) * v;
}
-protected:
+ protected:
const MatrixType *m_cmat;
};
#endif
diff --git a/source/blender/physics/intern/hair_volume.cpp b/source/blender/physics/intern/hair_volume.cpp
index 878f055af01..44d2aaceac5 100644
--- a/source/blender/physics/intern/hair_volume.cpp
+++ b/source/blender/physics/intern/hair_volume.cpp
@@ -389,9 +389,14 @@ void BPH_hair_volume_add_vertex(HairGrid *grid, const float x[3], const float v[
}
#if 0
-BLI_INLINE void hair_volume_eval_grid_vertex(
- HairGridVert *vert, const float loc[3], float radius, float dist_scale,
- const float x2[3], const float v2[3], const float x3[3], const float v3[3])
+BLI_INLINE void hair_volume_eval_grid_vertex(HairGridVert *vert,
+ const float loc[3],
+ float radius,
+ float dist_scale,
+ const float x2[3],
+ const float v2[3],
+ const float x3[3],
+ const float v3[3])
{
float closest[3], lambda, dist, weight;
@@ -418,14 +423,31 @@ BLI_INLINE int major_axis_v3(const float v[3])
return a > b ? (a > c ? 0 : 2) : (b > c ? 1 : 2);
}
-BLI_INLINE void hair_volume_add_segment_2D(
- HairGrid *grid,
- const float UNUSED(x1[3]), const float UNUSED(v1[3]), const float x2[3], const float v2[3],
- const float x3[3], const float v3[3], const float UNUSED(x4[3]), const float UNUSED(v4[3]),
- const float UNUSED(dir1[3]), const float dir2[3], const float UNUSED(dir3[3]),
- int resj, int resk, int jmin, int jmax, int kmin, int kmax,
- HairGridVert *vert, int stride_j, int stride_k, const float loc[3], int axis_j, int axis_k,
- int debug_i)
+BLI_INLINE void hair_volume_add_segment_2D(HairGrid *grid,
+ const float UNUSED(x1[3]),
+ const float UNUSED(v1[3]),
+ const float x2[3],
+ const float v2[3],
+ const float x3[3],
+ const float v3[3],
+ const float UNUSED(x4[3]),
+ const float UNUSED(v4[3]),
+ const float UNUSED(dir1[3]),
+ const float dir2[3],
+ const float UNUSED(dir3[3]),
+ int resj,
+ int resk,
+ int jmin,
+ int jmax,
+ int kmin,
+ int kmax,
+ HairGridVert *vert,
+ int stride_j,
+ int stride_k,
+ const float loc[3],
+ int axis_j,
+ int axis_k,
+ int debug_i)
{
const float radius = 1.5f;
const float dist_scale = grid->inv_cellsize;
@@ -439,12 +461,12 @@ BLI_INLINE void hair_volume_add_segment_2D(
CLAMP_MAX(kmax, resk - 1);
HairGridVert *vert_j = vert + jmin * stride_j;
- float loc_j[3] = { loc[0], loc[1], loc[2] };
+ float loc_j[3] = {loc[0], loc[1], loc[2]};
loc_j[axis_j] += (float)jmin;
for (j = jmin; j <= jmax; ++j, vert_j += stride_j, loc_j[axis_j] += 1.0f) {
HairGridVert *vert_k = vert_j + kmin * stride_k;
- float loc_k[3] = { loc_j[0], loc_j[1], loc_j[2] };
+ float loc_k[3] = {loc_j[0], loc_j[1], loc_j[2]};
loc_k[axis_k] += (float)kmin;
for (k = kmin; k <= kmax; ++k, vert_k += stride_k, loc_k[axis_k] += 1.0f) {
@@ -478,13 +500,20 @@ BLI_INLINE void hair_volume_add_segment_2D(
* The radius of influence around a segment is assumed to be at most 2*cellsize,
* i.e. only cells containing the segment and their direct neighbors are examined.
*/
-void BPH_hair_volume_add_segment(
- HairGrid *grid,
- const float x1[3], const float v1[3], const float x2[3], const float v2[3],
- const float x3[3], const float v3[3], const float x4[3], const float v4[3],
- const float dir1[3], const float dir2[3], const float dir3[3])
+void BPH_hair_volume_add_segment(HairGrid *grid,
+ const float x1[3],
+ const float v1[3],
+ const float x2[3],
+ const float v2[3],
+ const float x3[3],
+ const float v3[3],
+ const float x4[3],
+ const float v4[3],
+ const float dir1[3],
+ const float dir2[3],
+ const float dir3[3])
{
- const int res[3] = { grid->res[0], grid->res[1], grid->res[2] };
+ const int res[3] = {grid->res[0], grid->res[1], grid->res[2]};
/* find the primary direction from the major axis of the direction vector */
const int axis0 = major_axis_v3(dir2);
@@ -492,7 +521,7 @@ void BPH_hair_volume_add_segment(
const int axis2 = (axis0 + 2) % 3;
/* vertex buffer offset factors along cardinal axes */
- const int strides[3] = { 1, res[0], res[0] * res[1] };
+ const int strides[3] = {1, res[0], res[0] * res[1]};
const int stride0 = strides[axis0];
const int stride1 = strides[axis1];
const int stride2 = strides[axis2];
@@ -505,7 +534,7 @@ void BPH_hair_volume_add_segment(
/* start/end points, so increment along axis0 is always positive */
const float *start = x2[axis0] < x3[axis0] ? x2 : x3;
- const float *end = x2[axis0] < x3[axis0] ? x3 : x2;
+ const float *end = x2[axis0] < x3[axis0] ? x3 : x2;
const float start0 = start[axis0], start1 = start[axis1], start2 = start[axis2];
const float end0 = end[axis0];
@@ -550,11 +579,31 @@ void BPH_hair_volume_add_segment(
loc0[axis1] = 0.0f;
loc0[axis2] = 0.0f;
- hair_volume_add_segment_2D(
- grid, x1, v1, x2, v2, x3, v3, x4, v4, dir1, dir2, dir3,
- res[axis1], res[axis2], jmin - 1, jmax + 2, kmin - 1, kmax + 2,
- vert0, stride1, stride2, loc0, axis1, axis2,
- i);
+ hair_volume_add_segment_2D(grid,
+ x1,
+ v1,
+ x2,
+ v2,
+ x3,
+ v3,
+ x4,
+ v4,
+ dir1,
+ dir2,
+ dir3,
+ res[axis1],
+ res[axis2],
+ jmin - 1,
+ jmax + 2,
+ kmin - 1,
+ kmax + 2,
+ vert0,
+ stride1,
+ stride2,
+ loc0,
+ axis1,
+ axis2,
+ i);
}
}
#else
@@ -769,7 +818,8 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
interp_v3_v3v3(col, col0, coln, fac);
}
if (fac > 0.05f)
- BKE_sim_debug_data_add_circle(grid->debug_data, wloc, 0.01f, col[0], col[1], col[2], "grid", 5522, i, j, k);
+ BKE_sim_debug_data_add_circle(
+ grid->debug_data, wloc, 0.01f, col[0], col[1], col[2], "grid", 5522, i, j, k);
}
#endif
}
@@ -895,7 +945,8 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
for (j = 0; j < resA[1]; ++j) {
for (i = 0; i < resA[0]; ++i) {
int u = i * strideA0 + j * strideA1 + k * strideA2;
- bool is_margin = MARGIN_i0 || MARGIN_i1 || MARGIN_j0 || MARGIN_j1 || MARGIN_k0 || MARGIN_k1;
+ bool is_margin = MARGIN_i0 || MARGIN_i1 || MARGIN_j0 || MARGIN_j1 || MARGIN_k0 ||
+ MARGIN_k1;
if (i != slice)
continue;
@@ -923,12 +974,13 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
interp_v3_v3v3(col, col0, coln, fac);
}
if (fac > 0.05f)
- BKE_sim_debug_data_add_circle(grid->debug_data, wloc, 0.01f, col[0], col[1], col[2], "grid", 5533, i, j, k);
+ BKE_sim_debug_data_add_circle(
+ grid->debug_data, wloc, 0.01f, col[0], col[1], col[2], "grid", 5533, i, j, k);
if (!is_margin) {
float dvel[3];
sub_v3_v3v3(dvel, vert->velocity_smooth, vert->velocity);
-// BKE_sim_debug_data_add_vector(grid->debug_data, wloc, dvel, 1, 1, 1, "grid", 5566, i, j, k);
+ // BKE_sim_debug_data_add_vector(grid->debug_data, wloc, dvel, 1, 1, 1, "grid", 5566, i, j, k);
}
if (!is_margin) {
@@ -938,8 +990,8 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
float col[3];
interp_v3_v3v3(col, col0, colp, d);
-// if (d > 0.05f)
-// BKE_sim_debug_data_add_dot(grid->debug_data, wloc, col[0], col[1], col[2], "grid", 5544, i, j, k);
+ // if (d > 0.05f)
+ // BKE_sim_debug_data_add_dot(grid->debug_data, wloc, col[0], col[1], col[2], "grid", 5544, i, j, k);
}
}
}
@@ -964,7 +1016,8 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
* See https://en.wikipedia.org/wiki/Filter_%28large_eddy_simulation%29
*/
-BLI_INLINE void hair_volume_filter_box_convolute(HairVertexGrid *grid, float invD, const int kernel_size[3], int i, int j, int k)
+BLI_INLINE void hair_volume_filter_box_convolute(
+ HairVertexGrid *grid, float invD, const int kernel_size[3], int i, int j, int k)
{
int res = grid->res;
int p, q, r;
@@ -1109,7 +1162,9 @@ void BPH_hair_volume_grid_geometry(
}
#if 0
-static HairGridVert *hair_volume_create_collision_grid(ClothModifierData *clmd, lfVector *lX, unsigned int numverts)
+static HairGridVert *hair_volume_create_collision_grid(ClothModifierData *clmd,
+ lfVector *lX,
+ unsigned int numverts)
{
int res = hair_grid_res;
int size = hair_grid_size(res);
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 522927f56e2..279208993a0 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -4071,9 +4071,8 @@ int bpy_bm_generic_valid_check(BPy_BMGeneric *self)
* the previous action. */
#if 0
if (BM_mesh_validate(self->bm) == false) {
- PyErr_Format(PyExc_ReferenceError,
- "BMesh used by %.200s has become invalid",
- Py_TYPE(self)->tp_name);
+ PyErr_Format(
+ PyExc_ReferenceError, "BMesh used by %.200s has become invalid", Py_TYPE(self)->tp_name);
return -1;
}
#endif
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index d96bef797cb..056e3a33b6e 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -168,8 +168,7 @@ PyObject *BPy_IDGroup_WrapData(ID *id, IDProperty *prop, IDProperty *parent)
static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
{
switch (prop->type) {
- case IDP_STRING:
- {
+ case IDP_STRING: {
char *st;
if (!PyUnicode_Check(value)) {
PyErr_SetString(PyExc_TypeError, "expected a string!");
@@ -198,8 +197,7 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
return 0;
}
- case IDP_INT:
- {
+ case IDP_INT: {
int ivalue = PyLong_AsSsize_t(value);
if (ivalue == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected an int type");
@@ -208,8 +206,7 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
IDP_Int(prop) = ivalue;
break;
}
- case IDP_FLOAT:
- {
+ case IDP_FLOAT: {
float fvalue = (float)PyFloat_AsDouble(value);
if (fvalue == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected a float");
@@ -218,8 +215,7 @@ static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject
IDP_Float(self->prop) = fvalue;
break;
}
- case IDP_DOUBLE:
- {
+ case IDP_DOUBLE: {
double dvalue = PyFloat_AsDouble(value);
if (dvalue == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "expected a float");
diff --git a/source/blender/python/gpu/gpu_py_matrix.c b/source/blender/python/gpu/gpu_py_matrix.c
index 85d65ee4e2c..93cca78bad9 100644
--- a/source/blender/python/gpu/gpu_py_matrix.c
+++ b/source/blender/python/gpu/gpu_py_matrix.c
@@ -505,12 +505,9 @@ static struct PyMethodDef bpygpu_matrix_methods[] = {
/* TODO */
#if 0
- {"rotate", (PyCFunction)bpygpu_matrix_rotate,
- METH_O, bpygpu_matrix_rotate_doc},
- {"rotate_axis", (PyCFunction)bpygpu_matrix_rotate_axis,
- METH_O, bpygpu_matrix_rotate_axis_doc},
- {"look_at", (PyCFunction)bpygpu_matrix_look_at,
- METH_O, bpygpu_matrix_look_at_doc},
+ {"rotate", (PyCFunction)bpygpu_matrix_rotate, METH_O, bpygpu_matrix_rotate_doc},
+ {"rotate_axis", (PyCFunction)bpygpu_matrix_rotate_axis, METH_O, bpygpu_matrix_rotate_axis_doc},
+ {"look_at", (PyCFunction)bpygpu_matrix_look_at, METH_O, bpygpu_matrix_look_at_doc},
#endif
/* Write State */
diff --git a/source/blender/python/intern/bpy_capi_utils.c b/source/blender/python/intern/bpy_capi_utils.c
index db1684a7bca..2ff357896d5 100644
--- a/source/blender/python/intern/bpy_capi_utils.c
+++ b/source/blender/python/intern/bpy_capi_utils.c
@@ -136,7 +136,12 @@ bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const boo
}
#if 0 /* ARG!. workaround for a bug in blenders use of vsnprintf */
- BKE_reportf(reports, RPT_ERROR, "%s\nlocation: %s:%d\n", _PyUnicode_AsString(pystring), filename, lineno);
+ BKE_reportf(reports,
+ RPT_ERROR,
+ "%s\nlocation: %s:%d\n",
+ _PyUnicode_AsString(pystring),
+ filename,
+ lineno);
#else
pystring_format = PyUnicode_FromFormat(
TIP_("%s\nlocation: %s:%d\n"), _PyUnicode_AsString(pystring), filename, lineno);
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 1b36ded884d..774ce2b9422 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -184,7 +184,7 @@ void BPY_modules_update(bContext *C)
#if 0 /* slow, this runs all the time poll, draw etc 100's of time a sec. */
PyObject *mod = PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0);
PyModule_AddObject(mod, "data", BPY_rna_module());
- PyModule_AddObject(mod, "types", BPY_rna_types()); /* atm this does not need updating */
+ PyModule_AddObject(mod, "types", BPY_rna_types()); /* atm this does not need updating */
#endif
/* refreshes the main struct */
@@ -213,9 +213,9 @@ static PyObject *CCL_initPython(void)
static struct _inittab bpy_internal_modules[] = {
{"mathutils", PyInit_mathutils},
#if 0
- {"mathutils.geometry", PyInit_mathutils_geometry},
- {"mathutils.noise", PyInit_mathutils_noise},
- {"mathutils.kdtree", PyInit_mathutils_kdtree},
+ {"mathutils.geometry", PyInit_mathutils_geometry},
+ {"mathutils.noise", PyInit_mathutils_noise},
+ {"mathutils.kdtree", PyInit_mathutils_kdtree},
#endif
{"_bpy_path", BPyInit__bpy_path},
{"bgl", BPyInit_bgl},
@@ -223,9 +223,9 @@ static struct _inittab bpy_internal_modules[] = {
{"imbuf", BPyInit_imbuf},
{"bmesh", BPyInit_bmesh},
#if 0
- {"bmesh.types", BPyInit_bmesh_types},
- {"bmesh.utils", BPyInit_bmesh_utils},
- {"bmesh.utils", BPyInit_bmesh_geometry},
+ {"bmesh.types", BPyInit_bmesh_types},
+ {"bmesh.utils", BPyInit_bmesh_utils},
+ {"bmesh.utils", BPyInit_bmesh_geometry},
#endif
#ifdef WITH_AUDASPACE
{"aud", AUD_initPython},
@@ -841,7 +841,8 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
if (BPy_StructRNA_Check(list_item)) {
#if 0
- CollectionPointerLink *link = MEM_callocN(sizeof(CollectionPointerLink), "bpy_context_get");
+ CollectionPointerLink *link = MEM_callocN(sizeof(CollectionPointerLink),
+ "bpy_context_get");
link->ptr = ((BPy_StructRNA *)item)->ptr;
BLI_addtail(&result->list, link);
#endif
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 1e979ad1d0b..2c31fcda12d 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -298,9 +298,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
{
/* no props */
if (kw != NULL) {
- PyErr_Format(PyExc_AttributeError,
- "Operator \"%s\" does not take any args",
- opname);
+ PyErr_Format(PyExc_AttributeError, "Operator \"%s\" does not take any args", opname);
return NULL;
}
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 19315d9f2cc..a0a6c73fe1f 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -1382,7 +1382,11 @@ static size_t strswapbufcpy(char *buf, const char **orig)
char *dst = buf;
size_t i = 0;
*orig = buf;
- while ((*dst = *src)) { dst++; src++; i++; }
+ while ((*dst = *src)) {
+ dst++;
+ src++;
+ i++;
+ }
return i + 1; /* include '\0' */
}
#endif
@@ -1541,7 +1545,8 @@ static const EnumPropertyItem *enum_items_from_py(PyObject *seq_fast,
* immediately after use, so we need to duplicate them, ugh.
* annoying because it works most of the time without this. */
{
- EnumPropertyItem *items_dup = MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf),
+ EnumPropertyItem *items_dup = MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) +
+ (sizeof(char) * totbuf),
"enum_items_from_py2");
EnumPropertyItem *items_ptr = items_dup;
char *buf = ((char *)items_dup) + (sizeof(EnumPropertyItem) * (seq_len + 1));
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index cf45d6ca2d9..1f041b4ca48 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -1448,11 +1448,14 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
#if 0 /* gives python decoding errors while generating docs :( */
char error_str[256];
- BLI_snprintf(error_str, sizeof(error_str),
+ BLI_snprintf(error_str,
+ sizeof(error_str),
"RNA Warning: Current value \"%d\" "
"matches no enum in '%s', '%s', '%s'",
- val, RNA_struct_identifier(ptr->type),
- ptr_name, RNA_property_identifier(prop));
+ val,
+ RNA_struct_identifier(ptr->type),
+ ptr_name,
+ RNA_property_identifier(prop));
PyErr_Warn(PyExc_RuntimeWarning, error_str);
#endif
@@ -1464,8 +1467,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
ret = PyUnicode_FromString("");
#if 0
- PyErr_Format(PyExc_AttributeError,
- "RNA Error: Current value \"%d\" matches no enum", val);
+ PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val);
ret = NULL;
#endif
}
@@ -2807,14 +2809,18 @@ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self,
Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
/* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */
- if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL;
- if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL;
+ if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start))
+ return NULL;
+ if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop))
+ return NULL;
if (start < 0 || stop < 0) {
/* only get the length for negative values */
Py_ssize_t len = (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop);
- if (start < 0) start += len;
- if (stop < 0) stop += len;
+ if (start < 0)
+ start += len;
+ if (stop < 0)
+ stop += len;
}
if (stop - start <= 0) {
@@ -4262,9 +4268,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
}
else {
#if 0
- PyErr_Format(PyExc_AttributeError,
- "bpy_struct: attribute \"%.200s\" not found",
- name);
+ PyErr_Format(PyExc_AttributeError, "bpy_struct: attribute \"%.200s\" not found", name);
ret = NULL;
#endif
/* Include this in case this instance is a subtype of a python class
@@ -5113,14 +5117,14 @@ static int foreach_parse_args(BPy_PropertyRNA *self,
array_tot = RNA_property_array_length(&self->ptr, self->prop);
}
-
target_tot = array_tot * (*attr_tot);
/* rna_access.c - rna_raw_access(...) uses this same method */
if (target_tot != (*tot)) {
PyErr_Format(PyExc_TypeError,
"foreach_get(attr, sequence) sequence length mismatch given %d, needed %d",
- *tot, target_tot);
+ *tot,
+ target_tot);
return -1;
}
#endif
@@ -5482,11 +5486,14 @@ static struct PyMethodDef pyrna_struct_methods[] = {
/* experimental */
/* unused for now */
#if 0
- {"callback_add", (PyCFunction)pyrna_callback_add, METH_VARARGS, NULL},
- {"callback_remove", (PyCFunction)pyrna_callback_remove, METH_VARARGS, NULL},
+ {"callback_add", (PyCFunction)pyrna_callback_add, METH_VARARGS, NULL},
+ {"callback_remove", (PyCFunction)pyrna_callback_remove, METH_VARARGS, NULL},
- {"callback_add", (PyCFunction)pyrna_callback_classmethod_add, METH_VARARGS | METH_CLASS, NULL},
- {"callback_remove", (PyCFunction)pyrna_callback_classmethod_remove, METH_VARARGS | METH_CLASS, NULL},
+ {"callback_add", (PyCFunction)pyrna_callback_classmethod_add, METH_VARARGS | METH_CLASS, NULL},
+ {"callback_remove",
+ (PyCFunction)pyrna_callback_classmethod_remove,
+ METH_VARARGS | METH_CLASS,
+ NULL},
#endif
{NULL, NULL, 0, NULL},
};
@@ -5852,7 +5859,10 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
int lineno;
PyC_FileAndNum(&fn, &lineno);
printf("pyrna_func_call > %.200s.%.200s : %.200s:%d\n",
- RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), fn, lineno);
+ RNA_struct_identifier(self_ptr->type),
+ RNA_function_identifier(self_func),
+ fn,
+ lineno);
}
#endif
@@ -7090,8 +7100,8 @@ static PyObject *pyrna_srna_Subtype(StructRNA *srna)
/* always use O not N when calling, N causes refcount errors */
#if 0
- newclass = PyObject_CallFunction(metaclass, "s(O) {sss()}",
- idname, py_base, "__module__", "bpy.types", "__slots__");
+ newclass = PyObject_CallFunction(
+ metaclass, "s(O) {sss()}", idname, py_base, "__module__", "bpy.types", "__slots__");
#else
{
/* longhand of the call above */
@@ -8521,8 +8531,10 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
#if 0
if (RNA_struct_py_type_get(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));
+ "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;
}
#endif
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c
index 7097999201a..847ecde354a 100644
--- a/source/blender/python/intern/bpy_rna_array.c
+++ b/source/blender/python/intern/bpy_rna_array.c
@@ -283,8 +283,12 @@ static int validate_array_length(PyObject *rvalue,
/* BLI_snprintf(error_str, error_str_size,
* "%s.%s: array length cannot be changed to %d",
* RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); */
- PyErr_Format(PyExc_ValueError, "%s %s.%s: array length cannot be changed to %d",
- error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot);
+ PyErr_Format(PyExc_ValueError,
+ "%s %s.%s: array length cannot be changed to %d",
+ error_prefix,
+ RNA_struct_identifier(ptr->type),
+ RNA_property_identifier(prop),
+ tot);
return -1;
}
#else
@@ -883,7 +887,10 @@ PyObject *pyrna_array_index(PointerRNA *ptr, PropertyRNA *prop, int index)
#if 0
/* XXX this is not used (and never will?) */
/* Given an array property, creates an N-dimensional tuple of values. */
-static PyObject *pyrna_py_from_array_internal(PointerRNA *ptr, PropertyRNA *prop, int dim, int *index)
+static PyObject *pyrna_py_from_array_internal(PointerRNA *ptr,
+ PropertyRNA *prop,
+ int dim,
+ int *index)
{
PyObject *tuple;
int i, len;
diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c
index b24a28229aa..7d690cb7d47 100644
--- a/source/blender/python/intern/bpy_rna_callback.c
+++ b/source/blender/python/intern/bpy_rna_callback.c
@@ -135,7 +135,12 @@ PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args)
char *cb_event_str = NULL;
int cb_event;
- if (!PyArg_ParseTuple(args, "OO!|s:bpy_struct.callback_add", &cb_func, &PyTuple_Type, &cb_args, &cb_event_str)) {
+ if (!PyArg_ParseTuple(args,
+ "OO!|s:bpy_struct.callback_add",
+ &cb_func,
+ &PyTuple_Type,
+ &cb_args,
+ &cb_event_str)) {
return NULL;
}
@@ -147,9 +152,8 @@ PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args)
if (RNA_struct_is_a(self->ptr.type, &RNA_Region)) {
if (cb_event_str) {
if (pyrna_enum_value_from_id(
- region_draw_mode_items, cb_event_str,
- &cb_event, "bpy_struct.callback_add()") == -1)
- {
+ region_draw_mode_items, cb_event_str, &cb_event, "bpy_struct.callback_add()") ==
+ -1) {
return NULL;
}
}
@@ -157,7 +161,8 @@ PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args)
cb_event = REGION_DRAW_POST_PIXEL;
}
- handle = ED_region_draw_cb_activate(((ARegion *)self->ptr.data)->type, cb_region_draw, (void *)args, cb_event);
+ handle = ED_region_draw_cb_activate(
+ ((ARegion *)self->ptr.data)->type, cb_region_draw, (void *)args, cb_event);
Py_INCREF(args);
}
else {
@@ -181,7 +186,8 @@ PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args)
handle = PyCapsule_GetPointer(py_handle, rna_capsual_id);
if (handle == NULL) {
- PyErr_SetString(PyExc_ValueError, "callback_remove(handle): NULL handle given, invalid or already removed");
+ PyErr_SetString(PyExc_ValueError,
+ "callback_remove(handle): NULL handle given, invalid or already removed");
return NULL;
}
diff --git a/source/blender/render/intern/source/multires_bake.c b/source/blender/render/intern/source/multires_bake.c
index 1358b7a9438..52792718108 100644
--- a/source/blender/render/intern/source/multires_bake.c
+++ b/source/blender/render/intern/source/multires_bake.c
@@ -984,8 +984,10 @@ static unsigned short get_ao_random2(const int i)
return ao_random_table_2[i & (MAX_NUMBER_OF_AO_RAYS - 1)];
}
-static void build_permutation_table(unsigned short permutation[], unsigned short temp_permutation[],
- const int number_of_rays, const int is_first_perm_table)
+static void build_permutation_table(unsigned short permutation[],
+ unsigned short temp_permutation[],
+ const int number_of_rays,
+ const int is_first_perm_table)
{
int i, k;
@@ -1031,11 +1033,13 @@ static void create_ao_raytree(MultiresBakeRender *bkr, MAOBakeData *ao_data)
grid_data = hidm->getGridData(hidm);
hidm->getGridKey(hidm, &key);
- /* face_side = (grid_size << 1) - 1; */ /* UNUSED */
+ /* face_side = (grid_size << 1) - 1; */ /* UNUSED */
num_faces = num_grids * (grid_size - 1) * (grid_size - 1);
- raytree = ao_data->raytree = RE_rayobject_create(bkr->raytrace_structure, num_faces, bkr->octree_resolution);
- face = ao_data->rayfaces = (RayFace *)MEM_callocN(num_faces * sizeof(RayFace), "ObjectRen faces");
+ raytree = ao_data->raytree = RE_rayobject_create(
+ bkr->raytrace_structure, num_faces, bkr->octree_resolution);
+ face = ao_data->rayfaces = (RayFace *)MEM_callocN(num_faces * sizeof(RayFace),
+ "ObjectRen faces");
for (i = 0; i < num_grids; i++) {
int x, y;
@@ -1083,8 +1087,10 @@ static void *init_ao_data(MultiresBakeRender *bkr, Image *UNUSED(ima))
ao_data->permutation_table_2 = MEM_callocN(permutation_size, "multires AO baker perm2");
temp_permutation_table = MEM_callocN(permutation_size, "multires AO baker temp perm");
- build_permutation_table(ao_data->permutation_table_1, temp_permutation_table, bkr->number_of_rays, 1);
- build_permutation_table(ao_data->permutation_table_2, temp_permutation_table, bkr->number_of_rays, 0);
+ build_permutation_table(
+ ao_data->permutation_table_1, temp_permutation_table, bkr->number_of_rays, 1);
+ build_permutation_table(
+ ao_data->permutation_table_2, temp_permutation_table, bkr->number_of_rays, 0);
MEM_freeN(temp_permutation_table);
@@ -1113,17 +1119,23 @@ static void build_coordinate_frame(float axisX[3], float axisY[3], const float a
if (faX <= faY && faX <= faZ) {
const float len = sqrtf(axisZ[1] * axisZ[1] + axisZ[2] * axisZ[2]);
- axisY[0] = 0; axisY[1] = axisZ[2] / len; axisY[2] = -axisZ[1] / len;
+ axisY[0] = 0;
+ axisY[1] = axisZ[2] / len;
+ axisY[2] = -axisZ[1] / len;
cross_v3_v3v3(axisX, axisY, axisZ);
}
else if (faY <= faZ) {
const float len = sqrtf(axisZ[0] * axisZ[0] + axisZ[2] * axisZ[2]);
- axisX[0] = axisZ[2] / len; axisX[1] = 0; axisX[2] = -axisZ[0] / len;
+ axisX[0] = axisZ[2] / len;
+ axisX[1] = 0;
+ axisX[2] = -axisZ[0] / len;
cross_v3_v3v3(axisY, axisZ, axisX);
}
else {
const float len = sqrtf(axisZ[0] * axisZ[0] + axisZ[1] * axisZ[1]);
- axisX[0] = axisZ[1] / len; axisX[1] = -axisZ[0] / len; axisX[2] = 0;
+ axisX[0] = axisZ[1] / len;
+ axisX[1] = -axisZ[0] / len;
+ axisX[2] = 0;
cross_v3_v3v3(axisY, axisZ, axisX);
}
}
@@ -1143,9 +1155,17 @@ static int trace_ao_ray(MAOBakeData *ao_data, float ray_start[3], float ray_dire
return RE_rayobject_raycast(ao_data->raytree, &isect);
}
-static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, void *UNUSED(thread_data),
- void *bake_data, ImBuf *ibuf, const int tri_index, const int lvl,
- const float st[2], float UNUSED(tangmat[3][3]), const int x, const int y)
+static void apply_ao_callback(DerivedMesh *lores_dm,
+ DerivedMesh *hires_dm,
+ void *UNUSED(thread_data),
+ void *bake_data,
+ ImBuf *ibuf,
+ const int tri_index,
+ const int lvl,
+ const float st[2],
+ float UNUSED(tangmat[3][3]),
+ const int x,
+ const int y)
{
const MLoopTri *lt = lores_dm->getLoopTriArray(lores_dm) + tri_index;
MPoly *mpoly = lores_dm->getPolyArray(lores_dm) + lt->poly;
@@ -1180,9 +1200,8 @@ static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, void
CLAMP(uv[0], 0.0f, 1.0f);
CLAMP(uv[1], 0.0f, 1.0f);
- get_ccgdm_data(lores_dm, hires_dm,
- ao_data->orig_index_mp_to_orig,
- lvl, lt, uv[0], uv[1], pos, nrm);
+ get_ccgdm_data(
+ lores_dm, hires_dm, ao_data->orig_index_mp_to_orig, lvl, lt, uv[0], uv[1], pos, nrm);
/* offset ray origin by user bias along normal */
for (i = 0; i < 3; i++)
@@ -1204,11 +1223,14 @@ static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, void
/* use N-Rooks to distribute our N ray samples across
* a multi-dimensional domain (2D)
*/
- const unsigned short I = ao_data->permutation_table_1[(i + perm_offs) % ao_data->number_of_rays];
+ const unsigned short I =
+ ao_data->permutation_table_1[(i + perm_offs) % ao_data->number_of_rays];
const unsigned short J = ao_data->permutation_table_2[i];
- const float JitPh = (get_ao_random2(I + perm_offs) & (MAX_NUMBER_OF_AO_RAYS - 1)) / ((float)MAX_NUMBER_OF_AO_RAYS);
- const float JitTh = (get_ao_random1(J + perm_offs) & (MAX_NUMBER_OF_AO_RAYS - 1)) / ((float)MAX_NUMBER_OF_AO_RAYS);
+ const float JitPh = (get_ao_random2(I + perm_offs) & (MAX_NUMBER_OF_AO_RAYS - 1)) /
+ ((float)MAX_NUMBER_OF_AO_RAYS);
+ const float JitTh = (get_ao_random1(J + perm_offs) & (MAX_NUMBER_OF_AO_RAYS - 1)) /
+ ((float)MAX_NUMBER_OF_AO_RAYS);
const float SiSqPhi = (I + JitPh) / ao_data->number_of_rays;
const float Theta = (float)(2 * M_PI) * ((J + JitTh) / ao_data->number_of_rays);
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index b6aa9904747..bab806f6231 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -1108,7 +1108,6 @@ void *RE_gpu_context_get(Render *re)
#if 0
void RE_AddObject(Render *UNUSED(re), Object *UNUSED(ob))
{
-
}
#endif
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index c31f78339a8..1cc45653087 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1716,7 +1716,9 @@ int WM_operator_call_py(bContext *C,
wm->op_undo_depth--;
}
else {
- CLOG_WARN(WM_LOG_OPERATORS, "\"%s\" operator has no exec function, Python cannot call it", op->type->name);
+ CLOG_WARN(WM_LOG_OPERATORS,
+ "\"%s\" operator has no exec function, Python cannot call it",
+ op->type->name);
}
#endif
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index b264f6a570d..1b2ecf4c1ab 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -165,14 +165,22 @@ int wm_gesture_evaluate(wmGesture *gesture)
#if 0
/* debug */
- if (val == 1) printf("tweak north\n");
- if (val == 2) printf("tweak north-east\n");
- if (val == 3) printf("tweak east\n");
- if (val == 4) printf("tweak south-east\n");
- if (val == 5) printf("tweak south\n");
- if (val == 6) printf("tweak south-west\n");
- if (val == 7) printf("tweak west\n");
- if (val == 8) printf("tweak north-west\n");
+ if (val == 1)
+ printf("tweak north\n");
+ if (val == 2)
+ printf("tweak north-east\n");
+ if (val == 3)
+ printf("tweak east\n");
+ if (val == 4)
+ printf("tweak south-east\n");
+ if (val == 5)
+ printf("tweak south\n");
+ if (val == 6)
+ printf("tweak south-west\n");
+ if (val == 7)
+ printf("tweak west\n");
+ if (val == 8)
+ printf("tweak north-west\n");
#endif
return val;
}
diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c b/source/blender/windowmanager/intern/wm_gesture_ops.c
index 254ced02b26..00f9f078f91 100644
--- a/source/blender/windowmanager/intern/wm_gesture_ops.c
+++ b/source/blender/windowmanager/intern/wm_gesture_ops.c
@@ -449,7 +449,6 @@ void WM_OT_circle_gesture(wmOperatorType *ot)
/* properties */
WM_operator_properties_gesture_circle(ot);
-
}
#endif
@@ -726,8 +725,7 @@ const int (*WM_gesture_lasso_path_to_array(bContext *UNUSED(C),
static int gesture_lasso_exec(bContext *C, wmOperator *op)
{
- RNA_BEGIN (op->ptr, itemptr, "path")
- {
+ RNA_BEGIN (op->ptr, itemptr, "path") {
float loc[2];
RNA_float_get_array(&itemptr, "loc", loc);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 41cebec7e90..701aae20cd3 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -362,16 +362,15 @@ static const char *wm_context_member_from_ptr(bContext *C, const PointerRNA *ptr
for (link = lb.first; link; link = link->next) {
const char *identifier = link->data;
- PointerRNA ctx_item_ptr = {{0}}; // CTX_data_pointer_get(C, identifier); // XXX, this isnt working
+ PointerRNA ctx_item_ptr = {
+ {0}}; // CTX_data_pointer_get(C, identifier); // XXX, this isnt working
if (ctx_item_ptr.type == NULL) {
continue;
}
if (ptr->id.data == ctx_item_ptr.id.data) {
- if ((ptr->data == ctx_item_ptr.data) &&
- (ptr->type == ctx_item_ptr.type))
- {
+ if ((ptr->data == ctx_item_ptr.data) && (ptr->type == ctx_item_ptr.type)) {
/* found! */
member_found = identifier;
break;
@@ -801,7 +800,20 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg)
BLI_assert(search_menu->use_previews ||
(search_menu->prv_cols == 0 && search_menu->prv_rows == 0));
#if 0 /* ok, this isn't so easy... */
- uiDefBut(block, UI_BTYPE_LABEL, 0, RNA_struct_ui_name(op->type->srna), 10, 10, UI_searchbox_size_x(), UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block,
+ UI_BTYPE_LABEL,
+ 0,
+ RNA_struct_ui_name(op->type->srna),
+ 10,
+ 10,
+ UI_searchbox_size_x(),
+ UI_UNIT_Y,
+ NULL,
+ 0.0,
+ 0.0,
+ 0,
+ 0,
+ "");
#endif
but = uiDefSearchButO_ptr(block,
op->type,
@@ -3722,7 +3734,10 @@ const EnumPropertyItem *RNA_action_itemf(bContext *C,
C, ptr, r_free, C ? (ID *)CTX_data_main(C)->actions.first : NULL, false, NULL, NULL);
}
#if 0 /* UNUSED */
-const EnumPropertyItem *RNA_action_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
+const EnumPropertyItem *RNA_action_local_itemf(bContext *C,
+ PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop),
+ bool *r_free)
{
return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->action.first : NULL, true);
}