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>2012-04-29 19:47:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-29 19:47:02 +0400
commite701f9b67010279db02ceb51f7d08078cb34170a (patch)
tree22134b33527f2d3a1b05f4265422bf5d98420bbc /source
parent038c12895f50a97607dd372cb0780c55eb38fe22 (diff)
style cleanup: whitespace / commas
Diffstat (limited to 'source')
-rw-r--r--source/blender/avi/intern/avi.c16
-rw-r--r--source/blender/avi/intern/avirgb.c4
-rw-r--r--source/blender/avi/intern/codecs.c4
-rw-r--r--source/blender/avi/intern/endian.c4
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c2
-rw-r--r--source/blender/blenkernel/BKE_cloth.h8
-rw-r--r--source/blender/blenkernel/BKE_font.h2
-rw-r--r--source/blender/blenkernel/BKE_library.h2
-rw-r--r--source/blender/blenkernel/BKE_mesh.h2
-rw-r--r--source/blender/blenkernel/BKE_node.h2
-rw-r--r--source/blender/blenkernel/BKE_ocean.h4
-rw-r--r--source/blender/blenkernel/BKE_softbody.h6
-rw-r--r--source/blender/blenkernel/depsgraph_private.h8
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c24
-rw-r--r--source/blender/blenkernel/intern/anim.c12
-rw-r--r--source/blender/blenkernel/intern/armature.c18
-rw-r--r--source/blender/blenkernel/intern/blender.c2
-rw-r--r--source/blender/blenkernel/intern/boids.c24
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c20
-rw-r--r--source/blender/blenkernel/intern/camera.c2
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c62
-rw-r--r--source/blender/blenkernel/intern/cloth.c26
-rw-r--r--source/blender/blenkernel/intern/collision.c38
-rw-r--r--source/blender/blenkernel/intern/colortools.c6
-rw-r--r--source/blender/blenkernel/intern/constraint.c20
-rw-r--r--source/blender/blenkernel/intern/curve.c82
-rw-r--r--source/blender/blenkernel/intern/customdata.c12
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c196
-rw-r--r--source/blender/blenkernel/intern/displist.c8
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c54
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c12
-rw-r--r--source/blender/blenkernel/intern/effect.c14
-rw-r--r--source/blender/blenkernel/intern/fcurve.c10
-rw-r--r--source/blender/blenkernel/intern/font.c20
-rw-r--r--source/blender/blenkernel/intern/idcode.c2
-rw-r--r--source/blender/blenkernel/intern/image.c50
-rw-r--r--source/blender/blenkernel/intern/implicit.c116
-rw-r--r--source/blender/blenkernel/intern/lattice.c20
-rw-r--r--source/blender/blenkernel/intern/library.c2
-rw-r--r--source/blender/blenkernel/intern/material.c94
-rw-r--r--source/blender/blenkernel/intern/mball.c54
-rw-r--r--source/blender/blenkernel/intern/modifier.c2
-rw-r--r--source/blender/blenkernel/intern/movieclip.c2
-rw-r--r--source/blender/blenkernel/intern/multires.c12
-rw-r--r--source/blender/blenkernel/intern/navmesh_conversion.c6
-rw-r--r--source/blender/blenkernel/intern/node.c4
-rw-r--r--source/blender/blenkernel/intern/object.c40
-rw-r--r--source/blender/blenkernel/intern/ocean.c114
-rw-r--r--source/blender/blenkernel/intern/packedFile.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c326
-rw-r--r--source/blender/blenkernel/intern/particle_system.c196
-rw-r--r--source/blender/blenkernel/intern/pointcache.c10
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c136
-rw-r--r--source/blender/blenkernel/intern/smoke.c2
-rw-r--r--source/blender/blenkernel/intern/softbody.c1154
-rw-r--r--source/blender/blenkernel/intern/texture.c4
-rw-r--r--source/blender/blenkernel/intern/unit.c2
-rw-r--r--source/blender/blenkernel/intern/writeframeserver.c2
-rw-r--r--source/blender/blenlib/BLI_fileops_types.h2
-rw-r--r--source/blender/blenlib/BLI_math_geom.h8
-rw-r--r--source/blender/blenlib/BLI_math_vector.h2
-rw-r--r--source/blender/blenlib/BLI_path_util.h2
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c24
-rw-r--r--source/blender/blenlib/intern/BLI_kdtree.c24
-rw-r--r--source/blender/blenlib/intern/fileops.c10
-rw-r--r--source/blender/blenlib/intern/freetypefont.c10
-rw-r--r--source/blender/blenlib/intern/jitter.c6
-rw-r--r--source/blender/blenlib/intern/listbase.c2
-rw-r--r--source/blender/blenlib/intern/math_matrix.c4
-rw-r--r--source/blender/blenlib/intern/path_util.c16
-rw-r--r--source/blender/blenlib/intern/storage.c40
-rw-r--r--source/blender/blenlib/intern/string.c4
-rw-r--r--source/blender/blenlib/intern/string_utf8.c32
-rw-r--r--source/blender/blenlib/intern/winstuff.c42
-rw-r--r--source/blender/blenloader/intern/readfile.c32
-rw-r--r--source/blender/blenloader/intern/writefile.c8
-rw-r--r--source/blender/blenpluginapi/iff.h10
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c2
-rw-r--r--source/blender/collada/AnimationExporter.cpp38
-rw-r--r--source/blender/collada/AnimationExporter.h10
-rw-r--r--source/blender/collada/AnimationImporter.cpp76
-rw-r--r--source/blender/collada/AnimationImporter.h40
-rw-r--r--source/blender/collada/ArmatureExporter.cpp2
-rw-r--r--source/blender/collada/ArmatureImporter.cpp26
-rw-r--r--source/blender/collada/ArmatureImporter.h2
-rw-r--r--source/blender/collada/CameraExporter.cpp14
-rw-r--r--source/blender/collada/DocumentImporter.cpp4
-rw-r--r--source/blender/collada/EffectExporter.cpp32
-rw-r--r--source/blender/collada/LightExporter.cpp14
-rw-r--r--source/blender/collada/TransformWriter.cpp4
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c2
-rw-r--r--source/blender/editors/animation/anim_markers.c2
-rw-r--r--source/blender/editors/armature/editarmature.c20
-rw-r--r--source/blender/editors/armature/meshlaplacian.c18
-rw-r--r--source/blender/editors/armature/poseobject.c18
-rw-r--r--source/blender/editors/armature/reeb.c14
-rw-r--r--source/blender/editors/curve/editcurve.c52
-rw-r--r--source/blender/editors/physics/particle_edit.c212
-rw-r--r--source/blender/editors/physics/particle_object.c34
-rw-r--r--source/blender/editors/physics/physics_fluid.c30
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/editors/screen/area.c28
-rw-r--r--source/blender/editors/screen/glutil.c47
-rw-r--r--source/blender/editors/screen/screen_ops.c4
-rw-r--r--source/blender/editors/space_file/file_draw.c14
-rw-r--r--source/blender/editors/space_file/file_intern.h2
-rw-r--r--source/blender/editors/space_file/file_ops.c10
-rw-r--r--source/blender/editors/space_file/file_panels.c2
-rw-r--r--source/blender/editors/space_file/filelist.c14
-rw-r--r--source/blender/editors/space_file/fsmenu.c6
-rw-r--r--source/blender/editors/space_file/space_file.c12
-rw-r--r--source/blender/editors/space_logic/logic_ops.c2
-rw-r--r--source/blender/editors/space_logic/logic_window.c176
-rw-r--r--source/blender/editors/space_nla/nla_channels.c2
-rw-r--r--source/blender/editors/space_node/drawnode.c8
-rw-r--r--source/blender/editors/space_node/node_draw.c16
-rw-r--r--source/blender/editors/space_node/node_select.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c32
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c8
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c12
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c18
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h2
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c2
-rw-r--r--source/blender/editors/transform/transform.c138
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_constraints.c4
-rw-r--r--source/blender/editors/transform/transform_conversions.c98
-rw-r--r--source/blender/editors/transform/transform_manipulator.c6
-rw-r--r--source/blender/editors/transform/transform_ops.c2
-rw-r--r--source/blender/editors/transform/transform_orientations.c4
-rw-r--r--source/blender/editors/transform/transform_snap.c18
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c38
-rw-r--r--source/blender/gpu/intern/gpu_material.c2
-rw-r--r--source/blender/ikplugin/intern/iksolver_plugin.c6
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp52
-rw-r--r--source/blender/imbuf/intern/anim_movie.c14
-rw-r--r--source/blender/imbuf/intern/bmp.c60
-rw-r--r--source/blender/imbuf/intern/filter.c44
-rw-r--r--source/blender/imbuf/intern/imageprocess.c16
-rw-r--r--source/blender/imbuf/intern/indexer_dv.c4
-rw-r--r--source/blender/imbuf/intern/iris.c64
-rw-r--r--source/blender/imbuf/intern/jp2.c26
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp2
-rw-r--r--source/blender/imbuf/intern/readimage.c2
-rw-r--r--source/blender/imbuf/intern/rectop.c8
-rw-r--r--source/blender/imbuf/intern/scaling.c90
-rw-r--r--source/blender/imbuf/intern/targa.c64
-rw-r--r--source/blender/imbuf/intern/thumbs.c14
-rw-r--r--source/blender/imbuf/intern/util.c8
-rw-r--r--source/blender/makesdna/DNA_listBase.h2
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h2
-rw-r--r--source/blender/makesdna/DNA_node_types.h4
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim.h12
-rw-r--r--source/blender/makesdna/DNA_object_force.h2
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h2
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h6
-rw-r--r--source/blender/makesdna/intern/makesdna.c14
-rw-r--r--source/blender/makesrna/intern/makesrna.c4
-rw-r--r--source/blender/makesrna/intern/rna_action.c8
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c2
-rw-r--r--source/blender/makesrna/intern/rna_boid.c2
-rw-r--r--source/blender/makesrna/intern/rna_brush.c6
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c4
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c2
-rw-r--r--source/blender/makesrna/intern/rna_image.c18
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c6
-rw-r--r--source/blender/makesrna/intern/rna_main.c2
-rw-r--r--source/blender/makesrna/intern/rna_material.c6
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c4
-rw-r--r--source/blender/makesrna/intern/rna_movieclip.c6
-rw-r--r--source/blender/makesrna/intern/rna_object.c6
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c4
-rw-r--r--source/blender/makesrna/intern/rna_particle.c2
-rw-r--r--source/blender/makesrna/intern/rna_pose.c28
-rw-r--r--source/blender/makesrna/intern/rna_property.c6
-rw-r--r--source/blender/makesrna/intern/rna_scene.c8
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c6
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/makesrna/intern/rna_texture.c8
-rw-r--r--source/blender/makesrna/intern/rna_texture_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c10
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.c12
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c72
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.c8
-rw-r--r--source/blender/modifiers/intern/MOD_particleinstance.c16
-rw-r--r--source/blender/modifiers/intern/MOD_util.c2
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c4
-rw-r--r--source/blender/nodes/composite/node_composite_util.c16
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_bilateralblur.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_channelMatte.c20
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_chromaMatte.c18
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorMatte.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorSpill.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorbalance.c8
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_diffMatte.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_directionalblur.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_distanceMatte.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c30
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_filter.c10
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_gamma.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_glare.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_hueSatVal.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_levels.c26
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_lummaMatte.c10
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_texture.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_tonemap.c2
-rw-r--r--source/blender/nodes/intern/node_socket.c14
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_texture.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_bricks.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_mixRgb.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_texture.c6
-rw-r--r--source/blender/quicktime/apple/quicktime_export.c36
-rw-r--r--source/blender/quicktime/apple/quicktime_import.c4
-rw-r--r--source/blender/render/intern/include/render_types.h4
-rw-r--r--source/blender/render/intern/include/sunsky.h2
-rw-r--r--source/blender/render/intern/raytrace/bvh.h40
-rw-r--r--source/blender/render/intern/raytrace/rayobject_blibvh.cpp4
-rw-r--r--source/blender/render/intern/raytrace/rayobject_octree.cpp108
-rw-r--r--source/blender/render/intern/raytrace/rayobject_qbvh.cpp18
-rw-r--r--source/blender/render/intern/raytrace/rayobject_rtbuild.cpp22
-rw-r--r--source/blender/render/intern/raytrace/rayobject_svbvh.cpp22
-rw-r--r--source/blender/render/intern/raytrace/rayobject_vbvh.cpp20
-rw-r--r--source/blender/render/intern/raytrace/reorganize.h8
-rw-r--r--source/blender/render/intern/source/convertblender.c176
-rw-r--r--source/blender/render/intern/source/envmap.c6
-rw-r--r--source/blender/render/intern/source/imagetexture.c8
-rw-r--r--source/blender/render/intern/source/occlusion.c4
-rw-r--r--source/blender/render/intern/source/pipeline.c14
-rw-r--r--source/blender/render/intern/source/pointdensity.c2
-rw-r--r--source/blender/render/intern/source/rayshade.c10
-rw-r--r--source/blender/render/intern/source/render_texture.c32
-rw-r--r--source/blender/render/intern/source/rendercore.c4
-rw-r--r--source/blender/render/intern/source/renderdatabase.c48
-rw-r--r--source/blender/render/intern/source/shadbuf.c20
-rw-r--r--source/blender/render/intern/source/sss.c2
-rw-r--r--source/blender/render/intern/source/strand.c2
-rw-r--r--source/blender/render/intern/source/sunsky.c14
-rw-r--r--source/blender/render/intern/source/volume_precache.c18
-rw-r--r--source/blender/render/intern/source/volumetric.c10
-rw-r--r--source/blender/render/intern/source/voxeldata.c8
-rw-r--r--source/blender/render/intern/source/zbuf.c74
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp4
-rw-r--r--source/gameengine/VideoTexture/ImageRender.cpp4
249 files changed, 3267 insertions, 3268 deletions
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 637d4be30fd..ea83afb16fb 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -638,7 +638,7 @@ AviError AVI_open_movie (const char *name, AviMovie *movie)
return AVI_ERROR_FORMAT;
}
- movie->entries = (AviIndexEntry *) MEM_mallocN (movie->index_entries * sizeof(AviIndexEntry),"movieentries");
+ movie->entries = (AviIndexEntry *) MEM_mallocN (movie->index_entries * sizeof(AviIndexEntry), "movieentries");
for (temp=0; temp < movie->index_entries; temp++) {
movie->entries[temp].ChunkId = GET_FCC (movie->fp);
@@ -701,7 +701,7 @@ void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream)
fseek (movie->fp, movie->read_offset + movie->entries[i-1].Offset, SEEK_SET);
temp = GET_FCC(movie->fp);
- buffer = MEM_mallocN (temp,"readbuffer");
+ buffer = MEM_mallocN (temp, "readbuffer");
if (fread (buffer, 1, temp, movie->fp) != temp) {
MEM_freeN(buffer);
@@ -755,14 +755,14 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
if (movie->fp == NULL)
return AVI_ERROR_OPEN;
- movie->offset_table = (int64_t *) MEM_mallocN ((1+streams*2) * sizeof (int64_t),"offsettable");
+ movie->offset_table = (int64_t *) MEM_mallocN ((1+streams*2) * sizeof (int64_t), "offsettable");
for (i=0; i < 1 + streams*2; i++)
movie->offset_table[i] = -1L;
movie->entries = NULL;
- movie->header = (AviMainHeader *) MEM_mallocN (sizeof(AviMainHeader),"movieheader");
+ movie->header = (AviMainHeader *) MEM_mallocN (sizeof(AviMainHeader), "movieheader");
movie->header->fcc = FCC("avih");
movie->header->size = 56;
@@ -781,7 +781,7 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
movie->header->Reserved[2] = 0;
movie->header->Reserved[3] = 0;
- movie->streams = (AviStreamRec *) MEM_mallocN (sizeof(AviStreamRec) * movie->header->Streams,"moviestreams");
+ movie->streams = (AviStreamRec *) MEM_mallocN (sizeof(AviStreamRec) * movie->header->Streams, "moviestreams");
va_start (ap, streams);
@@ -818,7 +818,7 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
#if 0
if (movie->streams[i].format == AVI_FORMAT_MJPEG) {
movie->streams[i].sf = MEM_mallocN (sizeof(AviBitmapInfoHeader)
- + sizeof(AviMJPEGUnknown),"moviestreamformatL");
+ + sizeof(AviMJPEGUnknown), "moviestreamformatL");
movie->streams[i].sf_size = sizeof(AviBitmapInfoHeader) + sizeof(AviMJPEGUnknown);
}
else {
@@ -952,7 +952,7 @@ AviError AVI_write_frame (AviMovie *movie, int frame_num, ...)
if (frame_num+1 > movie->index_entries) {
temp = (AviIndexEntry *) MEM_mallocN ((frame_num+1) *
- (movie->header->Streams+1) * sizeof(AviIndexEntry),"newidxentry");
+ (movie->header->Streams+1) * sizeof(AviIndexEntry), "newidxentry");
if (movie->entries != NULL) {
memcpy (temp, movie->entries, movie->index_entries * (movie->header->Streams+1)
* sizeof(AviIndexEntry));
@@ -1062,7 +1062,7 @@ AviError AVI_close_compress (AviMovie *movie)
fseek (movie->fp, movie->movi_offset, SEEK_SET);
- PUT_FCCN((movi_size-(movie->movi_offset+4L)),movie->fp);
+ PUT_FCCN((movi_size-(movie->movi_offset+4L)), movie->fp);
fclose (movie->fp);
diff --git a/source/blender/avi/intern/avirgb.c b/source/blender/avi/intern/avirgb.c
index 8e5806c09cf..e06d0bbfa11 100644
--- a/source/blender/avi/intern/avirgb.c
+++ b/source/blender/avi/intern/avirgb.c
@@ -45,7 +45,7 @@
void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size)
{
- int x, y,i, rowstride;
+ int x, y, i, rowstride;
unsigned char *buf;
AviBitmapInfoHeader *bi;
short bits= 32;
@@ -127,7 +127,7 @@ void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buff
*size= movie->header->Height * movie->header->Width * 3;
if (movie->header->Width%2) *size+= movie->header->Height;
- buf = MEM_mallocN (*size,"toavirgbbuf");
+ buf = MEM_mallocN (*size, "toavirgbbuf");
rowstride = movie->header->Width*3;
if (movie->header->Width%2) rowstride++;
diff --git a/source/blender/avi/intern/codecs.c b/source/blender/avi/intern/codecs.c
index 2c244177655..222900b6637 100644
--- a/source/blender/avi/intern/codecs.c
+++ b/source/blender/avi/intern/codecs.c
@@ -90,9 +90,9 @@ int avi_get_data_id (AviFormat format, int stream)
char fcc[5];
if (avi_get_format_type (format) == FCC("vids"))
- sprintf (fcc,"%2.2ddc",stream);
+ sprintf (fcc, "%2.2ddc", stream);
else if (avi_get_format_type (format) == FCC("auds"))
- sprintf (fcc,"%2.2ddc",stream);
+ sprintf (fcc, "%2.2ddc", stream);
else
return 0;
diff --git a/source/blender/avi/intern/endian.c b/source/blender/avi/intern/endian.c
index adcc7e8750a..eb9e586cfb0 100644
--- a/source/blender/avi/intern/endian.c
+++ b/source/blender/avi/intern/endian.c
@@ -49,7 +49,7 @@
#ifdef __BIG_ENDIAN__
static void invert (int *num)
{
- int new=0,i,j;
+ int new=0, i, j;
for (j=0; j < 4; j++) {
for (i=0; i<8; i++) {
@@ -63,7 +63,7 @@ static void invert (int *num)
static void sinvert (short int *num)
{
short int new=0;
- int i,j;
+ int i, j;
for (j=0; j < 2; j++) {
for (i=0; i<8; i++) {
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 033efbfc1fc..9309cf15667 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -341,7 +341,7 @@ static void blf_texture5_draw(const float shadow_col[4], float uv[2][2], float x
static void blf_texture3_draw(const float shadow_col[4], float uv[2][2], float x1, float y1, float x2, float y2)
{
float soft[9] = {1/16.0f, 2/16.0f, 1/16.0f,
- 2/16.0f,4/16.0f, 2/16.0f,
+ 2/16.0f, 4/16.0f, 2/16.0f,
1/16.0f, 2/16.0f, 1/16.0f};
float color[4], *fp = soft;
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index 623dbd9c7ac..378cc72beb1 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -169,10 +169,10 @@ typedef enum
/* Spring types as defined in the paper.*/
typedef enum
{
- CLOTH_SPRING_TYPE_STRUCTURAL = ( 1 << 1 ),
- CLOTH_SPRING_TYPE_SHEAR = ( 1 << 2 ) ,
- CLOTH_SPRING_TYPE_BENDING = ( 1 << 3 ),
- CLOTH_SPRING_TYPE_GOAL = ( 1 << 4 ),
+ CLOTH_SPRING_TYPE_STRUCTURAL = (1 << 1),
+ CLOTH_SPRING_TYPE_SHEAR = (1 << 2),
+ CLOTH_SPRING_TYPE_BENDING = (1 << 3),
+ CLOTH_SPRING_TYPE_GOAL = (1 << 4)
} CLOTH_SPRING_TYPES;
/* SPRING FLAGS */
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h
index e94787cfd3c..16e98f25e0c 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -49,7 +49,7 @@ struct Main;
struct chartrans {
float xof, yof;
float rot;
- short linenr,charnr;
+ short linenr, charnr;
char dobreak;
};
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index b18d25094dc..be21996428a 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -85,7 +85,7 @@ struct ID *find_id(const char *type, const char *name);
void clear_id_newpoins(void);
void IDnames_to_pupstring(const char **str, const char *title, const char *extraops,
- struct ListBase *lb,struct ID* link, short *nr);
+ struct ListBase *lb, struct ID* link, short *nr);
void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops,
struct ListBase *lb, struct ID *link, short *nr);
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 742e6ef0b89..14cb5d19ddf 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -146,7 +146,7 @@ void copy_dverts(struct MDeformVert *dst, struct MDeformVert *src, int totvert);
void mesh_delete_material_index(struct Mesh *me, short index);
void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth);
void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh);
-void mesh_calc_normals_tessface(struct MVert *mverts, int numVerts,struct MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
+void mesh_calc_normals_tessface(struct MVert *mverts, int numVerts, struct MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
/* used for unit testing; compares two meshes, checking only
* differences we care about. should be usable with leaf's
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index cb161b26ee5..a4eddd0b590 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -123,7 +123,7 @@ typedef struct bNodeTemplate {
* implementing the node behavior.
*/
typedef struct bNodeType {
- void *next,*prev;
+ void *next, *prev;
short needs_free; /* set for allocated types that need to be freed */
int type;
diff --git a/source/blender/blenkernel/BKE_ocean.h b/source/blender/blenkernel/BKE_ocean.h
index 7c0d99b35ea..5f7f7740a9f 100644
--- a/source/blender/blenkernel/BKE_ocean.h
+++ b/source/blender/blenkernel/BKE_ocean.h
@@ -79,8 +79,8 @@ struct Ocean *BKE_add_ocean(void);
void BKE_free_ocean_data(struct Ocean *oc);
void BKE_free_ocean(struct Ocean *oc);
-void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, float l, float A, float w, float damp,
- float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed);
+void BKE_init_ocean(struct Ocean* o, int M, int N, float Lx, float Lz, float V, float l, float A, float w, float damp,
+ float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed);
void BKE_simulate_ocean(struct Ocean *o, float t, float scale, float chop_amount);
/* sampling the ocean surface */
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h
index 6714225f513..547fd9e4393 100644
--- a/source/blender/blenkernel/BKE_softbody.h
+++ b/source/blender/blenkernel/BKE_softbody.h
@@ -39,9 +39,9 @@ typedef struct BodyPoint {
float origS[3], origE[3], origT[3], pos[3], vec[3], force[3];
float goal;
float prevpos[3], prevvec[3], prevdx[3], prevdv[3]; /* used for Heun integration */
- float impdv[3],impdx[3];
+ float impdv[3], impdx[3];
int nofsprings; int *springs;
- float choke,choke2,frozen;
+ float choke, choke2, frozen;
float colball;
short loc_flag; //reserved by locale module specific states
//char octantflag;
@@ -68,7 +68,7 @@ extern void sbObjectToSoftbody(struct Object *ob);
/* pass NULL to unlink again */
extern void sbSetInterruptCallBack(int (*f)(void));
-extern void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3]);
+extern void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3]);
#endif
diff --git a/source/blender/blenkernel/depsgraph_private.h b/source/blender/blenkernel/depsgraph_private.h
index f27ee2f1a41..c5e2f0900f0 100644
--- a/source/blender/blenkernel/depsgraph_private.h
+++ b/source/blender/blenkernel/depsgraph_private.h
@@ -117,10 +117,10 @@ DagNode * get_top_node_queue(DagNodeQueue *queue);
DagForest *getMainDag(void);
void setMainDag(DagForest *dag);
DagForest * dag_init(void);
-DagNode * dag_find_node (DagForest *forest,void * fob);
-DagNode * dag_add_node (DagForest *forest,void * fob);
-DagNode * dag_get_node (DagForest *forest,void * fob);
-DagNode * dag_get_sub_node (DagForest *forest,void * fob);
+DagNode * dag_find_node (DagForest *forest, void * fob);
+DagNode * dag_add_node (DagForest *forest, void * fob);
+DagNode * dag_get_node (DagForest *forest, void * fob);
+DagNode * dag_get_sub_node (DagForest *forest, void * fob);
void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, const char *name);
void graph_bfs(void);
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 0fd030be39c..4406ca62e26 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -322,7 +322,7 @@ int DM_release(DerivedMesh *dm)
{
if (dm->needsFree) {
bvhcache_free(&dm->bvhCache);
- GPU_drawobject_free( dm );
+ GPU_drawobject_free(dm);
CustomData_free(&dm->vertData, dm->numVertData);
CustomData_free(&dm->edgeData, dm->numEdgeData);
CustomData_free(&dm->faceData, dm->numTessFaceData);
@@ -2536,11 +2536,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
if (mf->v4) {
v4= &mvert[mf->v4];
- normal_quad_v3( fno,v4->co, v3->co, v2->co, v1->co);
+ normal_quad_v3(fno, v4->co, v3->co, v2->co, v1->co);
}
else {
v4= NULL;
- normal_tri_v3( fno,v3->co, v2->co, v1->co);
+ normal_tri_v3(fno, v3->co, v2->co, v1->co);
}
if (mtface) {
@@ -2551,11 +2551,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
}
else {
uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
- map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
- map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
- map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
+ map_to_sphere( &uv[0][0], &uv[0][1], orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
+ map_to_sphere( &uv[1][0], &uv[1][1], orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
+ map_to_sphere( &uv[2][0], &uv[2][1], orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
if (v4)
- map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
+ map_to_sphere( &uv[3][0], &uv[3][1], orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
}
tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, fno, tang);
@@ -2578,11 +2578,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
len= (mf->v4)? 4 : 3;
if (mtface == NULL) {
- map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
- map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
- map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
+ map_to_sphere( &uv[0][0], &uv[0][1], orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
+ map_to_sphere( &uv[1][0], &uv[1][1], orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
+ map_to_sphere( &uv[2][0], &uv[2][1], orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
if (len==4)
- map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
+ map_to_sphere( &uv[3][0], &uv[3][1], orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
}
mf_vi[0]= mf->v1;
@@ -3117,7 +3117,7 @@ static void dm_debug_info_layers(DynStr *dynstr, DerivedMesh *dm, void *(*getEle
CustomData_file_write_info(type, &structname, &structnum);
BLI_dynstr_appendf(dynstr,
" dict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d, length=%d),\n",
- name, structname, type, (void *)pt, size, (int)(MEM_allocN_len(pt) / size));
+ name, structname, type, (void *)pt, size, (int)(MEM_allocN_len(pt) / size));
}
}
}
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 38c73ba72b9..7afcd828573 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -863,9 +863,9 @@ static void vertex_dupli__mapFunc(void *userData, int index, const float co[3],
vec[0]= -no_s[0]; vec[1]= -no_s[1]; vec[2]= -no_s[2];
}
- vec_to_quat( q2,vec, vdd->ob->trackflag, vdd->ob->upflag);
+ vec_to_quat(q2, vec, vdd->ob->trackflag, vdd->ob->upflag);
- quat_to_mat3( mat,q2);
+ quat_to_mat3(mat, q2);
copy_m4_m4(tmat, obmat);
mul_m4_m4m3(obmat, tmat, mat);
}
@@ -1142,8 +1142,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
copy_v3_v3(obmat[3], cent);
/* rotation */
- tri_to_quat( quat,v1, v2, v3);
- quat_to_mat3( mat,quat);
+ tri_to_quat(quat, v1, v2, v3);
+ quat_to_mat3(mat, quat);
/* scale */
if (par->transflag & OB_DUPLIFACES_SCALE) {
@@ -1329,7 +1329,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
else
a = totpart;
- for (pa=psys->particles,counter=0; a<totpart+totchild; a++,pa++,counter++) {
+ for (pa=psys->particles, counter=0; a<totpart+totchild; a++, pa++, counter++) {
if (a<totpart) {
/* handle parent particle */
if (pa->flag & no_draw_flag)
@@ -1505,7 +1505,7 @@ static Object *find_family_object(Object **obar, char *family, char ch)
ob= G.main->object.first;
while (ob) {
- if ( ob->id.name[flen+2]==ch ) {
+ if (ob->id.name[flen + 2] == ch) {
if ( strncmp(ob->id.name+2, family, flen)==0 ) break;
}
ob= ob->id.next;
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 0827cb5cb14..48ba9caf947 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -471,7 +471,7 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
next = pchan->child;
/* find the handle points, since this is inside bone space, the
- * first point = (0,0,0)
+ * first point = (0, 0, 0)
* last point = (0, length, 0) */
if (rest) {
invert_m4_m4(imat, pchan->bone->arm_mat);
@@ -1028,13 +1028,13 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
if (armature_weight != 1.0f) {
copy_v3_v3(dco, co);
- mul_v3m3_dq( dco, (defMats) ? summat : NULL,dq);
+ mul_v3m3_dq(dco, (defMats) ? summat : NULL, dq);
sub_v3_v3(dco, co);
mul_v3_fl(dco, armature_weight);
add_v3_v3(co, dco);
}
else
- mul_v3m3_dq( co, (defMats) ? summat : NULL,dq);
+ mul_v3m3_dq(co, (defMats) ? summat : NULL, dq);
smat = summat;
}
@@ -1366,12 +1366,12 @@ void BKE_rotMode_change_values (float quat[4], float eul[3], float axis[3], floa
if (newMode > 0) { /* to euler */
if (oldMode == ROT_MODE_AXISANGLE) {
/* axis-angle to euler */
- axis_angle_to_eulO( eul, newMode,axis, *angle);
+ axis_angle_to_eulO( eul, newMode, axis, *angle);
}
else if (oldMode == ROT_MODE_QUAT) {
/* quat to euler */
normalize_qt(quat);
- quat_to_eulO(eul, newMode,quat);
+ quat_to_eulO(eul, newMode, quat);
}
/* else { no conversion needed } */
}
@@ -1464,7 +1464,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3])
* was 0.000001, causes bug [#30438] (which is same as [#27675, imho).
* Reseting it to org value seems to cause no more [#23954]...
*/
- if (dot_v3v3(axis,axis) > 1.0e-13f) {
+ if (dot_v3v3(axis, axis) > 1.0e-13f) {
/* if nor is *not* a multiple of target ... */
normalize_v3(axis);
@@ -1478,7 +1478,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3])
float updown;
/* point same direction, or opposite? */
- updown = (dot_v3v3(target,nor) > 0) ? 1.0f : -1.0f;
+ updown = (dot_v3v3(target, nor) > 0) ? 1.0f : -1.0f;
/* I think this should work... */
bMatrix[0][0] = updown; bMatrix[0][1] = 0.0; bMatrix[0][2] = 0.0;
@@ -2309,8 +2309,8 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
/* make a copy of starting conditions */
copy_v3_v3(loc, pchan->pose_mat[3]);
- mat4_to_eul( eul,pchan->pose_mat);
- mat4_to_size( size,pchan->pose_mat);
+ mat4_to_eul(eul, pchan->pose_mat);
+ mat4_to_size(size, pchan->pose_mat);
copy_v3_v3(eulo, eul);
copy_v3_v3(sizeo, size);
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 9c9b207970c..471f09a338e 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -722,7 +722,7 @@ void BKE_undo_save_quit(void)
BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend");
- file = BLI_open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
+ file = BLI_open(str, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666);
if (file == -1) {
//XXX error("Unable to save %s, check you have permissions", str);
return;
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index fbcabccd2b9..014b3f5e40b 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -230,8 +230,8 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
/* avoid head-on collision */
if (dot_v3v3(col.pce.nor, pa->prev_state.ave) < -0.99f) {
- /* don't know why, but uneven range [0.0,1.0] */
- /* works much better than even [-1.0,1.0] */
+ /* don't know why, but uneven range [0.0, 1.0] */
+ /* works much better than even [-1.0, 1.0] */
bbd->wanted_co[0] = BLI_frand();
bbd->wanted_co[1] = BLI_frand();
bbd->wanted_co[2] = BLI_frand();
@@ -262,7 +262,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
sub_v3_v3v3(vec, vel1, vel2);
- inp = dot_v3v3(vec,vec);
+ inp = dot_v3v3(vec, vec);
/* velocities not parallel */
if (inp != 0.0f) {
@@ -308,7 +308,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
sub_v3_v3v3(vec, vel1, vel2);
- inp = dot_v3v3(vec,vec);
+ inp = dot_v3v3(vec, vec);
/* velocities not parallel */
if (inp != 0.0f) {
@@ -583,7 +583,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
copy_v3_v3(bbd->wanted_co, pa->prev_state.ave);
/* may happen at birth */
- if (dot_v2v2(bbd->wanted_co,bbd->wanted_co)==0.0f) {
+ if (dot_v2v2(bbd->wanted_co, bbd->wanted_co)==0.0f) {
bbd->wanted_co[0] = 2.0f*(0.5f - BLI_frand());
bbd->wanted_co[1] = 2.0f*(0.5f - BLI_frand());
bbd->wanted_co[2] = 2.0f*(0.5f - BLI_frand());
@@ -610,7 +610,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
ParticleData *enemy_pa = NULL;
BoidParticle *bpa;
/* friends & enemies */
- float closest_enemy[3] = {0.0f,0.0f,0.0f};
+ float closest_enemy[3] = {0.0f, 0.0f, 0.0f};
float closest_dist = fbr->distance + 1.0f;
float f_strength = 0.0f, e_strength = 0.0f;
float health = 0.0f;
@@ -748,7 +748,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float grou
SurfaceModifierData *surmd = NULL;
float x[3], v[3];
- surmd = (SurfaceModifierData *)modifiers_findByType ( bpa->ground, eModifierType_Surface );
+ surmd = (SurfaceModifierData *)modifiers_findByType(bpa->ground, eModifierType_Surface );
/* take surface velocity into account */
closest_point_on_surface(surmd, pa->state.co, x, NULL, v);
@@ -1096,7 +1096,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
set_boid_values(&val, boids, pa);
/* make sure there's something in new velocity, location & rotation */
- copy_particle_key(&pa->state,&pa->prev_state,0);
+ copy_particle_key(&pa->state, &pa->prev_state, 0);
if (bbd->part->flag & PART_SIZEMASS)
pa_mass*=pa->size;
@@ -1170,13 +1170,13 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
angle = MIN2(angle, val.max_ave);
cross_v3_v3v3(nor, old_dir, wanted_dir);
- axis_angle_to_quat( q,nor, angle);
+ axis_angle_to_quat(q, nor, angle);
copy_v3_v3(new_dir, old_dir);
mul_qt_v3(q, new_dir);
normalize_v3(new_dir);
/* save direction in case resulting velocity too small */
- axis_angle_to_quat( q,nor, angle*dtime);
+ axis_angle_to_quat(q, nor, angle*dtime);
copy_v3_v3(pa->state.ave, old_dir);
mul_qt_v3(q, pa->state.ave);
normalize_v3(pa->state.ave);
@@ -1196,7 +1196,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* maintain minimum flying velocity if not landing */
if (level >= landing_level) {
- float len2 = dot_v2v2(new_vel,new_vel);
+ float len2 = dot_v2v2(new_vel, new_vel);
float root;
len2 = MAX2(len2, val.min_speed*val.min_speed);
@@ -1427,7 +1427,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
cross_v3_v3v3(mat[1], mat[2], mat[0]);
/* apply rotation */
- mat3_to_quat_is_ok( q,mat);
+ mat3_to_quat_is_ok(q, mat);
copy_qt_qt(pa->state.rot, q);
}
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index df80ce6e87c..d66dcd8ae7e 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -383,7 +383,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float co[3
nearest->index = index;
nearest->dist = dist;
copy_v3_v3(nearest->co, nearest_tmp);
- normal_tri_v3( nearest->no,t0, t1, t2);
+ normal_tri_v3(nearest->no, t0, t1, t2);
}
t1 = t2;
@@ -402,10 +402,10 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
MFace *face = data->face + index;
float *t0, *t1, *t2, *t3;
- t0 = vert[ face->v1 ].co;
- t1 = vert[ face->v2 ].co;
- t2 = vert[ face->v3 ].co;
- t3 = face->v4 ? vert[ face->v4].co : NULL;
+ t0 = vert[face->v1].co;
+ t1 = vert[face->v2].co;
+ t2 = vert[face->v3].co;
+ t3 = face->v4 ? vert[face->v4].co : NULL;
do
@@ -421,7 +421,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
hit->dist = dist;
madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist);
- normal_tri_v3( hit->no,t0, t1, t2);
+ normal_tri_v3(hit->no, t0, t1, t2);
}
t1 = t2;
@@ -706,7 +706,7 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
if (!data->cached)
BLI_bvhtree_free(data->tree);
- memset( data, 0, sizeof(*data) );
+ memset(data, 0, sizeof(*data));
}
}
@@ -743,11 +743,11 @@ void bvhcache_insert(BVHCache *cache, BVHTree *tree, int type)
{
BVHCacheItem *item = NULL;
- assert( tree != NULL );
- assert( bvhcache_find(cache, type) == NULL );
+ assert(tree != NULL);
+ assert(bvhcache_find(cache, type) == NULL);
item = MEM_mallocN(sizeof(BVHCacheItem), "BVHCacheItem");
- assert( item != NULL );
+ assert(item != NULL);
item->type = type;
item->tree = tree;
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 12801228950..2be22e0e28b 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -472,7 +472,7 @@ int camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object *cam
float shift[2];
float plane_tx[4][3];
float rot_obmat[3][3];
- const float zero[3]= {0,0,0};
+ const float zero[3]= {0, 0, 0};
CameraViewFrameData data_cb;
unsigned int i;
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 4de7df098c3..2a6dbf84e56 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -322,9 +322,9 @@ static void cdDM_drawVerts(DerivedMesh *dm)
GPU_vertex_setup(dm);
if ( !GPU_buffer_legacy(dm) ) {
if (dm->drawObject->tot_triangle_point)
- glDrawArrays(GL_POINTS,0, dm->drawObject->tot_triangle_point);
+ glDrawArrays(GL_POINTS, 0, dm->drawObject->tot_triangle_point);
else
- glDrawArrays(GL_POINTS,0, dm->drawObject->tot_loose_point);
+ glDrawArrays(GL_POINTS, 0, dm->drawObject->tot_loose_point);
}
GPU_buffer_unbind();
}
@@ -380,7 +380,7 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
}
if ( prevdraw != draw ) {
if ( prevdraw > 0 && (curpos-prevstart) > 0) {
- glDrawArrays(GL_LINES,prevstart,curpos-prevstart);
+ glDrawArrays(GL_LINES, prevstart, curpos-prevstart);
}
prevstart = curpos;
}
@@ -393,7 +393,7 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
prevdraw = draw;
}
if ( prevdraw > 0 && (curpos-prevstart) > 0 ) {
- glDrawArrays(GL_LINES,prevstart,curpos-prevstart);
+ glDrawArrays(GL_LINES, prevstart, curpos-prevstart);
}
}
GPU_buffer_unbind();
@@ -558,10 +558,10 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
/* TODO make this better (cache facenormals as layer?) */
float nor[3];
if (mface->v4) {
- normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
+ normal_quad_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
}
else {
- normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
+ normal_tri_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
}
glNormal3fv(nor);
}
@@ -651,10 +651,10 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
else {
float nor[3];
if (mf->v4) {
- normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
+ normal_quad_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
}
else {
- normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
+ normal_tri_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
}
glNormal3fv(nor);
}
@@ -721,7 +721,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
colors[i*12+j*3+2] = col[i*4+j].r;
}
}
- GPU_color3_upload(dm,colors);
+ GPU_color3_upload(dm, colors);
MEM_freeN(colors);
if (realcol)
dm->drawObject->colType = CD_TEXTURE_MCOL;
@@ -856,10 +856,10 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
else {
float nor[3];
if (mf->v4) {
- normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
+ normal_quad_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
}
else {
- normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
+ normal_tri_v3(nor, mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
}
glNormal3fv(nor);
}
@@ -1088,10 +1088,10 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
/* TODO ideally a normal layer should always be available */
float nor[3];
if (mface->v4) {
- normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
+ normal_quad_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
}
else {
- normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
+ normal_tri_v3(nor, mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
}
glNormal3fv(nor);
}
@@ -1140,10 +1140,10 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
GPU_buffer_unlock(buffer);
- GPU_interleaved_attrib_setup(buffer,datatypes,numdata);
+ GPU_interleaved_attrib_setup(buffer, datatypes, numdata);
}
- glDrawArrays(GL_TRIANGLES,start*3,numfaces*3);
+ glDrawArrays(GL_TRIANGLES, start*3, numfaces*3);
if ( numdata != 0 ) {
@@ -1213,17 +1213,17 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
if (dodraw && numdata != 0 ) {
offset = 0;
if (attribs.totorco) {
- copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]);
- copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]);
- copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]);
+ copy_v3_v3((float *)&varray[elementsize*curface*3], (float *)attribs.orco.array[mface->v1]);
+ copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize], (float *)attribs.orco.array[mface->v2]);
+ copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2], (float *)attribs.orco.array[mface->v3]);
offset += sizeof(float)*3;
}
for (b = 0; b < attribs.tottface; b++) {
MTFace *tf = &attribs.tface[b].array[a];
- copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[0]);
- copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]);
+ copy_v2_v2((float *)&varray[elementsize*curface*3+offset], tf->uv[0]);
+ copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize], tf->uv[1]);
- copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]);
+ copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2], tf->uv[2]);
offset += sizeof(float)*2;
}
for (b = 0; b < attribs.totmcol; b++) {
@@ -1255,16 +1255,16 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
if (dodraw && numdata != 0 ) {
offset = 0;
if (attribs.totorco) {
- copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]);
- copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]);
- copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]);
+ copy_v3_v3((float *)&varray[elementsize*curface*3], (float *)attribs.orco.array[mface->v3]);
+ copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize], (float *)attribs.orco.array[mface->v4]);
+ copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2], (float *)attribs.orco.array[mface->v1]);
offset += sizeof(float)*3;
}
for (b = 0; b < attribs.tottface; b++) {
MTFace *tf = &attribs.tface[b].array[a];
- copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[2]);
- copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]);
- copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]);
+ copy_v2_v2((float *)&varray[elementsize*curface*3+offset], tf->uv[2]);
+ copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize], tf->uv[3]);
+ copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2], tf->uv[0]);
offset += sizeof(float)*2;
}
for (b = 0; b < attribs.totmcol; b++) {
@@ -1300,9 +1300,9 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
if ( dodraw ) {
if ( numdata != 0 ) {
GPU_buffer_unlock(buffer);
- GPU_interleaved_attrib_setup(buffer,datatypes,numdata);
+ GPU_interleaved_attrib_setup(buffer, datatypes, numdata);
}
- glDrawArrays(GL_TRIANGLES,start*3,(curface-start)*3);
+ glDrawArrays(GL_TRIANGLES, start*3, (curface-start)*3);
}
}
GPU_buffer_unbind();
@@ -1374,9 +1374,9 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
float nor[3];
if (mf->v4)
- normal_quad_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, mvert[mf->v4].co);
+ normal_quad_v3(nor, mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, mvert[mf->v4].co);
else
- normal_tri_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co);
+ normal_tri_v3(nor, mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co);
glNormal3fv(nor);
}
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 97baaad430b..d262dffd517 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -66,11 +66,11 @@ static struct timeval _tstart, _tend;
static struct timezone tz;
void tstart ( void )
{
- gettimeofday ( &_tstart, &tz );
+ gettimeofday(&_tstart, &tz);
}
-void tend ( void )
+void tend (void)
{
- gettimeofday ( &_tend,&tz );
+ gettimeofday(&_tend, &tz);
}
double tval(void)
{
@@ -746,7 +746,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
// ABS ( clmd->sim_parms->maxgoal - clmd->sim_parms->mingoal );
*/
- verts->goal = ( float ) pow ( verts->goal , 4.0f );
+ verts->goal = powf(verts->goal, 4.0f);
if ( verts->goal >=SOFTGOALSNAP ) {
verts->flags |= CLOTH_VERT_FLAG_PINNED;
}
@@ -781,7 +781,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
MVert *mvert = NULL;
ClothVertex *verts = NULL;
float (*shapekey_rest)[3]= NULL;
- float tnull[3] = {0,0,0};
+ float tnull[3] = {0, 0, 0};
Cloth *cloth = NULL;
float maxdist = 0;
@@ -984,7 +984,7 @@ static void cloth_free_errorsprings(Cloth *cloth, EdgeHash *UNUSED(edgehash), Li
if (edgelist) {
for ( i = 0; i < cloth->numverts; i++ ) {
- BLI_linklist_free ( edgelist[i],NULL );
+ BLI_linklist_free ( edgelist[i], NULL );
}
MEM_freeN ( edgelist );
@@ -1141,7 +1141,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
spring->type = CLOTH_SPRING_TYPE_BENDING;
spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0f;
- BLI_edgehash_insert ( edgehash, spring->ij, spring->kl, NULL );
+ BLI_edgehash_insert(edgehash, spring->ij, spring->kl, NULL);
bend_springs++;
BLI_linklist_prepend ( &cloth->springs, spring );
@@ -1190,14 +1190,14 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
/* insert other near springs in edgehash AFTER bending springs are calculated (for selfcolls) */
for (i = 0; i < numedges; i++) { /* struct springs */
- BLI_edgehash_insert ( edgehash, MIN2(medge[i].v1, medge[i].v2), MAX2(medge[i].v2, medge[i].v1), NULL );
+ BLI_edgehash_insert(edgehash, MIN2(medge[i].v1, medge[i].v2), MAX2(medge[i].v2, medge[i].v1), NULL);
}
for (i = 0; i < numfaces; i++) { /* edge springs */
if (mface[i].v4) {
- BLI_edgehash_insert ( edgehash, MIN2(mface[i].v1, mface[i].v3), MAX2(mface[i].v3, mface[i].v1), NULL );
+ BLI_edgehash_insert(edgehash, MIN2(mface[i].v1, mface[i].v3), MAX2(mface[i].v3, mface[i].v1), NULL);
- BLI_edgehash_insert ( edgehash, MIN2(mface[i].v2, mface[i].v4), MAX2(mface[i].v2, mface[i].v4), NULL );
+ BLI_edgehash_insert(edgehash, MIN2(mface[i].v2, mface[i].v4), MAX2(mface[i].v2, mface[i].v4), NULL);
}
}
@@ -1206,7 +1206,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
if ( edgelist ) {
for ( i = 0; i < numverts; i++ ) {
- BLI_linklist_free ( edgelist[i],NULL );
+ BLI_linklist_free ( edgelist[i], NULL );
}
MEM_freeN ( edgelist );
@@ -1214,8 +1214,8 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
cloth->edgehash = edgehash;
- if (G.rt>0)
- printf("avg_len: %f\n",clmd->sim_parms->avg_spring_len);
+ if (G.rt > 0)
+ printf("avg_len: %f\n", clmd->sim_parms->avg_spring_len);
return 1;
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 264a251c317..530fa1d5431 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -168,7 +168,7 @@ Collision modifier code end
* copied from SOLVE_CUBIC.C --> GSL
*/
-#define mySWAP(a,b) do { double tmp = b ; b = a ; a = tmp ; } while (0)
+#define mySWAP(a, b) do { double tmp = b ; b = a ; a = tmp ; } while (0)
#if 0 /* UNUSED */
static int
gsl_poly_solve_cubic (double a, double b, double c,
@@ -445,7 +445,7 @@ static int cloth_get_collision_time ( double a[3], double b[3], double c[3], dou
static void collision_compute_barycentric ( float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3 )
{
double tempV1[3], tempV2[3], tempV4[3];
- double a,b,c,d,e,f;
+ double a, b, c, d, e, f;
VECSUB ( tempV1, p1, p3 );
VECSUB ( tempV2, p2, p3 );
@@ -546,7 +546,7 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( dot_v3v3( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf( dot_v3v3( vrel_t_pre, vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO ) {
@@ -573,7 +573,7 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
cloth1->verts[collpair->ap3].impulse_count++;
// Apply repulse impulse if distance too short
- // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+ // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance;
@@ -861,7 +861,7 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO ) {
@@ -880,7 +880,7 @@ static int cloth_edge_collision_response_moving ( ClothModifierData *clmd, Colli
VECADDMUL ( pimpulse, collpair->normal, impulse);
// Apply repulse impulse if distance too short
- // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+ // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
d = collpair->distance;
@@ -957,7 +957,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO ) {
@@ -976,7 +976,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
cloth1->verts[collpair->collp].impulse_count++;
// Apply repulse impulse if distance too short
- // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+ // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
d = -collpair->distance;
@@ -1021,7 +1021,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO ) {
@@ -1039,7 +1039,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
VECADDMUL ( pimpulse, collpair->normal, impulse);
// Apply repulse impulse if distance too short
- // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+ // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale;
d = -collpair->distance;
@@ -1461,7 +1461,7 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2,
#ifdef USE_BULLET
// calc distance + normal
distance = plNearestPoints (
- verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa,collpair->pb,collpair->vector );
+ verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa, collpair->pb, collpair->vector );
#else
// just be sure that we don't add anything
distance = 2.0 * (double)( epsilon1 + epsilon2 + ALMOST_ZERO );
@@ -1573,7 +1573,7 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel,sqrt ( dot_v3v3 ( vrel_t_pre,vrel_t_pre ) ) );
+ magtangent = MIN2 ( clmd->coll_parms->friction * 0.01 * magrelVel, sqrt ( dot_v3v3 ( vrel_t_pre, vrel_t_pre ) ) );
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
@@ -1601,7 +1601,7 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
cloth1->verts[collpair->ap3].impulse_count++;
// Apply repulse impulse if distance too short
- // I_r = -min(dt*kd, m(0,1d/dt - v_n))
+ // I_r = -min(dt*kd, m(0, 1d/dt - v_n))
/*
d = clmd->coll_parms->epsilon*8.0/9.0 + epsilon2*8.0/9.0 - collpair->distance;
if ( ( magrelVel < 0.1*d*clmd->sim_parms->stepsPerFrame ) && ( d > ALMOST_ZERO ) )
@@ -1635,7 +1635,7 @@ static float projectPointOntoLine(float *p, float *a, float *b)
return dot_v3v3(pa, ba) / dot_v3v3(ba, ba);
}
-static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,float *out_normal)
+static void calculateEENormal(float *np1, float *np2, float *np3, float *np4, float *out_normal)
{
float line1[3], line2[3];
float length;
@@ -1987,7 +1987,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
// printf("sol %d: %lf\n", k, solution[k]);
if ( ( solution[k] >= ALMOST_ZERO ) && ( solution[k] <= 1.0 ) && ( solution[k] > ALMOST_ZERO))
{
- float a,b;
+ float a, b;
float out_normal[3];
float distance;
float impulse = 0;
@@ -2260,11 +2260,11 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair *collisions, CollPair *collisions_index)
{
Cloth *cloth = clmd->clothObject;
- int i=0, j = 0, /*numfaces = 0,*/ numverts = 0;
+ int i=0, j = 0, /*numfaces = 0, */ numverts = 0;
ClothVertex *verts = NULL;
int ret = 0;
int result = 0;
- float tnull[3] = {0,0,0};
+ float tnull[3] = {0, 0, 0};
/*numfaces = clmd->clothObject->numfaces;*/ /*UNUSED*/
numverts = clmd->clothObject->numverts;
@@ -2343,8 +2343,8 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
ret2 = 0;
- collisions = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair");
- collisions_index = MEM_callocN(sizeof(CollPair *) *numcollobj , "CollPair");
+ collisions = MEM_callocN(sizeof(CollPair *) *numcollobj, "CollPair");
+ collisions_index = MEM_callocN(sizeof(CollPair *) *numcollobj, "CollPair");
// check all collision objects
for (i = 0; i < numcollobj; i++) {
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 6dc1b2a4b00..2955e20c9e2 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -318,8 +318,8 @@ void curvemap_sethandle(CurveMap *cuma, int type)
/* reduced copy of garbled calchandleNurb() code in curve.c */
static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *next, int UNUSED(mode))
{
- float *p1,*p2,*p3,pt[3];
- float len,len_a, len_b;
+ float *p1, *p2, *p3, pt[3];
+ float len, len_a, len_b;
float dvec_a[2], dvec_b[2];
if (bezt->h1==0 && bezt->h2==0) {
@@ -1014,7 +1014,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
}
}
else {
- rgb_to_ycc(rgb[0],rgb[1],rgb[2],&ycc[0],&ycc[1],&ycc[2], ycc_mode);
+ rgb_to_ycc(rgb[0], rgb[1], rgb[2], &ycc[0], &ycc[1], &ycc[2], ycc_mode);
for (c=0; c<3; c++) {
ycc[c] *=INV_255;
if (ycc[c] < scopes->minmax[c][0]) scopes->minmax[c][0] = ycc[c];
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 82a908eaf57..04c10de9c55 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -1333,7 +1333,7 @@ static void followpath_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
if ((data->followflag & FOLLOWPATH_RADIUS)==0) { /* XXX - assume that scale correction means that radius will have some scale error in it - Campbell */
float obsize[3];
- mat4_to_size( obsize,cob->matrix);
+ mat4_to_size(obsize, cob->matrix);
if (obsize[0])
mul_v3_fl(cob->matrix[0], size[0] / obsize[0]);
if (obsize[1])
@@ -1475,8 +1475,8 @@ static void sizelimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
bSizeLimitConstraint *data = con->data;
float obsize[3], size[3];
- mat4_to_size( size,cob->matrix);
- mat4_to_size( obsize,cob->matrix);
+ mat4_to_size(size, cob->matrix);
+ mat4_to_size(obsize, cob->matrix);
if (data->flag & LIMIT_XMIN) {
if (size[0] < data->xmin)
@@ -2308,7 +2308,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
bConstraintTarget *ct= targets->first;
if (VALID_CONS_TARGET(ct)) {
- float vec[3],vec2[3];
+ float vec[3], vec2[3];
float totmat[3][3];
float tmpmat[3][3];
float invmat[3][3];
@@ -2542,9 +2542,9 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
copy_m4_m4(tmat, cob->matrix);
- mdet = determinant_m3( totmat[0][0],totmat[0][1],totmat[0][2],
- totmat[1][0],totmat[1][1],totmat[1][2],
- totmat[2][0],totmat[2][1],totmat[2][2]);
+ mdet = determinant_m3(totmat[0][0], totmat[0][1], totmat[0][2],
+ totmat[1][0], totmat[1][1], totmat[1][2],
+ totmat[2][0], totmat[2][1], totmat[2][2]);
if (mdet==0) {
unit_m3(totmat);
}
@@ -3311,7 +3311,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
/* obtain target effect */
switch (data->from) {
case 2: /* scale */
- mat4_to_size( dvec,ct->matrix);
+ mat4_to_size(dvec, ct->matrix);
break;
case 1: /* rotation (convert to degrees first) */
mat4_to_eulO(dvec, cob->rotOrder, ct->matrix);
@@ -3602,8 +3602,8 @@ static void damptrack_flush_tars (bConstraint *con, ListBase *list, short nocopy
/* array of direction vectors for the tracking flags */
static const float track_dir_vecs[6][3] = {
- {+1,0,0}, {0,+1,0}, {0,0,+1}, /* TRACK_X, TRACK_Y, TRACK_Z */
- {-1,0,0}, {0,-1,0}, {0,0,-1} /* TRACK_NX, TRACK_NY, TRACK_NZ */
+ {+1, 0, 0}, {0, +1, 0}, {0, 0, +1}, /* TRACK_X, TRACK_Y, TRACK_Z */
+ {-1, 0, 0}, {0, -1, 0}, {0, 0, -1} /* TRACK_NX, TRACK_NY, TRACK_NZ */
};
static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets)
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index e0cadac586b..1349a19a8e4 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -480,19 +480,19 @@ Nurb *BKE_nurb_duplicate(Nurb *nu)
Nurb *newnu;
int len;
- newnu= (Nurb*)MEM_mallocN(sizeof(Nurb),"duplicateNurb");
+ newnu= (Nurb*)MEM_mallocN(sizeof(Nurb), "duplicateNurb");
if (newnu==NULL) return NULL;
memcpy(newnu, nu, sizeof(Nurb));
if (nu->bezt) {
newnu->bezt=
- (BezTriple*)MEM_mallocN((nu->pntsu)* sizeof(BezTriple),"duplicateNurb2");
+ (BezTriple*)MEM_mallocN((nu->pntsu)* sizeof(BezTriple), "duplicateNurb2");
memcpy(newnu->bezt, nu->bezt, nu->pntsu*sizeof(BezTriple));
}
else {
len= nu->pntsu*nu->pntsv;
newnu->bp=
- (BPoint*)MEM_mallocN((len)* sizeof(BPoint),"duplicateNurb3");
+ (BPoint*)MEM_mallocN((len)* sizeof(BPoint), "duplicateNurb3");
memcpy(newnu->bp, nu->bp, len*sizeof(BPoint));
newnu->knotsu= newnu->knotsv= NULL;
@@ -749,7 +749,7 @@ void BKE_nurb_knot_calc_v(Nurb *nu)
static void basisNurb(float t, short order, short pnts, float *knots, float *basis, int *start, int *end)
{
float d, e;
- int i, i1 = 0, i2 = 0 ,j, orderpluspnts, opp2, o2;
+ int i, i1 = 0, i2 = 0, j, orderpluspnts, opp2, o2;
orderpluspnts= order+pnts;
opp2 = orderpluspnts-1;
@@ -777,7 +777,7 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
}
basis[i]= 0.0;
- /* this is order 2,3,... */
+ /* this is order 2, 3, ... */
for (j=2; j<=order; j++) {
if (i2+j>= orderpluspnts) i2= opp2-j;
@@ -870,7 +870,7 @@ void BKE_nurb_makeFaces(Nurb *nu, float *coord_array, int rowstride, int resolu,
jstart= (int *)MEM_mallocN(sizeof(float)*totv, "makeNurbfaces4");
jend= (int *)MEM_mallocN(sizeof(float)*totv, "makeNurbfaces5");
- /* precalculation of basisv and jstart,jend */
+ /* precalculation of basisv and jstart, jend */
if (nu->flagv & CU_NURB_CYCLIC) cycl= nu->orderv-1;
else cycl= 0;
v= vstart;
@@ -1076,7 +1076,7 @@ void BKE_nurb_makeCurve(Nurb *nu, float *coord_array, float *tilt_array, float *
/* forward differencing method for bezier curve */
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride)
{
- float rt0,rt1,rt2,rt3,f;
+ float rt0, rt1, rt2, rt3, f;
int a;
f= (float)it;
@@ -1281,7 +1281,7 @@ float *BKE_curve_make_orco(Scene *scene, Object *ob)
}
for (u=0; u<sizev; u++) {
- for (v=0; v<sizeu; v++,fp+=3) {
+ for (v=0; v<sizeu; v++, fp+=3) {
if (cu->flag & CU_UV_ORCO) {
fp[0]= 2.0f*u/(sizev - 1) - 1.0f;
fp[1]= 2.0f*v/(sizeu - 1) - 1.0f;
@@ -1544,13 +1544,13 @@ static int cu_isectLL(const float v1[3], const float v2[3], const float v3[3], c
}
-static short bevelinside(BevList *bl1,BevList *bl2)
+static short bevelinside(BevList *bl1, BevList *bl2)
{
/* is bl2 INSIDE bl1 ? with left-right method and "labda's" */
/* returns '1' if correct hole */
BevPoint *bevp, *prevbevp;
- float min,max,vec[3],hvec1[3],hvec2[3],lab,mu;
- int nr, links=0,rechts=0,mode;
+ float min, max, vec[3], hvec1[3], hvec2[3], lab, mu;
+ int nr, links=0, rechts=0, mode;
/* take first vertex of possible hole */
@@ -1558,7 +1558,7 @@ static short bevelinside(BevList *bl1,BevList *bl2)
hvec1[0]= bevp->vec[0];
hvec1[1]= bevp->vec[1];
hvec1[2]= 0.0;
- copy_v3_v3(hvec2,hvec1);
+ copy_v3_v3(hvec2, hvec1);
hvec2[0]+=1000;
/* test it with all edges of potential surounding poly */
@@ -1605,7 +1605,7 @@ struct bevelsort {
static int vergxcobev(const void *a1, const void *a2)
{
- const struct bevelsort *x1=a1,*x2=a2;
+ const struct bevelsort *x1=a1, *x2=a2;
if ( x1->left > x2->left ) return 1;
else if ( x1->left < x2->left) return -1;
@@ -1837,7 +1837,7 @@ static void bevel_list_smooth(BevList *bl, int smooth_iter)
while (nr--) {
/* interpolate quats */
- float zaxis[3] = {0,0,1}, cross[3], q2[4];
+ float zaxis[3] = {0, 0, 1}, cross[3], q2[4];
interp_qt_qtqt(q, bevp0_quat, bevp2->quat, 0.5);
normalize_qt(q);
@@ -1872,7 +1872,7 @@ static void make_bevel_list_3D_zup(BevList *bl)
while (nr--) {
/* totally simple */
bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
- vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+ vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
bevp0= bevp1;
bevp1= bevp2;
@@ -1896,7 +1896,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
while (nr--) {
if (nr+4 > bl->nr) { /* first time and second time, otherwise first point adjusts last */
- vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+ vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
}
else {
float angle= angle_normalized_v3v3(bevp0->dir, bevp1->dir);
@@ -1930,7 +1930,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
*
* this is why we compare last with second last
* */
- float vec_1[3]= {0,1,0}, vec_2[3]= {0,1,0}, angle, ang_fac, cross_tmp[3];
+ float vec_1[3]= {0, 1, 0}, vec_2[3]= {0, 1, 0}, angle, ang_fac, cross_tmp[3];
BevPoint *bevp_first;
BevPoint *bevp_last;
@@ -2024,11 +2024,11 @@ static void make_bevel_list_3D_tangent(BevList *bl)
/* make perpendicular, modify tan in place, is ok */
float cross_tmp[3];
- float zero[3] = {0,0,0};
+ float zero[3] = {0, 0, 0};
cross_v3_v3v3(cross_tmp, bevp1->tan, bevp1->dir);
normalize_v3(cross_tmp);
- tri_to_quat( bevp1->quat,zero, cross_tmp, bevp1->tan); /* XXX - could be faster */
+ tri_to_quat(bevp1->quat, zero, cross_tmp, bevp1->tan); /* XXX - could be faster */
/* bevp0= bevp1; */ /* UNUSED */
bevp1= bevp2;
@@ -2072,7 +2072,7 @@ static void make_bevel_list_segment_3D(BevList *bl)
sub_v3_v3v3(bevp1->dir, bevp1->vec, bevp2->vec);
normalize_v3(bevp1->dir);
- vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+ vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
axis_angle_to_quat(q, bevp1->dir, bevp1->alfa);
mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
@@ -2299,7 +2299,7 @@ void BKE_curve_bevelList_make(Object *ob)
memcpy(blnew, bl, sizeof(BevList));
blnew->nr= 0;
BLI_remlink(&(cu->bev), bl);
- BLI_insertlinkbefore(&(cu->bev),blnext,blnew); /* to make sure bevlijst is tuned with nurblist */
+ BLI_insertlinkbefore(&(cu->bev), blnext, blnew); /* to make sure bevlijst is tuned with nurblist */
bevp0= (BevPoint *)(bl+1);
bevp1= (BevPoint *)(blnew+1);
nr= bl->nr;
@@ -2367,7 +2367,7 @@ void BKE_curve_bevelList_make(Object *ob)
bl= bl->next;
}
- qsort(sortdata,poly,sizeof(struct bevelsort), vergxcobev);
+ qsort(sortdata, poly, sizeof(struct bevelsort), vergxcobev);
sd= sortdata+1;
for (a=1; a<poly; a++, sd++) {
@@ -2442,7 +2442,7 @@ void BKE_curve_bevelList_make(Object *ob)
/* from: make_bevel_list_3D_zup, could call but avoid a second loop.
* no need for tricky tilt calculation as with 3D curves */
bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
- vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+ vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
/* done with inline make_bevel_list_3D_zup */
bevp0= bevp1;
@@ -2497,7 +2497,7 @@ void BKE_curve_bevelList_make(Object *ob)
/* mode: is not zero when FCurve, is 2 when forced horizontal for autohandles */
static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode, int skip_align)
{
- float *p1,*p2,*p3, pt[3];
+ float *p1, *p2, *p3, pt[3];
float dvec_a[3], dvec_b[3];
float len, len_a, len_b;
const float eps= 1e-5;
@@ -2545,7 +2545,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
if (len_b==0.0f) len_b=1.0f;
- if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* auto */
+ if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) || ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) { /* auto */
float tvec[3];
tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a;
tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a;
@@ -2558,7 +2558,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
if (len_a>5.0f*len_b) len_a= 5.0f*len_b;
if (len_b>5.0f*len_a) len_b= 5.0f*len_a;
- if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) {
+ if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) {
len_a/=len;
madd_v3_v3v3fl(p2-3, p2, tvec, -len_a);
@@ -2584,7 +2584,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
}
}
}
- if (ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {
+ if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) {
len_b/=len;
madd_v3_v3v3fl(p2+3, p2, tvec, len_b);
@@ -3075,7 +3075,7 @@ float (*BKE_curve_vertexCos_get(Curve *UNUSED(cu), ListBase *lb, int *numVerts_r
if (nu->type == CU_BEZIER) {
BezTriple *bezt = nu->bezt;
- for (i=0; i<nu->pntsu; i++,bezt++) {
+ for (i=0; i<nu->pntsu; i++, bezt++) {
copy_v3_v3(co, bezt->vec[0]); co+=3;
copy_v3_v3(co, bezt->vec[1]); co+=3;
copy_v3_v3(co, bezt->vec[2]); co+=3;
@@ -3084,7 +3084,7 @@ float (*BKE_curve_vertexCos_get(Curve *UNUSED(cu), ListBase *lb, int *numVerts_r
else {
BPoint *bp = nu->bp;
- for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+ for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
copy_v3_v3(co, bp->vec); co+=3;
}
}
@@ -3103,7 +3103,7 @@ void BK_curve_vertexCos_apply(Curve *UNUSED(cu), ListBase *lb, float (*vertexCos
if (nu->type == CU_BEZIER) {
BezTriple *bezt = nu->bezt;
- for (i=0; i<nu->pntsu; i++,bezt++) {
+ for (i=0; i<nu->pntsu; i++, bezt++) {
copy_v3_v3(bezt->vec[0], co); co+=3;
copy_v3_v3(bezt->vec[1], co); co+=3;
copy_v3_v3(bezt->vec[2], co); co+=3;
@@ -3112,7 +3112,7 @@ void BK_curve_vertexCos_apply(Curve *UNUSED(cu), ListBase *lb, float (*vertexCos
else {
BPoint *bp = nu->bp;
- for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+ for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
copy_v3_v3(bp->vec, co); co+=3;
}
}
@@ -3132,7 +3132,7 @@ float (*BKE_curve_keyVertexCos_get(Curve *UNUSED(cu), ListBase *lb, float *key))
if (nu->type == CU_BEZIER) {
BezTriple *bezt = nu->bezt;
- for (i=0; i<nu->pntsu; i++,bezt++) {
+ for (i=0; i<nu->pntsu; i++, bezt++) {
copy_v3_v3(co, key); co+=3; key+=3;
copy_v3_v3(co, key); co+=3; key+=3;
copy_v3_v3(co, key); co+=3; key+=3;
@@ -3142,7 +3142,7 @@ float (*BKE_curve_keyVertexCos_get(Curve *UNUSED(cu), ListBase *lb, float *key))
else {
BPoint *bp = nu->bp;
- for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+ for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
copy_v3_v3(co, key); co+=3; key+=3;
key++; /* skip tilt */
}
@@ -3161,7 +3161,7 @@ void BKE_curve_keyVertexTilts_apply(Curve *UNUSED(cu), ListBase *lb, float *key)
if (nu->type == CU_BEZIER) {
BezTriple *bezt = nu->bezt;
- for (i=0; i<nu->pntsu; i++,bezt++) {
+ for (i=0; i<nu->pntsu; i++, bezt++) {
key+=3*3;
bezt->alfa= *key;
key+=3;
@@ -3170,7 +3170,7 @@ void BKE_curve_keyVertexTilts_apply(Curve *UNUSED(cu), ListBase *lb, float *key)
else {
BPoint *bp = nu->bp;
- for (i=0; i<nu->pntsu*nu->pntsv; i++,bp++) {
+ for (i=0; i<nu->pntsu*nu->pntsv; i++, bp++) {
key+=3;
bp->alfa= *key;
key++;
@@ -3179,7 +3179,7 @@ void BKE_curve_keyVertexTilts_apply(Curve *UNUSED(cu), ListBase *lb, float *key)
}
}
-int BKE_nurb_check_valid_u( struct Nurb *nu )
+int BKE_nurb_check_valid_u(struct Nurb *nu)
{
if (nu==NULL) return 0;
if (nu->pntsu <= 1) return 0;
@@ -3194,7 +3194,7 @@ int BKE_nurb_check_valid_u( struct Nurb *nu )
}
return 1;
}
-int BKE_nurb_check_valid_v( struct Nurb *nu)
+int BKE_nurb_check_valid_v(struct Nurb *nu)
{
if (nu==NULL) return 0;
if (nu->pntsv <= 1) return 0;
@@ -3210,7 +3210,7 @@ int BKE_nurb_check_valid_v( struct Nurb *nu)
return 1;
}
-int BKE_nurb_order_clamp_u( struct Nurb *nu )
+int BKE_nurb_order_clamp_u(struct Nurb *nu)
{
int change = 0;
if (nu->pntsu<nu->orderu) {
@@ -3218,13 +3218,13 @@ int BKE_nurb_order_clamp_u( struct Nurb *nu )
change= 1;
}
if (((nu->flagu & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) {
- CLAMP(nu->orderu, 3,4);
+ CLAMP(nu->orderu, 3, 4);
change= 1;
}
return change;
}
-int BKE_nurb_order_clamp_v( struct Nurb *nu)
+int BKE_nurb_order_clamp_v(struct Nurb *nu)
{
int change = 0;
if (nu->pntsv<nu->orderv) {
@@ -3232,7 +3232,7 @@ int BKE_nurb_order_clamp_v( struct Nurb *nu)
change= 1;
}
if (((nu->flagv & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) {
- CLAMP(nu->orderv, 3,4);
+ CLAMP(nu->orderv, 3, 4);
change= 1;
}
return change;
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index ee8e57d5a3e..4666aa6a456 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -638,7 +638,7 @@ static void layerInitMinMax_mloopcol(void *vmin, void *vmax)
static void layerDefault_mloopcol(void *data, int count)
{
- MLoopCol default_mloopcol = {255,255,255,255};
+ MLoopCol default_mloopcol = {255, 255, 255, 255};
MLoopCol *mlcol = (MLoopCol*)data;
int i;
for (i = 0; i < count; i++)
@@ -986,11 +986,11 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 9: CD_POLYINDEX */
{sizeof(int), "MIntProperty", 1, NULL, NULL, NULL, NULL, NULL, NULL},
/* 10: CD_PROP_FLT */
- {sizeof(MFloatProperty), "MFloatProperty",1,"Float", layerCopy_propFloat,NULL,NULL,NULL},
+ {sizeof(MFloatProperty), "MFloatProperty", 1, "Float", layerCopy_propFloat, NULL, NULL, NULL},
/* 11: CD_PROP_INT */
- {sizeof(MIntProperty), "MIntProperty",1,"Int",layerCopy_propInt,NULL,NULL,NULL},
+ {sizeof(MIntProperty), "MIntProperty", 1, "Int", layerCopy_propInt, NULL, NULL, NULL},
/* 12: CD_PROP_STR */
- {sizeof(MStringProperty), "MStringProperty",1,"String",layerCopy_propString,NULL,NULL,NULL},
+ {sizeof(MStringProperty), "MStringProperty", 1, "String", layerCopy_propString, NULL, NULL, NULL},
/* 13: CD_ORIGSPACE */
{sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVMap", layerCopy_origspace_face, NULL,
layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face},
@@ -1026,7 +1026,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 23: CD_CLOTH_ORCO */
{sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 24: CD_RECAST */
- {sizeof(MRecast), "MRecast", 1,"Recast",NULL,NULL,NULL,NULL}
+ {sizeof(MRecast), "MRecast", 1, "Recast", NULL, NULL, NULL, NULL}
/* BMESH ONLY */
,
@@ -1064,7 +1064,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
/* 0-4 */ "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace",
/* 5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags",
- /* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco",
+ /* 10-14 */ "CDMFloatProperty", "CDMIntProperty", "CDMStringProperty", "CDOrigSpace", "CDOrco",
/* 15-19 */ "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent", "CDMDisps",
/* 20-24 */"CDPreviewMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco", "CDMRecast"
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 045d85242f1..e5ef9878295 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -87,18 +87,18 @@ DagNodeQueue * queue_create (int slots)
DagNodeQueueElem * elem;
int i;
- queue = MEM_mallocN(sizeof(DagNodeQueue),"DAG queue");
- queue->freenodes = MEM_mallocN(sizeof(DagNodeQueue),"DAG queue");
+ queue = MEM_mallocN(sizeof(DagNodeQueue), "DAG queue");
+ queue->freenodes = MEM_mallocN(sizeof(DagNodeQueue), "DAG queue");
queue->count = 0;
queue->maxlevel = 0;
queue->first = queue->last = NULL;
- elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem3");
+ elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem3");
elem->node = NULL;
elem->next = NULL;
queue->freenodes->first = queue->freenodes->last = elem;
for (i = 1; i <slots;i++) {
- elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem4");
+ elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem4");
elem->node = NULL;
elem->next = NULL;
queue->freenodes->last->next = elem;
@@ -159,10 +159,10 @@ void push_queue(DagNodeQueue *queue, DagNode *node)
int i;
if (node == NULL) {
- fprintf(stderr,"pushing null node\n");
+ fprintf(stderr, "pushing null node\n");
return;
}
- /*fprintf(stderr,"BFS push : %s %d\n",((ID *) node->ob)->name, queue->count);*/
+ /*fprintf(stderr, "BFS push : %s %d\n", ((ID *) node->ob)->name, queue->count);*/
elem = queue->freenodes->first;
if (elem != NULL) {
@@ -174,13 +174,13 @@ void push_queue(DagNodeQueue *queue, DagNode *node)
queue->freenodes->count--;
}
else { /* alllocating more */
- elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
+ elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem1");
elem->node = NULL;
elem->next = NULL;
queue->freenodes->first = queue->freenodes->last = elem;
for (i = 1; i <DAGQUEUEALLOC;i++) {
- elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem2");
+ elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem2");
elem->node = NULL;
elem->next = NULL;
queue->freenodes->last->next = elem;
@@ -219,13 +219,13 @@ void push_stack(DagNodeQueue *queue, DagNode *node)
queue->freenodes->count--;
}
else { /* alllocating more */
- elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
+ elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem1");
elem->node = NULL;
elem->next = NULL;
queue->freenodes->first = queue->freenodes->last = elem;
for (i = 1; i <DAGQUEUEALLOC;i++) {
- elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem2");
+ elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem2");
elem->node = NULL;
elem->next = NULL;
queue->freenodes->last->next = elem;
@@ -270,7 +270,7 @@ DagNode * pop_queue(DagNodeQueue *queue)
return node;
}
else {
- fprintf(stderr,"return null\n");
+ fprintf(stderr, "return null\n");
return NULL;
}
}
@@ -295,7 +295,7 @@ DagForest *dag_init(void)
{
DagForest *forest;
/* use callocN to init all zero */
- forest = MEM_callocN(sizeof(DagForest),"DAG root");
+ forest = MEM_callocN(sizeof(DagForest), "DAG root");
return forest;
}
@@ -376,8 +376,8 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
node = dag_get_node(dag, ob);
if ((ob->data) && (mask&DAG_RL_DATA)) {
- node2 = dag_get_node(dag,ob->data);
- dag_add_relation(dag,node,node2,DAG_RL_DATA, "Object-Data Relation");
+ node2 = dag_get_node(dag, ob->data);
+ dag_add_relation(dag, node, node2, DAG_RL_DATA, "Object-Data Relation");
node2->first_ancestor = ob;
node2->ancestor_count += 1;
}
@@ -401,18 +401,18 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
for (ct= targets.first; ct; ct= ct->next) {
if (ct->tar && ct->tar != ob) {
- // fprintf(stderr,"armature %s target :%s\n", ob->id.name, target->id.name);
+ // fprintf(stderr, "armature %s target :%s\n", ob->id.name, target->id.name);
node3 = dag_get_node(dag, ct->tar);
if (ct->subtarget[0]) {
- dag_add_relation(dag,node3,node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, cti->name);
+ dag_add_relation(dag, node3, node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, cti->name);
if (ct->tar->type == OB_MESH)
node3->customdata_mask |= CD_MASK_MDEFORMVERT;
}
else if (ELEM3(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK))
- dag_add_relation(dag,node3,node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, cti->name);
+ dag_add_relation(dag, node3, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, cti->name);
else
- dag_add_relation(dag,node3,node, DAG_RL_OB_DATA, cti->name);
+ dag_add_relation(dag, node3, node, DAG_RL_OB_DATA, cti->name);
}
}
@@ -460,31 +460,31 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
}
}
if (ob->parent) {
- node2 = dag_get_node(dag,ob->parent);
+ node2 = dag_get_node(dag, ob->parent);
switch (ob->partype) {
case PARSKEL:
- dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Parent");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Parent");
break;
case PARVERT1: case PARVERT3:
- dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Vertex Parent");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, "Vertex Parent");
node2->customdata_mask |= CD_MASK_ORIGINDEX;
break;
case PARBONE:
- dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Bone Parent");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, "Bone Parent");
break;
default:
if (ob->parent->type==OB_LATTICE)
- dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Lattice Parent");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Lattice Parent");
else if (ob->parent->type==OB_CURVE) {
Curve *cu= ob->parent->data;
if (cu->flag & CU_PATH)
- dag_add_relation(dag,node2,node,DAG_RL_DATA_OB|DAG_RL_OB_OB, "Curve Parent");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, "Curve Parent");
else
- dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Curve Parent");
+ dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Curve Parent");
}
else
- dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Parent");
+ dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Parent");
}
/* exception case: parent is duplivert */
if (ob->type==OB_MBALL && (ob->parent->transflag & OB_DUPLIVERTS)) {
@@ -533,7 +533,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
if (cam->dof_ob) {
node2 = dag_get_node(dag, cam->dof_ob);
- dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Camera DoF");
+ dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Camera DoF");
}
}
break;
@@ -543,7 +543,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
if (mom!=ob) {
node2 = dag_get_node(dag, mom);
- dag_add_relation(dag,node,node2,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball"); // mom depends on children!
+ dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball"); // mom depends on children!
}
}
break;
@@ -554,16 +554,16 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
if (cu->bevobj) {
node2 = dag_get_node(dag, cu->bevobj);
- dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
}
if (cu->taperobj) {
node2 = dag_get_node(dag, cu->taperobj);
- dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
}
if (ob->type == OB_FONT) {
if (cu->textoncurve) {
node2 = dag_get_node(dag, cu->textoncurve);
- dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
}
}
}
@@ -587,7 +587,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
if (!psys_check_enabled(ob, psys))
continue;
- if (ELEM(part->phystype,PART_PHYS_KEYED,PART_PHYS_BOIDS)) {
+ if (ELEM(part->phystype, PART_PHYS_KEYED, PART_PHYS_BOIDS)) {
ParticleTarget *pt = psys->targets.first;
for (; pt; pt=pt->next) {
@@ -677,7 +677,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
}
- dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, "Scene Relation");
+ dag_add_relation(dag, scenenode, node, DAG_RL_SCENE, "Scene Relation");
addtoroot = 0;
}
else if (cti->get_constraint_targets) {
@@ -712,7 +712,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
}
if (addtoroot == 1 )
- dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, "Scene Relation");
+ dag_add_relation(dag, scenenode, node, DAG_RL_SCENE, "Scene Relation");
}
struct DagForest *build_dag(Main *bmain, Scene *sce, short mask)
@@ -729,7 +729,7 @@ struct DagForest *build_dag(Main *bmain, Scene *sce, short mask)
dag = sce->theDag;
sce->dagisvalid=1;
if ( dag)
- free_forest( dag );
+ free_forest(dag);
else {
dag = dag_init();
sce->theDag = dag;
@@ -831,7 +831,7 @@ void free_forest(DagForest *Dag)
}
-DagNode * dag_find_node (DagForest *forest,void * fob)
+DagNode * dag_find_node (DagForest *forest, void * fob)
{
if (forest->nodeHash)
return BLI_ghash_lookup(forest->nodeHash, fob);
@@ -847,7 +847,7 @@ DagNode * dag_add_node (DagForest *forest, void * fob)
{
DagNode *node;
- node = MEM_callocN(sizeof(DagNode),"DAG node");
+ node = MEM_callocN(sizeof(DagNode), "DAG node");
if (node) {
node->ob = fob;
node->color = DAG_WHITE;
@@ -872,7 +872,7 @@ DagNode * dag_add_node (DagForest *forest, void * fob)
return node;
}
-DagNode * dag_get_node (DagForest *forest,void * fob)
+DagNode * dag_get_node (DagForest *forest, void * fob)
{
DagNode *node;
@@ -884,7 +884,7 @@ DagNode * dag_get_node (DagForest *forest,void * fob)
-DagNode * dag_get_sub_node (DagForest *forest,void * fob)
+DagNode * dag_get_sub_node (DagForest *forest, void * fob)
{
DagNode *node;
DagAdjList *mainchild, *prev=NULL;
@@ -926,7 +926,7 @@ static void dag_add_parent_relation(DagForest *UNUSED(forest), DagNode *fob1, Da
itA = itA->next;
}
/* create new relation and insert at head. MALLOC alert! */
- itA = MEM_mallocN(sizeof(DagAdjList),"DAG adj list");
+ itA = MEM_mallocN(sizeof(DagAdjList), "DAG adj list");
itA->node = fob1;
itA->type = rel;
itA->count = 1;
@@ -951,7 +951,7 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel
itA = itA->next;
}
/* create new relation and insert at head. MALLOC alert! */
- itA = MEM_mallocN(sizeof(DagAdjList),"DAG adj list");
+ itA = MEM_mallocN(sizeof(DagAdjList), "DAG adj list");
itA->node = fob2;
itA->type = rel;
itA->count = 1;
@@ -1118,7 +1118,7 @@ void graph_bfs(void)
DagAdjList *itA;
int minheight;
- /* fprintf(stderr,"starting BFS\n ------------\n"); */
+ /* fprintf(stderr, "starting BFS\n ------------\n"); */
nqueue = queue_create(DAGQUEUEALLOC);
for ( i=0; i<50; i++)
pos[i] = 0;
@@ -1138,7 +1138,7 @@ void graph_bfs(void)
if (node->color == DAG_WHITE) {
node->color = DAG_GRAY;
node->BFS_dist = 1;
- push_queue(nqueue,node);
+ push_queue(nqueue, node);
while (nqueue->count) {
node = pop_queue(nqueue);
@@ -1149,11 +1149,11 @@ void graph_bfs(void)
itA->node->color = DAG_GRAY;
itA->node->BFS_dist = node->BFS_dist + 1;
itA->node->k = (float) minheight;
- push_queue(nqueue,itA->node);
+ push_queue(nqueue, itA->node);
}
else {
- fprintf(stderr,"bfs not dag tree edge color :%i\n",itA->node->color);
+ fprintf(stderr, "bfs not dag tree edge color :%i\n", itA->node->color);
}
@@ -1169,7 +1169,7 @@ void graph_bfs(void)
set_node_xy(node, node->BFS_dist*DEPSX*2, pos[node->BFS_dist]*DEPSY*2);
node->color = DAG_BLACK;
- // fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
+ // fprintf(stderr, "BFS node : %20s %i %5.0f %5.0f\n", ((ID *) node->ob)->name, node->BFS_dist, node->x, node->y);
}
}
queue_delete(nqueue);
@@ -1190,7 +1190,7 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
DagNodeQueue *nqueue;
DagAdjList *itA;
int retval = 0;
- /* fprintf(stderr,"starting BFS\n ------------\n"); */
+ /* fprintf(stderr, "starting BFS\n ------------\n"); */
/* Init
* dagnode.first is always the root (scene)
@@ -1207,7 +1207,7 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
if (node->color == DAG_WHITE) {
node->color = DAG_GRAY;
node->BFS_dist = 1;
- pre_func(node->ob,data);
+ pre_func(node->ob, data);
while (nqueue->count) {
node = pop_queue(nqueue);
@@ -1217,8 +1217,8 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
if ((itA->node->color == DAG_WHITE) && (itA->type & mask)) {
itA->node->color = DAG_GRAY;
itA->node->BFS_dist = node->BFS_dist + 1;
- push_queue(nqueue,itA->node);
- pre_func(node->ob,data);
+ push_queue(nqueue, itA->node);
+ pre_func(node->ob, data);
}
else { // back or cross edge
@@ -1226,10 +1226,10 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
}
itA = itA->next;
}
- post_func(node->ob,data);
+ post_func(node->ob, data);
node->color = DAG_BLACK;
- // fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
+ // fprintf(stderr, "BFS node : %20s %i %5.0f %5.0f\n", ((ID *) node->ob)->name, node->BFS_dist, node->x, node->y);
}
}
queue_delete(nqueue);
@@ -1251,7 +1251,7 @@ DagNodeQueue * graph_dfs(void)
int maxpos=0;
/* int is_cycle = 0; */ /* UNUSED */
/*
- *fprintf(stderr,"starting DFS\n ------------\n");
+ *fprintf(stderr, "starting DFS\n ------------\n");
*/
nqueue = queue_create(DAGQUEUEALLOC);
retqueue = queue_create(MainDag->numNodes);
@@ -1280,7 +1280,7 @@ DagNodeQueue * graph_dfs(void)
node->DFS_dist = 1;
node->DFS_dvtm = time;
time++;
- push_stack(nqueue,node);
+ push_stack(nqueue, node);
while (nqueue->count) {
//graph_print_queue(nqueue);
@@ -1299,13 +1299,13 @@ DagNodeQueue * graph_dfs(void)
time++;
itA->node->DFS_dist = node->DFS_dist + 1;
itA->node->k = (float) minheight;
- push_stack(nqueue,itA->node);
+ push_stack(nqueue, itA->node);
skip = 1;
break;
}
else {
if (itA->node->color == DAG_GRAY) { // back edge
- fprintf(stderr,"dfs back edge :%15s %15s\n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
+ fprintf(stderr, "dfs back edge :%15s %15s\n", ((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
/* is_cycle = 1; */ /* UNUSED */
}
else if (itA->node->color == DAG_BLACK) {
@@ -1316,7 +1316,7 @@ DagNodeQueue * graph_dfs(void)
if (node->DFS_dist >= itA->node->DFS_dist)
itA->node->DFS_dist = node->DFS_dist + 1;
- fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i\n",
+ fprintf(stderr, "dfs forward or cross edge :%15s %i-%i %15s %i-%i\n",
((ID *) node->ob)->name,
node->DFS_dvtm,
node->DFS_fntm,
@@ -1326,7 +1326,7 @@ DagNodeQueue * graph_dfs(void)
#endif
}
else
- fprintf(stderr,"dfs unknown edge\n");
+ fprintf(stderr, "dfs unknown edge\n");
}
itA = itA->next;
}
@@ -1348,16 +1348,16 @@ DagNodeQueue * graph_dfs(void)
}
set_node_xy(node, node->DFS_dist*DEPSX*2, pos[node->DFS_dist]*DEPSY*2);
- // fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
+ // fprintf(stderr, "DFS node : %20s %i %i %i %i\n", ((ID *) node->ob)->name, node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
- push_stack(retqueue,node);
+ push_stack(retqueue, node);
}
}
}
node = node->next;
} while (node);
-// fprintf(stderr,"i size : %i\n", maxpos);
+// fprintf(stderr, "i size : %i\n", maxpos);
queue_delete(nqueue);
return(retqueue);
@@ -1381,7 +1381,7 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
int skip = 0;
int retval = 0;
/*
- *fprintf(stderr,"starting DFS\n ------------\n");
+ *fprintf(stderr, "starting DFS\n ------------\n");
*/
nqueue = queue_create(DAGQUEUEALLOC);
@@ -1406,8 +1406,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
node->DFS_dist = 1;
node->DFS_dvtm = time;
time++;
- push_stack(nqueue,node);
- pre_func(node->ob,data);
+ push_stack(nqueue, node);
+ pre_func(node->ob, data);
while (nqueue->count) {
skip = 0;
@@ -1421,8 +1421,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
time++;
itA->node->DFS_dist = node->DFS_dist + 1;
- push_stack(nqueue,itA->node);
- pre_func(node->ob,data);
+ push_stack(nqueue, itA->node);
+ pre_func(node->ob, data);
skip = 1;
break;
@@ -1444,7 +1444,7 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
node->DFS_fntm = time;
time++;
- post_func(node->ob,data);
+ post_func(node->ob, data);
}
}
}
@@ -1462,13 +1462,13 @@ struct DagNodeQueue *get_obparents(struct DagForest *dag, void *ob)
DagNodeQueue *nqueue;
DagAdjList *itA;
- node = dag_find_node(dag,ob);
+ node = dag_find_node(dag, ob);
if (node==NULL) {
return NULL;
}
else if (node->ancestor_count == 1) { // simple case
nqueue = queue_create(1);
- push_queue(nqueue,node);
+ push_queue(nqueue, node);
}
else { /* need to go over the whole dag for adj list */
nqueue = queue_create(node->ancestor_count);
@@ -1479,7 +1479,7 @@ struct DagNodeQueue *get_obparents(struct DagForest *dag, void *ob)
itA = node->child;
while (itA != NULL) {
if ((itA->node == node) && (itA->type == DAG_RL_DATA)) {
- push_queue(nqueue,node);
+ push_queue(nqueue, node);
}
itA = itA->next;
}
@@ -1496,7 +1496,7 @@ struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob)
DagNodeQueue *nqueue;
DagAdjList *itA;
- node = dag_find_node(dag,ob);
+ node = dag_find_node(dag, ob);
// need to go over the whole dag for adj list
nqueue = queue_create(node->ancestor_count);
@@ -1507,7 +1507,7 @@ struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob)
itA = node->child;
while (itA != NULL) {
if (itA->node == node) {
- push_queue(nqueue,node);
+ push_queue(nqueue, node);
}
itA = itA->next;
}
@@ -1544,7 +1544,7 @@ struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob)
node->color = DAG_GRAY;
time++;
- push_stack(nqueue,node);
+ push_stack(nqueue, node);
while (nqueue->count) {
@@ -1558,7 +1558,7 @@ struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob)
itA->node->color = DAG_GRAY;
time++;
- push_stack(nqueue,itA->node);
+ push_stack(nqueue, itA->node);
skip = 1;
break;
}
@@ -1570,7 +1570,7 @@ struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob)
node->color = DAG_BLACK;
time++;
- push_stack(retqueue,node);
+ push_stack(retqueue, node);
}
}
}
@@ -1618,10 +1618,10 @@ void graph_print_queue(DagNodeQueue *nqueue)
queueElem = nqueue->first;
while (queueElem) {
- fprintf(stderr,"** %s %i %i-%i ",((ID *) queueElem->node->ob)->name,queueElem->node->color,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
+ fprintf(stderr, "** %s %i %i-%i ", ((ID *) queueElem->node->ob)->name, queueElem->node->color, queueElem->node->DFS_dvtm, queueElem->node->DFS_fntm);
queueElem = queueElem->next;
}
- fprintf(stderr,"\n");
+ fprintf(stderr, "\n");
}
void graph_print_queue_dist(DagNodeQueue *nqueue)
@@ -1632,16 +1632,16 @@ void graph_print_queue_dist(DagNodeQueue *nqueue)
queueElem = nqueue->first;
count = 0;
while (queueElem) {
- fprintf(stderr,"** %25s %2.2i-%2.2i ",((ID *) queueElem->node->ob)->name,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
- while (count < queueElem->node->DFS_dvtm-1) { fputc(' ',stderr); count++;}
- fputc('|',stderr);
- while (count < queueElem->node->DFS_fntm-2) { fputc('-',stderr); count++;}
- fputc('|',stderr);
- fputc('\n',stderr);
+ fprintf(stderr, "** %25s %2.2i-%2.2i ", ((ID *) queueElem->node->ob)->name, queueElem->node->DFS_dvtm, queueElem->node->DFS_fntm);
+ while (count < queueElem->node->DFS_dvtm-1) { fputc(' ', stderr); count++;}
+ fputc('|', stderr);
+ while (count < queueElem->node->DFS_fntm-2) { fputc('-', stderr); count++;}
+ fputc('|', stderr);
+ fputc('\n', stderr);
count = 0;
queueElem = queueElem->next;
}
- fprintf(stderr,"\n");
+ fprintf(stderr, "\n");
}
void graph_print_adj_list(void)
@@ -1651,14 +1651,14 @@ void graph_print_adj_list(void)
node = (getMainDag())->DagNode.first;
while (node) {
- fprintf(stderr,"node : %s col: %i",((ID *) node->ob)->name, node->color);
+ fprintf(stderr, "node : %s col: %i", ((ID *) node->ob)->name, node->color);
itA = node->child;
while (itA) {
- fprintf(stderr,"-- %s ",((ID *) itA->node->ob)->name);
+ fprintf(stderr, "-- %s ", ((ID *) itA->node->ob)->name);
itA = itA->next;
}
- fprintf(stderr,"\n");
+ fprintf(stderr, "\n");
node = node->next;
}
}
@@ -1760,7 +1760,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
rootnode = sce->theDag->DagNode.first;
rootnode->color = DAG_GRAY;
time++;
- push_stack(nqueue,rootnode);
+ push_stack(nqueue, rootnode);
while (nqueue->count) {
@@ -1774,7 +1774,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
itA->node->color = DAG_GRAY;
time++;
- push_stack(nqueue,itA->node);
+ push_stack(nqueue, itA->node);
skip = 1;
break;
}
@@ -1793,8 +1793,8 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
while (base && base->object != node->ob)
base = base->next;
if (base) {
- BLI_remlink(&sce->base,base);
- BLI_addhead(&tempbase,base);
+ BLI_remlink(&sce->base, base);
+ BLI_addhead(&tempbase, base);
}
}
}
@@ -1803,8 +1803,8 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
/* temporal correction for circular dependencies */
base = sce->base.first;
while (base) {
- BLI_remlink(&sce->base,base);
- BLI_addhead(&tempbase,base);
+ BLI_remlink(&sce->base, base);
+ BLI_addhead(&tempbase, base);
//if (G.debug & G_DEBUG)
printf("cyclic %s\n", base->object->id.name);
base = sce->base.first;
@@ -1930,7 +1930,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
}
-/* node was checked to have lasttime != curtime , and is of type ID_OB */
+/* node was checked to have lasttime != curtime, and is of type ID_OB */
static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
{
DagAdjList *itA;
@@ -1952,7 +1952,7 @@ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
return node->lay;
}
-/* node was checked to have lasttime != curtime , and is of type ID_OB */
+/* node was checked to have lasttime != curtime, and is of type ID_OB */
static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int reset)
{
Main *bmain= G.main;
@@ -2897,7 +2897,7 @@ void DAG_pose_sort(Object *ob)
while (itA != NULL) {
if (itA->node->color == DAG_WHITE) {
itA->node->color = DAG_GRAY;
- push_stack(nqueue,itA->node);
+ push_stack(nqueue, itA->node);
skip = 1;
break;
}
@@ -2935,8 +2935,8 @@ void DAG_pose_sort(Object *ob)
// printf(" %s\n", pchan->name);
// }
- free_forest( dag );
- MEM_freeN( dag );
+ free_forest(dag);
+ MEM_freeN(dag);
ugly_hack_sorry= 1;
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 3d79386e19a..4e900794173 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -197,7 +197,7 @@ void addnormalsDispList(ListBase *lb)
for (; b<dl->nr; b++) {
- normal_quad_v3( nor,v1, v3, v4, v2);
+ normal_quad_v3(nor, v1, v3, v4, v2);
add_v3_v3(n1, nor);
add_v3_v3(n2, nor);
@@ -1197,7 +1197,7 @@ static void rotateBevelPiece(Curve *cu, BevPoint *bevp, DispList *dlb, float wid
int b;
fp = dlb->verts;
- for (b = 0; b<dlb->nr; b++,fp += 3,data += 3) {
+ for (b = 0; b<dlb->nr; b++, fp += 3, data += 3) {
if (cu->flag & CU_3D) {
float vec[3];
@@ -1288,7 +1288,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
BevList *bl= cu->bev.first;
Nurb *nu= nubase->first;
- for (; bl && nu; bl=bl->next,nu=nu->next) {
+ for (; bl && nu; bl=bl->next, nu=nu->next) {
DispList *dl;
float *data;
BevPoint *bevp;
@@ -1357,7 +1357,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
/* for each point of poly make a bevel piece */
bevp= (BevPoint *)(bl+1);
- for (a=0; a<bl->nr; a++,bevp++) {
+ for (a=0; a<bl->nr; a++, bevp++) {
float fac=1.0;
if (cu->taperobj==NULL) {
if ( (cu->bevobj!=NULL) || !((cu->flag & CU_FRONT) || (cu->flag & CU_BACK)) )
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index e6f38a3a334..636788e20e8 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -78,15 +78,15 @@
/* precalculated gaussian factors for 5x super sampling */
static float gaussianFactors[5] = { 0.996849f,
- 0.596145f,
- 0.596145f,
- 0.596145f,
- 0.524141f};
+ 0.596145f,
+ 0.596145f,
+ 0.596145f,
+ 0.524141f};
static float gaussianTotal = 3.309425f;
/* UV Image neighboring pixel table x and y list */
-static int neighX[8] = {1,1,0,-1,-1,-1, 0, 1};
-static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
+static int neighX[8] = {1, 1, 0, -1, -1, -1, 0, 1};
+static int neighY[8] = {0, 1, 1, 1, 0, -1, -1, -1};
/* subframe_updateObject() flags */
#define UPDATE_PARENTS (1<<0)
@@ -110,7 +110,7 @@ static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
#define MIN_WETNESS 0.001f
#define MAX_WETNESS 5.0f
/* dissolve macro */
-#define VALUE_DISSOLVE(VALUE, TIME, SCALE, LOG) (VALUE) = (LOG) ? (VALUE) * (pow(MIN_WETNESS,1.0f/(1.2f*((float)(TIME))/(SCALE)))) : (VALUE) - 1.0f/(TIME)*(SCALE)
+#define VALUE_DISSOLVE(VALUE, TIME, SCALE, LOG) (VALUE) = (LOG) ? (VALUE) * (pow(MIN_WETNESS, 1.0f/(1.2f*((float)(TIME))/(SCALE)))) : (VALUE) - 1.0f/(TIME)*(SCALE)
/***************************** Internal Structs ***************************/
@@ -376,18 +376,18 @@ void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
}
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
- strcat(surface->output_name,"paintmap");
- strcat(surface->output_name2,"wetmap");
+ strcat(surface->output_name, "paintmap");
+ strcat(surface->output_name2, "wetmap");
surface_setUniqueOutputName(surface, surface->output_name2, 1);
}
else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
- strcat(surface->output_name,"displace");
+ strcat(surface->output_name, "displace");
}
else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT) {
- strcat(surface->output_name,"weight");
+ strcat(surface->output_name, "weight");
}
else if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
- strcat(surface->output_name,"wave");
+ strcat(surface->output_name, "wave");
}
surface_setUniqueOutputName(surface, surface->output_name, 0);
@@ -720,14 +720,14 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
/* get dimensions */
sub_v3_v3v3(dim, grid->grid_bounds.max, grid->grid_bounds.min);
copy_v3_v3(td, dim);
- min_dim = MAX3(td[0],td[1],td[2]) / 1000.f;
+ min_dim = MAX3(td[0], td[1], td[2]) / 1000.f;
/* deactivate zero axises */
for (i=0; i<3; i++) {
if (td[i]<min_dim) {td[i]=1.0f; axis-=1;}
}
- if (axis == 0 || MAX3(td[0],td[1],td[2]) < 0.0001f) {
+ if (axis == 0 || MAX3(td[0], td[1], td[2]) < 0.0001f) {
MEM_freeN(grid_bounds);
MEM_freeN(bData->grid);
bData->grid = NULL;
@@ -1469,7 +1469,7 @@ void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
#pragma omp parallel for schedule(static)
for (i=0; i<sData->total_points; i++) {
int face_ind = f_data->uv_p[i].face_index;
- float colors[3][4] = {{0.0f,0.0f,0.0f,0.0f}};
+ float colors[3][4] = {{0.0f, 0.0f, 0.0f, 0.0f}};
float final_color[4];
int j;
/* collect color values */
@@ -1914,8 +1914,8 @@ struct DerivedMesh *dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, Scen
* Tries to find the neighboring pixel in given (uv space) direction.
* Result is used by effect system to move paint on the surface.
*
-* px,py : origin pixel x and y
-* n_index : lookup direction index (use neighX,neighY to get final index)
+* px, py : origin pixel x and y
+* n_index : lookup direction index (use neighX, neighY to get final index)
*/
static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh *dm,
const char *uvname, int w, int h, int px, int py, int n_index)
@@ -1925,7 +1925,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
* and faster/simplier than including possible face tip point links)
*/
- int x,y;
+ int x, y;
PaintUVPoint *tPoint = NULL;
PaintUVPoint *cPoint = NULL;
@@ -2121,7 +2121,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
0.4f, -0.2f,
-0.4f, 0.3f};
int ty;
- int w,h;
+ int w, h;
int numOfFaces;
char uvname[MAX_CUSTOMDATA_LAYER_NAME];
int active_points = 0;
@@ -2217,7 +2217,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
short isInside = 0; /* if point is inside a uv face */
float d1[2], d2[2], d3[2], point[5][2];
- float dot00,dot01,dot02,dot11,dot12, invDenom, u,v;
+ float dot00, dot01, dot02, dot11, dot12, invDenom, u, v;
/* Init per pixel settings */
tPoint->face_index = -1;
@@ -2258,7 +2258,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
if (faceBB[i].max[1] < (point[sample][1])) continue;
/* Calculate point inside a triangle check
- * for uv0,1,2 */
+ * for uv0, 1, 2 */
sub_v2_v2v2(d1, tface[i].uv[2], tface[i].uv[0]); // uv2 - uv0
sub_v2_v2v2(d2, tface[i].uv[1], tface[i].uv[0]); // uv1 - uv0
sub_v2_v2v2(d3, point[sample], tface[i].uv[0]); // point - uv0
@@ -2358,7 +2358,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
/* If point isn't't on canvas mesh */
if (tPoint->face_index == -1) {
int u_min, u_max, v_min, v_max;
- int u,v, ind;
+ int u, v, ind;
float point[2];
/* get loop area */
@@ -2696,7 +2696,7 @@ static void dynamicPaint_updateBrushMaterials(Object *brushOb, Material *ui_mat,
if (tot) {
bMats->ob_mats = MEM_callocN(sizeof(Material*)*(tot), "BrushMaterials");
for (i=0; i<tot; i++) {
- bMats->ob_mats[i] = RE_init_sample_material(give_current_material(brushOb,(i+1)), scene);
+ bMats->ob_mats[i] = RE_init_sample_material(give_current_material(brushOb, (i+1)), scene);
}
}
bMats->tot = tot;
@@ -3189,7 +3189,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
if (brush->flags & MOD_DPAINT_PROX_PROJECT && brush->collision != MOD_DPAINT_COL_VOLUME) {
mul_v3_fl(avg_brushNor, 1.0f/(float)numOfVerts);
/* instead of null vector use positive z */
- if (!(MIN3(avg_brushNor[0],avg_brushNor[1],avg_brushNor[2])))
+ if (!(MIN3(avg_brushNor[0], avg_brushNor[1], avg_brushNor[2])))
avg_brushNor[2] = 1.0f;
else
normalize_v3(avg_brushNor);
@@ -3278,7 +3278,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
float dot;
if (quad) {v2=mface[hit.index].v3; v3=mface[hit.index].v4;}
- normal_tri_v3( hit.no, mvert[v1].co, mvert[v2].co, mvert[v3].co);
+ normal_tri_v3(hit.no, mvert[v1].co, mvert[v2].co, mvert[v3].co);
dot = ray_dir[0]*hit.no[0] + ray_dir[1]*hit.no[1] + ray_dir[2]*hit.no[2];
/* If ray and hit face normal are facing same direction
@@ -3402,7 +3402,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
/* velocity brush, only do on main sample */
if (brush->flags & MOD_DPAINT_USES_VELOCITY && ss==0 && brushVelocity) {
- int v1,v2,v3;
+ int v1, v2, v3;
float weights[4];
float brushPointVelocity[3];
float velocity[3];
@@ -3888,7 +3888,7 @@ static void dynamicPaint_prepareAdjacencyData(DynamicPaintSurface *surface, int
if ((!surface_usesAdjDistance(surface) && !force_init) || !sData->adj_data) return;
if (bData->bNeighs) MEM_freeN(bData->bNeighs);
- bNeighs = bData->bNeighs = MEM_mallocN(sData->adj_data->total_targets*sizeof(struct BakeAdjPoint),"PaintEffectBake");
+ bNeighs = bData->bNeighs = MEM_mallocN(sData->adj_data->total_targets*sizeof(struct BakeAdjPoint), "PaintEffectBake");
if (!bNeighs) return;
#pragma omp parallel for schedule(static)
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 263f89a363e..884e4e15c8b 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -387,14 +387,14 @@ static void emDM_foreachMappedEdge(
BM_mesh_elem_index_ensure(bmdm->tc->bm, BM_VERT);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
- for (i=0; eed; i++,eed=BM_iter_step(&iter))
+ for (i=0; eed; i++, eed=BM_iter_step(&iter))
func(userData, i,
bmdm->vertexCos[BM_elem_index_get(eed->v1)],
bmdm->vertexCos[BM_elem_index_get(eed->v2)]);
}
else {
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
- for (i=0; eed; i++,eed=BM_iter_step(&iter))
+ for (i=0; eed; i++, eed=BM_iter_step(&iter))
func(userData, i, eed->v1->co, eed->v2->co);
}
}
@@ -415,7 +415,7 @@ static void emDM_drawMappedEdges(
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
- for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+ for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v1)]);
glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v2)]);
@@ -426,7 +426,7 @@ static void emDM_drawMappedEdges(
else {
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
- for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+ for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
glVertex3fv(eed->v1->co);
glVertex3fv(eed->v2->co);
@@ -460,7 +460,7 @@ static void emDM_drawMappedEdgesInterp(
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
- for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+ for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
setDrawInterpOptions(userData, i, 0.0);
glVertex3fv(bmdm->vertexCos[BM_elem_index_get(eed->v1)]);
@@ -473,7 +473,7 @@ static void emDM_drawMappedEdgesInterp(
else {
glBegin(GL_LINES);
eed = BM_iter_new(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
- for (i=0; eed; i++,eed=BM_iter_step(&iter)) {
+ for (i=0; eed; i++, eed=BM_iter_step(&iter)) {
if (!setDrawOptions || (setDrawOptions(userData, i) != DM_DRAW_OPTION_SKIP)) {
setDrawInterpOptions(userData, i, 0.0);
glVertex3fv(eed->v1->co);
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index c275d4ef0ac..7fb0cf9f0fa 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -756,7 +756,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
strength= eff->pd->f_strength * efd->falloff;
- copy_v3_v3(tex_co,point->loc);
+ copy_v3_v3(tex_co, point->loc);
if (eff->pd->flag & PFIELD_TEX_2D) {
float fac=-dot_v3v3(tex_co, efd->nor);
@@ -767,7 +767,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
mul_m4_v3(eff->ob->imat, tex_co);
}
- hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL,NULL, 0, result);
+ hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result);
if (hasrgb && mode==PFIELD_TEX_RGB) {
force[0] = (0.5f - result->tr) * strength;
@@ -820,7 +820,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
{
PartDeflect *pd = eff->pd;
RNG *rng = pd->rng;
- float force[3]={0,0,0};
+ float force[3]={0, 0, 0};
float temp[3];
float fac;
float strength = pd->f_strength;
@@ -905,9 +905,9 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
else {
add_v3_v3v3(temp, efd->vec_to_point2, efd->nor2);
}
- force[0] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[0], temp[1], temp[2], 2,0,2);
- force[1] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[1], temp[2], temp[0], 2,0,2);
- force[2] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[2], temp[0], temp[1], 2,0,2);
+ force[0] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[0], temp[1], temp[2], 2, 0, 2);
+ force[1] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[1], temp[2], temp[0], 2, 0, 2);
+ force[2] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[2], temp[0], temp[1], 2, 0, 2);
mul_v3_fl(force, strength * efd->falloff);
break;
case PFIELD_DRAG:
@@ -993,7 +993,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
else if (eff->pd->forcefield == PFIELD_TEXTURE)
do_texture_effector(eff, &efd, point, force);
else {
- float temp1[3]={0,0,0}, temp2[3];
+ float temp1[3]={0, 0, 0}, temp2[3];
copy_v3_v3(temp1, force);
do_physical_effector(eff, &efd, point, force);
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index e85432581d5..74513243621 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -803,7 +803,7 @@ void calchandles_fcurve (FCurve *fcu)
BKE_nurb_handle_calc(bezt, prev, next, 1); /* 1==special autohandle */
/* for automatic ease in and out */
- if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) && ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {
+ if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) {
/* only do this on first or last beztriple */
if ((a == 0) || (a == fcu->totvert-1)) {
/* set both handles to have same horizontal value as keyframe */
@@ -1144,8 +1144,8 @@ static float dvar_eval_rotDiff (ChannelDriver *driver, DriverVar *dvar)
// TODO: this needs to take into account space conversions...
static float dvar_eval_locDiff (ChannelDriver *driver, DriverVar *dvar)
{
- float loc1[3] = {0.0f,0.0f,0.0f};
- float loc2[3] = {0.0f,0.0f,0.0f};
+ float loc1[3] = {0.0f, 0.0f, 0.0f};
+ float loc2[3] = {0.0f, 0.0f, 0.0f};
/* get two location values */
// NOTE: for now, these are all just worldspace
@@ -1240,7 +1240,7 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar)
Object *ob= (Object *)dtar_id_ensure_proxy_from(dtar->id);
bPoseChannel *pchan;
float mat[4][4];
- float oldEul[3] = {0.0f,0.0f,0.0f};
+ float oldEul[3] = {0.0f, 0.0f, 0.0f};
short useEulers=0, rotOrder=ROT_MODE_EUL;
/* check if this target has valid data */
@@ -1656,7 +1656,7 @@ static float evaluate_driver (ChannelDriver *driver, const float evaltime)
driver->curval= 0.0f;
}
else {
- /* this evaluates the expression using Python,and returns its result:
+ /* this evaluates the expression using Python, and returns its result:
* - on errors it reports, then returns 0.0f
*/
driver->curval= BPY_driver_exec(driver, evaltime);
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 5d7960a9823..a7f01393a02 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -317,7 +317,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
Nurb *nu2;
BPoint *bp;
- nu2 =(Nurb*) MEM_callocN(sizeof(Nurb),"underline_nurb");
+ nu2 =(Nurb*) MEM_callocN(sizeof(Nurb), "underline_nurb");
if (nu2 == NULL) return;
nu2->resolu= cu->resolu;
nu2->bezt = NULL;
@@ -331,7 +331,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
nu2->orderv = 1;
nu2->flagu = CU_NURB_CYCLIC;
- bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp");
+ bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint), "underline_bp");
if (bp == NULL) {
MEM_freeN(nu2);
return;
@@ -382,7 +382,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
}
#endif
- /* make a copy at distance ofsx,ofsy with shear*/
+ /* make a copy at distance ofsx, ofsy with shear*/
fsize= cu->fsize;
shear= cu->shear;
si= (float)sin(rot);
@@ -398,7 +398,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
while (nu1) {
bezt1 = nu1->bezt;
if (bezt1) {
- nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb),"duplichar_nurb");
+ nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb), "duplichar_nurb");
if (nu2 == NULL) break;
memcpy(nu2, nu1, sizeof(struct Nurb));
nu2->resolu= cu->resolu;
@@ -416,7 +416,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
/* nu2->trim.last = 0; */
i = nu2->pntsu;
- bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple),"duplichar_bezt2");
+ bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple), "duplichar_bezt2");
if (bezt2 == NULL) {
MEM_freeN(nu2);
break;
@@ -583,14 +583,14 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
/* calc offset and rotation of each char */
ct = chartransdata =
- (struct chartrans*)MEM_callocN((slen+1)* sizeof(struct chartrans),"buildtext");
+ (struct chartrans*)MEM_callocN((slen+1)* sizeof(struct chartrans), "buildtext");
/* We assume the worst case: 1 character per line (is freed at end anyway) */
- linedata= MEM_mallocN(sizeof(float)*(slen*2 + 1),"buildtext2");
- linedata2= MEM_mallocN(sizeof(float)*(slen*2 + 1),"buildtext3");
- linedata3= MEM_callocN(sizeof(float)*(slen*2 + 1),"buildtext4");
- linedata4= MEM_callocN(sizeof(float)*(slen*2 + 1),"buildtext5");
+ linedata = MEM_mallocN(sizeof(float) * (slen * 2 + 1), "buildtext2");
+ linedata2 = MEM_mallocN(sizeof(float) * (slen * 2 + 1), "buildtext3");
+ linedata3 = MEM_callocN(sizeof(float) * (slen * 2 + 1), "buildtext4");
+ linedata4 = MEM_callocN(sizeof(float) * (slen * 2 + 1), "buildtext5");
linedist= cu->linedist;
diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c
index b52576ec465..cd246681f3c 100644
--- a/source/blender/blenkernel/intern/idcode.c
+++ b/source/blender/blenkernel/intern/idcode.c
@@ -53,7 +53,7 @@ static IDType idtypes[]= {
{ ID_BR, "Brush", "brushes", IDTYPE_FLAGS_ISLINKABLE},
{ ID_CA, "Camera", "cameras", IDTYPE_FLAGS_ISLINKABLE},
{ ID_CU, "Curve", "curves", IDTYPE_FLAGS_ISLINKABLE},
- { ID_GD, "GPencil", "grease_pencil",IDTYPE_FLAGS_ISLINKABLE}, /* rename gpencil */
+ { ID_GD, "GPencil", "grease_pencil", IDTYPE_FLAGS_ISLINKABLE}, /* rename gpencil */
{ ID_GR, "Group", "groups", IDTYPE_FLAGS_ISLINKABLE},
{ ID_ID, "ID", "ids", 0}, /* plural is fake */
{ ID_IM, "Image", "images", IDTYPE_FLAGS_ISLINKABLE},
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 5c9c942cc6c..9c5c99592ed 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1036,38 +1036,38 @@ char BKE_imtype_valid_depths(const char imtype)
* creator.c help info */
char BKE_imtype_from_arg(const char *imtype_arg)
{
- if (!strcmp(imtype_arg,"TGA")) return R_IMF_IMTYPE_TARGA;
- else if (!strcmp(imtype_arg,"IRIS")) return R_IMF_IMTYPE_IRIS;
+ if (!strcmp(imtype_arg, "TGA")) return R_IMF_IMTYPE_TARGA;
+ else if (!strcmp(imtype_arg, "IRIS")) return R_IMF_IMTYPE_IRIS;
#ifdef WITH_DDS
- else if (!strcmp(imtype_arg,"DDS")) return R_IMF_IMTYPE_DDS;
+ else if (!strcmp(imtype_arg, "DDS")) return R_IMF_IMTYPE_DDS;
#endif
- else if (!strcmp(imtype_arg,"JPEG")) return R_IMF_IMTYPE_JPEG90;
- else if (!strcmp(imtype_arg,"IRIZ")) return R_IMF_IMTYPE_IRIZ;
- else if (!strcmp(imtype_arg,"RAWTGA")) return R_IMF_IMTYPE_RAWTGA;
- else if (!strcmp(imtype_arg,"AVIRAW")) return R_IMF_IMTYPE_AVIRAW;
- else if (!strcmp(imtype_arg,"AVIJPEG")) return R_IMF_IMTYPE_AVIJPEG;
- else if (!strcmp(imtype_arg,"PNG")) return R_IMF_IMTYPE_PNG;
- else if (!strcmp(imtype_arg,"AVICODEC")) return R_IMF_IMTYPE_AVICODEC;
- else if (!strcmp(imtype_arg,"QUICKTIME")) return R_IMF_IMTYPE_QUICKTIME;
- else if (!strcmp(imtype_arg,"BMP")) return R_IMF_IMTYPE_BMP;
+ else if (!strcmp(imtype_arg, "JPEG")) return R_IMF_IMTYPE_JPEG90;
+ else if (!strcmp(imtype_arg, "IRIZ")) return R_IMF_IMTYPE_IRIZ;
+ else if (!strcmp(imtype_arg, "RAWTGA")) return R_IMF_IMTYPE_RAWTGA;
+ else if (!strcmp(imtype_arg, "AVIRAW")) return R_IMF_IMTYPE_AVIRAW;
+ else if (!strcmp(imtype_arg, "AVIJPEG")) return R_IMF_IMTYPE_AVIJPEG;
+ else if (!strcmp(imtype_arg, "PNG")) return R_IMF_IMTYPE_PNG;
+ else if (!strcmp(imtype_arg, "AVICODEC")) return R_IMF_IMTYPE_AVICODEC;
+ else if (!strcmp(imtype_arg, "QUICKTIME")) return R_IMF_IMTYPE_QUICKTIME;
+ else if (!strcmp(imtype_arg, "BMP")) return R_IMF_IMTYPE_BMP;
#ifdef WITH_HDR
- else if (!strcmp(imtype_arg,"HDR")) return R_IMF_IMTYPE_RADHDR;
+ else if (!strcmp(imtype_arg, "HDR")) return R_IMF_IMTYPE_RADHDR;
#endif
#ifdef WITH_TIFF
- else if (!strcmp(imtype_arg,"TIFF")) return R_IMF_IMTYPE_TIFF;
+ else if (!strcmp(imtype_arg, "TIFF")) return R_IMF_IMTYPE_TIFF;
#endif
#ifdef WITH_OPENEXR
- else if (!strcmp(imtype_arg,"EXR")) return R_IMF_IMTYPE_OPENEXR;
- else if (!strcmp(imtype_arg,"MULTILAYER")) return R_IMF_IMTYPE_MULTILAYER;
+ else if (!strcmp(imtype_arg, "EXR")) return R_IMF_IMTYPE_OPENEXR;
+ else if (!strcmp(imtype_arg, "MULTILAYER")) return R_IMF_IMTYPE_MULTILAYER;
#endif
- else if (!strcmp(imtype_arg,"MPEG")) return R_IMF_IMTYPE_FFMPEG;
- else if (!strcmp(imtype_arg,"FRAMESERVER")) return R_IMF_IMTYPE_FRAMESERVER;
+ else if (!strcmp(imtype_arg, "MPEG")) return R_IMF_IMTYPE_FFMPEG;
+ else if (!strcmp(imtype_arg, "FRAMESERVER")) return R_IMF_IMTYPE_FRAMESERVER;
#ifdef WITH_CINEON
- else if (!strcmp(imtype_arg,"CINEON")) return R_IMF_IMTYPE_CINEON;
- else if (!strcmp(imtype_arg,"DPX")) return R_IMF_IMTYPE_DPX;
+ else if (!strcmp(imtype_arg, "CINEON")) return R_IMF_IMTYPE_CINEON;
+ else if (!strcmp(imtype_arg, "DPX")) return R_IMF_IMTYPE_DPX;
#endif
#ifdef WITH_OPENJPEG
- else if (!strcmp(imtype_arg,"JP2")) return R_IMF_IMTYPE_JP2;
+ else if (!strcmp(imtype_arg, "JP2")) return R_IMF_IMTYPE_JP2;
#endif
else return R_IMF_IMTYPE_INVALID;
}
@@ -1118,7 +1118,7 @@ int BKE_add_image_extension(char *string, const char imtype)
}
#endif
#ifdef WITH_OPENEXR
- else if ( ELEM(imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER)) {
+ else if (ELEM(imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER)) {
if (!BLI_testextensie(string, ".exr"))
extension= ".exr";
}
@@ -1144,7 +1144,7 @@ int BKE_add_image_extension(char *string, const char imtype)
}
#endif
else { // R_IMF_IMTYPE_AVICODEC, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_QUICKTIME etc
- if (!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
+ if (!(BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
extension= ".jpg";
}
@@ -2603,7 +2603,7 @@ int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
/* cyclic */
if (iuser->cycl) {
- cfra= ( (cfra) % len );
+ cfra= ((cfra) % len);
if (cfra < 0) cfra+= len;
if (cfra==0) cfra= len;
}
@@ -2621,7 +2621,7 @@ int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
framenr+= iuser->offset;
if (iuser->cycl) {
- framenr= ( (framenr) % len );
+ framenr= ((framenr) % len);
while (framenr < 0) framenr+= len;
if (framenr==0) framenr= len;
}
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index b593419db9f..cd6ac327f4a 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -87,7 +87,7 @@ void itstart(void)
}
static void itend(void)
{
- gettimeofday(&_itend,&itz);
+ gettimeofday(&_itend, &itz);
}
double itval(void)
{
@@ -98,8 +98,8 @@ double itval(void)
}
#endif
-static float I[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
-static float ZERO[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
+static float I[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
+static float ZERO[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
/*
#define C99
@@ -119,9 +119,9 @@ struct Cloth;
typedef float lfVector[3];
typedef struct fmatrix3x3 {
float m[3][3]; /* 3x3 matrix */
- unsigned int c,r; /* column and row number */
+ unsigned int c, r; /* column and row number */
int pinned; /* is this vertex allowed to move? */
- float n1,n2,n3; /* three normal vectors for collision constrains */
+ float n1, n2, n3; /* three normal vectors for collision constrains */
unsigned int vcount; /* vertex count */
unsigned int scount; /* spring count */
} fmatrix3x3;
@@ -168,7 +168,7 @@ DO_INLINE void mul_fvectorT_fvectorS(float to[3][3], float vectorA[3], float vec
/* printf vector[3] on console: for debug output */
static void print_fvector(float m3[3])
{
- printf("%f\n%f\n%f\n\n",m3[0],m3[1],m3[2]);
+ printf("%f\n%f\n%f\n\n", m3[0], m3[1], m3[2]);
}
///////////////////////////
@@ -303,9 +303,9 @@ DO_INLINE void sub_lfvector_lfvector(float (*to)[3], float (*fLongVectorA)[3], f
/* printf 3x3 matrix on console: for debug output */
static void print_fmatrix(float m3[3][3])
{
- printf("%f\t%f\t%f\n",m3[0][0],m3[0][1],m3[0][2]);
- printf("%f\t%f\t%f\n",m3[1][0],m3[1][1],m3[1][2]);
- printf("%f\t%f\t%f\n\n",m3[2][0],m3[2][1],m3[2][2]);
+ printf("%f\t%f\t%f\n", m3[0][0], m3[0][1], m3[0][2]);
+ printf("%f\t%f\t%f\n", m3[1][0], m3[1][1], m3[1][2]);
+ printf("%f\t%f\t%f\n\n", m3[2][0], m3[2][1], m3[2][2]);
}
#endif
@@ -367,9 +367,9 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3])
/* STATUS: verified */
DO_INLINE void mul_fmatrix_S(float matrix[3][3], float scalar)
{
- mul_fvector_S(matrix[0], matrix[0],scalar);
- mul_fvector_S(matrix[1], matrix[1],scalar);
- mul_fvector_S(matrix[2], matrix[2],scalar);
+ mul_fvector_S(matrix[0], matrix[0], scalar);
+ mul_fvector_S(matrix[1], matrix[1], scalar);
+ mul_fvector_S(matrix[2], matrix[2], scalar);
}
/* a vector multiplied by a 3x3 matrix */
@@ -385,17 +385,17 @@ DO_INLINE void mul_fvector_fmatrix(float *to, float *from, float matrix[3][3])
/* STATUS: verified */
DO_INLINE void mul_fmatrix_fvector(float *to, float matrix[3][3], float from[3])
{
- to[0] = dot_v3v3(matrix[0],from);
- to[1] = dot_v3v3(matrix[1],from);
- to[2] = dot_v3v3(matrix[2],from);
+ to[0] = dot_v3v3(matrix[0], from);
+ to[1] = dot_v3v3(matrix[1], from);
+ to[2] = dot_v3v3(matrix[2], from);
}
/* 3x3 matrix multiplied by a 3x3 matrix */
/* STATUS: verified */
DO_INLINE void mul_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
{
- mul_fvector_fmatrix(to[0], matrixA[0],matrixB);
- mul_fvector_fmatrix(to[1], matrixA[1],matrixB);
- mul_fvector_fmatrix(to[2], matrixA[2],matrixB);
+ mul_fvector_fmatrix(to[0], matrixA[0], matrixB);
+ mul_fvector_fmatrix(to[1], matrixA[1], matrixB);
+ mul_fvector_fmatrix(to[2], matrixA[2], matrixB);
}
/* 3x3 matrix addition with 3x3 matrix */
DO_INLINE void add_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
@@ -459,9 +459,9 @@ DO_INLINE void muladd_fvector_fmatrix(float to[3], float from[3], float matrix[3
/* 3x3 matrix multiplied and added to/by a 3x3 matrix and added to another 3x3 matrix */
DO_INLINE void muladd_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
{
- muladd_fvector_fmatrix(to[0], matrixA[0],matrixB);
- muladd_fvector_fmatrix(to[1], matrixA[1],matrixB);
- muladd_fvector_fmatrix(to[2], matrixA[2],matrixB);
+ muladd_fvector_fmatrix(to[0], matrixA[0], matrixB);
+ muladd_fvector_fmatrix(to[1], matrixA[1], matrixB);
+ muladd_fvector_fmatrix(to[2], matrixA[2], matrixB);
}
/* a vector multiplied and sub'd to/by a 3x3 matrix */
DO_INLINE void mulsub_fvector_fmatrix(float to[3], float from[3], float matrix[3][3])
@@ -473,9 +473,9 @@ DO_INLINE void mulsub_fvector_fmatrix(float to[3], float from[3], float matrix[3
/* 3x3 matrix multiplied and sub'd to/by a 3x3 matrix and added to another 3x3 matrix */
DO_INLINE void mulsub_fmatrix_fmatrix(float to[3][3], float matrixA[3][3], float matrixB[3][3])
{
- mulsub_fvector_fmatrix(to[0], matrixA[0],matrixB);
- mulsub_fvector_fmatrix(to[1], matrixA[1],matrixB);
- mulsub_fvector_fmatrix(to[2], matrixA[2],matrixB);
+ mulsub_fvector_fmatrix(to[0], matrixA[0], matrixB);
+ mulsub_fvector_fmatrix(to[1], matrixA[1], matrixB);
+ mulsub_fvector_fmatrix(to[2], matrixA[2], matrixB);
}
/* 3x3 matrix multiplied+added by a vector */
/* STATUS: verified */
@@ -549,8 +549,8 @@ DO_INLINE void init_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
// slow in parallel
DO_INLINE void initdiag_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
{
- unsigned int i,j;
- float tmatrix[3][3] = {{0,0,0},{0,0,0},{0,0,0}};
+ unsigned int i, j;
+ float tmatrix[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
for (i = 0; i < matrix[0].vcount; i++) {
cp_fmatrix(matrix[i].m, m3);
@@ -824,14 +824,14 @@ int implicit_free (ClothModifierData *clmd)
DO_INLINE float fb(float length, float L)
{
float x = length/L;
- return (-11.541f*pow(x,4)+34.193f*pow(x,3)-39.083f*pow(x,2)+23.116f*x-9.713f);
+ return (-11.541f*pow(x, 4)+34.193f*pow(x, 3)-39.083f*pow(x, 2)+23.116f*x-9.713f);
}
DO_INLINE float fbderiv(float length, float L)
{
float x = length/L;
- return (-46.164f*pow(x,3)+102.579f*pow(x,2)-78.166f*x+23.116f);
+ return (-46.164f*pow(x, 3)+102.579f*pow(x, 2)-78.166f*x+23.116f);
}
DO_INLINE float fbstar(float length, float L, float kb, float cb)
@@ -887,12 +887,12 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
add_lfvector_lfvector(ldV, ldV, z, numverts);
- // r = B - Mul(tmp,A,X); // just use B if X known to be zero
+ // r = B - Mul(tmp, A, X); // just use B if X known to be zero
cp_lfvector(r, lB, numverts);
mul_bfmatrix_lfvector(tmp, lA, ldV);
sub_lfvector_lfvector(r, r, tmp, numverts);
- filter(r,S);
+ filter(r, S);
cp_lfvector(d, r, numverts);
@@ -900,10 +900,10 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
starget = s * sqrt(conjgrad_epsilon);
while (s>starget && conjgrad_loopcount < conjgrad_looplimit) {
- // Mul(q,A,d); // q = A*d;
+ // Mul(q, A, d); // q = A*d;
mul_bfmatrix_lfvector(q, lA, d);
- filter(q,S);
+ filter(q, S);
a = s/dot_lfvector(d, q, numverts);
@@ -919,7 +919,7 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
//d = r+d*(s/s_prev);
add_lfvector_lfvectorS(d, r, d, (s/s_prev), numverts);
- filter(d,S);
+ filter(d, S);
conjgrad_loopcount++;
}
@@ -1126,7 +1126,7 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
DO_INLINE void dfdx_spring_type1(float to[3][3], float extent[3], float length, float L, float dot, float k)
{
// dir is unit length direction, rest is spring's restlength, k is spring constant.
- // return (outerprod(dir,dir)*k + (I - outerprod(dir,dir))*(k - ((k*L)/length)));
+ // return (outerprod(dir, dir)*k + (I - outerprod(dir, dir))*(k - ((k*L)/length)));
float temp[3][3];
float temp1 = k*(1.0 - (L/length));
@@ -1148,7 +1148,7 @@ DO_INLINE void dfdx_spring_type1(float to[3][3], float extent[3], float length,
DO_INLINE void dfdx_spring_type2(float to[3][3], float dir[3], float length, float L, float k, float cb)
{
- // return outerprod(dir,dir)*fbstar_jacobi(length, L, k, cb);
+ // return outerprod(dir, dir)*fbstar_jacobi(length, L, k, cb);
mul_fvectorT_fvectorS(to, dir, dir, fbstar_jacobi(length, L, k, cb));
}
@@ -1159,10 +1159,10 @@ DO_INLINE void dfdv_damp(float to[3][3], float dir[3], float damping)
}
-DO_INLINE void dfdx_spring(float to[3][3], float dir[3],float length,float L,float k)
+DO_INLINE void dfdx_spring(float to[3][3], float dir[3], float length, float L, float k)
{
// dir is unit length direction, rest is spring's restlength, k is spring constant.
- //return ( (I-outerprod(dir,dir))*Min(1.0f,rest/length) - I) * -k;
+ //return ( (I-outerprod(dir, dir))*Min(1.0f, rest/length) - I) * -k;
mul_fvectorT_fvector(to, dir, dir);
sub_fmatrix_fmatrix(to, I, to);
@@ -1172,13 +1172,13 @@ DO_INLINE void dfdx_spring(float to[3][3], float dir[3],float length,float L,fl
}
// unused atm
-DO_INLINE void dfdx_damp(float to[3][3], float dir[3],float length,const float vel[3],float rest,float damping)
+DO_INLINE void dfdx_damp(float to[3][3], float dir[3], float length, const float vel[3], float rest, float damping)
{
// inner spring damping vel is the relative velocity of the endpoints.
- // return (I-outerprod(dir,dir)) * (-damping * -(dot(dir,vel)/Max(length,rest)));
+ // return (I-outerprod(dir, dir)) * (-damping * -(dot(dir, vel)/Max(length, rest)));
mul_fvectorT_fvector(to, dir, dir);
sub_fmatrix_fmatrix(to, I, to);
- mul_fmatrix_S(to, (-damping * -(dot_v3v3(dir,vel)/MAX2(length,rest))));
+ mul_fmatrix_S(to, (-damping * -(dot_v3v3(dir, vel)/MAX2(length, rest))));
}
@@ -1188,17 +1188,17 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
ClothVertex *verts = cloth->verts;
float extent[3];
float length = 0, dot = 0;
- float dir[3] = {0,0,0};
+ float dir[3] = {0, 0, 0};
float vel[3];
float k = 0.0f;
float L = s->restlen;
float cb; /* = clmd->sim_parms->structural; */ /*UNUSED*/
- float nullf[3] = {0,0,0};
- float stretch_force[3] = {0,0,0};
- float bending_force[3] = {0,0,0};
- float damping_force[3] = {0,0,0};
- float nulldfdx[3][3]={ {0,0,0}, {0,0,0}, {0,0,0}};
+ float nullf[3] = {0, 0, 0};
+ float stretch_force[3] = {0, 0, 0};
+ float bending_force[3] = {0, 0, 0};
+ float damping_force[3] = {0, 0, 0};
+ float nulldfdx[3][3]={ {0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
float scaling = 0.0;
@@ -1306,7 +1306,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
mul_fvector_S(bending_force, dir, fbstar(length, L, k, cb));
VECADD(s->f, s->f, bending_force);
- dfdx_spring_type2(s->dfdx, dir, length,L, k, cb);
+ dfdx_spring_type2(s->dfdx, dir, length, L, k, cb);
}
}
}
@@ -1334,7 +1334,7 @@ DO_INLINE void cloth_apply_spring_force(ClothModifierData *UNUSED(clmd), ClothSp
static void CalcFloat( float *v1, float *v2, float *v3, float *n)
{
- float n1[3],n2[3];
+ float n1[3], n2[3];
n1[0]= v1[0]-v2[0];
n2[0]= v2[0]-v3[0];
@@ -1350,7 +1350,7 @@ static void CalcFloat( float *v1, float *v2, float *v3, float *n)
static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
{
/* real cross! */
- float n1[3],n2[3];
+ float n1[3], n2[3];
n1[0]= v1[0]-v3[0];
n1[1]= v1[1]-v3[1];
@@ -1512,7 +1512,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M)
{
- /* Collect forces and derivatives: F,dFdX,dFdV */
+ /* Collect forces and derivatives: F, dFdX, dFdV */
Cloth *cloth = clmd->clothObject;
unsigned int i = 0;
float spring_air = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */
@@ -1568,17 +1568,17 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
}
for (i = 0; i < cloth->numfaces; i++) {
- float trinormal[3]={0,0,0}; // normalized triangle normal
- float triunnormal[3]={0,0,0}; // not-normalized-triangle normal
- float tmp[3]={0,0,0};
+ float trinormal[3]={0, 0, 0}; // normalized triangle normal
+ float triunnormal[3]={0, 0, 0}; // not-normalized-triangle normal
+ float tmp[3]={0, 0, 0};
float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0;
factor *= 0.02;
// calculate face normal
if (mfaces[i].v4)
- CalcFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],triunnormal);
+ CalcFloat4(lX[mfaces[i].v1], lX[mfaces[i].v2], lX[mfaces[i].v3], lX[mfaces[i].v4], triunnormal);
else
- CalcFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],triunnormal);
+ CalcFloat(lX[mfaces[i].v1], lX[mfaces[i].v2], lX[mfaces[i].v3], triunnormal);
normalize_v3_v3(trinormal, triunnormal);
@@ -1608,9 +1608,9 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
/* Hair has only edges */
if (cloth->numfaces == 0) {
ClothSpring *spring;
- float edgevec[3]={0,0,0}; //edge vector
- float edgeunnormal[3]={0,0,0}; // not-normalized-edge normal
- float tmp[3]={0,0,0};
+ float edgevec[3]={0, 0, 0}; //edge vector
+ float edgeunnormal[3]={0, 0, 0}; // not-normalized-edge normal
+ float tmp[3]={0, 0, 0};
float factor = 0.01;
search = cloth->springs;
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 12f11a9dee1..e78da48d153 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -131,9 +131,9 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
}
co = vertexCos[0];
- for (w=0,wc=fw; w<wNew; w++,wc+=dw) {
- for (v=0,vc=fv; v<vNew; v++,vc+=dv) {
- for (u=0,uc=fu; u<uNew; u++,co+=3,uc+=du) {
+ for (w=0, wc=fw; w<wNew; w++, wc+=dw) {
+ for (v=0, vc=fv; v<vNew; v++, vc+=dv) {
+ for (u=0, uc=fu; u<uNew; u++, co+=3, uc+=du) {
co[0] = uc;
co[1] = vc;
co[2] = wc;
@@ -177,7 +177,7 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
bp= lt->def;
- for (i=0; i<lt->pntsu*lt->pntsv*lt->pntsw; i++,bp++) {
+ for (i=0; i<lt->pntsu*lt->pntsv*lt->pntsw; i++, bp++) {
copy_v3_v3(bp->vec, vertexCos[i]);
}
@@ -322,9 +322,9 @@ void init_latt_deform(Object *oblatt, Object *ob)
invert_m4_m4(imat, lt->latmat);
}
- for (w=0,fw=lt->fw; w<lt->pntsw; w++,fw+=lt->dw) {
- for (v=0,fv=lt->fv; v<lt->pntsv; v++, fv+=lt->dv) {
- for (u=0,fu=lt->fu; u<lt->pntsu; u++, bp++, co+=3, fp+=3, fu+=lt->du) {
+ for (w=0, fw=lt->fw; w<lt->pntsw; w++, fw+=lt->dw) {
+ for (v=0, fv=lt->fv; v<lt->pntsv; v++, fv+=lt->dv) {
+ for (u=0, fu=lt->fu; u<lt->pntsu; u++, bp++, co+=3, fp+=3, fu+=lt->du) {
if (dl) {
fp[0] = co[0] - fu;
fp[1] = co[1] - fv;
@@ -568,7 +568,7 @@ static int calc_curve_deform(Scene *scene, Object *par, float co[3],
/* this is not exactly the same as 2.4x, since the axis is having rotation removed rather than
* changing the axis before calculating the tilt but serves much the same purpose */
- float dir_flat[3]={0,0,0}, q[4];
+ float dir_flat[3]={0, 0, 0}, q[4];
copy_v3_v3(dir_flat, dir);
dir_flat[cd->no_rot_axis-1]= 0.0f;
@@ -774,7 +774,7 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target,
if (calc_curve_deform(scene, cuOb, vec, target->trackflag, &cd, quat)) {
float qmat[3][3];
- quat_to_mat3( qmat,quat);
+ quat_to_mat3(qmat, quat);
mul_m3_m3m3(mat, qmat, cd.objectspace3);
}
else
@@ -937,7 +937,7 @@ float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
if (lt->editlatt) lt= lt->editlatt->latt;
numVerts = *numVerts_r = lt->pntsu*lt->pntsv*lt->pntsw;
- vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
+ vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts, "lt_vcos");
for (i=0; i<numVerts; i++) {
copy_v3_v3(vertexCos[i], lt->def[i].vec);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 71266275fbd..4576df711e3 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1217,7 +1217,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
continue;
}
/* this format specifier is from hell... */
- BLI_snprintf(name, sizeof(id->name) - 2,"%s.%.3d", left, nr);
+ BLI_snprintf(name, sizeof(id->name) - 2, "%s.%.3d", left, nr);
return 1;
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 2dfd41f299a..95ec14e12fb 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1054,31 +1054,31 @@ int material_in_material(Material *parmat, Material *mat)
/* ****************** */
#if 0 /* UNUSED */
static char colname_array[125][20]= {
-"Black","DarkRed","HalfRed","Red","Red",
-"DarkGreen","DarkOlive","Brown","Chocolate","OrangeRed",
-"HalfGreen","GreenOlive","DryOlive","Goldenrod","DarkOrange",
-"LightGreen","Chartreuse","YellowGreen","Yellow","Gold",
-"Green","LawnGreen","GreenYellow","LightOlive","Yellow",
-"DarkBlue","DarkPurple","HotPink","VioletPink","RedPink",
-"SlateGray","DarkGrey","PalePurple","IndianRed","Tomato",
-"SeaGreen","PaleGreen","GreenKhaki","LightBrown","LightSalmon",
-"SpringGreen","PaleGreen","MediumOlive","YellowBrown","LightGold",
-"LightGreen","LightGreen","LightGreen","GreenYellow","PaleYellow",
-"HalfBlue","DarkSky","HalfMagenta","VioletRed","DeepPink",
-"SteelBlue","SkyBlue","Orchid","LightHotPink","HotPink",
-"SeaGreen","SlateGray","MediumGrey","Burlywood","LightPink",
-"SpringGreen","Aquamarine","PaleGreen","Khaki","PaleOrange",
-"SpringGreen","SeaGreen","PaleGreen","PaleWhite","YellowWhite",
-"LightBlue","Purple","MediumOrchid","Magenta","Magenta",
-"RoyalBlue","SlateBlue","MediumOrchid","Orchid","Magenta",
-"DeepSkyBlue","LightSteelBlue","LightSkyBlue","Violet","LightPink",
-"Cyan","DarkTurquoise","SkyBlue","Grey","Snow",
-"Mint","Mint","Aquamarine","MintCream","Ivory",
-"Blue","Blue","DarkMagenta","DarkOrchid","Magenta",
-"SkyBlue","RoyalBlue","LightSlateBlue","MediumOrchid","Magenta",
-"DodgerBlue","SteelBlue","MediumPurple","PalePurple","Plum",
-"DeepSkyBlue","PaleBlue","LightSkyBlue","PalePurple","Thistle",
-"Cyan","ColdBlue","PaleTurquoise","GhostWhite","White"
+"Black", "DarkRed", "HalfRed", "Red", "Red",
+"DarkGreen", "DarkOlive", "Brown", "Chocolate", "OrangeRed",
+"HalfGreen", "GreenOlive", "DryOlive", "Goldenrod", "DarkOrange",
+"LightGreen", "Chartreuse", "YellowGreen", "Yellow", "Gold",
+"Green", "LawnGreen", "GreenYellow", "LightOlive", "Yellow",
+"DarkBlue", "DarkPurple", "HotPink", "VioletPink", "RedPink",
+"SlateGray", "DarkGrey", "PalePurple", "IndianRed", "Tomato",
+"SeaGreen", "PaleGreen", "GreenKhaki", "LightBrown", "LightSalmon",
+"SpringGreen", "PaleGreen", "MediumOlive", "YellowBrown", "LightGold",
+"LightGreen", "LightGreen", "LightGreen", "GreenYellow", "PaleYellow",
+"HalfBlue", "DarkSky", "HalfMagenta", "VioletRed", "DeepPink",
+"SteelBlue", "SkyBlue", "Orchid", "LightHotPink", "HotPink",
+"SeaGreen", "SlateGray", "MediumGrey", "Burlywood", "LightPink",
+"SpringGreen", "Aquamarine", "PaleGreen", "Khaki", "PaleOrange",
+"SpringGreen", "SeaGreen", "PaleGreen", "PaleWhite", "YellowWhite",
+"LightBlue", "Purple", "MediumOrchid", "Magenta", "Magenta",
+"RoyalBlue", "SlateBlue", "MediumOrchid", "Orchid", "Magenta",
+"DeepSkyBlue", "LightSteelBlue", "LightSkyBlue", "Violet", "LightPink",
+"Cyan", "DarkTurquoise", "SkyBlue", "Grey", "Snow",
+"Mint", "Mint", "Aquamarine", "MintCream", "Ivory",
+"Blue", "Blue", "DarkMagenta", "DarkOrchid", "Magenta",
+"SkyBlue", "RoyalBlue", "LightSlateBlue", "MediumOrchid", "Magenta",
+"DodgerBlue", "SteelBlue", "MediumPurple", "PalePurple", "Plum",
+"DeepSkyBlue", "PaleBlue", "LightSkyBlue", "PalePurple", "Thistle",
+"Cyan", "ColdBlue", "PaleTurquoise", "GhostWhite", "White"
};
void automatname(Material *ma)
@@ -1316,13 +1316,13 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
break;
case MA_RAMP_HUE:
{
- float rH,rS,rV;
- float colH,colS,colV;
- float tmpr,tmpg,tmpb;
- rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
+ float rH, rS, rV;
+ float colH, colS, colV;
+ float tmpr, tmpg, tmpb;
+ rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
if (colS != 0) {
- rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
- hsv_to_rgb( colH , rS, rV, &tmpr, &tmpg, &tmpb);
+ rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
+ hsv_to_rgb(colH, rS, rV, &tmpr, &tmpg, &tmpb);
r_col[0] = facm*(r_col[0]) + fac*tmpr;
r_col[1] = facm*(r_col[1]) + fac*tmpg;
r_col[2] = facm*(r_col[2]) + fac*tmpb;
@@ -1331,33 +1331,33 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
break;
case MA_RAMP_SAT:
{
- float rH,rS,rV;
- float colH,colS,colV;
- rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
+ float rH, rS, rV;
+ float colH, colS, colV;
+ rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
if (rS != 0) {
- rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
- hsv_to_rgb( rH, (facm*rS +fac*colS), rV, r_col+0, r_col+1, r_col+2);
+ rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
+ hsv_to_rgb(rH, (facm*rS +fac*colS), rV, r_col+0, r_col+1, r_col+2);
}
}
break;
case MA_RAMP_VAL:
{
- float rH,rS,rV;
- float colH,colS,colV;
- rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
- rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
- hsv_to_rgb( rH, rS, (facm*rV +fac*colV), r_col+0, r_col+1, r_col+2);
+ float rH, rS, rV;
+ float colH, colS, colV;
+ rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
+ rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
+ hsv_to_rgb(rH, rS, (facm*rV +fac*colV), r_col+0, r_col+1, r_col+2);
}
break;
case MA_RAMP_COLOR:
{
- float rH,rS,rV;
- float colH,colS,colV;
- float tmpr,tmpg,tmpb;
- rgb_to_hsv(col[0],col[1],col[2],&colH,&colS,&colV);
+ float rH, rS, rV;
+ float colH, colS, colV;
+ float tmpr, tmpg, tmpb;
+ rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
if (colS != 0) {
- rgb_to_hsv(r_col[0],r_col[1],r_col[2],&rH,&rS,&rV);
- hsv_to_rgb( colH, colS, rV, &tmpr, &tmpg, &tmpb);
+ rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
+ hsv_to_rgb(colH, colS, rV, &tmpr, &tmpg, &tmpb);
r_col[0] = facm*(r_col[0]) + fac*tmpr;
r_col[1] = facm*(r_col[1]) + fac*tmpg;
r_col[2] = facm*(r_col[2]) + fac*tmpb;
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 73e3576b57f..0f2ac2dab30 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -142,7 +142,7 @@ typedef struct octal_node {
struct ListBase elems; /* ListBase of MetaElem pointers (ml_pointer) */
float x_min, y_min, z_min; /* 1st border point */
float x_max, y_max, z_max; /* 7th border point */
- float x,y,z; /* center of node */
+ float x, y, z; /* center of node */
int pos, neg; /* number of positive and negative MetaElements in the node */
int count; /* number of MetaElems, which belongs to the node */
} octal_node;
@@ -520,7 +520,7 @@ Object *BKE_metaball_basis_find(Scene *scene, Object *basis)
{
Scene *sce_iter= scene;
Base *base;
- Object *ob,*bob= basis;
+ Object *ob, *bob= basis;
MetaElem *ml=NULL;
int basisnr, obnr;
char basisname[MAX_ID_NAME], obname[MAX_ID_NAME];
@@ -614,10 +614,10 @@ Object *BKE_metaball_basis_find(Scene *scene, Object *basis)
#define HASHBIT (5)
#define HASHSIZE (size_t)(1<<(3*HASHBIT)) /*! < hash table size (32768) */
-#define HASH(i,j,k) ((((( (i) & 31)<<5) | ( (j) & 31))<<5 ) | ( (k) & 31) )
+#define HASH(i, j, k) ((((( (i) & 31)<<5) | ( (j) & 31))<<5 ) | ( (k) & 31) )
#define MB_BIT(i, bit) (((i)>>(bit))&1)
-#define FLIP(i,bit) ((i)^1<<(bit)) /* flip the given bit of i */
+#define FLIP(i, bit) ((i)^1<<(bit)) /* flip the given bit of i */
/* **************** POLYGONIZATION ************************ */
@@ -713,13 +713,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
if (y < node->y) {
if (x < node->x) {
if (node->nodes[0])
- return find_metaball_octal_node(node->nodes[0],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[0], x, y, z, depth--);
else
return node;
}
else {
if (node->nodes[1])
- return find_metaball_octal_node(node->nodes[1],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[1], x, y, z, depth--);
else
return node;
}
@@ -727,13 +727,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
else {
if (x < node->x) {
if (node->nodes[3])
- return find_metaball_octal_node(node->nodes[3],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[3], x, y, z, depth--);
else
return node;
}
else {
if (node->nodes[2])
- return find_metaball_octal_node(node->nodes[2],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[2], x, y, z, depth--);
else
return node;
}
@@ -743,13 +743,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
if (y < node->y) {
if (x < node->x) {
if (node->nodes[4])
- return find_metaball_octal_node(node->nodes[4],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[4], x, y, z, depth--);
else
return node;
}
else {
if (node->nodes[5])
- return find_metaball_octal_node(node->nodes[5],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[5], x, y, z, depth--);
else
return node;
}
@@ -757,13 +757,13 @@ static octal_node* find_metaball_octal_node(octal_node *node, float x, float y,
else {
if (x < node->x) {
if (node->nodes[7])
- return find_metaball_octal_node(node->nodes[7],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[7], x, y, z, depth--);
else
return node;
}
else {
if (node->nodes[6])
- return find_metaball_octal_node(node->nodes[6],x,y,z,depth--);
+ return find_metaball_octal_node(node->nodes[6], x, y, z, depth--);
else
return node;
}
@@ -919,9 +919,9 @@ static INTLISTS *cubetable[256];
/* edge: LB, LT, LN, LF, RB, RT, RN, RF, BN, BF, TN, TF */
static int corner1[12] = {
- LBN,LTN,LBN,LBF,RBN,RTN,RBN,RBF,LBN,LBF,LTN,LTF};
+ LBN, LTN, LBN, LBF, RBN, RTN, RBN, RBF, LBN, LBF, LTN, LTF};
static int corner2[12] = {
- LBF,LTF,LTN,LTF,RBF,RTF,RTN,RTF,RBN,RBF,RTN,RTF};
+ LBF, LTF, LTN, LTF, RBF, RTF, RTN, RTF, RBN, RBF, RTN, RTF};
static int leftface[12] = {
B, L, L, F, R, T, N, R, N, B, T, F};
/* face on left when going corner1 to corner2 */
@@ -1197,7 +1197,7 @@ void BKE_metaball_cubeTable_free(void)
/**** Storage ****/
-/* setcenter: set (i,j,k) entry of table[]
+/* setcenter: set (i, j, k) entry of table[]
* return 1 if already set; otherwise, set and return 0 */
static int setcenter(CENTERLIST *table[], int i, int j, int k)
@@ -1405,7 +1405,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
int i = 0;
MB_POINT pos, neg;
float positive = 0.0f, negative = 0.0f;
- float dx = 0.0f ,dy = 0.0f ,dz = 0.0f;
+ float dx = 0.0f, dy = 0.0f, dz = 0.0f;
if (v1 < 0) {
pos= *p2;
@@ -1453,7 +1453,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
while (1) {
if (i++ == RES) return;
p->x = 0.5f*(pos.x + neg.x);
- if ((function(p->x,p->y,p->z)) > 0.0f) pos.x = p->x; else neg.x = p->x;
+ if ((function(p->x, p->y, p->z)) > 0.0f) pos.x = p->x; else neg.x = p->x;
}
}
@@ -1463,7 +1463,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
while (1) {
if (i++ == RES) return;
p->y = 0.5f*(pos.y + neg.y);
- if ((function(p->x,p->y,p->z)) > 0.0f) pos.y = p->y; else neg.y = p->y;
+ if ((function(p->x, p->y, p->z)) > 0.0f) pos.y = p->y; else neg.y = p->y;
}
}
@@ -1473,7 +1473,7 @@ static void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
while (1) {
if (i++ == RES) return;
p->z = 0.5f*(pos.z + neg.z);
- if ((function(p->x,p->y,p->z)) > 0.0f) pos.z = p->z; else neg.z = p->z;
+ if ((function(p->x, p->y, p->z)) > 0.0f) pos.z = p->z; else neg.z = p->z;
}
}
@@ -1523,7 +1523,7 @@ static void add_cube(PROCESS *mbproc, int i, int j, int k, int count)
/* set corners of initial cube: */
for (n = 0; n < 8; n++)
- ncube->cube.corners[n] = setcorner(mbproc, a+MB_BIT(n,2), b+MB_BIT(n,1), c+MB_BIT(n,0));
+ ncube->cube.corners[n] = setcorner(mbproc, a+MB_BIT(n, 2), b+MB_BIT(n, 1), c+MB_BIT(n, 0));
}
}
}
@@ -1534,7 +1534,7 @@ static void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
MB_POINT IN, in, OUT, out; /*point;*/
MetaElem *ml;
int i, j, k, c_i, c_j, c_k;
- int index[3]={1,0,-1};
+ int index[3]={1, 0, -1};
float f =0.0f;
float in_v /*, out_v*/;
MB_POINT workp;
@@ -1610,7 +1610,7 @@ static void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
ny = abs((out.y - in.y)/mbproc->size);
nz = abs((out.z - in.z)/mbproc->size);
- MAXN = MAX3(nx,ny,nz);
+ MAXN = MAX3(nx, ny, nz);
if (MAXN!=0.0f) {
dx = (out.x - in.x)/MAXN;
dy = (out.y - in.y)/MAXN;
@@ -1774,7 +1774,7 @@ static float init_meta(Scene *scene, Object *ob) /* return totsize */
if (ml->s > 10.0f) ml->s = 10.0f;
/* Rotation of MetaElem is stored in quat */
- quat_to_mat4( temp3,ml->quat);
+ quat_to_mat4( temp3, ml->quat);
/* Translation of MetaElem */
unit_m4(temp2);
@@ -1798,7 +1798,7 @@ static float init_meta(Scene *scene, Object *ob) /* return totsize */
/* MetaBall transformation */
mult_m4_m4m4(mat, temp2, temp1);
- invert_m4_m4(imat,mat);
+ invert_m4_m4(imat, mat);
mainb[a]->rad2= ml->rad*ml->rad;
@@ -1951,12 +1951,12 @@ static void subdivide_metaball_octal_node(octal_node *node, float size_x, float
{
MetaElem *ml;
ml_pointer *ml_p;
- float x,y,z;
- int a,i;
+ float x, y, z;
+ int a, i;
/* create new nodes */
for (a=0;a<8;a++) {
- node->nodes[a]= MEM_mallocN(sizeof(octal_node),"octal_node");
+ node->nodes[a]= MEM_mallocN(sizeof(octal_node), "octal_node");
for (i=0;i<8;i++)
node->nodes[a]->nodes[i]= NULL;
node->nodes[a]->parent= node;
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 12aa6232cb0..98cbc957201 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -296,7 +296,7 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCag
}
/* Find the last modifier acting on the cage. */
- for (i=0; md; i++,md=md->next) {
+ for (i=0; md; i++, md=md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
md->scene= scene;
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index d548d7589bb..14db68e434a 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -462,7 +462,7 @@ MovieClip *BKE_movieclip_file_add(const char *name)
BLI_path_abs(str, G.main->name);
/* exists? */
- file = BLI_open(str, O_BINARY|O_RDONLY,0);
+ file = BLI_open(str, O_BINARY | O_RDONLY, 0);
if (file == -1)
return NULL;
close(file);
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index d7212e5eaf9..f3901cec506 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -747,7 +747,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
copy_v3_v3(origco[i], me->mvert[i].co);
for (i = 0; i < me->totvert; ++i) {
- float avg_no[3] = {0,0,0}, center[3] = {0,0,0}, push[3];
+ float avg_no[3] = {0, 0, 0}, center[3] = {0, 0, 0}, push[3];
float dist;
int tot = 0;
@@ -942,7 +942,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm
MPoly *mpoly = me->mpoly;
MDisps *mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
int *gridOffset;
- int i, k, /*numGrids,*/ gridSize, dGridSize, dSkip;
+ int i, k, /*numGrids, */ gridSize, dGridSize, dSkip;
int totloop, totpoly;
/* this happens in the dm made by bmesh_mdisps_space_set */
@@ -1545,9 +1545,9 @@ void multires_free(Multires *mr)
}
static void create_old_vert_face_map(ListBase **map, IndexNode **mem, const MultiresFace *mface,
- const int totvert, const int totface)
+ const int totvert, const int totface)
{
- int i,j;
+ int i, j;
IndexNode *node = NULL;
(*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert face map");
@@ -1566,7 +1566,7 @@ static void create_old_vert_face_map(ListBase **map, IndexNode **mem, const Mult
static void create_old_vert_edge_map(ListBase **map, IndexNode **mem, const MultiresEdge *medge,
const int totvert, const int totedge)
{
- int i,j;
+ int i, j;
IndexNode *node = NULL;
(*map) = MEM_callocN(sizeof(ListBase) * totvert, "vert edge map");
@@ -2043,7 +2043,7 @@ static void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3])
/* MLoop *mloop = me->mloop; */ /* UNUSED */
MDisps *mdisps;
int *gridOffset;
- int i, /*numGrids,*/ gridSize, dGridSize, dSkip, totvert;
+ int i, /*numGrids, */ gridSize, dGridSize, dSkip, totvert;
float (*vertCos)[3] = NULL;
MultiresModifierData *mmd= get_multires_modifier(scene, ob, 1);
MultiresModifierData high_mmd;
diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c
index 23d2f50c3f7..24382b3bf91 100644
--- a/source/blender/blenkernel/intern/navmesh_conversion.c
+++ b/source/blender/blenkernel/intern/navmesh_conversion.c
@@ -86,8 +86,8 @@ float distPointToSegmentSq(const float* point, const float* a, const float* b)
float abx[3], dx[3];
float d, t;
- sub_v3_v3v3(abx, b,a);
- sub_v3_v3v3(dx, point,a);
+ sub_v3_v3v3(abx, b, a);
+ sub_v3_v3v3(dx, point, a);
d = abx[0]*abx[0]+abx[2]*abx[2];
t = abx[0]*dx[0]+abx[2]*dx[2];
@@ -447,7 +447,7 @@ int buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int *vertsPerPoly,
}
res = buildNavMeshData(*nverts, *verts, ntris, tris, recastData, *trisToFacesMap,
- ndtris, dtris, npolys, dmeshes,polys, vertsPerPoly,
+ ndtris, dtris, npolys, dmeshes, polys, vertsPerPoly,
dtrisToPolysMap, dtrisToTrisMap);
if (!res) {
printf("Converting navmesh: Error! Can't get vertices and indices from mesh\n");
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 2fb3f81b147..b2a85ad0629 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -141,8 +141,8 @@ void ntreeInitTypes(bNodeTree *ntree)
/* needed info if the pynode script fails now: */
node->storage= ntree;
if (node->id!=NULL) { /* not an empty script node */
- node->custom1= 0;
- node->custom1= BSET(node->custom1,NODE_DYNAMIC_ADDEXIST);
+ node->custom1 = 0;
+ node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ADDEXIST);
}
// if (node->typeinfo)
// node->typeinfo->initfunc(node);
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 3ffd8115914..474d1e5b442 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -162,9 +162,9 @@ void object_free_particlesystems(Object *ob)
while (ob->particlesystem.first) {
ParticleSystem *psys = ob->particlesystem.first;
- BLI_remlink(&ob->particlesystem,psys);
+ BLI_remlink(&ob->particlesystem, psys);
- psys_free(ob,psys);
+ psys_free(ob, psys);
}
}
@@ -541,7 +541,7 @@ void unlink_object(Object *ob)
BoidParticle *bpa;
int p;
- for (p=0,pa=tpsys->particles; p<tpsys->totpart; p++,pa++) {
+ for (p=0, pa=tpsys->particles; p<tpsys->totpart; p++, pa++) {
bpa = pa->boid;
if (bpa->ground == ob)
bpa->ground = NULL;
@@ -1326,7 +1326,7 @@ void object_copy_proxy_drivers(Object *ob, Object *target)
if ((Object *)dtar->id == target)
dtar->id= (ID *)ob;
else {
- /* only on local objects because this causes indirect links a -> b -> c,blend to point directly to a.blend
+ /* only on local objects because this causes indirect links a -> b -> c, blend to point directly to a.blend
* when a.blend has a proxy thats linked into c.blend */
if (ob->id.lib==NULL)
id_lib_extern((ID *)dtar->id);
@@ -1445,7 +1445,7 @@ void object_scale_to_mat3(Object *ob, float mat[][3])
{
float vec[3];
mul_v3_v3v3(vec, ob->size, ob->dscale);
- size_to_mat3( mat,vec);
+ size_to_mat3(mat, vec);
}
void object_rot_to_mat3(Object *ob, float mat[][3])
@@ -1692,12 +1692,12 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
/* vec: 4 items! */
- if ( where_on_path(par, ctime, vec, dir, cu->flag & CU_FOLLOW ? quat:NULL, &radius, NULL) ) {
+ if (where_on_path(par, ctime, vec, dir, cu->flag & CU_FOLLOW ? quat:NULL, &radius, NULL)) {
if (cu->flag & CU_FOLLOW) {
#if 0
float x1, q[4];
- vec_to_quat( quat,dir, ob->trackflag, ob->upflag);
+ vec_to_quat(quat, dir, ob->trackflag, ob->upflag);
/* the tilt */
normalize_v3(dir);
@@ -1801,7 +1801,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
}
if (count==0) {
- /* keep as 0,0,0 */
+ /* keep as 0, 0, 0 */
}
else if (count > 0) {
mul_v3_fl(vec, 1.0f / count);
@@ -1896,8 +1896,8 @@ static void ob_parvert3(Object *ob, Object *par, float mat[][4])
give_parvert(par, ob->par2, v2);
give_parvert(par, ob->par3, v3);
- tri_to_quat( q,v1, v2, v3);
- quat_to_mat3( cmat,q);
+ tri_to_quat(q, v1, v2, v3);
+ quat_to_mat3(cmat, q);
copy_m4_m3(mat, cmat);
if (ob->type==OB_CURVE) {
@@ -1918,7 +1918,7 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[
int a;
// include framerate
- fac1= ( 1.0f / (1.0f + fabsf(ob->sf)) );
+ fac1= (1.0f / (1.0f + fabsf(ob->sf)) );
if (fac1 >= 1.0f) return 0;
fac2= 1.0f-fac1;
@@ -2030,7 +2030,7 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
case PAROBJECT:
ok= 0;
if (par->type==OB_CURVE) {
- if ( ((Curve *)par->data)->flag & CU_PATH ) {
+ if (((Curve *)par->data)->flag & CU_PATH ) {
ob_parcurve(scene, ob, par, tmat);
ok= 1;
}
@@ -2083,7 +2083,7 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
copy_m3_m4(originmat, tmat);
// origin, voor help line
- if ( (ob->partype & PARTYPE)==PARSKEL ) {
+ if ((ob->partype & PARTYPE)==PARSKEL ) {
copy_v3_v3(ob->orig, par->obmat[3]);
}
else {
@@ -2169,7 +2169,7 @@ void what_does_parent(Scene *scene, Object *ob, Object *workob)
BoundBox *unit_boundbox(void)
{
BoundBox *bb;
- float min[3] = {-1.0f,-1.0f,-1.0f}, max[3] = {-1.0f,-1.0f,-1.0f};
+ float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {-1.0f, -1.0f, -1.0f};
bb= MEM_callocN(sizeof(BoundBox), "OB-BoundBox");
boundbox_set_from_min_max(bb, min, max);
@@ -2197,7 +2197,7 @@ BoundBox *object_get_boundbox(Object *ob)
bb = mesh_get_bb(ob);
}
else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
- bb= ob->bb ? ob->bb : ( (Curve *)ob->data )->bb;
+ bb= ob->bb ? ob->bb : ((Curve *)ob->data )->bb;
}
else if (ob->type==OB_MBALL) {
bb= ob->bb;
@@ -2223,7 +2223,7 @@ void object_get_dimensions(Object *ob, float vec[3])
if (bb) {
float scale[3];
- mat4_to_size( scale,ob->obmat);
+ mat4_to_size(scale, ob->obmat);
vec[0] = fabsf(scale[0]) * (bb->vec[4][0] - bb->vec[0][0]);
vec[1] = fabsf(scale[1]) * (bb->vec[2][1] - bb->vec[0][1]);
@@ -2242,7 +2242,7 @@ void object_set_dimensions(Object *ob, const float *value)
if (bb) {
float scale[3], len[3];
- mat4_to_size( scale,ob->obmat);
+ mat4_to_size(scale, ob->obmat);
len[0] = bb->vec[4][0] - bb->vec[0][0];
len[1] = bb->vec[2][1] - bb->vec[0][1];
@@ -2644,7 +2644,7 @@ void object_handle_update(Scene *scene, Object *ob)
else if (psys->flag & PSYS_DELETE) {
tpsys=psys->next;
BLI_remlink(&ob->particlesystem, psys);
- psys_free(ob,psys);
+ psys_free(ob, psys);
psys= tpsys;
}
else
@@ -2896,7 +2896,7 @@ static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, int
int newkey= 0;
if (key==NULL) {
- key= lt->key= add_key( (ID *)lt);
+ key= lt->key= add_key((ID *)lt);
key->type= KEY_RELATIVE;
newkey= 1;
}
@@ -2934,7 +2934,7 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int
int newkey= 0;
if (key==NULL) {
- key= cu->key= add_key( (ID *)cu);
+ key= cu->key= add_key((ID *)cu);
key->type = KEY_RELATIVE;
newkey= 1;
}
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index 5ba1b3d86c3..4ddcd6f4b51 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -172,12 +172,12 @@ static float gaussRand (void)
/**
* Some useful functions
* */
-MINLINE float lerp(float a,float b,float f)
+MINLINE float lerp(float a, float b, float f)
{
return a + (b-a)*f;
}
-MINLINE float catrom(float p0,float p1,float p2,float p3,float f)
+MINLINE float catrom(float p0, float p1, float p2, float p3, float f)
{
return 0.5f *((2.0f * p1) +
(-p0 + p2) * f +
@@ -191,7 +191,7 @@ MINLINE float omega(float k, float depth)
}
// modified Phillips spectrum
-static float Ph(struct Ocean* o, float kx,float kz )
+static float Ph(struct Ocean* o, float kx, float kz )
{
float tmp;
float k2 = kx*kx + kz*kz;
@@ -206,12 +206,12 @@ static float Ph(struct Ocean* o, float kx,float kz )
tmp *= o->_damp_reflections;
}
- return o->_A * expf( -1.0f / (k2*(o->_L*o->_L))) * expf(-k2 * (o->_l*o->_l)) * powf(fabsf(tmp),o->_wind_alignment) / (k2*k2);
+ return o->_A * expf( -1.0f / (k2*(o->_L*o->_L))) * expf(-k2 * (o->_l*o->_l)) * powf(fabsf(tmp), o->_wind_alignment) / (k2*k2);
}
-static void compute_eigenstuff(struct OceanResult *ocr, float jxx,float jzz,float jxz)
+static void compute_eigenstuff(struct OceanResult *ocr, float jxx, float jzz, float jxz)
{
- float a,b,qplus,qminus;
+ float a, b, qplus, qminus;
a = jxx + jzz;
b = sqrt((jxx - jzz)*(jxx - jzz) + 4 * jxz * jxz);
@@ -304,15 +304,15 @@ float BKE_ocean_jminus_to_foam(float jminus, float coverage)
return foam*foam;
}
-void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u,float v)
+void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u, float v)
{
- int i0,i1,j0,j1;
- float frac_x,frac_z;
- float uu,vv;
+ int i0, i1, j0, j1;
+ float frac_x, frac_z;
+ float uu, vv;
- // first wrap the texture so 0 <= (u,v) < 1
- u = fmodf(u,1.0f);
- v = fmodf(v,1.0f);
+ // first wrap the texture so 0 <= (u, v) < 1
+ u = fmodf(u, 1.0f);
+ v = fmodf(v, 1.0f);
if (u < 0) u += 1.0f;
if (v < 0) v += 1.0f;
@@ -338,7 +338,7 @@ void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u,float
j1 = j1 % oc->_N;
-#define BILERP(m) (lerp(lerp(m[i0*oc->_N+j0],m[i1*oc->_N+j0],frac_x),lerp(m[i0*oc->_N+j1],m[i1*oc->_N+j1],frac_x),frac_z))
+#define BILERP(m) (lerp(lerp(m[i0*oc->_N+j0], m[i1*oc->_N+j0], frac_x), lerp(m[i0*oc->_N+j1], m[i1*oc->_N+j1], frac_x), frac_z))
{
if (oc->_do_disp_y) {
ocr->disp[1] = BILERP(oc->_disp_y);
@@ -360,7 +360,7 @@ void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u,float
}
if (oc->_do_jacobian) {
- compute_eigenstuff(ocr, BILERP(oc->_Jxx),BILERP(oc->_Jzz),BILERP(oc->_Jxz));
+ compute_eigenstuff(ocr, BILERP(oc->_Jxx), BILERP(oc->_Jzz), BILERP(oc->_Jxz));
}
}
#undef BILERP
@@ -369,15 +369,15 @@ void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u,float
}
// use catmullrom interpolation rather than linear
-void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u,float v)
+void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u, float v)
{
- int i0,i1,i2,i3,j0,j1,j2,j3;
- float frac_x,frac_z;
- float uu,vv;
+ int i0, i1, i2, i3, j0, j1, j2, j3;
+ float frac_x, frac_z;
+ float uu, vv;
- // first wrap the texture so 0 <= (u,v) < 1
- u = fmod(u,1.0f);
- v = fmod(v,1.0f);
+ // first wrap the texture so 0 <= (u, v) < 1
+ u = fmod(u, 1.0f);
+ v = fmod(v, 1.0f);
if (u < 0) u += 1.0f;
if (v < 0) v += 1.0f;
@@ -412,10 +412,10 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
j0 = j0 < 0 ? j0 + oc->_N : j0;
j3 = j3 >= oc->_N ? j3 - oc->_N : j3;
-#define INTERP(m) catrom(catrom(m[i0*oc->_N+j0],m[i1*oc->_N+j0],m[i2*oc->_N+j0],m[i3*oc->_N+j0],frac_x),\
- catrom(m[i0*oc->_N+j1],m[i1*oc->_N+j1],m[i2*oc->_N+j1],m[i3*oc->_N+j1],frac_x),\
- catrom(m[i0*oc->_N+j2],m[i1*oc->_N+j2],m[i2*oc->_N+j2],m[i3*oc->_N+j2],frac_x),\
- catrom(m[i0*oc->_N+j3],m[i1*oc->_N+j3],m[i2*oc->_N+j3],m[i3*oc->_N+j3],frac_x),\
+#define INTERP(m) catrom(catrom(m[i0*oc->_N+j0], m[i1*oc->_N+j0], m[i2*oc->_N+j0], m[i3*oc->_N+j0], frac_x), \
+ catrom(m[i0*oc->_N+j1], m[i1*oc->_N+j1], m[i2*oc->_N+j1], m[i3*oc->_N+j1], frac_x), \
+ catrom(m[i0*oc->_N+j2], m[i1*oc->_N+j2], m[i2*oc->_N+j2], m[i3*oc->_N+j2], frac_x), \
+ catrom(m[i0*oc->_N+j3], m[i1*oc->_N+j3], m[i2*oc->_N+j3], m[i3*oc->_N+j3], frac_x), \
frac_z)
{
@@ -437,7 +437,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
}
if (oc->_do_jacobian) {
- compute_eigenstuff(ocr, INTERP(oc->_Jxx),INTERP(oc->_Jzz),INTERP(oc->_Jxz));
+ compute_eigenstuff(ocr, INTERP(oc->_Jxx), INTERP(oc->_Jzz), INTERP(oc->_Jxz));
}
}
#undef INTERP
@@ -446,20 +446,20 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
}
-void BKE_ocean_eval_xz(struct Ocean *oc, struct OceanResult *ocr, float x,float z)
+void BKE_ocean_eval_xz(struct Ocean *oc, struct OceanResult *ocr, float x, float z)
{
- BKE_ocean_eval_uv(oc, ocr, x/oc->_Lx,z/oc->_Lz);
+ BKE_ocean_eval_uv(oc, ocr, x/oc->_Lx, z/oc->_Lz);
}
-void BKE_ocean_eval_xz_catrom(struct Ocean *oc, struct OceanResult *ocr, float x,float z)
+void BKE_ocean_eval_xz_catrom(struct Ocean *oc, struct OceanResult *ocr, float x, float z)
{
- BKE_ocean_eval_uv_catrom(oc, ocr, x/oc->_Lx,z/oc->_Lz);
+ BKE_ocean_eval_uv_catrom(oc, ocr, x/oc->_Lx, z/oc->_Lz);
}
-// note that this doesn't wrap properly for i,j < 0, but its
+// note that this doesn't wrap properly for i, j < 0, but its
// not really meant for that being just a way to get the raw data out
// to save in some image format.
-void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i,int j)
+void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i, int j)
{
BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_READ);
@@ -486,7 +486,7 @@ void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i,int j)
}
if (oc->_do_jacobian) {
- compute_eigenstuff(ocr, oc->_Jxx[i*oc->_N+j],oc->_Jzz[i*oc->_N+j],oc->_Jxz[i*oc->_N+j]);
+ compute_eigenstuff(ocr, oc->_Jxx[i*oc->_N+j], oc->_Jzz[i*oc->_N+j], oc->_Jxz[i*oc->_N+j]);
}
BLI_rw_mutex_unlock(&oc->oceanmutex);
@@ -511,8 +511,8 @@ void BKE_simulate_ocean(struct Ocean *o, float t, float scale, float chop_amount
fftw_complex conj_param;
- init_complex(exp_param1, 0.0, omega(o->_k[i*(1+o->_N/2)+j],o->_depth)*t);
- init_complex(exp_param2, 0.0, -omega(o->_k[i*(1+o->_N/2)+j],o->_depth)*t);
+ init_complex(exp_param1, 0.0, omega(o->_k[i*(1+o->_N/2)+j], o->_depth)*t);
+ init_complex(exp_param2, 0.0, -omega(o->_k[i*(1+o->_N/2)+j], o->_depth)*t);
exp_complex(exp_param1, exp_param1);
exp_complex(exp_param2, exp_param2);
conj_complex(conj_param, o->_h0_minus[i*o->_N+j]);
@@ -710,7 +710,7 @@ static void set_height_normalize_factor(struct Ocean *oc)
float res = 1.0;
float max_h = 0.0;
- int i,j;
+ int i, j;
if (!oc->_do_disp_y) return;
@@ -746,10 +746,10 @@ struct Ocean *BKE_add_ocean(void)
return oc;
}
-void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, float l, float A, float w, float damp,
+void BKE_init_ocean(struct Ocean* o, int M, int N, float Lx, float Lz, float V, float l, float A, float w, float damp,
float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed)
{
- int i,j,ii;
+ int i, j, ii;
BLI_rw_mutex_lock(&o->oceanmutex, THREAD_LOCK_WRITE);
@@ -792,7 +792,7 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
o->_kx[i] = 2.0f * (float)M_PI * i / o->_Lx;
// the -ve components
- for (i = o->_M-1,ii=0 ; i > o->_M/2 ; --i,++ii)
+ for (i = o->_M-1, ii=0 ; i > o->_M/2 ; --i, ++ii)
o->_kx[i] = -2.0f * (float)M_PI * ii / o->_Lx;
// the +ve components and DC
@@ -800,7 +800,7 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
o->_kz[i] = 2.0f * (float)M_PI * i / o->_Lz;
// the -ve components
- for (i = o->_N-1,ii=0 ; i > o->_N/2 ; --i,++ii)
+ for (i = o->_N-1, ii=0 ; i > o->_N/2 ; --i, ++ii)
o->_kz[i] = -2.0f * (float)M_PI * ii / o->_Lz;
// pre-calculate the k matrix
@@ -819,7 +819,7 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
fftw_complex r1r2;
init_complex(r1r2, r1, r2);
mul_complex_f(o->_h0[i*o->_N+j], r1r2, (float)(sqrt(Ph(o, o->_kx[i], o->_kz[j]) / 2.0f)));
- mul_complex_f(o->_h0_minus[i*o->_N+j], r1r2, (float)(sqrt(Ph(o, -o->_kx[i],-o->_kz[j]) / 2.0f)));
+ mul_complex_f(o->_h0_minus[i*o->_N+j], r1r2, (float)(sqrt(Ph(o, -o->_kx[i], -o->_kz[j]) / 2.0f)));
}
}
@@ -828,7 +828,7 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
if (o->_do_disp_y) {
o->_disp_y = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_disp_y");
- o->_disp_y_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in, o->_disp_y, FFTW_ESTIMATE);
+ o->_disp_y_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in, o->_disp_y, FFTW_ESTIMATE);
}
if (o->_do_normals) {
@@ -839,8 +839,8 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
/*o->_N_y = (float*) fftwf_malloc(o->_M * o->_N * sizeof(float)); (MEM01)*/
o->_N_z = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_N_z");
- o->_N_x_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_nx, o->_N_x, FFTW_ESTIMATE);
- o->_N_z_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_nz, o->_N_z, FFTW_ESTIMATE);
+ o->_N_x_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_nx, o->_N_x, FFTW_ESTIMATE);
+ o->_N_z_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_nz, o->_N_z, FFTW_ESTIMATE);
}
if (o->_do_chop) {
@@ -850,8 +850,8 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
o->_disp_x = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_disp_x");
o->_disp_z = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_disp_z");
- o->_disp_x_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_x, o->_disp_x, FFTW_ESTIMATE);
- o->_disp_z_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_z, o->_disp_z, FFTW_ESTIMATE);
+ o->_disp_x_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_x, o->_disp_x, FFTW_ESTIMATE);
+ o->_disp_z_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_z, o->_disp_z, FFTW_ESTIMATE);
}
if (o->_do_jacobian) {
o->_fft_in_jxx = (fftw_complex*) MEM_mallocN(o->_M * (1+o->_N/2) * sizeof(fftw_complex), "ocean_fft_in_jxx");
@@ -862,9 +862,9 @@ void BKE_init_ocean(struct Ocean* o, int M,int N, float Lx, float Lz, float V, f
o->_Jzz = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_Jzz");
o->_Jxz = (double*) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_Jxz");
- o->_Jxx_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_jxx, o->_Jxx, FFTW_ESTIMATE);
- o->_Jzz_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_jzz, o->_Jzz, FFTW_ESTIMATE);
- o->_Jxz_plan = fftw_plan_dft_c2r_2d(o->_M,o->_N, o->_fft_in_jxz, o->_Jxz, FFTW_ESTIMATE);
+ o->_Jxx_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_jxx, o->_Jxx, FFTW_ESTIMATE);
+ o->_Jzz_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_jzz, o->_Jzz, FFTW_ESTIMATE);
+ o->_Jxz_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_jxz, o->_Jxz, FFTW_ESTIMATE);
}
BLI_rw_mutex_unlock(&o->oceanmutex);
@@ -1192,7 +1192,7 @@ void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v
if (o->_do_jacobian) {
/* TODO, cleanup unused code - campbell */
- float /*r,*/ /* UNUSED */ pr=0.0f, foam_result;
+ float /*r, */ /* UNUSED */ pr=0.0f, foam_result;
float neg_disp, neg_eplus;
ocr.foam = BKE_ocean_jminus_to_foam(ocr.Jminus, och->foam_coverage);
@@ -1298,24 +1298,24 @@ float BKE_ocean_jminus_to_foam(float UNUSED(jminus), float UNUSED(coverage))
return 0.0f;
}
-void BKE_ocean_eval_uv(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(u),float UNUSED(v))
+void BKE_ocean_eval_uv(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(u), float UNUSED(v))
{
}
// use catmullrom interpolation rather than linear
-void BKE_ocean_eval_uv_catrom(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(u),float UNUSED(v))
+void BKE_ocean_eval_uv_catrom(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(u), float UNUSED(v))
{
}
-void BKE_ocean_eval_xz(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(x),float UNUSED(z))
+void BKE_ocean_eval_xz(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(x), float UNUSED(z))
{
}
-void BKE_ocean_eval_xz_catrom(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(x),float UNUSED(z))
+void BKE_ocean_eval_xz_catrom(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), float UNUSED(x), float UNUSED(z))
{
}
-void BKE_ocean_eval_ij(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), int UNUSED(i),int UNUSED(j))
+void BKE_ocean_eval_ij(struct Ocean *UNUSED(oc), struct OceanResult *UNUSED(ocr), int UNUSED(i), int UNUSED(j))
{
}
@@ -1330,7 +1330,7 @@ struct Ocean *BKE_add_ocean(void)
return oc;
}
-void BKE_init_ocean(struct Ocean* UNUSED(o), int UNUSED(M),int UNUSED(N), float UNUSED(Lx), float UNUSED(Lz), float UNUSED(V), float UNUSED(l), float UNUSED(A), float UNUSED(w), float UNUSED(damp),
+void BKE_init_ocean(struct Ocean* UNUSED(o), int UNUSED(M), int UNUSED(N), float UNUSED(Lx), float UNUSED(Lz), float UNUSED(V), float UNUSED(l), float UNUSED(A), float UNUSED(w), float UNUSED(damp),
float UNUSED(alignment), float UNUSED(depth), float UNUSED(time), short UNUSED(do_height_field), short UNUSED(do_chop), short UNUSED(do_normals), short UNUSED(do_jacobian), int UNUSED(seed))
{
}
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index e0c61fbcc90..3b5b4b766fb 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -189,7 +189,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
// open the file
// and create a PackedFile structure
- file= BLI_open(name, O_BINARY|O_RDONLY,0);
+ file= BLI_open(name, O_BINARY|O_RDONLY, 0);
if (file <= 0) {
BKE_reportf(reports, RPT_ERROR, "Unable to pack file, source path not found: \"%s\"", name);
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index febe4277010..b6136e8e83b 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -549,7 +549,7 @@ void psys_free(Object *ob, ParticleSystem * psys)
// check if we are last non-visible particle system
for (tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
if (tpsys->part) {
- if (ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) {
+ if (ELEM(tpsys->part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
nr++;
break;
}
@@ -637,7 +637,7 @@ static float psys_render_projected_area(ParticleSystem *psys, const float center
/* compute two vectors orthogonal to view vector */
normalize_v3_v3(view, co);
- ortho_basis_v3v3_v3( ortho1, ortho2,view);
+ ortho_basis_v3v3_v3(ortho1, ortho2, view);
/* compute on screen minification */
w= co[2]*data->winmat[2][3] + data->winmat[3][3];
@@ -1024,7 +1024,7 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic
float t[4];
if (type<0) {
- interp_cubic_v3( result->co, result->vel,keys[1].co, keys[1].vel, keys[2].co, keys[2].vel, dt);
+ interp_cubic_v3( result->co, result->vel, keys[1].co, keys[1].vel, keys[2].co, keys[2].vel, dt);
}
else {
key_curve_position_weights(dt, t, type);
@@ -1357,13 +1357,13 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
invdt = dfra * 0.04f * (psys ? psys->part->timetweak : 1.f);
mul_v3_fl(keys[1].vel, invdt);
mul_v3_fl(keys[2].vel, invdt);
- interp_qt_qtqt(result->rot,keys[1].rot,keys[2].rot,keytime);
+ interp_qt_qtqt(result->rot, keys[1].rot, keys[2].rot, keytime);
}
- /* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/
+ /* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0, 1]->[k2, k3] (k1 & k4 used for cardinal & bspline interpolation)*/
psys_interpolate_particle((pind->keyed || pind->cache || point_vel) ? -1 /* signal for cubic interpolation */
: (pind->bspline ? KEY_BSPLINE : KEY_CARDINAL)
- ,keys, keytime, result, 1);
+ , keys, keytime, result, 1);
/* the velocity needs to be converted back from cubic interpolation */
if (pind->keyed || pind->cache || point_vel)
@@ -1403,10 +1403,10 @@ static void interpolate_pathcache(ParticleCacheKey *first, float t, ParticleCach
/************************************************/
/* interpolate a location on a face based on face coordinates */
void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*orcodata)[3],
- float *w, float *vec, float *nor, float *utan, float *vtan, float *orco,float *ornor)
+ float *w, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
{
float *v1=0, *v2=0, *v3=0, *v4=0;
- float e1[3],e2[3],s1,s2,t1,t2;
+ float e1[3], e2[3], s1, s2, t1, t2;
float *uv1, *uv2, *uv3, *uv4;
float n1[3], n2[3], n3[3], n4[3];
float tuv[4][2];
@@ -1430,7 +1430,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
if (mface->flag & ME_SMOOTH)
interp_v3_v3v3v3v3(nor, n1, n2, n3, n4, w);
else
- normal_quad_v3(nor,v1,v2,v3,v4);
+ normal_quad_v3(nor, v1, v2, v3, v4);
}
}
else {
@@ -1440,7 +1440,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
if (mface->flag & ME_SMOOTH)
interp_v3_v3v3v3(nor, n1, n2, n3, w);
else
- normal_tri_v3(nor,v1,v2,v3);
+ normal_tri_v3(nor, v1, v2, v3);
}
}
@@ -1454,11 +1454,11 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
}
else {
uv1= tuv[0]; uv2= tuv[1]; uv3= tuv[2]; uv4= tuv[3];
- map_to_sphere( uv1, uv1+1,v1[0], v1[1], v1[2]);
- map_to_sphere( uv2, uv2+1,v2[0], v2[1], v2[2]);
- map_to_sphere( uv3, uv3+1,v3[0], v3[1], v3[2]);
+ map_to_sphere( uv1, uv1+1, v1[0], v1[1], v1[2]);
+ map_to_sphere( uv2, uv2+1, v2[0], v2[1], v2[2]);
+ map_to_sphere( uv3, uv3+1, v3[0], v3[1], v3[2]);
if (v4)
- map_to_sphere( uv4, uv4+1,v4[0], v4[1], v4[2]);
+ map_to_sphere( uv4, uv4+1, v4[0], v4[1], v4[2]);
}
if (v4) {
@@ -1503,13 +1503,13 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
interp_v3_v3v3v3v3(orco, o1, o2, o3, o4, w);
if (ornor)
- normal_quad_v3( ornor,o1, o2, o3, o4);
+ normal_quad_v3(ornor, o1, o2, o3, o4);
}
else {
interp_v3_v3v3v3(orco, o1, o2, o3, w);
if (ornor)
- normal_tri_v3( ornor,o1, o2, o3);
+ normal_tri_v3(ornor, o1, o2, o3);
}
}
else {
@@ -1527,7 +1527,7 @@ void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float
float v21= tface->uv[1][1];
float v30= tface->uv[2][0];
float v31= tface->uv[2][1];
- float v40,v41;
+ float v40, v41;
if (quad) {
v40= tface->uv[3][0];
@@ -1578,8 +1578,8 @@ static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int
case PART_FROM_FACE:
case PART_FROM_VOLUME:
{
- MFace *mf=dm->getTessFaceData(dm,index,CD_MFACE);
- return interpolate_particle_value(values[mf->v1],values[mf->v2],values[mf->v3],values[mf->v4],fw,mf->v4);
+ MFace *mf=dm->getTessFaceData(dm, index, CD_MFACE);
+ return interpolate_particle_value(values[mf->v1], values[mf->v2], values[mf->v3], values[mf->v4], fw, mf->v4);
}
}
@@ -1766,10 +1766,10 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
orcodata= dm->getVertDataArray(dm, CD_ORCO);
if (from == PART_FROM_VERT) {
- dm->getVertCo(dm,mapindex,vec);
+ dm->getVertCo(dm, mapindex, vec);
if (nor) {
- dm->getVertNo(dm,mapindex,nor);
+ dm->getVertNo(dm, mapindex, nor);
normalize_v3(nor);
}
@@ -1777,7 +1777,7 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
copy_v3_v3(orco, orcodata[mapindex]);
if (ornor) {
- dm->getVertNo(dm,mapindex,nor);
+ dm->getVertNo(dm, mapindex, nor);
normalize_v3(nor);
}
@@ -1791,24 +1791,24 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
MTFace *mtface;
MVert *mvert;
- mface=dm->getTessFaceData(dm,mapindex,CD_MFACE);
- mvert=dm->getVertDataArray(dm,CD_MVERT);
- mtface=CustomData_get_layer(&dm->faceData,CD_MTFACE);
+ mface=dm->getTessFaceData(dm, mapindex, CD_MFACE);
+ mvert=dm->getVertDataArray(dm, CD_MVERT);
+ mtface=CustomData_get_layer(&dm->faceData, CD_MTFACE);
if (mtface)
mtface += mapindex;
if (from==PART_FROM_VOLUME) {
- psys_interpolate_face(mvert,mface,mtface,orcodata,mapfw,vec,tmpnor,utan,vtan,orco,ornor);
+ psys_interpolate_face(mvert, mface, mtface, orcodata, mapfw, vec, tmpnor, utan, vtan, orco, ornor);
if (nor)
- copy_v3_v3(nor,tmpnor);
+ copy_v3_v3(nor, tmpnor);
normalize_v3(tmpnor);
- mul_v3_fl(tmpnor,-foffset);
+ mul_v3_fl(tmpnor, -foffset);
add_v3_v3(vec, tmpnor);
}
else
- psys_interpolate_face(mvert,mface,mtface,orcodata,mapfw,vec,nor,utan,vtan,orco,ornor);
+ psys_interpolate_face(mvert, mface, mtface, orcodata, mapfw, vec, nor, utan, vtan, orco, ornor);
}
}
@@ -1845,24 +1845,24 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys)
static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *UNUSED(fuv), float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
{
/* TODO */
- float zerovec[3]={0.0f,0.0f,0.0f};
+ float zerovec[3]={0.0f, 0.0f, 0.0f};
if (vec) {
- copy_v3_v3(vec,zerovec);
+ copy_v3_v3(vec, zerovec);
}
if (nor) {
- copy_v3_v3(nor,zerovec);
+ copy_v3_v3(nor, zerovec);
}
if (utan) {
- copy_v3_v3(utan,zerovec);
+ copy_v3_v3(utan, zerovec);
}
if (vtan) {
- copy_v3_v3(vtan,zerovec);
+ copy_v3_v3(vtan, zerovec);
}
if (orco) {
- copy_v3_v3(orco,zerovec);
+ copy_v3_v3(orco, zerovec);
}
if (ornor) {
- copy_v3_v3(ornor,zerovec);
+ copy_v3_v3(ornor, zerovec);
}
}
/************************************************/
@@ -1873,17 +1873,17 @@ void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int in
if (psmd) {
if (psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT) {
if (vec)
- copy_v3_v3(vec,fuv);
+ copy_v3_v3(vec, fuv);
if (orco)
copy_v3_v3(orco, fuv);
return;
}
/* we cant use the num_dmcache */
- psys_particle_on_dm(psmd->dm,from,index,index_dmcache,fuv,foffset,vec,nor,utan,vtan,orco,ornor);
+ psys_particle_on_dm(psmd->dm, from, index, index_dmcache, fuv, foffset, vec, nor, utan, vtan, orco, ornor);
}
else
- psys_particle_on_shape(from,index,fuv,vec,nor,utan,vtan,orco,ornor);
+ psys_particle_on_shape(from, index, fuv, vec, nor, utan, vtan, orco, ornor);
}
/************************************************/
@@ -1892,7 +1892,7 @@ void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int in
static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float time, float freq, float shape, float amplitude, float flat, short type, short axis, float obmat[][4], int smooth_start)
{
- float kink[3]={1.f,0.f,0.f}, par_vec[3], q1[4]={1.f,0.f,0.f,0.f};
+ float kink[3]={1.f, 0.f, 0.f}, par_vec[3], q1[4]={1.f, 0.f, 0.f, 0.f};
float t, dt=1.f, result[3];
if (par == NULL || type == PART_KINK_NO)
@@ -1995,8 +1995,8 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
}
case PART_KINK_BRAID:
{
- float y_vec[3]={0.f,1.f,0.f};
- float z_vec[3]={0.f,0.f,1.f};
+ float y_vec[3]={0.f, 1.f, 0.f};
+ float z_vec[3]={0.f, 0.f, 1.f};
float vec_one[3], state_co[3];
float inp_y, inp_z, length;
@@ -2077,11 +2077,11 @@ static float do_clump(ParticleKey *state, ParticleKey *par, float time, float cl
cpow=1.0f+9.0f*clumppow;
if (clumpfac < 0.0f) /* clump roots instead of tips */
- clump = -clumpfac*pa_clump*(float)pow(1.0-(double)time,(double)cpow);
+ clump = -clumpfac*pa_clump*(float)pow(1.0-(double)time, (double)cpow);
else
- clump = clumpfac*pa_clump*(float)pow((double)time,(double)cpow);
+ clump = clumpfac*pa_clump*(float)pow((double)time, (double)cpow);
- interp_v3_v3v3(state->co,state->co,par->co,clump);
+ interp_v3_v3v3(state->co, state->co, par->co, clump);
}
return clump;
@@ -2101,7 +2101,7 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
return;
LOOP_PARTICLES {
- psys_particle_on_emitter(sim->psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,state.co,0,0,0,0,0);
+ psys_particle_on_emitter(sim->psmd, sim->psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, state.co, 0, 0, 0, 0, 0);
mul_m4_v3(sim->ob->obmat, state.co);
mul_mat3_m4_v3(sim->ob->obmat, state.vel);
@@ -2178,11 +2178,11 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
cross_v3_v3v3(temp, eff->guide_dir, guidedir);
angle = dot_v3v3(eff->guide_dir, guidedir)/(len_v3(eff->guide_dir));
angle = saacos(angle);
- axis_angle_to_quat( rot2,temp, angle);
+ axis_angle_to_quat( rot2, temp, angle);
mul_qt_v3(rot2, vec_to_point);
/* curve tilt */
- axis_angle_to_quat( rot2,guidedir, guidevec[3] - eff->guide_loc[3]);
+ axis_angle_to_quat( rot2, guidedir, guidevec[3] - eff->guide_loc[3]);
mul_qt_v3(rot2, vec_to_point);
}
@@ -2203,7 +2203,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
add_v3_v3(vec_to_point, guidevec);
- //sub_v3_v3v3(pa_loc,pa_loc,pa_zero);
+ //sub_v3_v3v3(pa_loc, pa_loc, pa_zero);
madd_v3_v3fl(effect, vec_to_point, data->strength);
madd_v3_v3fl(veffect, guidedir, data->strength);
totstrength += data->strength;
@@ -2216,7 +2216,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
if (totstrength > 1.0f)
mul_v3_fl(effect, 1.0f / totstrength);
CLAMP(totstrength, 0.0f, 1.0f);
- //add_v3_v3(effect,pa_zero);
+ //add_v3_v3(effect, pa_zero);
interp_v3_v3v3(state->co, state->co, effect, totstrength);
normalize_v3(veffect);
@@ -2234,11 +2234,11 @@ static void do_rough(float *loc, float mat[4][4], float t, float fac, float size
if (thres != 0.0f)
if ((float)fabs((float)(-1.5f+loc[0]+loc[1]+loc[2]))<1.5f*thres) return;
- copy_v3_v3(rco,loc);
- mul_v3_fl(rco,t);
- rough[0]=-1.0f+2.0f*BLI_gTurbulence(size, rco[0], rco[1], rco[2], 2,0,2);
- rough[1]=-1.0f+2.0f*BLI_gTurbulence(size, rco[1], rco[2], rco[0], 2,0,2);
- rough[2]=-1.0f+2.0f*BLI_gTurbulence(size, rco[2], rco[0], rco[1], 2,0,2);
+ copy_v3_v3(rco, loc);
+ mul_v3_fl(rco, t);
+ rough[0]=-1.0f+2.0f*BLI_gTurbulence(size, rco[0], rco[1], rco[2], 2, 0, 2);
+ rough[1]=-1.0f+2.0f*BLI_gTurbulence(size, rco[1], rco[2], rco[0], 2, 0, 2);
+ rough[2]=-1.0f+2.0f*BLI_gTurbulence(size, rco[2], rco[0], rco[1], 2, 0, 2);
madd_v3_v3fl(state->co, mat[0], fac * rough[0]);
madd_v3_v3fl(state->co, mat[1], fac * rough[1]);
@@ -2249,18 +2249,18 @@ static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float
float rough[2];
float roughfac;
- roughfac=fac*(float)pow((double)t,shape);
- copy_v2_v2(rough,loc);
+ roughfac=fac*(float)pow((double)t, shape);
+ copy_v2_v2(rough, loc);
rough[0]=-1.0f+2.0f*rough[0];
rough[1]=-1.0f+2.0f*rough[1];
- mul_v2_fl(rough,roughfac);
+ mul_v2_fl(rough, roughfac);
madd_v3_v3fl(state->co, mat[0], rough[0]);
madd_v3_v3fl(state->co, mat[1], rough[1]);
}
static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *UNUSED(rootco), float effector, float UNUSED(dfra), float UNUSED(cfra), float *length, float *vec)
{
- float force[3] = {0.0f,0.0f,0.0f};
+ float force[3] = {0.0f, 0.0f, 0.0f};
ParticleKey eff_key;
EffectedPoint epoint;
@@ -2268,9 +2268,9 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK
if (sim->psys->flag & PSYS_HAIR_DYNAMICS)
return;
- copy_v3_v3(eff_key.co,(ca-1)->co);
- copy_v3_v3(eff_key.vel,(ca-1)->vel);
- copy_qt_qt(eff_key.rot,(ca-1)->rot);
+ copy_v3_v3(eff_key.co, (ca-1)->co);
+ copy_v3_v3(eff_key.vel, (ca-1)->vel);
+ copy_qt_qt(eff_key.rot, (ca-1)->rot);
pd_point_from_particle(sim, sim->psys->particles+i, &eff_key, &epoint);
pdDoEffectors(sim->psys->effectors, sim->colliders, sim->psys->part->effector_weights, &epoint, force, NULL);
@@ -2351,7 +2351,7 @@ void psys_find_parents(ParticleSimulationData *sim)
ParticleSettings *part=sim->psys->part;
KDTree *tree;
ChildParticle *cpa;
- int p, totparent,totchild=sim->psys->totchild;
+ int p, totparent, totchild=sim->psys->totchild;
float co[3], orco[3];
int from=PART_FROM_FACE;
totparent=(int)(totchild*part->parents*0.3f);
@@ -2361,15 +2361,15 @@ void psys_find_parents(ParticleSimulationData *sim)
tree=BLI_kdtree_new(totparent);
- for (p=0,cpa=sim->psys->child; p<totparent; p++,cpa++) {
- psys_particle_on_emitter(sim->psmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0);
+ for (p=0, cpa=sim->psys->child; p<totparent; p++, cpa++) {
+ psys_particle_on_emitter(sim->psmd, from, cpa->num, DMCACHE_ISCHILD, cpa->fuv, cpa->foffset, co, 0, 0, 0, orco, 0);
BLI_kdtree_insert(tree, p, orco, NULL);
}
BLI_kdtree_balance(tree);
- for (; p<totchild; p++,cpa++) {
- psys_particle_on_emitter(sim->psmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0);
+ for (; p<totchild; p++, cpa++) {
+ psys_particle_on_emitter(sim->psmd, from, cpa->num, DMCACHE_ISCHILD, cpa->fuv, cpa->foffset, co, 0, 0, 0, orco, 0);
cpa->parent=BLI_kdtree_find_nearest(tree, orco, NULL, NULL);
}
@@ -2441,10 +2441,10 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c
}
if (psys->renderdata)
- steps=(int)pow(2.0,(double)part->ren_step);
+ steps=(int)pow(2.0, (double)part->ren_step);
else {
totchild=(int)((float)totchild*(float)part->disp/100.0f);
- totparent=MIN2(totparent,totchild);
+ totparent=MIN2(totparent, totchild);
}
if (totchild==0) return 0;
@@ -2472,14 +2472,14 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c
psys->lattice = psys_get_lattice(&ctx->sim);
/* cache all relevant vertex groups if they exist */
- ctx->vg_length = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_LENGTH);
- ctx->vg_clump = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_CLUMP);
- ctx->vg_kink = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_KINK);
- ctx->vg_rough1 = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_ROUGH1);
- ctx->vg_rough2 = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_ROUGH2);
- ctx->vg_roughe = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_ROUGHE);
+ ctx->vg_length = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_LENGTH);
+ ctx->vg_clump = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_CLUMP);
+ ctx->vg_kink = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_KINK);
+ ctx->vg_rough1 = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_ROUGH1);
+ ctx->vg_rough2 = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_ROUGH2);
+ ctx->vg_roughe = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_ROUGHE);
if (psys->part->flag & PART_CHILD_EFFECT)
- ctx->vg_effector = psys_cache_vgroup(ctx->dm,psys,PSYS_VG_EFFECTOR);
+ ctx->vg_effector = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_EFFECTOR);
/* set correct ipo timing */
#if 0 // XXX old animation system
@@ -2599,7 +2599,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
cpa_fuv = cpa->fuv;
cpa_from = PART_FROM_FACE;
- psys_particle_on_emitter(ctx->sim.psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa->fuv,foffset,co,ornor,0,0,orco,0);
+ psys_particle_on_emitter(ctx->sim.psmd, cpa_from, cpa_num, DMCACHE_ISCHILD, cpa->fuv, foffset, co, ornor, 0, 0, orco, 0);
mul_m4_v3(ob->obmat, co);
@@ -2626,7 +2626,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
cpa_num = pa->num;
cpa_fuv = pa->fuv;
- psys_particle_on_emitter(ctx->sim.psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa_fuv,pa->foffset,co,ornor,0,0,orco,0);
+ psys_particle_on_emitter(ctx->sim.psmd, cpa_from, cpa_num, DMCACHE_ISCHILD, cpa_fuv, pa->foffset, co, ornor, 0, 0, orco, 0);
psys_mat_hair_to_global(ob, ctx->sim.psmd->dm, psys->part->from, pa, hairmat);
}
@@ -2642,7 +2642,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
}
/* create the child path */
- for (k=0,child=child_keys; k<=ctx->steps; k++,child++) {
+ for (k=0, child=child_keys; k<=ctx->steps; k++, child++) {
if (ctx->between) {
int w=0;
@@ -2689,7 +2689,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
/* apply effectors */
if (part->flag & PART_CHILD_EFFECT) {
- for (k=0,child=child_keys; k<=ctx->steps; k++,child++) {
+ for (k=0, child=child_keys; k<=ctx->steps; k++, child++) {
if (k) {
do_path_effectors(&ctx->sim, cpa->pa[0], child, k, ctx->steps, child_keys->co, ptex.effector, 0.0f, ctx->cfra, &eff_length, eff_vec);
}
@@ -2700,7 +2700,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
}
}
- for (k=0,child=child_keys; k<=ctx->steps; k++,child++) {
+ for (k=0, child=child_keys; k<=ctx->steps; k++, child++) {
t = (float)k/(float)ctx->steps;
if (ctx->totparent)
@@ -2871,7 +2871,7 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache
else {
angle= saacos(cosangle);
cross_v3_v3v3(normal, prev_tangent, tangent);
- axis_angle_to_quat( q,normal, angle);
+ axis_angle_to_quat( q, normal, angle);
mul_qt_qtqt(key1->rot, q, key2->rot);
}
@@ -2954,7 +2954,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
psys_get_texture(sim, pa, &ptex, PAMAP_LENGTH, 0.f);
pa_length = ptex.length * (1.0f - part->randlength * PSYS_FRAND(psys->seed + p));
if (vg_length)
- pa_length *= psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_length);
+ pa_length *= psys_particle_value_from_verts(psmd->dm, part->from, pa, vg_length);
}
pind.keyed = keyed;
@@ -3018,9 +3018,9 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
if ((psys->part->flag & PART_CHILD_EFFECT) == 0) {
float effector= 1.0f;
if (vg_effector)
- effector*= psys_particle_value_from_verts(psmd->dm,psys->part->from,pa,vg_effector);
+ effector*= psys_particle_value_from_verts(psmd->dm, psys->part->from, pa, vg_effector);
- sub_v3_v3v3(vec,(cache[p]+1)->co,cache[p]->co);
+ sub_v3_v3v3(vec, (cache[p]+1)->co, cache[p]->co);
length = len_v3(vec);
for (k=1, ca=cache[p]+1; k<=steps; k++, ca++)
@@ -3290,19 +3290,19 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
void copy_particle_key(ParticleKey *to, ParticleKey *from, int time)
{
if (time) {
- memcpy(to,from,sizeof(ParticleKey));
+ memcpy(to, from, sizeof(ParticleKey));
}
else {
float to_time=to->time;
- memcpy(to,from,sizeof(ParticleKey));
+ memcpy(to, from, sizeof(ParticleKey));
to->time=to_time;
}
}
void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, float *time)
{
- if (loc) copy_v3_v3(loc,key->co);
- if (vel) copy_v3_v3(vel,key->vel);
- if (rot) copy_qt_qt(rot,key->rot);
+ if (loc) copy_v3_v3(loc, key->co);
+ if (vel) copy_v3_v3(vel, key->vel);
+ if (rot) copy_qt_qt(rot, key->rot);
if (time) *time=key->time;
}
/*-------changing particle keys from space to another-------*/
@@ -3313,12 +3313,12 @@ static void key_from_object(Object *ob, ParticleKey *key)
add_v3_v3(key->vel, key->co);
- mul_m4_v3(ob->obmat,key->co);
- mul_m4_v3(ob->obmat,key->vel);
- mat4_to_quat(q,ob->obmat);
+ mul_m4_v3(ob->obmat, key->co);
+ mul_m4_v3(ob->obmat, key->vel);
+ mat4_to_quat(q, ob->obmat);
- sub_v3_v3v3(key->vel,key->vel,key->co);
- mul_qt_qtqt(key->rot,q,key->rot);
+ sub_v3_v3v3(key->vel, key->vel, key->co);
+ mul_qt_qtqt(key->rot, q, key->rot);
}
#endif
@@ -3330,7 +3330,7 @@ static void triatomat(float *v1, float *v2, float *v3, float (*uv)[2], float mat
mat[3][3]= 1.0f;
/* first axis is the normal */
- normal_tri_v3( mat[2],v1, v2, v3);
+ normal_tri_v3(mat[2], v1, v2, v3);
/* second axis along (1, 0) in uv space */
if (uv) {
@@ -3374,8 +3374,8 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m
if (i==-1 || i >= dm->getNumTessFaces(dm)) { unit_m4(mat); return; }
- mface=dm->getTessFaceData(dm,i,CD_MFACE);
- osface=dm->getTessFaceData(dm,i,CD_ORIGSPACE);
+ mface=dm->getTessFaceData(dm, i, CD_MFACE);
+ osface=dm->getTessFaceData(dm, i, CD_ORIGSPACE);
if (orco && (orcodata=dm->getVertDataArray(dm, CD_ORCO))) {
copy_v3_v3(v[0], orcodata[mface->v1]);
@@ -3388,9 +3388,9 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m
transform_mesh_orco_verts(ob->data, v, 3, 1);
}
else {
- dm->getVertCo(dm,mface->v1,v[0]);
- dm->getVertCo(dm,mface->v2,v[1]);
- dm->getVertCo(dm,mface->v3,v[2]);
+ dm->getVertCo(dm, mface->v1, v[0]);
+ dm->getVertCo(dm, mface->v2, v[1]);
+ dm->getVertCo(dm, mface->v3, v[2]);
}
triatomat(v[0], v[1], v[2], (osface)? osface->uv: NULL, mat);
@@ -3402,7 +3402,7 @@ void psys_mat_hair_to_object(Object *UNUSED(ob), DerivedMesh *dm, short from, Pa
psys_face_mat(0, dm, pa, hairmat, 0);
psys_particle_on_dm(dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, vec, 0, 0, 0, 0, 0);
- copy_v3_v3(hairmat[3],vec);
+ copy_v3_v3(hairmat[3], vec);
}
void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4])
@@ -3415,7 +3415,7 @@ void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData
/* see psys_face_mat for why this function is called */
if (DM_get_vert_data_layer(dm, CD_ORIGINDEX))
transform_mesh_orco_verts(ob->data, &orco, 1, 1);
- copy_v3_v3(hairmat[3],orco);
+ copy_v3_v3(hairmat[3], orco);
}
void psys_vec_rot_to_face(DerivedMesh *dm, ParticleData *pa, float vec[3])
@@ -3513,7 +3513,7 @@ void object_remove_particle_system(Scene *scene, Object *ob)
/* clear particle system */
BLI_remlink(&ob->particlesystem, psys);
- psys_free(ob,psys);
+ psys_free(ob, psys);
if (ob->particlesystem.first)
((ParticleSystem *) ob->particlesystem.first)->flag |= PSYS_CURRENT;
@@ -3795,7 +3795,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
copy_v3_v3(texvec, orco);
break;
case TEXCO_PARTICLE:
- /* texture coordinates in range [-1,1] */
+ /* texture coordinates in range [-1, 1] */
texvec[0] = 2.f * (cfra - par->time)/(par->dietime-par->time) - 1.f;
texvec[1] = 0.f;
texvec[2] = 0.f;
@@ -3805,7 +3805,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
externtex(mtex, texvec, &value, rgba, rgba+1, rgba+2, rgba+3, 0);
if ((event & mtex->mapto) & PAMAP_ROUGH)
- ptex->rough1= ptex->rough2= ptex->roughe= texture_value_blend(def,ptex->rough1,value,mtex->roughfac,blend);
+ ptex->rough1= ptex->rough2= ptex->roughe= texture_value_blend(def, ptex->rough1, value, mtex->roughfac, blend);
SET_PARTICLE_TEXTURE(PAMAP_LENGTH, ptex->length, mtex->lengthfac);
SET_PARTICLE_TEXTURE(PAMAP_CLUMP, ptex->clump, mtex->clumpfac);
@@ -3860,10 +3860,10 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
break;
/* no break, failed to get uv's, so let's try orco's */
case TEXCO_ORCO:
- psys_particle_on_emitter(sim->psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,0,0,0,texvec, 0);
+ psys_particle_on_emitter(sim->psmd, sim->psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, 0, 0, 0, texvec, 0);
break;
case TEXCO_PARTICLE:
- /* texture coordinates in range [-1,1] */
+ /* texture coordinates in range [-1, 1] */
texvec[0] = 2.f * (cfra - pa->time)/(pa->dietime-pa->time) - 1.f;
texvec[1] = 0.f;
texvec[2] = 0.f;
@@ -3882,7 +3882,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
setvars |= MAP_PA_TIME;
}
else
- ptex->time= texture_value_blend(def,ptex->time,value,mtex->timefac,blend);
+ ptex->time= texture_value_blend(def, ptex->time, value, mtex->timefac, blend);
}
SET_PARTICLE_TEXTURE(PAMAP_LIFE, ptex->life, mtex->lifefac)
SET_PARTICLE_TEXTURE(PAMAP_DENS, ptex->exist, mtex->padensfac)
@@ -3970,19 +3970,19 @@ static void get_child_modifier_parameters(ParticleSettings *part, ParticleThread
return;
if (ctx->vg_length)
- ptex->length*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_length);
+ ptex->length*=psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_length);
if (ctx->vg_clump)
- ptex->clump*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_clump);
+ ptex->clump*=psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_clump);
if (ctx->vg_kink)
- ptex->kink*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_kink);
+ ptex->kink*=psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_kink);
if (ctx->vg_rough1)
- ptex->rough1*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough1);
+ ptex->rough1*=psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_rough1);
if (ctx->vg_rough2)
- ptex->rough2*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough2);
+ ptex->rough2*=psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_rough2);
if (ctx->vg_roughe)
- ptex->roughe*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_roughe);
+ ptex->roughe*=psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_roughe);
if (ctx->vg_effector)
- ptex->effector*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_effector);
+ ptex->effector*=psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_effector);
}
static void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, float mat[4][4], ParticleKey *state, float t)
{
@@ -4098,13 +4098,13 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
}
if (psys->lattice && edit==0)
- calc_latt_deform(psys->lattice, state->co,1.0f);
+ calc_latt_deform(psys->lattice, state->co, 1.0f);
}
}
}
}
else if (totchild) {
- //invert_m4_m4(imat,ob->obmat);
+ //invert_m4_m4(imat, ob->obmat);
/* interpolate childcache directly if it exists */
if (psys->childcache) {
@@ -4119,7 +4119,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
if (state->time < 0.0f)
t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL);
-
+
if (totchild && part->childtype==PART_CHILD_FACES) {
/* part->parents could still be 0 so we can't test with totparent */
between=1;
@@ -4137,17 +4137,17 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
/* get the original coordinates (orco) for texture usage */
cpa_num=cpa->num;
-
+
foffset= cpa->foffset;
cpa_fuv = cpa->fuv;
cpa_from = PART_FROM_FACE;
- psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa->fuv,foffset,co,0,0,0,orco,0);
+ psys_particle_on_emitter(psmd, cpa_from, cpa_num, DMCACHE_ISCHILD, cpa->fuv, foffset, co, 0, 0, 0, orco, 0);
/* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */
- //copy_v3_v3(cpa_1st,co);
+ //copy_v3_v3(cpa_1st, co);
- //mul_m4_v3(ob->obmat,cpa_1st);
+ //mul_m4_v3(ob->obmat, cpa_1st);
pa = psys->particles + cpa->parent;
@@ -4158,38 +4158,38 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
pa=0;
}
- else {
- /* get the parent state */
- keys->time = state->time;
- psys_get_particle_on_path(sim, cpa->parent, keys,1);
+ else {
+ /* get the parent state */
+ keys->time = state->time;
+ psys_get_particle_on_path(sim, cpa->parent, keys, 1);
- /* get the original coordinates (orco) for texture usage */
- pa=psys->particles+cpa->parent;
+ /* get the original coordinates (orco) for texture usage */
+ pa=psys->particles+cpa->parent;
- cpa_from=part->from;
- cpa_num=pa->num;
- cpa_fuv=pa->fuv;
+ cpa_from=part->from;
+ cpa_num=pa->num;
+ cpa_fuv=pa->fuv;
-
- if (part->type == PART_HAIR) {
- psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa_fuv,pa->foffset,co,0,0,0,orco,0);
- psys_mat_hair_to_global(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat);
- }
- else {
- copy_v3_v3(orco, cpa->fuv);
- unit_m4(hairmat);
+
+ if (part->type == PART_HAIR) {
+ psys_particle_on_emitter(psmd, cpa_from, cpa_num, DMCACHE_ISCHILD, cpa_fuv, pa->foffset, co, 0, 0, 0, orco, 0);
+ psys_mat_hair_to_global(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat);
+ }
+ else {
+ copy_v3_v3(orco, cpa->fuv);
+ unit_m4(hairmat);
+ }
}
- }
/* correct child ipo timing */
- #if 0 // XXX old animation system
+#if 0 // XXX old animation system
if ((part->flag&PART_ABS_TIME)==0 && part->ipo) {
calc_ipo(part->ipo, 100.0f*t);
execute_ipo((ID *)part, part->ipo);
}
- #endif // XXX old animation system
-
+#endif // XXX old animation system
+
/* get different child parameters from textures & vgroups */
memset(&ctx, 0, sizeof(ParticleThreadContext));
ctx.sim = *sim;
@@ -4238,14 +4238,14 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
if (t>=0.001f) {
tstate.time=t-0.001f;
- psys_get_particle_on_path(sim,p,&tstate,0);
- sub_v3_v3v3(state->vel,state->co,tstate.co);
+ psys_get_particle_on_path(sim, p, &tstate, 0);
+ sub_v3_v3v3(state->vel, state->co, tstate.co);
normalize_v3(state->vel);
}
else {
tstate.time=t+0.001f;
- psys_get_particle_on_path(sim,p,&tstate,0);
- sub_v3_v3v3(state->vel,tstate.co,state->co);
+ psys_get_particle_on_path(sim, p, &tstate, 0);
+ sub_v3_v3v3(state->vel, tstate.co, state->co);
normalize_v3(state->vel);
}
@@ -4290,7 +4290,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
state->time= (cfra - (part->sta + (part->end - part->sta) * PSYS_FRAND(p + 23))) / (part->lifetime * PSYS_FRAND(p + 24));
- psys_get_particle_on_path(sim, p, state,1);
+ psys_get_particle_on_path(sim, p, state, 1);
return 1;
}
else {
@@ -4316,7 +4316,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
if (sim->psys->flag & PSYS_KEYED) {
state->time= -cfra;
- psys_get_particle_on_path(sim, p, state,1);
+ psys_get_particle_on_path(sim, p, state, 1);
return 1;
}
else {
@@ -4334,10 +4334,10 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
do_child_modifiers(sim, NULL, key1, key1->rot, cpa, cpa->fuv, mat, state, t);
if (psys->lattice)
- calc_latt_deform(sim->psys->lattice, state->co,1.0f);
+ calc_latt_deform(sim->psys->lattice, state->co, 1.0f);
}
else {
- if (pa->state.time==cfra || ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED))
+ if (pa->state.time==cfra || ELEM(part->phystype, PART_PHYS_NO, PART_PHYS_KEYED))
copy_particle_key(state, &pa->state, 1);
else if (pa->prev_state.time==cfra)
copy_particle_key(state, &pa->prev_state, 1);
@@ -4393,7 +4393,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
}
if (sim->psys->lattice)
- calc_latt_deform(sim->psys->lattice, state->co,1.0f);
+ calc_latt_deform(sim->psys->lattice, state->co, 1.0f);
}
return 1;
@@ -4418,7 +4418,7 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part, Partic
psys_interpolate_uvs(mtface, mface->v4, cpa->fuv, uv);
}
- psys_particle_on_emitter(psmd,PART_FROM_FACE,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,loc,0,0,0,orco,0);
+ psys_particle_on_emitter(psmd, PART_FROM_FACE, cpa->num, DMCACHE_ISCHILD, cpa->fuv, cpa->foffset, loc, 0, 0, 0, orco, 0);
return;
}
else {
@@ -4446,7 +4446,7 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part, Partic
}
}
- psys_particle_on_emitter(psmd,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc,0,0,0,orco,0);
+ psys_particle_on_emitter(psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, loc, 0, 0, 0, orco, 0);
}
void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa, ChildParticle *cpa, ParticleCacheKey *cache, float mat[][4], float *scale)
@@ -4464,9 +4464,9 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
pa = psys->particles + cpa->pa[0];
if (pa)
- psys_particle_on_emitter(psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc,nor,0,0,0,0);
+ psys_particle_on_emitter(psmd, sim->psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, loc, nor, 0, 0, 0, 0);
else
- psys_particle_on_emitter(psmd,PART_FROM_FACE,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,loc,nor,0,0,0,0);
+ psys_particle_on_emitter(psmd, PART_FROM_FACE, cpa->num, DMCACHE_ISCHILD, cpa->fuv, cpa->foffset, loc, nor, 0, 0, 0, 0);
if (psys->part->rotmode == PART_ROT_VEL) {
copy_m3_m4(nmat, ob->imat);
@@ -4475,8 +4475,8 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
normalize_v3(nor);
/* make sure that we get a proper side vector */
- if (fabs(dot_v3v3(nor,vec))>0.999999) {
- if (fabs(dot_v3v3(nor,xvec))>0.999999) {
+ if (fabs(dot_v3v3(nor, vec))>0.999999) {
+ if (fabs(dot_v3v3(nor, xvec))>0.999999) {
nor[0] = 0.0f;
nor[1] = 1.0f;
nor[2] = 0.0f;
@@ -4517,7 +4517,7 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3], float zvec[3], float center[3])
{
- float onevec[3] = {0.0f,0.0f,0.0f}, tvec[3], tvec2[3];
+ float onevec[3] = {0.0f, 0.0f, 0.0f}, tvec[3], tvec2[3];
xvec[0] = 1.0f; xvec[1] = 0.0f; xvec[2] = 0.0f;
yvec[0] = 0.0f; yvec[1] = 1.0f; yvec[2] = 0.0f;
@@ -4561,10 +4561,10 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
}
normalize_v3(zvec);
- cross_v3_v3v3(xvec,temp,zvec);
+ cross_v3_v3v3(xvec, temp, zvec);
normalize_v3(xvec);
- cross_v3_v3v3(yvec,zvec,xvec);
+ cross_v3_v3v3(yvec, zvec, xvec);
}
else {
sub_v3_v3v3(zvec, bb->ob->obmat[3], bb->vec);
@@ -4578,7 +4578,7 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
cross_v3_v3v3(xvec, bb->ob->obmat[1], zvec);
normalize_v3(xvec);
- cross_v3_v3v3(yvec,zvec,xvec);
+ cross_v3_v3v3(yvec, zvec, xvec);
}
copy_v3_v3(tvec, xvec);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index d3644657de7..9dbc0f3da4b 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -241,10 +241,10 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
}
if (psys->particles) {
- totsaved=MIN2(psys->totpart,totpart);
+ totsaved=MIN2(psys->totpart, totpart);
/*save old pars*/
if (totsaved) {
- memcpy(newpars,psys->particles,totsaved*sizeof(ParticleData));
+ memcpy(newpars, psys->particles, totsaved*sizeof(ParticleData));
if (psys->particles->boid)
memcpy(newboids, psys->particles->boid, totsaved*sizeof(BoidParticle));
@@ -418,7 +418,7 @@ static void distribute_simple_children(Scene *scene, Object *ob, DerivedMesh *fi
cpa = psys->child;
for (i=0; i<child_nbr; i++) {
- for (p=0; p<psys->totpart; p++,cpa++) {
+ for (p=0; p<psys->totpart; p++, cpa++) {
float length=2.0;
cpa->parent=p;
@@ -440,7 +440,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
{
ParticleData *pa=NULL;
float min[3], max[3], delta[3], d;
- MVert *mv, *mvert = dm->getVertDataArray(dm,0);
+ MVert *mv, *mvert = dm->getVertDataArray(dm, 0);
int totvert=dm->getNumVerts(dm), from=psys->part->from;
int i, j, k, p, res=psys->part->grid_res, size[3], axis;
@@ -452,13 +452,13 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
mv++;
for (i=1; i<totvert; i++, mv++) {
- min[0]=MIN2(min[0],mv->co[0]);
- min[1]=MIN2(min[1],mv->co[1]);
- min[2]=MIN2(min[2],mv->co[2]);
+ min[0]=MIN2(min[0], mv->co[0]);
+ min[1]=MIN2(min[1], mv->co[1]);
+ min[2]=MIN2(min[2], mv->co[2]);
- max[0]=MAX2(max[0],mv->co[0]);
- max[1]=MAX2(max[1],mv->co[1]);
- max[2]=MAX2(max[2],mv->co[2]);
+ max[0]=MAX2(max[0], mv->co[0]);
+ max[1]=MAX2(max[1], mv->co[1]);
+ max[2]=MAX2(max[2], mv->co[2]);
}
sub_v3_v3v3(delta, max, min);
@@ -473,8 +473,8 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
size[(axis+2)%3] = (int)ceil(delta[(axis+2)%3]/d);
/* float errors grrr.. */
- size[(axis+1)%3] = MIN2(size[(axis+1)%3],res);
- size[(axis+2)%3] = MIN2(size[(axis+2)%3],res);
+ size[(axis+1)%3] = MIN2(size[(axis+1)%3], res);
+ size[(axis+2)%3] = MIN2(size[(axis+2)%3], res);
size[0] = MAX2(size[0], 1);
size[1] = MAX2(size[1], 1);
@@ -485,9 +485,9 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
min[1]+= d < delta[1] ? d/2.f : delta[1]/2.f;
min[2]+= d < delta[2] ? d/2.f : delta[2]/2.f;
- for (i=0,p=0,pa=psys->particles; i<res; i++) {
+ for (i=0, p=0, pa=psys->particles; i<res; i++) {
for (j=0; j<res; j++) {
- for (k=0; k<res; k++,p++,pa++) {
+ for (k=0; k<res; k++, p++, pa++) {
pa->fuv[0] = min[0] + (float)i*d;
pa->fuv[1] = min[1] + (float)j*d;
pa->fuv[2] = min[2] + (float)k*d;
@@ -507,8 +507,8 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
min[1] -= d/2.0f;
min[2] -= d/2.0f;
- for (i=0,mv=mvert; i<totvert; i++,mv++) {
- sub_v3_v3v3(vec,mv->co,min);
+ for (i=0, mv=mvert; i<totvert; i++, mv++) {
+ sub_v3_v3v3(vec, mv->co, min);
vec[0]/=delta[0];
vec[1]/=delta[1];
vec[2]/=delta[2];
@@ -517,7 +517,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
+(int)(vec[2]*(size[2]-1)))->flag &= ~PARS_UNEXIST;
}
}
- else if (ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ else if (ELEM(from, PART_FROM_FACE, PART_FROM_VOLUME)) {
float co1[3], co2[3];
MFace *mface= NULL, *mface_array;
@@ -526,7 +526,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
int amax= from==PART_FROM_FACE ? 3 : 1;
totface=dm->getNumTessFaces(dm);
- mface=mface_array=dm->getTessFaceDataArray(dm,CD_MFACE);
+ mface=mface_array=dm->getTessFaceDataArray(dm, CD_MFACE);
for (a=0; a<amax; a++) {
if (a==0) { a0mul=res*res; a1mul=res; a2mul=1; }
@@ -545,7 +545,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
co1[a] -= 0.001f*d;
/* lets intersect the faces */
- for (i=0; i<totface; i++,mface++) {
+ for (i=0; i<totface; i++, mface++) {
copy_v3_v3(v1, mvert[mface->v1].co);
copy_v3_v3(v2, mvert[mface->v2].co);
copy_v3_v3(v3, mvert[mface->v3].co);
@@ -586,9 +586,9 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
}
if (psys->part->flag & PART_GRID_HEXAGONAL) {
- for (i=0,p=0,pa=psys->particles; i<res; i++) {
+ for (i=0, p=0, pa=psys->particles; i<res; i++) {
for (j=0; j<res; j++) {
- for (k=0; k<res; k++,p++,pa++) {
+ for (k=0; k<res; k++, p++, pa++) {
if (j%2)
pa->fuv[0] += d/2.f;
@@ -614,7 +614,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
if (psys->part->grid_rand > 0.f) {
float rfac = d * psys->part->grid_rand;
- for (p=0,pa=psys->particles; p<psys->totpart; p++,pa++) {
+ for (p=0, pa=psys->particles; p<psys->totpart; p++, pa++) {
if (pa->flag & PARS_UNEXIST)
continue;
@@ -708,10 +708,10 @@ static void psys_uv_to_w(float u, float v, int quad, float *w)
if (quad) {
vert[3][0]= 0.0f; vert[3][1]= 1.0f; vert[3][2]= 0.0f;
- interp_weights_poly_v3( w,vert, 4, co);
+ interp_weights_poly_v3( w, vert, 4, co);
}
else {
- interp_weights_poly_v3( w,vert, 3, co);
+ interp_weights_poly_v3( w, vert, 3, co);
w[3]= 0.0f;
}
}
@@ -771,9 +771,9 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
KDTreeNearest ptn[3];
int w, maxw;
- psys_particle_on_dm(ctx->dm,from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co1,0,0,0,orco1,0);
+ psys_particle_on_dm(ctx->dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co1, 0, 0, 0, orco1, 0);
transform_mesh_orco_verts((Mesh*)ob->data, &orco1, 1, 1);
- maxw = BLI_kdtree_find_n_nearest(ctx->tree,3,orco1,NULL,ptn);
+ maxw = BLI_kdtree_find_n_nearest(ctx->tree, 3, orco1, NULL, ptn);
for (w=0; w<maxw; w++) {
pa->verts[w]=ptn->num;
@@ -785,7 +785,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
MFace *mface;
pa->num = i = ctx->index[p];
- mface = dm->getTessFaceData(dm,i,CD_MFACE);
+ mface = dm->getTessFaceData(dm, i, CD_MFACE);
switch (distr) {
case PART_DISTR_JIT:
@@ -796,7 +796,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
psys_uv_to_w(0.33333f, 0.33333f, mface->v4, pa->fuv);
}
else {
- ctx->jitoff[i] = fmod(ctx->jitoff[i],(float)ctx->jitlevel);
+ ctx->jitoff[i] = fmod(ctx->jitoff[i], (float)ctx->jitlevel);
psys_uv_to_w(ctx->jit[2*(int)ctx->jitoff[i]], ctx->jit[2*(int)ctx->jitoff[i]+1], mface->v4, pa->fuv);
ctx->jitoff[i]++;
}
@@ -813,21 +813,21 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
/* experimental */
if (from==PART_FROM_VOLUME) {
- MVert *mvert=dm->getVertDataArray(dm,CD_MVERT);
+ MVert *mvert=dm->getVertDataArray(dm, CD_MVERT);
tot=dm->getNumTessFaces(dm);
- psys_interpolate_face(mvert,mface,0,0,pa->fuv,co1,nor,0,0,0,0);
+ psys_interpolate_face(mvert, mface, 0, 0, pa->fuv, co1, nor, 0, 0, 0, 0);
normalize_v3(nor);
- mul_v3_fl(nor,-100.0);
+ mul_v3_fl(nor, -100.0);
- add_v3_v3v3(co2,co1,nor);
+ add_v3_v3v3(co2, co1, nor);
min_d=2.0;
intersect=0;
- for (i=0,mface=dm->getTessFaceDataArray(dm,CD_MFACE); i<tot; i++,mface++) {
+ for (i=0, mface=dm->getTessFaceDataArray(dm, CD_MFACE); i<tot; i++, mface++) {
if (i==pa->num) continue;
v1=mvert[mface->v1].co;
@@ -889,14 +889,14 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
if (ctx->tree) {
KDTreeNearest ptn[10];
- int w,maxw;//, do_seams;
- float maxd /*, mind,dd */, totw= 0.0f;
+ int w, maxw;//, do_seams;
+ float maxd /*, mind, dd */, totw= 0.0f;
int parent[10];
float pweight[10];
- psys_particle_on_dm(dm,cfrom,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co1,nor1,NULL,NULL,orco1,NULL);
+ psys_particle_on_dm(dm, cfrom, cpa->num, DMCACHE_ISCHILD, cpa->fuv, cpa->foffset, co1, nor1, NULL, NULL, orco1, NULL);
transform_mesh_orco_verts((Mesh*)ob->data, &orco1, 1, 1);
- maxw = BLI_kdtree_find_n_nearest(ctx->tree,4,orco1,NULL,ptn);
+ maxw = BLI_kdtree_find_n_nearest(ctx->tree, 4, orco1, NULL, ptn);
maxd=ptn[maxw-1].dist;
/* mind=ptn[0].dist; */ /* UNUSED */
@@ -904,14 +904,14 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
/* the weights here could be done better */
for (w=0; w<maxw; w++) {
parent[w]=ptn[w].index;
- pweight[w]=(float)pow(2.0,(double)(-6.0f*ptn[w].dist/maxd));
+ pweight[w]=(float)pow(2.0, (double)(-6.0f*ptn[w].dist/maxd));
}
for (;w<10; w++) {
parent[w]=-1;
pweight[w]=0.0f;
}
- for (w=0,i=0; w<maxw && i<4; w++) {
+ for (w=0, i=0; w<maxw && i<4; w++) {
if (parent[w]>=0) {
cpa->pa[i]=parent[w];
cpa->w[i]=pweight[w];
@@ -997,7 +997,7 @@ static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from)
int p, totchild = get_psys_tot_child(scene, psys);
if (psys->child && totchild) {
- for (p=0,cpa=psys->child; p<totchild; p++,cpa++) {
+ for (p=0, cpa=psys->child; p<totchild; p++, cpa++) {
cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3]= 0.0;
cpa->foffset= 0.0f;
cpa->parent=0;
@@ -1033,7 +1033,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
int cfrom=0;
int totelem=0, totpart, *particle_element=0, children=0, totseam=0;
int jitlevel= 1, distr;
- float *element_weight=NULL,*element_sum=NULL,*jitter_offset=NULL, *vweight=NULL;
+ float *element_weight=NULL, *element_sum=NULL, *jitter_offset=NULL, *vweight=NULL;
float cur, maxweight=0.0, tweight, totweight, inv_totweight, co[3], nor[3], orco[3], ornor[3];
if (ELEM3(NULL, ob, psys, psys->part))
@@ -1064,7 +1064,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
if (part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) {
BLI_srandom(31415926 + psys->seed);
dm= CDDM_from_mesh((Mesh*)ob->data, ob);
- distribute_grid(dm,psys);
+ distribute_grid(dm, psys);
dm->release(dm);
return 0;
}
@@ -1083,8 +1083,8 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
tree=BLI_kdtree_new(totpart);
- for (p=0,pa=psys->particles; p<totpart; p++,pa++) {
- psys_particle_on_dm(dm,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,nor,0,0,orco,ornor);
+ for (p=0, pa=psys->particles; p<totpart; p++, pa++) {
+ psys_particle_on_dm(dm, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, orco, ornor);
transform_mesh_orco_verts((Mesh*)ob->data, &orco, 1, 1);
BLI_kdtree_insert(tree, p, orco, ornor);
}
@@ -1117,12 +1117,12 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
for (p=0; p<totvert; p++) {
if (orcodata) {
- copy_v3_v3(co,orcodata[p]);
+ copy_v3_v3(co, orcodata[p]);
transform_mesh_orco_verts((Mesh*)ob->data, &co, 1, 1);
}
else
- copy_v3_v3(co,mv[p].co);
- BLI_kdtree_insert(tree,p,co,NULL);
+ copy_v3_v3(co, mv[p].co);
+ BLI_kdtree_insert(tree, p, co, NULL);
}
BLI_kdtree_balance(tree);
@@ -1136,7 +1136,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
distribute_invalid(scene, psys, children ? PART_FROM_CHILD : 0);
if (G.debug & G_DEBUG)
- fprintf(stderr,"Particle distribution error: Nothing to emit from!\n");
+ fprintf(stderr, "Particle distribution error: Nothing to emit from!\n");
if (dm != finaldm) dm->release(dm);
@@ -1159,7 +1159,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
orcodata= dm->getVertDataArray(dm, CD_ORCO);
for (i=0; i<totelem; i++) {
- MFace *mf=dm->getTessFaceData(dm,i,CD_MFACE);
+ MFace *mf=dm->getTessFaceData(dm, i, CD_MFACE);
if (orcodata) {
copy_v3_v3(co1, orcodata[mf->v1]);
@@ -1174,14 +1174,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
}
else {
- v1= (MVert*)dm->getVertData(dm,mf->v1,CD_MVERT);
- v2= (MVert*)dm->getVertData(dm,mf->v2,CD_MVERT);
- v3= (MVert*)dm->getVertData(dm,mf->v3,CD_MVERT);
+ v1= (MVert*)dm->getVertData(dm, mf->v1, CD_MVERT);
+ v2= (MVert*)dm->getVertData(dm, mf->v2, CD_MVERT);
+ v3= (MVert*)dm->getVertData(dm, mf->v3, CD_MVERT);
copy_v3_v3(co1, v1->co);
copy_v3_v3(co2, v2->co);
copy_v3_v3(co3, v3->co);
if (mf->v4) {
- v4= (MVert*)dm->getVertData(dm,mf->v4,CD_MVERT);
+ v4= (MVert*)dm->getVertData(dm, mf->v4, CD_MVERT);
copy_v3_v3(co4, v4->co);
}
}
@@ -1201,14 +1201,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
maxweight /= totarea;
}
else {
- float min=1.0f/(float)(MIN2(totelem,totpart));
+ float min=1.0f/(float)(MIN2(totelem, totpart));
for (i=0; i<totelem; i++)
element_weight[i]=min;
maxweight=min;
}
/* Calculate weights from vgroup */
- vweight = psys_cache_vgroup(dm,psys,PSYS_VG_DENSITY);
+ vweight = psys_cache_vgroup(dm, psys, PSYS_VG_DENSITY);
if (vweight) {
if (from==PART_FROM_VERT) {
@@ -1217,7 +1217,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
else { /* PART_FROM_FACE / PART_FROM_VOLUME */
for (i=0;i<totelem; i++) {
- MFace *mf=dm->getTessFaceData(dm,i,CD_MFACE);
+ MFace *mf=dm->getTessFaceData(dm, i, CD_MFACE);
tweight = vweight[mf->v1] + vweight[mf->v2] + vweight[mf->v3];
if (mf->v4) {
@@ -1302,7 +1302,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
/* Create jittering if needed */
- if (distr==PART_DISTR_JIT && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ if (distr==PART_DISTR_JIT && ELEM(from, PART_FROM_FACE, PART_FROM_VOLUME)) {
jitlevel= part->userjit;
if (jitlevel == 0) {
@@ -1398,7 +1398,7 @@ static void distribute_particles_on_shape(ParticleSimulationData *sim, int UNUSE
{
distribute_invalid(sim->scene, sim->psys, 0);
- fprintf(stderr,"Shape emission not yet possible!\n");
+ fprintf(stderr, "Shape emission not yet possible!\n");
}
static void distribute_particles(ParticleSimulationData *sim, int from)
@@ -1418,7 +1418,7 @@ static void distribute_particles(ParticleSimulationData *sim, int from)
if (distr_error) {
distribute_invalid(sim->scene, sim->psys, from);
- fprintf(stderr,"Particle distribution error!\n");
+ fprintf(stderr, "Particle distribution error!\n");
}
}
@@ -1619,18 +1619,18 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
ParticleSystem *psys = sim->psys;
ParticleSettings *part;
ParticleTexture ptex;
- float fac, phasefac, nor[3]={0,0,0},loc[3],vel[3]={0.0,0.0,0.0},rot[4],q2[4];
- float r_vel[3],r_ave[3],r_rot[4],vec[3],p_vel[3]={0.0,0.0,0.0};
- float x_vec[3]={1.0,0.0,0.0}, utan[3]={0.0,1.0,0.0}, vtan[3]={0.0,0.0,1.0}, rot_vec[3]={0.0,0.0,0.0};
+ float fac, phasefac, nor[3]={0, 0, 0}, loc[3], vel[3]={0.0, 0.0, 0.0}, rot[4], q2[4];
+ float r_vel[3], r_ave[3], r_rot[4], vec[3], p_vel[3]={0.0, 0.0, 0.0};
+ float x_vec[3]={1.0, 0.0, 0.0}, utan[3]={0.0, 1.0, 0.0}, vtan[3]={0.0, 0.0, 1.0}, rot_vec[3]={0.0, 0.0, 0.0};
float q_phase[4];
int p = pa - psys->particles;
part=psys->part;
/* get birth location from object */
if (part->tanfac != 0.f)
- psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0);
+ psys_particle_on_emitter(sim->psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, loc, nor, utan, vtan, 0, 0);
else
- psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0);
+ psys_particle_on_emitter(sim->psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, loc, nor, 0, 0, 0, 0);
/* get possible textural influence */
psys_get_texture(sim, pa, &ptex, PAMAP_IVEL, cfra);
@@ -1646,16 +1646,16 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
/* -tangent */
if (part->tanfac!=0.0f) {
- //float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm,part->from,pa,vg_rot)-0.5f):0.0f;
+ //float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm, part->from, pa, vg_rot)-0.5f):0.0f;
float phase=0.0f;
- mul_v3_fl(vtan,-cosf((float)M_PI*(part->tanphase+phase)));
+ mul_v3_fl(vtan, -cosf((float)M_PI*(part->tanphase+phase)));
fac= -sinf((float)M_PI*(part->tanphase+phase));
madd_v3_v3fl(vtan, utan, fac);
- mul_mat3_m4_v3(ob->obmat,vtan);
+ mul_mat3_m4_v3(ob->obmat, vtan);
copy_v3_v3(utan, nor);
- mul_v3_fl(utan,dot_v3v3(vtan,nor));
+ mul_v3_fl(utan, dot_v3v3(vtan, nor));
sub_v3_v3(vtan, utan);
normalize_v3(vtan);
@@ -1678,7 +1678,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
r_ave[1] = 2.0f * (PSYS_FRAND(p + 14) - 0.5f);
r_ave[2] = 2.0f * (PSYS_FRAND(p + 15) - 0.5f);
- mul_mat3_m4_v3(ob->obmat,r_ave);
+ mul_mat3_m4_v3(ob->obmat, r_ave);
normalize_v3(r_ave);
}
@@ -1690,14 +1690,14 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
r_rot[3] = 2.0f * (PSYS_FRAND(p + 19) - 0.5f);
normalize_qt(r_rot);
- mat4_to_quat(rot,ob->obmat);
- mul_qt_qtqt(r_rot,r_rot,rot);
+ mat4_to_quat(rot, ob->obmat);
+ mul_qt_qtqt(r_rot, r_rot, rot);
}
if (part->phystype==PART_PHYS_BOIDS && pa->boid) {
float dvec[3], q[4], mat[3][3];
- copy_v3_v3(state->co,loc);
+ copy_v3_v3(state->co, loc);
/* boids don't get any initial velocity */
zero_v3(state->vel);
@@ -1720,7 +1720,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
cross_v3_v3v3(mat[1], mat[2], mat[0]);
/* apply rotation */
- mat3_to_quat_is_ok( q,mat);
+ mat3_to_quat_is_ok( q, mat);
copy_qt_qt(state->rot, q);
}
else {
@@ -1774,7 +1774,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
mul_v3_v3fl(state->vel, vel, ptex.ivel);
/* -location from emitter */
- copy_v3_v3(state->co,loc);
+ copy_v3_v3(state->co, loc);
/* -rotation */
unit_qt(state->rot);
@@ -1802,19 +1802,19 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
/* create rotation quat */
negate_v3(rot_vec);
- vec_to_quat( q2,rot_vec, OB_POSX, OB_POSZ);
+ vec_to_quat(q2, rot_vec, OB_POSX, OB_POSZ);
/* randomize rotation quat */
if (part->randrotfac!=0.0f)
interp_qt_qtqt(rot, q2, r_rot, part->randrotfac);
else
- copy_qt_qt(rot,q2);
+ copy_qt_qt(rot, q2);
/* rotation phase */
phasefac = part->phasefac;
if (part->randphasefac != 0.0f)
phasefac += part->randphasefac * PSYS_FRAND(p + 20);
- axis_angle_to_quat( q_phase,x_vec, phasefac*(float)M_PI);
+ axis_angle_to_quat( q_phase, x_vec, phasefac*(float)M_PI);
/* combine base rotation & phase */
mul_qt_qtqt(state->rot, rot, q_phase);
@@ -2132,7 +2132,7 @@ static void psys_update_effectors(ParticleSimulationData *sim)
static void integrate_particle(ParticleSettings *part, ParticleData *pa, float dtime, float *external_acceleration, void (*force_func)(void *forcedata, ParticleKey *state, float *force, float *impulse), void *forcedata)
{
ParticleKey states[5];
- float force[3],acceleration[3],impulse[3],dx[4][3],dv[4][3],oldpos[3];
+ float force[3], acceleration[3], impulse[3], dx[4][3], dv[4][3], oldpos[3];
float pa_mass= (part->flag & PART_SIZEMASS ? part->mass * pa->size : part->mass);
int i, steps=1;
int integrator = part->integrator;
@@ -2713,23 +2713,23 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
time=(cfra-pa->time)/pa->lifetime;
CLAMP(time, 0.0f, 1.0f);
- copy_v3_v3(tkey.co,pa->state.co);
- copy_v3_v3(tkey.vel,pa->state.vel);
+ copy_v3_v3(tkey.co, pa->state.co);
+ copy_v3_v3(tkey.vel, pa->state.vel);
tkey.time=pa->state.time;
if (part->type != PART_HAIR) {
if (do_guides(sim->psys->effectors, &tkey, p, time)) {
- copy_v3_v3(pa->state.co,tkey.co);
+ copy_v3_v3(pa->state.co, tkey.co);
/* guides don't produce valid velocity */
sub_v3_v3v3(pa->state.vel, tkey.co, pa->prev_state.co);
- mul_v3_fl(pa->state.vel,1.0f/dtime);
+ mul_v3_fl(pa->state.vel, 1.0f/dtime);
pa->state.time=tkey.time;
}
}
}
static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, float timestep)
{
- float rotfac, rot1[4], rot2[4]={1.0,0.0,0.0,0.0}, dtime=dfra*timestep;
+ float rotfac, rot1[4], rot2[4]={1.0, 0.0, 0.0, 0.0}, dtime=dfra*timestep;
if ((part->flag & PART_ROTATIONS)==0) {
pa->state.rot[0]=1.0f;
@@ -2757,15 +2757,15 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
}
rotfac = len_v3(pa->state.ave);
- if (rotfac == 0.0f) { /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */
+ if (rotfac == 0.0f) { /* unit_qt(in VecRotToQuat) doesn't give unit quat [1, 0, 0, 0]?? */
rot1[0]=1.0f;
rot1[1]=rot1[2]=rot1[3]=0;
}
else {
- axis_angle_to_quat(rot1,pa->state.ave,rotfac*dtime);
+ axis_angle_to_quat(rot1, pa->state.ave, rotfac*dtime);
}
- mul_qt_qtqt(pa->state.rot,rot1,pa->prev_state.rot);
- mul_qt_qtqt(pa->state.rot,rot2,pa->state.rot);
+ mul_qt_qtqt(pa->state.rot, rot1, pa->prev_state.rot);
+ mul_qt_qtqt(pa->state.rot, rot2, pa->state.rot);
/* keep rotation quat in good health */
normalize_qt(pa->state.rot);
@@ -3256,8 +3256,8 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
float frict = pd->pdef_frict + pd->pdef_rfrict * 2 * (BLI_frand() - 0.5f);
float distance, nor[3], dot;
- CLAMP(damp,0.0f, 1.0f);
- CLAMP(frict,0.0f, 1.0f);
+ CLAMP(damp, 0.0f, 1.0f);
+ CLAMP(frict, 0.0f, 1.0f);
/* get exact velocity right before collision */
madd_v3_v3v3fl(v0, col->ve1, col->acc, dt1);
@@ -3603,7 +3603,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
psys_mat_hair_to_object(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat);
- for (k=0, key=pa->hair; k<pa->totkey; k++,key++) {
+ for (k=0, key=pa->hair; k<pa->totkey; k++, key++) {
/* create fake root before actual root to resist bending */
if (k==0) {
@@ -3869,7 +3869,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
}
/* initialize all particles for dynamics */
LOOP_SHOWN_PARTICLES {
- copy_particle_key(&pa->prev_state,&pa->state,1);
+ copy_particle_key(&pa->prev_state, &pa->state, 1);
psys_get_texture(sim, pa, &ptex, PAMAP_SIZE, cfra);
@@ -3948,7 +3948,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
SPHData sphdata;
sph_solver_init(sim, &sphdata);
- #pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic,5)
+ #pragma omp parallel for firstprivate (sphdata) private (pa) schedule(dynamic, 5)
LOOP_DYNAMIC_PARTICLES {
/* do global forces & effectors */
basic_integrate(sim, p, pa->state.time, cfra);
@@ -4085,7 +4085,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
gzf = BLI_gzopen(filename, "rb");
if (!gzf) {
- BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"readFsPartData::error - Unable to open file for reading '%s'\n", filename);
+ BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "readFsPartData::error - Unable to open file for reading '%s'\n", filename);
// XXX bad level call elbeemDebugOut(debugStrBuffer);
return;
}
@@ -4118,7 +4118,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
float wrf;
gzread(gzf, &wrf, sizeof( wrf ));
pa->state.co[j] = wrf;
- //fprintf(stderr,"Rj%d ",j);
+ //fprintf(stderr, "Rj%d ", j);
}
for (j=0; j<3; j++) {
float wrf;
@@ -4134,7 +4134,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
pa->dietime = sim->scene->r.efra + 1;
pa->lifetime = sim->scene->r.efra;
pa->alive = PARS_ALIVE;
- //if (a < 25) fprintf(stderr,"FSPARTICLE debug set %s , a%d = %f,%f,%f , life=%f\n", filename, a, pa->co[0],pa->co[1],pa->co[2], pa->lifetime );
+ //if (a < 25) fprintf(stderr, "FSPARTICLE debug set %s, a%d = %f, %f, %f, life=%f\n", filename, a, pa->co[0], pa->co[1], pa->co[2], pa->lifetime );
}
else {
// skip...
@@ -4147,7 +4147,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
gzclose(gzf);
totpart = psys->totpart = activeParts;
- BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d\n", psys->totpart,activeParts,fileParts,readMask);
+ BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d\n", psys->totpart, activeParts, fileParts, readMask);
// bad level call
// XXX elbeemDebugOut(debugStrBuffer);
@@ -4302,7 +4302,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
dynamics_step(sim, cfra+dframe+t_frac - 1.f);
psys->cfra = cfra+dframe+t_frac - 1.f;
#if 0
- printf("%f,%f,%f,%f\n", cfra+dframe+t_frac - 1.f, t_frac, dt_frac, sim->courant_num);
+ printf("%f, %f, %f, %f\n", cfra+dframe+t_frac - 1.f, t_frac, dt_frac, sim->courant_num);
#endif
if (part->time_flag & PART_TIME_AUTOSF)
dt_frac = update_timestep(psys, sim, t_frac);
@@ -4589,7 +4589,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
if (part->phystype == PART_PHYS_KEYED) {
psys_count_keyed_targets(&sim);
set_keyed_keys(&sim);
- psys_update_path_cache(&sim,(int)cfra);
+ psys_update_path_cache(&sim, (int)cfra);
}
break;
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 39293084dc0..1e80f1e6d1e 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -222,7 +222,7 @@ void BKE_ptcache_make_particle_key(ParticleKey *key, int index, void **data, flo
/* no rotation info, so make something nice up */
if (data[BPHYS_DATA_ROTATION]==NULL) {
- vec_to_quat( key->rot, key->vel, OB_NEGX, OB_POSZ);
+ vec_to_quat(key->rot, key->vel, OB_NEGX, OB_POSZ);
}
else {
PTCACHE_DATA_TO(data, BPHYS_DATA_ROTATION, index, key->rot);
@@ -366,7 +366,7 @@ static void ptcache_particle_interpolate(int index, void *psys_v, void **data, f
/* determine rotation from velocity */
if (data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
- vec_to_quat( keys[2].rot,keys[2].vel, OB_NEGX, OB_POSZ);
+ vec_to_quat(keys[2].rot, keys[2].vel, OB_NEGX, OB_POSZ);
}
if (cfra > pa->time)
@@ -400,7 +400,7 @@ static int ptcache_particle_totwrite(void *psys_v, int cfra)
if (cfra == 0)
return psys->totpart;
- for (p=0; p<psys->totpart; p++,pa++)
+ for (p=0; p<psys->totpart; p++, pa++)
totwrite += (cfra >= pa->time - step && cfra <= pa->dietime + step);
return totwrite;
@@ -720,7 +720,7 @@ static int ptcache_dynamicpaint_read(PTCacheFile *pf, void *dp_v)
/* version header */
ptcache_file_read(pf, version, 1, sizeof(char)*4);
- if (strncmp(version, DPAINT_CACHE_VERSION,4)) {printf("Dynamic Paint: Invalid cache version: %s!\n",version); return 0;}
+ if (strncmp(version, DPAINT_CACHE_VERSION, 4)) {printf("Dynamic Paint: Invalid cache version: %s!\n", version); return 0;}
if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && surface->data) {
unsigned int data_len;
@@ -1260,7 +1260,7 @@ static int ptcache_file_compressed_write(PTCacheFile *pf, unsigned char *in, uns
#ifdef WITH_LZMA
if (mode == 2) {
- r = LzmaCompress(out, &out_len, in, in_len,//assume sizeof(char)==1....
+ r = LzmaCompress(out, &out_len, in, in_len, //assume sizeof(char)==1....
props, &sizeOfIt, 5, 1 << 24, 3, 0, 2, 32, 2);
if (!(r == SZ_OK) || (out_len >= in_len))
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 01ab5745256..0a8f0bcb7d6 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -408,7 +408,7 @@ Scene *add_scene(const char *name)
sce->r.border.xmax = 1.0f;
sce->r.border.ymax = 1.0f;
- sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct");
+ sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings), "Tool Settings Struct");
sce->toolsettings->cornertype=1;
sce->toolsettings->degr = 90;
sce->toolsettings->step = 9;
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index d3eade834e6..4e307942bbb 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -294,7 +294,7 @@ static struct ImBuf * do_plugin_effect(
* old plugins) do very bad stuff
* with imbuf-internals */
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
int x = context.rectx;
int y = context.recty;
@@ -548,7 +548,7 @@ static struct ImBuf * do_alphaover_effect(
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
if (out->rect_float) {
do_alphaover_effect_float(
@@ -937,7 +937,7 @@ static float gammaCorrect(float c)
float res = 0.0;
i = floor(c * inv_color_step);
- /* Clip to range [0,1]: outside, just do the complete calculation. */
+ /* Clip to range [0, 1]: outside, just do the complete calculation. */
/* We may have some performance problems here. Stretching up the LUT */
/* may help solve that, by exchanging LUT size for the interpolation. */
/* Negative colors are explicitly handled. */
@@ -1121,7 +1121,7 @@ static struct ImBuf * do_gammacross_effect(
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
build_gammatabs();
@@ -1240,7 +1240,7 @@ static struct ImBuf * do_add_effect(SeqRenderData context,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
if (out->rect_float) {
do_add_effect_float(
@@ -1357,7 +1357,7 @@ static struct ImBuf * do_sub_effect(
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
if (out->rect_float) {
do_sub_effect_float(
@@ -1571,7 +1571,7 @@ static struct ImBuf * do_mul_effect(
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
if (out->rect_float) {
do_mul_effect_float(
@@ -1612,7 +1612,7 @@ static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo
}
// This function calculates the blur band for the wipe effects
-static float in_band(float width,float dist,int side,int dir)
+static float in_band(float width, float dist, int side, int dir)
{
float alpha;
@@ -1636,15 +1636,15 @@ static float in_band(float width,float dist,int side,int dir)
static float check_zone(WipeZone *wipezone, int x, int y,
Sequence *seq, float facf0)
{
- float posx, posy,hyp,hyp2,angle,hwidth,b1,b2,b3,pointdist;
+ float posx, posy, hyp, hyp2, angle, hwidth, b1, b2, b3, pointdist;
/* some future stuff */
- // float hyp3,hyp4,b4,b5
- float temp1,temp2,temp3,temp4; //some placeholder variables
+ // float hyp3, hyp4, b4, b5
+ float temp1, temp2, temp3, temp4; //some placeholder variables
int xo = wipezone->xo;
int yo = wipezone->yo;
float halfx = xo*0.5f;
float halfy = yo*0.5f;
- float widthf,output=0;
+ float widthf, output=0;
WipeVars *wipe = (WipeVars *)seq->effectdata;
int width;
@@ -1683,15 +1683,15 @@ static float check_zone(WipeZone *wipezone, int x, int y,
if (wipe->forward) {
if (b1 < b2)
- output = in_band(width,hyp,1,1);
+ output = in_band(width, hyp, 1, 1);
else
- output = in_band(width,hyp,0,1);
+ output = in_band(width, hyp, 0, 1);
}
else {
if (b1 < b2)
- output = in_band(width,hyp,0,1);
+ output = in_band(width, hyp, 0, 1);
else
- output = in_band(width,hyp,1,1);
+ output = in_band(width, hyp, 1, 1);
}
break;
@@ -1721,25 +1721,25 @@ static float check_zone(WipeZone *wipezone, int x, int y,
hwidth = minf(hwidth, fabsf(b3-b1)/2.0f);
if (b2 < b1 && b2 < b3 ) {
- output = in_band(hwidth,hyp,0,1);
+ output = in_band(hwidth, hyp, 0, 1);
}
else if (b2 > b1 && b2 > b3 ) {
- output = in_band(hwidth,hyp2,0,1);
+ output = in_band(hwidth, hyp2, 0, 1);
}
else {
if ( hyp < hwidth && hyp2 > hwidth )
- output = in_band(hwidth,hyp,1,1);
+ output = in_band(hwidth, hyp, 1, 1);
else if ( hyp > hwidth && hyp2 < hwidth )
- output = in_band(hwidth,hyp2,1,1);
+ output = in_band(hwidth, hyp2, 1, 1);
else
- output = in_band(hwidth,hyp2,1,1) * in_band(hwidth,hyp,1,1);
+ output = in_band(hwidth, hyp2, 1, 1) * in_band(hwidth, hyp, 1, 1);
}
if (!wipe->forward)output = 1-output;
break;
case DO_CLOCK_WIPE:
/*
* temp1: angle of effect center in rads
- * temp2: angle of line through (halfx,halfy) and (x,y) in rads
+ * temp2: angle of line through (halfx, halfy) and (x, y) in rads
* temp3: angle of low side of blur
* temp4: angle of high side of blur
*/
@@ -1801,19 +1801,19 @@ static float check_zone(WipeZone *wipezone, int x, int y,
if (b2 < b1 && b2 < b3 ) {
if (hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp,facf0,0,1);
+ output = in_band(wipezone, hwidth, hyp, facf0, 0, 1);
}
else if (b2 > b1 && b2 > b3 ) {
if (hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp2,facf0,0,1);
+ output = in_band(wipezone, hwidth, hyp2, facf0, 0, 1);
}
else {
if ( hyp < hwidth && hyp2 > hwidth )
- output = in_band(wipezone,hwidth,hyp,facf0,1,1);
+ output = in_band(wipezone, hwidth, hyp, facf0, 1, 1);
else if ( hyp > hwidth && hyp2 < hwidth )
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1);
+ output = in_band(wipezone, hwidth, hyp2, facf0, 1, 1);
else
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
+ output = in_band(wipezone, hwidth, hyp2, facf0, 1, 1) * in_band(wipezone, hwidth, hyp, facf0, 1, 1);
}
if (invert)facf0 = 1-facf0;
@@ -1827,19 +1827,19 @@ static float check_zone(WipeZone *wipezone, int x, int y,
if (b2 < b1 && b2 < b3 ) {
if (hwidth < pointdist)
- output *= in_band(wipezone,hwidth,hyp,facf0,0,1);
+ output *= in_band(wipezone, hwidth, hyp, facf0, 0, 1);
}
else if (b2 > b1 && b2 > b3 ) {
if (hwidth < pointdist)
- output *= in_band(wipezone,hwidth,hyp2,facf0,0,1);
+ output *= in_band(wipezone, hwidth, hyp2, facf0, 0, 1);
}
else {
if ( hyp < hwidth && hyp2 > hwidth )
- output *= in_band(wipezone,hwidth,hyp,facf0,1,1);
+ output *= in_band(wipezone, hwidth, hyp, facf0, 1, 1);
else if ( hyp > hwidth && hyp2 < hwidth )
- output *= in_band(wipezone,hwidth,hyp2,facf0,1,1);
+ output *= in_band(wipezone, hwidth, hyp2, facf0, 1, 1);
else
- output *= in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
+ output *= in_band(wipezone, hwidth, hyp2, facf0, 1, 1) * in_band(wipezone, hwidth, hyp, facf0, 1, 1);
}
break;
@@ -1857,8 +1857,8 @@ static float check_zone(WipeZone *wipezone, int x, int y,
pointdist = sqrt(temp1*temp1 + temp1*temp1);
temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
- if (temp2 > pointdist) output = in_band(hwidth,fabs(temp2-pointdist),0,1);
- else output = in_band(hwidth,fabs(temp2-pointdist),1,1);
+ if (temp2 > pointdist) output = in_band(hwidth, fabs(temp2-pointdist), 0, 1);
+ else output = in_band(hwidth, fabs(temp2-pointdist), 1, 1);
if (!wipe->forward) output = 1-output;
@@ -1911,7 +1911,7 @@ static void do_wipe_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1),
yo = y;
for (y=0;y<yo;y++) {
for (x=0;x<xo;x++) {
- float check = check_zone(&wipezone,x,y,seq,facf0);
+ float check = check_zone(&wipezone, x, y, seq, facf0);
if (check) {
if (rt1) {
rt[0] = (int)(rt1[0]*check)+ (int)(rt2[0]*(1-check));
@@ -1972,7 +1972,7 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float UNUSED(facf1)
yo = y;
for (y=0;y<yo;y++) {
for (x=0;x<xo;x++) {
- float check = check_zone(&wipezone,x,y,seq,facf0);
+ float check = check_zone(&wipezone, x, y, seq, facf0);
if (check) {
if (rt1) {
rt[0] = rt1[0]*check+ rt2[0]*(1-check);
@@ -2019,7 +2019,7 @@ static struct ImBuf * do_wipe_effect(
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
if (out->rect_float) {
do_wipe_effect_float(seq,
@@ -2083,7 +2083,7 @@ static void transform_image(int x, int y, struct ImBuf *ibuf1, struct ImBuf *out
{
int xo, yo, xi, yi;
float xt, yt, xr, yr;
- float s,c;
+ float s, c;
xo = x;
yo = y;
@@ -2114,13 +2114,13 @@ static void transform_image(int x, int y, struct ImBuf *ibuf1, struct ImBuf *out
//interpolate
switch (interpolation) {
case 0:
- neareast_interpolation(ibuf1,out, xt,yt,xi,yi);
+ neareast_interpolation(ibuf1, out, xt, yt, xi, yi);
break;
case 1:
- bilinear_interpolation(ibuf1,out, xt,yt,xi,yi);
+ bilinear_interpolation(ibuf1, out, xt, yt, xi, yi);
break;
case 2:
- bicubic_interpolation(ibuf1,out, xt,yt,xi,yi);
+ bicubic_interpolation(ibuf1, out, xt, yt, xi, yi);
break;
}
}
@@ -2128,7 +2128,7 @@ static void transform_image(int x, int y, struct ImBuf *ibuf1, struct ImBuf *out
}
static void do_transform(Scene *scene, Sequence *seq, float UNUSED(facf0), int x, int y,
- struct ImBuf *ibuf1,struct ImBuf *out)
+ struct ImBuf *ibuf1, struct ImBuf *out)
{
TransformVars *transform = (TransformVars *)seq->effectdata;
float scale_x, scale_y, translate_x, translate_y, rotate_radians;
@@ -2157,17 +2157,17 @@ static void do_transform(Scene *scene, Sequence *seq, float UNUSED(facf0), int x
// Rotate
rotate_radians = DEG2RADF(transform->rotIni);
- transform_image(x,y, ibuf1, out, scale_x, scale_y, translate_x, translate_y, rotate_radians, transform->interpolation);
+ transform_image(x, y, ibuf1, out, scale_x, scale_y, translate_x, translate_y, rotate_radians, transform->interpolation);
}
static struct ImBuf * do_transform_effect(
- SeqRenderData context, Sequence *seq,float UNUSED(cfra),
+ SeqRenderData context, Sequence *seq, float UNUSED(cfra),
float facf0, float UNUSED(facf1),
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
do_transform(context.scene, seq, facf0,
context.rectx, context.recty, ibuf1, out);
@@ -2180,7 +2180,7 @@ static struct ImBuf * do_transform_effect(
* GLOW
* ********************************************************************** */
-static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
+static void RVBlurBitmap2_byte ( unsigned char* map, int width, int height,
float blur,
int quality)
/* MUUUCCH better than the previous blur. */
@@ -2192,9 +2192,9 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
/* a small bitmap. Avoid avoid avoid. */
/*=============================== */
{
- unsigned char* temp=NULL,*swap;
+ unsigned char* temp=NULL, *swap;
float *filter=NULL;
- int x,y,i,fx,fy;
+ int x, y, i, fx, fy;
int index, ix, halfWidth;
float fval, k, curColor[3], curColor2[3], weight=0;
@@ -2349,7 +2349,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
MEM_freeN (temp);
}
-static void RVBlurBitmap2_float ( float* map, int width,int height,
+static void RVBlurBitmap2_float ( float* map, int width, int height,
float blur,
int quality)
/* MUUUCCH better than the previous blur. */
@@ -2361,9 +2361,9 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
/* a small bitmap. Avoid avoid avoid. */
/*=============================== */
{
- float* temp=NULL,*swap;
+ float* temp=NULL, *swap;
float *filter=NULL;
- int x,y,i,fx,fy;
+ int x, y, i, fx, fy;
int index, ix, halfWidth;
float fval, k, curColor[3], curColor2[3], weight=0;
@@ -2526,15 +2526,15 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
/*=============================== */
static void RVAddBitmaps_byte (unsigned char* a, unsigned char* b, unsigned char* c, int width, int height)
{
- int x,y,index;
+ int x, y, index;
for (y=0;y<height;y++) {
for (x=0;x<width;x++) {
index=(x+y*width)*4;
- c[index+GlowR]=MIN2(255,a[index+GlowR]+b[index+GlowR]);
- c[index+GlowG]=MIN2(255,a[index+GlowG]+b[index+GlowG]);
- c[index+GlowB]=MIN2(255,a[index+GlowB]+b[index+GlowB]);
- c[index+GlowA]=MIN2(255,a[index+GlowA]+b[index+GlowA]);
+ c[index+GlowR]=MIN2(255, a[index+GlowR]+b[index+GlowR]);
+ c[index+GlowG]=MIN2(255, a[index+GlowG]+b[index+GlowG]);
+ c[index+GlowB]=MIN2(255, a[index+GlowB]+b[index+GlowB]);
+ c[index+GlowA]=MIN2(255, a[index+GlowA]+b[index+GlowA]);
}
}
}
@@ -2542,7 +2542,7 @@ static void RVAddBitmaps_byte (unsigned char* a, unsigned char* b, unsigned char
static void RVAddBitmaps_float (float* a, float* b, float* c,
int width, int height)
{
- int x,y,index;
+ int x, y, index;
for (y=0;y<height;y++) {
for (x=0;x<width;x++) {
@@ -2561,7 +2561,7 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
int width, int height, int threshold,
float boost, float clamp)
{
- int x,y,index;
+ int x, y, index;
int intensity;
@@ -2591,7 +2591,7 @@ static void RVIsolateHighlights_float (float* in, float* out,
int width, int height, float threshold,
float boost, float clamp)
{
- int x,y,index;
+ int x, y, index;
float intensity;
@@ -2658,10 +2658,10 @@ static void do_glow_effect_byte(Sequence *seq, int render_size, float facf0, flo
unsigned char *inbuf=(unsigned char *)rect1;
GlowVars *glow = (GlowVars *)seq->effectdata;
- RVIsolateHighlights_byte(inbuf, outbuf , x, y, glow->fMini*765, glow->fBoost * facf0, glow->fClamp);
- RVBlurBitmap2_byte (outbuf, x, y, glow->dDist * (render_size / 100.0f),glow->dQuality);
+ RVIsolateHighlights_byte(inbuf, outbuf, x, y, glow->fMini*765, glow->fBoost * facf0, glow->fClamp);
+ RVBlurBitmap2_byte (outbuf, x, y, glow->dDist * (render_size / 100.0f), glow->dQuality);
if (!glow->bNoComp)
- RVAddBitmaps_byte (inbuf , outbuf, outbuf, x, y);
+ RVAddBitmaps_byte (inbuf, outbuf, outbuf, x, y);
}
static void do_glow_effect_float(Sequence *seq, int render_size, float facf0, float UNUSED(facf1),
@@ -2672,10 +2672,10 @@ static void do_glow_effect_float(Sequence *seq, int render_size, float facf0, fl
float *inbuf = rect1;
GlowVars *glow = (GlowVars *)seq->effectdata;
- RVIsolateHighlights_float(inbuf, outbuf , x, y, glow->fMini*3.0f, glow->fBoost * facf0, glow->fClamp);
- RVBlurBitmap2_float (outbuf, x, y, glow->dDist * (render_size / 100.0f),glow->dQuality);
+ RVIsolateHighlights_float(inbuf, outbuf, x, y, glow->fMini*3.0f, glow->fBoost * facf0, glow->fClamp);
+ RVBlurBitmap2_float (outbuf, x, y, glow->dDist * (render_size / 100.0f), glow->dQuality);
if (!glow->bNoComp)
- RVAddBitmaps_float (inbuf , outbuf, outbuf, x, y);
+ RVAddBitmaps_float (inbuf, outbuf, outbuf, x, y);
}
static struct ImBuf * do_glow_effect(
@@ -2684,7 +2684,7 @@ static struct ImBuf * do_glow_effect(
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
int render_size = 100*context.rectx/context.scene->r.xsch;
@@ -2749,7 +2749,7 @@ static struct ImBuf * do_solid_color(
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
SolidColorVars *cv = (SolidColorVars *)seq->effectdata;
@@ -3234,7 +3234,7 @@ static struct ImBuf * do_overdrop_effect(SeqRenderData context,
struct ImBuf * ibuf2,
struct ImBuf * ibuf3)
{
- struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
+ struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
int x = context.rectx;
int y = context.recty;
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 309164cb935..e4fca26a3bc 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1568,7 +1568,7 @@ static void update_effectors(Scene *scene, Object *ob, SmokeDomainSettings *sds,
for(z = 0; z < sds->res[2]; z++)
{
EffectedPoint epoint;
- float voxelCenter[3] = {0,0,0} , vel[3] = {0,0,0} , retvel[3] = {0,0,0};
+ float voxelCenter[3] = {0,0,0}, vel[3] = {0,0,0}, retvel[3] = {0,0,0};
unsigned int index = smoke_get_index(x, sds->res[0], y, sds->res[1], z);
if((density[index] < FLT_EPSILON) || obstacle[index])
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 5d8a4955e58..479c0393573 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -90,18 +90,18 @@ static int (*SB_localInterruptCallBack)(void) = NULL;
/* ********** soft body engine ******* */
-typedef enum {SB_EDGE=1,SB_BEND=2,SB_STIFFQUAD=3,SB_HANDLE=4} type_spring;
+typedef enum {SB_EDGE=1, SB_BEND=2, SB_STIFFQUAD=3, SB_HANDLE=4} type_spring;
typedef struct BodySpring {
int v1, v2;
- float len,cf,load;
+ float len, cf, load;
float ext_force[3]; /* edges colliding and sailing */
type_spring springtype;
short flag;
} BodySpring;
typedef struct BodyFace {
- int v1, v2, v3 ,v4;
+ int v1, v2, v3, v4;
float ext_force[3]; /* faces colliding */
short flag;
} BodyFace;
@@ -124,7 +124,7 @@ typedef struct SBScratch {
short flag;
BodyFace *bodyface;
int totface;
- float aabbmin[3],aabbmax[3];
+ float aabbmin[3], aabbmax[3];
ReferenceState Ref;
} SBScratch;
@@ -223,8 +223,8 @@ static float sb_time_scale(Object *ob)
We DO linear interpolation for goals .. and i think we should do on animated properties as well
*/
-/* animate sb->maxgoal,sb->mingoal */
-static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */
+/* animate sb->maxgoal, sb->mingoal */
+static float _final_goal(Object *ob, BodyPoint *bp)/*jow_go_for2_5 */
{
float f = -1999.99f;
if (ob) {
@@ -241,7 +241,7 @@ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */
return f; /*using crude but spot able values some times helps debuggin */
}
-static float _final_mass(Object *ob,BodyPoint *bp)
+static float _final_mass(Object *ob, BodyPoint *bp)
{
if (ob) {
SoftBody *sb= ob->soft; /* is supposed to be there */
@@ -259,7 +259,7 @@ static float _final_mass(Object *ob,BodyPoint *bp)
/********************
for each target object/face the axis aligned bounding box (AABB) is stored
faces parallel to global axes
-so only simple "value" in [min,max] ckecks are used
+so only simple "value" in [min, max] ckecks are used
float operations still
*/
@@ -295,7 +295,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
ccd_Mesh *pccd_M = NULL;
ccdf_minmax *mima = NULL;
MFace *mface=NULL;
- float v[3],hull;
+ float v[3], hull;
int i;
cmd =(CollisionModifierData *)modifiers_findByType(ob, eModifierType_Collision);
@@ -304,7 +304,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
if (!cmd) return NULL;
if (!cmd->numverts || !cmd->numfaces) return NULL;
- pccd_M = MEM_mallocN(sizeof(ccd_Mesh),"ccd_Mesh");
+ pccd_M = MEM_mallocN(sizeof(ccd_Mesh), "ccd_Mesh");
pccd_M->totvert = cmd->numverts;
pccd_M->totface = cmd->numfaces;
pccd_M->savety = CCD_SAVETY;
@@ -314,7 +314,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
/* blow it up with forcefield ranges */
- hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft);
+ hull = MAX2(ob->pd->pdef_sbift, ob->pd->pdef_sboft);
/* alloc and copy verts*/
pccd_M->mvert = MEM_dupallocN(cmd->xnew);
@@ -322,21 +322,21 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
/* determine the ortho BB */
for (i=0; i < pccd_M->totvert; i++) {
/* evaluate limits */
- copy_v3_v3(v,pccd_M->mvert[i].co);
- pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
- pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
- pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
+ copy_v3_v3(v, pccd_M->mvert[i].co);
+ pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0], v[0]-hull);
+ pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1], v[1]-hull);
+ pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2], v[2]-hull);
- pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0],v[0]+hull);
- pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1],v[1]+hull);
- pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
+ pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0], v[0]+hull);
+ pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1], v[1]+hull);
+ pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2], v[2]+hull);
}
/* alloc and copy faces*/
pccd_M->mface = MEM_dupallocN(cmd->mfaces);
/* OBBs for idea1 */
- pccd_M->mima = MEM_mallocN(sizeof(ccdf_minmax)*pccd_M->totface,"ccd_Mesh_Faces_mima");
+ pccd_M->mima = MEM_mallocN(sizeof(ccdf_minmax)*pccd_M->totface, "ccd_Mesh_Faces_mima");
mima = pccd_M->mima;
mface = pccd_M->mface;
@@ -346,38 +346,38 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
- copy_v3_v3(v,pccd_M->mvert[mface->v1].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
- copy_v3_v3(v,pccd_M->mvert[mface->v2].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
- copy_v3_v3(v,pccd_M->mvert[mface->v3].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
+ copy_v3_v3(v, pccd_M->mvert[mface->v1].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
+
+ copy_v3_v3(v, pccd_M->mvert[mface->v2].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
+
+ copy_v3_v3(v, pccd_M->mvert[mface->v3].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
if (mface->v4) {
- copy_v3_v3(v,pccd_M->mvert[mface->v4].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
+ copy_v3_v3(v, pccd_M->mvert[mface->v4].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
}
@@ -387,12 +387,12 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
}
return pccd_M;
}
-static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
+static void ccd_mesh_update(Object *ob, ccd_Mesh *pccd_M)
{
CollisionModifierData *cmd;
ccdf_minmax *mima = NULL;
MFace *mface=NULL;
- float v[3],hull;
+ float v[3], hull;
int i;
cmd =(CollisionModifierData *)modifiers_findByType(ob, eModifierType_Collision);
@@ -412,7 +412,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
/* blow it up with forcefield ranges */
- hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft);
+ hull = MAX2(ob->pd->pdef_sbift, ob->pd->pdef_sboft);
/* rotate current to previous */
if (pccd_M->mprevvert) MEM_freeN(pccd_M->mprevvert);
@@ -423,24 +423,24 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
/* determine the ortho BB */
for (i=0; i < pccd_M->totvert; i++) {
/* evaluate limits */
- copy_v3_v3(v,pccd_M->mvert[i].co);
- pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
- pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
- pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
+ copy_v3_v3(v, pccd_M->mvert[i].co);
+ pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0], v[0]-hull);
+ pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1], v[1]-hull);
+ pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2], v[2]-hull);
- pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0],v[0]+hull);
- pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1],v[1]+hull);
- pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
+ pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0], v[0]+hull);
+ pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1], v[1]+hull);
+ pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2], v[2]+hull);
/* evaluate limits */
- copy_v3_v3(v,pccd_M->mprevvert[i].co);
- pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
- pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
- pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
+ copy_v3_v3(v, pccd_M->mprevvert[i].co);
+ pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0], v[0]-hull);
+ pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1], v[1]-hull);
+ pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2], v[2]-hull);
- pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0],v[0]+hull);
- pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1],v[1]+hull);
- pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
+ pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0], v[0]+hull);
+ pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1], v[1]+hull);
+ pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2], v[2]+hull);
}
@@ -453,73 +453,73 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
- copy_v3_v3(v,pccd_M->mvert[mface->v1].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
- copy_v3_v3(v,pccd_M->mvert[mface->v2].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
- copy_v3_v3(v,pccd_M->mvert[mface->v3].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
+ copy_v3_v3(v, pccd_M->mvert[mface->v1].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
+
+ copy_v3_v3(v, pccd_M->mvert[mface->v2].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
+
+ copy_v3_v3(v, pccd_M->mvert[mface->v3].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
if (mface->v4) {
- copy_v3_v3(v,pccd_M->mvert[mface->v4].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
+ copy_v3_v3(v, pccd_M->mvert[mface->v4].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
}
- copy_v3_v3(v,pccd_M->mprevvert[mface->v1].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
- copy_v3_v3(v,pccd_M->mprevvert[mface->v2].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
- copy_v3_v3(v,pccd_M->mprevvert[mface->v3].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
+ copy_v3_v3(v, pccd_M->mprevvert[mface->v1].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
+
+ copy_v3_v3(v, pccd_M->mprevvert[mface->v2].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
+
+ copy_v3_v3(v, pccd_M->mprevvert[mface->v3].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
if (mface->v4) {
- copy_v3_v3(v,pccd_M->mprevvert[mface->v4].co);
- mima->minx = MIN2(mima->minx,v[0]-hull);
- mima->miny = MIN2(mima->miny,v[1]-hull);
- mima->minz = MIN2(mima->minz,v[2]-hull);
- mima->maxx = MAX2(mima->maxx,v[0]+hull);
- mima->maxy = MAX2(mima->maxy,v[1]+hull);
- mima->maxz = MAX2(mima->maxz,v[2]+hull);
+ copy_v3_v3(v, pccd_M->mprevvert[mface->v4].co);
+ mima->minx = MIN2(mima->minx, v[0]-hull);
+ mima->miny = MIN2(mima->miny, v[1]-hull);
+ mima->minz = MIN2(mima->minz, v[2]-hull);
+ mima->maxx = MAX2(mima->maxx, v[0]+hull);
+ mima->maxy = MAX2(mima->maxy, v[1]+hull);
+ mima->maxz = MAX2(mima->maxz, v[2]+hull);
}
@@ -587,9 +587,9 @@ static void ccd_update_deflector_hash(Scene *scene, Object *vertexowner, GHash *
/*+++ only with deflecting set */
if (ob->pd && ob->pd->deflect) {
- ccd_Mesh *ccdmesh = BLI_ghash_lookup(hash,ob);
+ ccd_Mesh *ccdmesh = BLI_ghash_lookup(hash, ob);
if (ccdmesh)
- ccd_mesh_update(ob,ccdmesh);
+ ccd_mesh_update(ob, ccdmesh);
}/*--- only with deflecting set */
}/* mesh && layer*/
@@ -605,7 +605,7 @@ static void ccd_update_deflector_hash(Scene *scene, Object *vertexowner, GHash *
static int count_mesh_quads(Mesh *me)
{
- int a,result = 0;
+ int a, result = 0;
MFace *mface= me->mface;
if (mface) {
@@ -632,7 +632,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
if (nofquads) {
/* resize spring-array to hold additional quad springs */
bs_new= MEM_callocN( (ob->soft->totspring + nofquads *2 )*sizeof(BodySpring), "bodyspring");
- memcpy(bs_new,ob->soft->bspring,(ob->soft->totspring )*sizeof(BodySpring));
+ memcpy(bs_new, ob->soft->bspring, (ob->soft->totspring )*sizeof(BodySpring));
if (ob->soft->bspring)
MEM_freeN(ob->soft->bspring); /* do this before reassigning the pointer or have a 1st class memory leak */
@@ -664,13 +664,13 @@ static void add_mesh_quad_diag_springs(Object *ob)
}
}
-static void add_2nd_order_roller(Object *ob,float UNUSED(stiffness), int *counter, int addsprings)
+static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *counter, int addsprings)
{
/*assume we have a softbody*/
SoftBody *sb= ob->soft; /* is supposed to be there */
- BodyPoint *bp,*bpo;
- BodySpring *bs,*bs2,*bs3= NULL;
- int a,b,c,notthis= 0,v0;
+ BodyPoint *bp, *bpo;
+ BodySpring *bs, *bs2, *bs3= NULL;
+ int a, b, c, notthis= 0, v0;
if (!sb->bspring) {return;} /* we are 2nd order here so 1rst should have been build :) */
/* first run counting second run adding */
*counter = 0;
@@ -726,28 +726,28 @@ static void add_2nd_order_roller(Object *ob,float UNUSED(stiffness), int *counte
}
-static void add_2nd_order_springs(Object *ob,float stiffness)
+static void add_2nd_order_springs(Object *ob, float stiffness)
{
int counter = 0;
BodySpring *bs_new;
stiffness *=stiffness;
- add_2nd_order_roller(ob,stiffness,&counter,0); /* counting */
+ add_2nd_order_roller(ob, stiffness, &counter, 0); /* counting */
if (counter) {
/* resize spring-array to hold additional springs */
bs_new= MEM_callocN( (ob->soft->totspring + counter )*sizeof(BodySpring), "bodyspring");
- memcpy(bs_new,ob->soft->bspring,(ob->soft->totspring )*sizeof(BodySpring));
+ memcpy(bs_new, ob->soft->bspring, (ob->soft->totspring )*sizeof(BodySpring));
if (ob->soft->bspring)
MEM_freeN(ob->soft->bspring);
ob->soft->bspring = bs_new;
- add_2nd_order_roller(ob,stiffness,&counter,1); /* adding */
+ add_2nd_order_roller(ob, stiffness, &counter, 1); /* adding */
ob->soft->totspring += counter;
}
}
-static void add_bp_springlist(BodyPoint *bp,int springID)
+static void add_bp_springlist(BodyPoint *bp, int springID)
{
int *newlist;
@@ -759,7 +759,7 @@ static void add_bp_springlist(BodyPoint *bp,int springID)
else {
bp->nofsprings++;
newlist = MEM_callocN(bp->nofsprings * sizeof(int), "bpsprings");
- memcpy(newlist,bp->springs,(bp->nofsprings-1)* sizeof(int));
+ memcpy(newlist, bp->springs, (bp->nofsprings-1)* sizeof(int));
MEM_freeN(bp->springs);
bp->springs = newlist;
bp->springs[bp->nofsprings-1] = springID;
@@ -774,7 +774,7 @@ static void build_bps_springlist(Object *ob)
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
BodySpring *bs;
- int a,b;
+ int a, b;
if (sb==NULL) return; /* paranoya check */
@@ -787,10 +787,10 @@ static void build_bps_springlist(Object *ob)
/* scan for attached inner springs */
for (b=sb->totspring, bs= sb->bspring; b>0; b--, bs++) {
if (( (sb->totpoint-a) == bs->v1) ) {
- add_bp_springlist(bp,sb->totspring -b);
+ add_bp_springlist(bp, sb->totspring -b);
}
if (( (sb->totpoint-a) == bs->v2) ) {
- add_bp_springlist(bp,sb->totspring -b);
+ add_bp_springlist(bp, sb->totspring -b);
}
}/*for springs*/
}/*for bp*/
@@ -801,8 +801,8 @@ static void calculate_collision_balls(Object *ob)
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
BodySpring *bs;
- int a,b,akku_count;
- float min,max,akku;
+ int a, b, akku_count;
+ float min, max, akku;
if (sb==NULL) return; /* paranoya check */
@@ -818,8 +818,8 @@ static void calculate_collision_balls(Object *ob)
if (bs->springtype == SB_EDGE) {
akku += bs->len;
akku_count++,
- min = MIN2(bs->len,min);
- max = MAX2(bs->len,max);
+ min = MIN2(bs->len, min);
+ max = MAX2(bs->len, max);
}
}
@@ -1015,21 +1015,21 @@ static int query_external_colliders(Scene *scene, Object *me)
/* +++ the aabb "force" section*/
-static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int UNUSED(par_layer),struct Object *vertexowner,float UNUSED(time))
+static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int UNUSED(par_layer), struct Object *vertexowner, float UNUSED(time))
{
Object *ob;
SoftBody *sb=vertexowner->soft;
GHash *hash;
GHashIterator *ihash;
- float aabbmin[3],aabbmax[3];
+ float aabbmin[3], aabbmax[3];
int deflected=0;
#if 0
int a;
#endif
if ((sb == NULL) || (sb->scratch ==NULL)) return 0;
- copy_v3_v3(aabbmin,sb->scratch->aabbmin);
- copy_v3_v3(aabbmax,sb->scratch->aabbmax);
+ copy_v3_v3(aabbmin, sb->scratch->aabbmin);
+ copy_v3_v3(aabbmax, sb->scratch->aabbmax);
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
@@ -1085,22 +1085,22 @@ static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int
/* +++ the face external section*/
-static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp,
- float force[3], unsigned int UNUSED(par_layer),struct Object *vertexowner,float time)
- {
+static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float face_v3[3], float *damp,
+ float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time)
+{
Object *ob;
GHash *hash;
GHashIterator *ihash;
- float nv1[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3],aabbmax[3];
- float facedist,outerfacethickness,tune = 10.f;
+ float nv1[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
+ float facedist, outerfacethickness, tune = 10.f;
int a, deflected=0;
- aabbmin[0] = MIN3(face_v1[0],face_v2[0],face_v3[0]);
- aabbmin[1] = MIN3(face_v1[1],face_v2[1],face_v3[1]);
- aabbmin[2] = MIN3(face_v1[2],face_v2[2],face_v3[2]);
- aabbmax[0] = MAX3(face_v1[0],face_v2[0],face_v3[0]);
- aabbmax[1] = MAX3(face_v1[1],face_v2[1],face_v3[1]);
- aabbmax[2] = MAX3(face_v1[2],face_v2[2],face_v3[2]);
+ aabbmin[0] = MIN3(face_v1[0], face_v2[0], face_v3[0]);
+ aabbmin[1] = MIN3(face_v1[1], face_v2[1], face_v3[1]);
+ aabbmin[2] = MIN3(face_v1[2], face_v2[2], face_v3[2]);
+ aabbmax[0] = MAX3(face_v1[0], face_v2[0], face_v3[0]);
+ aabbmax[1] = MAX3(face_v1[1], face_v2[1], face_v3[1]);
+ aabbmax[2] = MAX3(face_v1[2], face_v2[2], face_v3[2]);
/* calculate face normal once again SIGH */
sub_v3_v3v3(edge1, face_v1, face_v2);
@@ -1147,16 +1147,16 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
/* use mesh*/
if (mvert) {
while (a) {
- copy_v3_v3(nv1,mvert[a-1].co);
+ copy_v3_v3(nv1, mvert[a-1].co);
if (mprevvert) {
- mul_v3_fl(nv1,time);
- Vec3PlusStVec(nv1,(1.0f-time),mprevvert[a-1].co);
+ mul_v3_fl(nv1, time);
+ Vec3PlusStVec(nv1, (1.0f-time), mprevvert[a-1].co);
}
/* origin to face_v2*/
sub_v3_v3(nv1, face_v2);
- facedist = dot_v3v3(nv1,d_nvect);
+ facedist = dot_v3v3(nv1, d_nvect);
if (ABS(facedist)<outerfacethickness) {
- if (isect_point_tri_prism_v3(nv1, face_v1,face_v2,face_v3) ) {
+ if (isect_point_tri_prism_v3(nv1, face_v1, face_v2, face_v3) ) {
float df;
if (facedist > 0) {
df = (outerfacethickness-facedist)/outerfacethickness;
@@ -1168,7 +1168,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
*damp=df*tune*ob->pd->pdef_sbdamp;
df = 0.01f*exp(- 100.0f*df);
- Vec3PlusStVec(force,-df,d_nvect);
+ Vec3PlusStVec(force, -df, d_nvect);
deflected = 3;
}
}
@@ -1183,22 +1183,22 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
}
-static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp,
- float force[3], unsigned int UNUSED(par_layer),struct Object *vertexowner,float time)
+static int sb_detect_face_collisionCached(float face_v1[3], float face_v2[3], float face_v3[3], float *damp,
+ float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time)
{
Object *ob;
GHash *hash;
GHashIterator *ihash;
- float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3],aabbmax[3];
- float t,tune = 10.0f;
+ float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
+ float t, tune = 10.0f;
int a, deflected=0;
- aabbmin[0] = MIN3(face_v1[0],face_v2[0],face_v3[0]);
- aabbmin[1] = MIN3(face_v1[1],face_v2[1],face_v3[1]);
- aabbmin[2] = MIN3(face_v1[2],face_v2[2],face_v3[2]);
- aabbmax[0] = MAX3(face_v1[0],face_v2[0],face_v3[0]);
- aabbmax[1] = MAX3(face_v1[1],face_v2[1],face_v3[1]);
- aabbmax[2] = MAX3(face_v1[2],face_v2[2],face_v3[2]);
+ aabbmin[0] = MIN3(face_v1[0], face_v2[0], face_v3[0]);
+ aabbmin[1] = MIN3(face_v1[1], face_v2[1], face_v3[1]);
+ aabbmin[2] = MIN3(face_v1[2], face_v2[2], face_v3[2]);
+ aabbmax[0] = MAX3(face_v1[0], face_v2[0], face_v3[0]);
+ aabbmax[1] = MAX3(face_v1[1], face_v2[1], face_v3[1]);
+ aabbmax[2] = MAX3(face_v1[2], face_v2[2], face_v3[2]);
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
@@ -1257,25 +1257,25 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
if (mvert) {
- copy_v3_v3(nv1,mvert[mface->v1].co);
- copy_v3_v3(nv2,mvert[mface->v2].co);
- copy_v3_v3(nv3,mvert[mface->v3].co);
+ copy_v3_v3(nv1, mvert[mface->v1].co);
+ copy_v3_v3(nv2, mvert[mface->v2].co);
+ copy_v3_v3(nv3, mvert[mface->v3].co);
if (mface->v4) {
- copy_v3_v3(nv4,mvert[mface->v4].co);
+ copy_v3_v3(nv4, mvert[mface->v4].co);
}
if (mprevvert) {
- mul_v3_fl(nv1,time);
- Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
+ mul_v3_fl(nv1, time);
+ Vec3PlusStVec(nv1, (1.0f-time), mprevvert[mface->v1].co);
- mul_v3_fl(nv2,time);
- Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
+ mul_v3_fl(nv2, time);
+ Vec3PlusStVec(nv2, (1.0f-time), mprevvert[mface->v2].co);
- mul_v3_fl(nv3,time);
- Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
+ mul_v3_fl(nv3, time);
+ Vec3PlusStVec(nv3, (1.0f-time), mprevvert[mface->v3].co);
if (mface->v4) {
- mul_v3_fl(nv4,time);
- Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
+ mul_v3_fl(nv4, time);
+ Vec3PlusStVec(nv4, (1.0f-time), mprevvert[mface->v4].co);
}
}
}
@@ -1289,7 +1289,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
isect_line_tri_v3(nv1, nv2, face_v1, face_v2, face_v3, &t, NULL) ||
isect_line_tri_v3(nv2, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
isect_line_tri_v3(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL) ) {
- Vec3PlusStVec(force,-0.5f,d_nvect);
+ Vec3PlusStVec(force, -0.5f, d_nvect);
*damp=tune*ob->pd->pdef_sbdamp;
deflected = 2;
}
@@ -1304,7 +1304,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
we did that edge already */
isect_line_tri_v3(nv3, nv4, face_v1, face_v2, face_v3, &t, NULL) ||
isect_line_tri_v3(nv4, nv1, face_v1, face_v2, face_v3, &t, NULL) ) {
- Vec3PlusStVec(force,-0.5f,d_nvect);
+ Vec3PlusStVec(force, -0.5f, d_nvect);
*damp=tune*ob->pd->pdef_sbdamp;
deflected = 2;
}
@@ -1321,12 +1321,12 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
-static void scan_for_ext_face_forces(Object *ob,float timenow)
+static void scan_for_ext_face_forces(Object *ob, float timenow)
{
SoftBody *sb = ob->soft;
BodyFace *bf;
int a;
- float damp=0.0f,choke=1.0f;
+ float damp=0.0f, choke=1.0f;
float tune = -10.0f;
float feedback[3];
@@ -1339,25 +1339,25 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
/*+++edges intruding*/
bf->flag &= ~BFF_INTERSECT;
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
- &damp, feedback, ob->lay ,ob , timenow)) {
- Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v2].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback);
-// Vec3PlusStVec(bf->ext_force,tune,feedback);
+ if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos, sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
+ &damp, feedback, ob->lay, ob, timenow)) {
+ Vec3PlusStVec(sb->bpoint[bf->v1].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v2].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v3].force, tune, feedback);
+// Vec3PlusStVec(bf->ext_force, tune, feedback);
bf->flag |= BFF_INTERSECT;
- choke = MIN2(MAX2(damp,choke),1.0f);
+ choke = MIN2(MAX2(damp, choke), 1.0f);
}
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if ((bf->v4) && (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
- &damp, feedback, ob->lay ,ob , timenow))) {
- Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v4].force,tune,feedback);
-// Vec3PlusStVec(bf->ext_force,tune,feedback);
+ if ((bf->v4) && (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos, sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
+ &damp, feedback, ob->lay, ob, timenow))) {
+ Vec3PlusStVec(sb->bpoint[bf->v1].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v3].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v4].force, tune, feedback);
+// Vec3PlusStVec(bf->ext_force, tune, feedback);
bf->flag |= BFF_INTERSECT;
- choke = MIN2(MAX2(damp,choke),1.0f);
+ choke = MIN2(MAX2(damp, choke), 1.0f);
}
/*---edges intruding*/
@@ -1366,25 +1366,25 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
bf->flag &= ~BFF_CLOSEVERT;
tune = -1.0f;
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
- &damp, feedback, ob->lay ,ob , timenow)) {
- Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v2].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback);
-// Vec3PlusStVec(bf->ext_force,tune,feedback);
+ if (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos, sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
+ &damp, feedback, ob->lay, ob, timenow)) {
+ Vec3PlusStVec(sb->bpoint[bf->v1].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v2].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v3].force, tune, feedback);
+// Vec3PlusStVec(bf->ext_force, tune, feedback);
bf->flag |= BFF_CLOSEVERT;
- choke = MIN2(MAX2(damp,choke),1.0f);
+ choke = MIN2(MAX2(damp, choke), 1.0f);
}
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if ((bf->v4) && (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
- &damp, feedback, ob->lay ,ob , timenow))) {
- Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback);
- Vec3PlusStVec(sb->bpoint[bf->v4].force,tune,feedback);
-// Vec3PlusStVec(bf->ext_force,tune,feedback);
+ if ((bf->v4) && (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos, sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
+ &damp, feedback, ob->lay, ob, timenow))) {
+ Vec3PlusStVec(sb->bpoint[bf->v1].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v3].force, tune, feedback);
+ Vec3PlusStVec(sb->bpoint[bf->v4].force, tune, feedback);
+// Vec3PlusStVec(bf->ext_force, tune, feedback);
bf->flag |= BFF_CLOSEVERT;
- choke = MIN2(MAX2(damp,choke),1.0f);
+ choke = MIN2(MAX2(damp, choke), 1.0f);
}
}
/*--- close vertices*/
@@ -1392,11 +1392,11 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
bf = sb->scratch->bodyface;
for (a=0; a<sb->scratch->totface; a++, bf++) {
if (( bf->flag & BFF_INTERSECT) || ( bf->flag & BFF_CLOSEVERT)) {
- sb->bpoint[bf->v1].choke2=MAX2(sb->bpoint[bf->v1].choke2,choke);
- sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke);
- sb->bpoint[bf->v3].choke2=MAX2(sb->bpoint[bf->v3].choke2,choke);
+ sb->bpoint[bf->v1].choke2=MAX2(sb->bpoint[bf->v1].choke2, choke);
+ sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2, choke);
+ sb->bpoint[bf->v3].choke2=MAX2(sb->bpoint[bf->v3].choke2, choke);
if (bf->v4) {
- sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke);
+ sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2, choke);
}
}
}
@@ -1408,24 +1408,24 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
/* +++ the spring external section*/
-static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp,
- float force[3], unsigned int UNUSED(par_layer),struct Object *vertexowner,float time)
+static int sb_detect_edge_collisionCached(float edge_v1[3], float edge_v2[3], float *damp,
+ float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time)
{
Object *ob;
GHash *hash;
GHashIterator *ihash;
- float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3],aabbmax[3];
- float t,el;
+ float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
+ float t, el;
int a, deflected=0;
- aabbmin[0] = MIN2(edge_v1[0],edge_v2[0]);
- aabbmin[1] = MIN2(edge_v1[1],edge_v2[1]);
- aabbmin[2] = MIN2(edge_v1[2],edge_v2[2]);
- aabbmax[0] = MAX2(edge_v1[0],edge_v2[0]);
- aabbmax[1] = MAX2(edge_v1[1],edge_v2[1]);
- aabbmax[2] = MAX2(edge_v1[2],edge_v2[2]);
+ aabbmin[0] = MIN2(edge_v1[0], edge_v2[0]);
+ aabbmin[1] = MIN2(edge_v1[1], edge_v2[1]);
+ aabbmin[2] = MIN2(edge_v1[2], edge_v2[2]);
+ aabbmax[0] = MAX2(edge_v1[0], edge_v2[0]);
+ aabbmax[1] = MAX2(edge_v1[1], edge_v2[1]);
+ aabbmax[2] = MAX2(edge_v1[2], edge_v2[2]);
- el = len_v3v3(edge_v1,edge_v2);
+ el = len_v3v3(edge_v1, edge_v2);
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
@@ -1484,25 +1484,25 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
if (mvert) {
- copy_v3_v3(nv1,mvert[mface->v1].co);
- copy_v3_v3(nv2,mvert[mface->v2].co);
- copy_v3_v3(nv3,mvert[mface->v3].co);
+ copy_v3_v3(nv1, mvert[mface->v1].co);
+ copy_v3_v3(nv2, mvert[mface->v2].co);
+ copy_v3_v3(nv3, mvert[mface->v3].co);
if (mface->v4) {
- copy_v3_v3(nv4,mvert[mface->v4].co);
+ copy_v3_v3(nv4, mvert[mface->v4].co);
}
if (mprevvert) {
- mul_v3_fl(nv1,time);
- Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
+ mul_v3_fl(nv1, time);
+ Vec3PlusStVec(nv1, (1.0f-time), mprevvert[mface->v1].co);
- mul_v3_fl(nv2,time);
- Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
+ mul_v3_fl(nv2, time);
+ Vec3PlusStVec(nv2, (1.0f-time), mprevvert[mface->v2].co);
- mul_v3_fl(nv3,time);
- Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
+ mul_v3_fl(nv3, time);
+ Vec3PlusStVec(nv3, (1.0f-time), mprevvert[mface->v3].co);
if (mface->v4) {
- mul_v3_fl(nv4,time);
- Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
+ mul_v3_fl(nv4, time);
+ Vec3PlusStVec(nv4, (1.0f-time), mprevvert[mface->v4].co);
}
}
}
@@ -1514,14 +1514,14 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
if ( isect_line_tri_v3(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)) {
- float v1[3],v2[3];
- float intrusiondepth,i1,i2;
+ float v1[3], v2[3];
+ float intrusiondepth, i1, i2;
sub_v3_v3v3(v1, edge_v1, nv2);
sub_v3_v3v3(v2, edge_v2, nv2);
- i1 = dot_v3v3(v1,d_nvect);
- i2 = dot_v3v3(v2,d_nvect);
- intrusiondepth = -MIN2(i1,i2)/el;
- Vec3PlusStVec(force,intrusiondepth,d_nvect);
+ i1 = dot_v3v3(v1, d_nvect);
+ i2 = dot_v3v3(v2, d_nvect);
+ intrusiondepth = -MIN2(i1, i2)/el;
+ Vec3PlusStVec(force, intrusiondepth, d_nvect);
*damp=ob->pd->pdef_sbdamp;
deflected = 2;
}
@@ -1532,17 +1532,17 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
- if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)) {
- float v1[3],v2[3];
- float intrusiondepth,i1,i2;
+ if (isect_line_tri_v3( edge_v1, edge_v2, nv1, nv3, nv4, &t, NULL)) {
+ float v1[3], v2[3];
+ float intrusiondepth, i1, i2;
sub_v3_v3v3(v1, edge_v1, nv4);
sub_v3_v3v3(v2, edge_v2, nv4);
- i1 = dot_v3v3(v1,d_nvect);
- i2 = dot_v3v3(v2,d_nvect);
- intrusiondepth = -MIN2(i1,i2)/el;
+ i1 = dot_v3v3(v1, d_nvect);
+ i2 = dot_v3v3(v2, d_nvect);
+ intrusiondepth = -MIN2(i1, i2)/el;
- Vec3PlusStVec(force,intrusiondepth,d_nvect);
+ Vec3PlusStVec(force, intrusiondepth, d_nvect);
*damp=ob->pd->pdef_sbdamp;
deflected = 2;
}
@@ -1574,8 +1574,8 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
if (bs->springtype == SB_EDGE) {
/* +++ springs colliding */
if (ob->softflag & OB_SB_EDGECOLL) {
- if ( sb_detect_edge_collisionCached (sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos,
- &damp,feedback,ob->lay,ob,timenow)) {
+ if ( sb_detect_edge_collisionCached (sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos,
+ &damp, feedback, ob->lay, ob, timenow)) {
add_v3_v3(bs->ext_force, feedback);
bs->flag |= BSF_INTERSECT;
//bs->cf=damp;
@@ -1588,40 +1588,40 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
/* +++ springs seeing wind ... n stuff depending on their orientation*/
/* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/
if (sb->aeroedge) {
- float vel[3],sp[3],pr[3],force[3];
- float f,windfactor = 0.25f;
+ float vel[3], sp[3], pr[3], force[3];
+ float f, windfactor = 0.25f;
/*see if we have wind*/
if (do_effector) {
EffectedPoint epoint;
- float speed[3]={0.0f,0.0f,0.0f};
+ float speed[3]={0.0f, 0.0f, 0.0f};
float pos[3];
- mid_v3_v3v3(pos, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
- mid_v3_v3v3(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
+ mid_v3_v3v3(pos, sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos);
+ mid_v3_v3v3(vel, sb->bpoint[bs->v1].vec, sb->bpoint[bs->v2].vec);
pd_point_from_soft(scene, pos, vel, -1, &epoint);
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
- mul_v3_fl(speed,windfactor);
+ mul_v3_fl(speed, windfactor);
add_v3_v3(vel, speed);
}
/* media in rest */
else {
- add_v3_v3v3(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
+ add_v3_v3v3(vel, sb->bpoint[bs->v1].vec, sb->bpoint[bs->v2].vec);
}
f = normalize_v3(vel);
f = -0.0001f*f*f*sb->aeroedge;
/* (todo) add a nice angle dependent function done for now BUT */
/* still there could be some nice drag/lift function, but who needs it */
- sub_v3_v3v3(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
- project_v3_v3v3(pr,vel,sp);
+ sub_v3_v3v3(sp, sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos);
+ project_v3_v3v3(pr, vel, sp);
sub_v3_v3(vel, pr);
normalize_v3(vel);
if (ob->softflag & OB_SB_AERO_ANGLE) {
normalize_v3(sp);
- Vec3PlusStVec(bs->ext_force,f*(1.0f-ABS(dot_v3v3(vel,sp))),vel);
+ Vec3PlusStVec(bs->ext_force, f*(1.0f-ABS(dot_v3v3(vel, sp))), vel);
}
else {
- Vec3PlusStVec(bs->ext_force,f,vel); // to keep compatible with 2.45 release files
+ Vec3PlusStVec(bs->ext_force, f, vel); // to keep compatible with 2.45 release files
}
}
/* --- springs seeing wind */
@@ -1648,12 +1648,12 @@ static void *exec_scan_for_ext_spring_forces(void *data)
return NULL;
}
-static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,int totsprings,int *UNUSED(ptr_to_break_func(void)))
+static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow, int totsprings, int *UNUSED(ptr_to_break_func(void)))
{
ListBase *do_effector = NULL;
ListBase threads;
SB_thread_context *sb_threads;
- int i, totthread,left,dec;
+ int i, totthread, left, dec;
int lowsprings =100; /* wild guess .. may increase with better thread management 'above' or even be UI option sb->spawn_cf_threads_nopts */
do_effector= pdInitEffectors(scene, ob, NULL, ob->soft->effector_weights);
@@ -1710,27 +1710,27 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,
/* --- the spring external section*/
-static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,float*cb,float*cc)
+static int choose_winner(float*w, float* pos, float*a, float*b, float*c, float*ca, float*cb, float*cc)
{
- float mindist,cp;
+ float mindist, cp;
int winner =1;
- mindist = ABS(dot_v3v3(pos,a));
+ mindist = ABS(dot_v3v3(pos, a));
- cp = ABS(dot_v3v3(pos,b));
+ cp = ABS(dot_v3v3(pos, b));
if ( mindist < cp ) {
mindist = cp;
winner =2;
}
- cp = ABS(dot_v3v3(pos,c));
+ cp = ABS(dot_v3v3(pos, c));
if (mindist < cp ) {
mindist = cp;
winner =3;
}
switch (winner) {
- case 1: copy_v3_v3(w,ca); break;
- case 2: copy_v3_v3(w,cb); break;
- case 3: copy_v3_v3(w,cc);
+ case 1: copy_v3_v3(w, ca); break;
+ case 2: copy_v3_v3(w, cb); break;
+ case 3: copy_v3_v3(w, cc);
}
return(winner);
}
@@ -1739,12 +1739,12 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl
static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *damp,
float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner,
- float time,float vel[3], float *intrusion)
+ float time, float vel[3], float *intrusion)
{
Object *ob= NULL;
GHash *hash;
GHashIterator *ihash;
- float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3],d_nvect[3], dv1[3],ve[3],avel[3]={0.0,0.0,0.0},
+ float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3], avel[3]={0.0, 0.0, 0.0},
vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
outerforceaccu[3], innerforceaccu[3],
facedist, /* n_mag, */ /* UNUSED */ force_mag_norm, minx, miny, minz, maxx, maxy, maxz,
@@ -1827,11 +1827,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
if (mvert) {
- copy_v3_v3(nv1,mvert[mface->v1].co);
- copy_v3_v3(nv2,mvert[mface->v2].co);
- copy_v3_v3(nv3,mvert[mface->v3].co);
+ copy_v3_v3(nv1, mvert[mface->v1].co);
+ copy_v3_v3(nv2, mvert[mface->v2].co);
+ copy_v3_v3(nv3, mvert[mface->v3].co);
if (mface->v4) {
- copy_v3_v3(nv4,mvert[mface->v4].co);
+ copy_v3_v3(nv4, mvert[mface->v4].co);
}
if (mprevvert) {
@@ -1841,25 +1841,25 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
since the AABB reduced propabitlty to get here drasticallly
it might be a nice tradeof CPU <--> memory
*/
- sub_v3_v3v3(vv1,nv1,mprevvert[mface->v1].co);
- sub_v3_v3v3(vv2,nv2,mprevvert[mface->v2].co);
- sub_v3_v3v3(vv3,nv3,mprevvert[mface->v3].co);
+ sub_v3_v3v3(vv1, nv1, mprevvert[mface->v1].co);
+ sub_v3_v3v3(vv2, nv2, mprevvert[mface->v2].co);
+ sub_v3_v3v3(vv3, nv3, mprevvert[mface->v3].co);
if (mface->v4) {
- sub_v3_v3v3(vv4,nv4,mprevvert[mface->v4].co);
+ sub_v3_v3v3(vv4, nv4, mprevvert[mface->v4].co);
}
- mul_v3_fl(nv1,time);
- Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
+ mul_v3_fl(nv1, time);
+ Vec3PlusStVec(nv1, (1.0f-time), mprevvert[mface->v1].co);
- mul_v3_fl(nv2,time);
- Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
+ mul_v3_fl(nv2, time);
+ Vec3PlusStVec(nv2, (1.0f-time), mprevvert[mface->v2].co);
- mul_v3_fl(nv3,time);
- Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
+ mul_v3_fl(nv3, time);
+ Vec3PlusStVec(nv3, (1.0f-time), mprevvert[mface->v3].co);
if (mface->v4) {
- mul_v3_fl(nv4,time);
- Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
+ mul_v3_fl(nv4, time);
+ Vec3PlusStVec(nv4, (1.0f-time), mprevvert[mface->v4].co);
}
}
}
@@ -1867,11 +1867,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
/* switch origin to be nv2*/
sub_v3_v3v3(edge1, nv1, nv2);
sub_v3_v3v3(edge2, nv3, nv2);
- sub_v3_v3v3(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
+ sub_v3_v3v3(dv1, opco, nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
cross_v3_v3v3(d_nvect, edge2, edge1);
/* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
- facedist = dot_v3v3(dv1,d_nvect);
+ facedist = dot_v3v3(dv1, d_nvect);
// so rules are
//
@@ -1883,16 +1883,16 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
*damp=ob->pd->pdef_sbdamp;
if (facedist > 0.0f) {
*damp *= (1.0f - facedist/outerfacethickness);
- Vec3PlusStVec(outerforceaccu,force_mag_norm,d_nvect);
+ Vec3PlusStVec(outerforceaccu, force_mag_norm, d_nvect);
deflected = 3;
}
else {
- Vec3PlusStVec(innerforceaccu,force_mag_norm,d_nvect);
+ Vec3PlusStVec(innerforceaccu, force_mag_norm, d_nvect);
if (deflected < 2) deflected = 2;
}
if ((mprevvert) && (*damp > 0.0f)) {
- choose_winner(ve,opco,nv1,nv2,nv3,vv1,vv2,vv3);
+ choose_winner(ve, opco, nv1, nv2, nv3, vv1, vv2, vv3);
add_v3_v3(avel, ve);
cavel ++;
}
@@ -1904,11 +1904,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
/* switch origin to be nv4 */
sub_v3_v3v3(edge1, nv3, nv4);
sub_v3_v3v3(edge2, nv1, nv4);
- sub_v3_v3v3(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
+ sub_v3_v3v3(dv1, opco, nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
cross_v3_v3v3(d_nvect, edge2, edge1);
/* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
- facedist = dot_v3v3(dv1,d_nvect);
+ facedist = dot_v3v3(dv1, d_nvect);
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)) {
if (isect_point_tri_prism_v3(opco, nv1, nv3, nv4) ) {
@@ -1918,17 +1918,17 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
*damp=ob->pd->pdef_sbdamp;
if (facedist > 0.0f) {
*damp *= (1.0f - facedist/outerfacethickness);
- Vec3PlusStVec(outerforceaccu,force_mag_norm,d_nvect);
+ Vec3PlusStVec(outerforceaccu, force_mag_norm, d_nvect);
deflected = 3;
}
else {
- Vec3PlusStVec(innerforceaccu,force_mag_norm,d_nvect);
+ Vec3PlusStVec(innerforceaccu, force_mag_norm, d_nvect);
if (deflected < 2) deflected = 2;
}
if ((mprevvert) && (*damp > 0.0f)) {
- choose_winner(ve,opco,nv1,nv3,nv4,vv1,vv3,vv4);
+ choose_winner(ve, opco, nv1, nv3, nv4, vv1, vv3, vv4);
add_v3_v3(avel, ve);
cavel ++;
}
@@ -1942,46 +1942,46 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
float dist;
closest_to_line_segment_v3(ve, opco, nv1, nv2);
- sub_v3_v3v3(ve,opco,ve);
+ sub_v3_v3v3(ve, opco, ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )) {
- copy_v3_v3(coledge,ve);
+ copy_v3_v3(coledge, ve);
mindistedge = dist,
deflected=1;
}
closest_to_line_segment_v3(ve, opco, nv2, nv3);
- sub_v3_v3v3(ve,opco,ve);
+ sub_v3_v3v3(ve, opco, ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )) {
- copy_v3_v3(coledge,ve);
+ copy_v3_v3(coledge, ve);
mindistedge = dist,
deflected=1;
}
closest_to_line_segment_v3(ve, opco, nv3, nv1);
- sub_v3_v3v3(ve,opco,ve);
+ sub_v3_v3v3(ve, opco, ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )) {
- copy_v3_v3(coledge,ve);
+ copy_v3_v3(coledge, ve);
mindistedge = dist,
deflected=1;
}
if (mface->v4) { /* quad */
closest_to_line_segment_v3(ve, opco, nv3, nv4);
- sub_v3_v3v3(ve,opco,ve);
+ sub_v3_v3v3(ve, opco, ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )) {
- copy_v3_v3(coledge,ve);
+ copy_v3_v3(coledge, ve);
mindistedge = dist,
deflected=1;
}
closest_to_line_segment_v3(ve, opco, nv1, nv4);
- sub_v3_v3v3(ve,opco,ve);
+ sub_v3_v3v3(ve, opco, ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )) {
- copy_v3_v3(coledge,ve);
+ copy_v3_v3(coledge, ve);
mindistedge = dist,
deflected=1;
}
@@ -2002,7 +2002,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
force_mag_norm =(float)exp(-ee*mindistedge);
if (mindistedge > outerfacethickness*ff)
force_mag_norm =(float)force_mag_norm*fa*(mindistedge - outerfacethickness)*(mindistedge - outerfacethickness);
- Vec3PlusStVec(force,force_mag_norm,coledge);
+ Vec3PlusStVec(force, force_mag_norm, coledge);
*damp=ob->pd->pdef_sbdamp;
if (mindistedge > 0.0f) {
*damp *= (1.0f - mindistedge/outerfacethickness);
@@ -2017,8 +2017,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
BLI_ghashIterator_free(ihash);
- if (cavel) mul_v3_fl(avel,1.0f/(float)cavel);
- copy_v3_v3(vel,avel);
+ if (cavel) mul_v3_fl(avel, 1.0f/(float)cavel);
+ copy_v3_v3(vel, avel);
if (ci) *intrusion /= ci;
if (deflected) {
normalize_v3_v3(facenormal, force);
@@ -2028,34 +2028,34 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
/* sandbox to plug in various deflection algos */
-static int sb_deflect_face(Object *ob,float *actpos,float *facenormal,float *force,float *cf,float time,float *vel,float *intrusion)
+static int sb_deflect_face(Object *ob, float *actpos, float *facenormal, float *force, float *cf, float time, float *vel, float *intrusion)
{
float s_actpos[3];
int deflected;
- copy_v3_v3(s_actpos,actpos);
- deflected= sb_detect_vertex_collisionCached(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
- //deflected= sb_detect_vertex_collisionCachedEx(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
+ copy_v3_v3(s_actpos, actpos);
+ deflected= sb_detect_vertex_collisionCached(s_actpos, facenormal, cf, force, ob->lay, ob, time, vel, intrusion);
+ //deflected= sb_detect_vertex_collisionCachedEx(s_actpos, facenormal, cf, force, ob->lay, ob, time, vel, intrusion);
return(deflected);
}
/* hiding this for now .. but the jacobian may pop up on other tasks .. so i'd like to keep it
-static void dfdx_spring(int ia, int ic, int op, float dir[3],float L,float len,float factor)
+static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len, float factor)
{
- float m,delta_ij;
- int i ,j;
+ 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]));
- nlMatrixAdd(ia+i,op+ic+j,m);
+ nlMatrixAdd(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];
- nlMatrixAdd(ia+i,op+ic+j,m);
+ nlMatrixAdd(ia+i, op+ic+j, m);
}
}
}
@@ -2064,24 +2064,24 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3],float L,float len,f
static void dfdx_goal(int ia, int ic, int op, float factor)
{
int i;
- for (i=0;i<3;i++) nlMatrixAdd(ia+i,op+ic+i,factor);
+ for (i=0;i<3;i++) nlMatrixAdd(ia+i, op+ic+i, factor);
}
-static void dfdv_goal(int ia, int ic,float factor)
+static void dfdv_goal(int ia, int ic, float factor)
{
int i;
- for (i=0;i<3;i++) nlMatrixAdd(ia+i,ic+i,factor);
+ for (i=0;i<3;i++) nlMatrixAdd(ia+i, ic+i, factor);
}
*/
-static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UNUSED(forcetime), int nl_flags)
+static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float UNUSED(forcetime), int nl_flags)
{
SoftBody *sb= ob->soft; /* is supposed to be there */
- BodyPoint *bp1,*bp2;
+ BodyPoint *bp1, *bp2;
- float dir[3],dvel[3];
- float distance,forcefactor,kd,absvel,projvel,kw;
+ float dir[3], dvel[3];
+ float distance, forcefactor, kd, absvel, projvel, kw;
#if 0 /* UNUSED */
- int ia,ic;
+ int ia, ic;
#endif
/* prepare depending on which side of the spring we are on */
if (bpi == bs->v1) {
@@ -2108,7 +2108,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN
}
/* do bp1 <--> bp2 elastic */
- sub_v3_v3v3(dir,bp1->pos,bp2->pos);
+ sub_v3_v3v3(dir, bp1->pos, bp2->pos);
distance = normalize_v3(dir);
if (bs->len < distance)
iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
@@ -2138,15 +2138,15 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN
}
- Vec3PlusStVec(bp1->force,(bs->len - distance)*forcefactor,dir);
+ Vec3PlusStVec(bp1->force, (bs->len - distance)*forcefactor, dir);
/* do bp1 <--> bp2 viscous */
- sub_v3_v3v3(dvel,bp1->vec,bp2->vec);
+ sub_v3_v3v3(dvel, bp1->vec, bp2->vec);
kd = sb->infrict * sb_fric_force_scale(ob);
absvel = normalize_v3(dvel);
- projvel = dot_v3v3(dir,dvel);
+ projvel = dot_v3v3(dir, dvel);
kd *= absvel * projvel;
- Vec3PlusStVec(bp1->force,-kd,dir);
+ Vec3PlusStVec(bp1->force, -kd, dir);
/* do jacobian stuff if needed */
if (nl_flags & NLF_BUILD) {
@@ -2154,14 +2154,14 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN
//float mvel = -forcetime*kd;
//float mpos = -forcetime*forcefactor;
/* depending on my pos */
- // dfdx_spring(ia,ia,op,dir,bs->len,distance,-mpos);
+ // dfdx_spring(ia, ia, op, dir, bs->len, distance, -mpos);
/* depending on my vel */
- // dfdv_goal(ia,ia,mvel); // well that ignores geometie
+ // dfdv_goal(ia, ia, mvel); // well that ignores geometie
if (bp2->goal < SOFTGOALSNAP) { /* ommit this bp when it snaps */
/* depending on other pos */
- // dfdx_spring(ia,ic,op,dir,bs->len,distance,mpos);
+ // dfdx_spring(ia, ic, op, dir, bs->len, distance, mpos);
/* depending on other vel */
- // dfdv_goal(ia,ia,-mvel); // well that ignores geometie
+ // dfdv_goal(ia, ia, -mvel); // well that ignores geometie
}
}
}
@@ -2170,10 +2170,10 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN
/* since this is definitely the most CPU consuming task here .. try to spread it */
/* core function _softbody_calc_forces_slice_in_a_thread */
/* result is int to be able to flag user break */
-static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, float forcetime, float timenow,int ifirst,int ilast,int *UNUSED(ptr_to_break_func(void)),ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor)
+static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, float forcetime, float timenow, int ifirst, int ilast, int *UNUSED(ptr_to_break_func(void)), ListBase *do_effector, int do_deflector, float fieldfactor, float windfactor)
{
float iks;
- int bb,do_selfcollision,do_springcollision,do_aero;
+ int bb, do_selfcollision, do_springcollision, do_aero;
int number_of_points_here = ilast - ifirst;
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
@@ -2210,8 +2210,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
int attached;
BodyPoint *obp;
BodySpring *bs;
- int c,b;
- float velcenter[3],dvel[3],def[3];
+ int c, b;
+ float velcenter[3], dvel[3], def[3];
float distance;
float compare;
float bstune = sb->ballstiff;
@@ -2236,42 +2236,42 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
float f = bstune / (distance) + bstune / (compare * compare) * distance - 2.0f * bstune / compare;
mid_v3_v3v3(velcenter, bp->vec, obp->vec);
- sub_v3_v3v3(dvel,velcenter,bp->vec);
- mul_v3_fl(dvel,_final_mass(ob,bp));
+ sub_v3_v3v3(dvel, velcenter, bp->vec);
+ mul_v3_fl(dvel, _final_mass(ob, bp));
- Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
- Vec3PlusStVec(bp->force,sb->balldamp,dvel);
+ Vec3PlusStVec(bp->force, f*(1.0f-sb->balldamp), def);
+ Vec3PlusStVec(bp->force, sb->balldamp, dvel);
- /* exploit force(a,b) == -force(b,a) part2/2 */
- sub_v3_v3v3(dvel,velcenter,obp->vec);
- mul_v3_fl(dvel,_final_mass(ob,bp));
+ /* exploit force(a, b) == -force(b, a) part2/2 */
+ sub_v3_v3v3(dvel, velcenter, obp->vec);
+ mul_v3_fl(dvel, _final_mass(ob, bp));
- Vec3PlusStVec(obp->force,sb->balldamp,dvel);
- Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
+ Vec3PlusStVec(obp->force, sb->balldamp, dvel);
+ Vec3PlusStVec(obp->force, -f*(1.0f-sb->balldamp), def);
}
}
}
}
/* naive ball self collision done */
- if (_final_goal(ob,bp) < SOFTGOALSNAP) { /* ommit this bp when it snaps */
+ if (_final_goal(ob, bp) < SOFTGOALSNAP) { /* ommit this bp when it snaps */
float auxvect[3];
float velgoal[3];
/* do goal stuff */
if (ob->softflag & OB_SB_GOAL) {
/* true elastic goal */
- float ks,kd;
- sub_v3_v3v3(auxvect,bp->pos,bp->origT);
+ float ks, kd;
+ sub_v3_v3v3(auxvect, bp->pos, bp->origT);
ks = 1.0f / (1.0f - _final_goal(ob, bp) * sb->goalspring) - 1.0f;
bp->force[0]+= -ks*(auxvect[0]);
bp->force[1]+= -ks*(auxvect[1]);
bp->force[2]+= -ks*(auxvect[2]);
/* calulate damping forces generated by goals*/
- sub_v3_v3v3(velgoal,bp->origS, bp->origE);
+ sub_v3_v3v3(velgoal, bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob);
- add_v3_v3v3(auxvect,velgoal,bp->vec);
+ add_v3_v3v3(auxvect, velgoal, bp->vec);
if (forcetime > 0.0f) { /* make sure friction does not become rocket motor on time reversal */
bp->force[0]-= kd * (auxvect[0]);
@@ -2290,7 +2290,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
float gravity[3];
copy_v3_v3(gravity, scene->physics_settings.gravity);
- mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob,bp)*sb->effector_weights->global_gravity); /* individual mass of node here */
+ mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob, bp)*sb->effector_weights->global_gravity); /* individual mass of node here */
add_v3_v3(bp->force, gravity);
}
@@ -2305,7 +2305,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
/* apply forcefield*/
- mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
+ mul_v3_fl(force, fieldfactor* eval_sb_fric_force_scale);
add_v3_v3(bp->force, force);
/* BP friction in moving media */
@@ -2330,20 +2330,20 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
bp->choke2 = 0.0f;
bp->loc_flag &= ~SBF_DOFUZZY;
if (do_deflector && !(bp->loc_flag & SBF_OUTOFCOLLISION) ) {
- float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion;
+ float cfforce[3], defforce[3] ={0.0f, 0.0f, 0.0f}, vel[3] = {0.0f, 0.0f, 0.0f}, facenormal[3], cf = 1.0f, intrusion;
float kd = 1.0f;
- if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)) {
+ if (sb_deflect_face(ob, bp->pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) {
if (intrusion < 0.0f) {
sb->scratch->flag |= SBF_DOFUZZY;
bp->loc_flag |= SBF_DOFUZZY;
bp->choke = sb->choke*0.01f;
}
- sub_v3_v3v3(cfforce,bp->vec,vel);
- Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
+ sub_v3_v3v3(cfforce, bp->vec, vel);
+ Vec3PlusStVec(bp->force, -cf*50.0f, cfforce);
- Vec3PlusStVec(bp->force,kd,defforce);
+ Vec3PlusStVec(bp->force, kd, defforce);
}
}
@@ -2363,8 +2363,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
bp->choke = bs->cf;
}
- // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags)
- sb_spring_force(ob,ilast-bb,bs,iks,forcetime,0);
+ // sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float forcetime, int nl_flags)
+ sb_spring_force(ob, ilast-bb, bs, iks, forcetime, 0);
}/* loop springs */
}/* existing spring list */
}/*any edges*/
@@ -2377,15 +2377,15 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
static void *exec_softbody_calc_forces(void *data)
{
SB_thread_context *pctx = (SB_thread_context*)data;
- _softbody_calc_forces_slice_in_a_thread(pctx->scene, pctx->ob, pctx->forcetime, pctx->timenow, pctx->ifirst, pctx->ilast, NULL, pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor);
+ _softbody_calc_forces_slice_in_a_thread(pctx->scene, pctx->ob, pctx->forcetime, pctx->timenow, pctx->ifirst, pctx->ilast, NULL, pctx->do_effector, pctx->do_deflector, pctx->fieldfactor, pctx->windfactor);
return NULL;
}
-static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow,int totpoint,int *UNUSED(ptr_to_break_func(void)),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor)
+static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow, int totpoint, int *UNUSED(ptr_to_break_func(void)), struct ListBase *do_effector, int do_deflector, float fieldfactor, float windfactor)
{
ListBase threads;
SB_thread_context *sb_threads;
- int i, totthread,left,dec;
+ int i, totthread, left, dec;
int lowpoints =100; /* wild guess .. may increase with better thread management 'above' or even be UI option sb->spawn_cf_threads_nopts */
/* figure the number of threads while preventing pretty pointless threading overhead */
@@ -2398,7 +2398,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t
totthread--;
}
- /* printf("sb_cf_threads_run spawning %d threads\n",totthread); */
+ /* printf("sb_cf_threads_run spawning %d threads\n", totthread); */
sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBThread");
memset(sb_threads, 0, sizeof(SB_thread_context)*totthread);
@@ -2450,7 +2450,7 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl
/* float gravity; */ /* UNUSED */
/* float iks; */
float fieldfactor = -1.0f, windfactor = 0.25;
- int do_deflector /*,do_selfcollision*/ ,do_springcollision,do_aero;
+ int do_deflector /*, do_selfcollision*/, do_springcollision, do_aero;
/* gravity = sb->grav * sb_grav_force_scale(ob); */ /* UNUSED */
@@ -2464,20 +2464,20 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl
/* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */
if (do_springcollision || do_aero)
- sb_sfesf_threads_run(scene, ob, timenow,sb->totspring,NULL);
+ sb_sfesf_threads_run(scene, ob, timenow, sb->totspring, NULL);
/* after spring scan because it uses Effoctors too */
do_effector= pdInitEffectors(scene, ob, NULL, sb->effector_weights);
if (do_deflector) {
float defforce[3];
- do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow);
+ do_deflector = sb_detect_aabb_collisionCached(defforce, ob->lay, ob, timenow);
}
sb_cf_threads_run(scene, ob, forcetime, timenow, sb->totpoint, NULL, do_effector, do_deflector, fieldfactor, windfactor);
/* finally add forces caused by face collision */
- if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow);
+ if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob, timenow);
/* finish matrix and solve */
pdEndEffectors(&do_effector);
@@ -2510,10 +2510,10 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* BodyPoint *bproot; */ /* UNUSED */
BodySpring *bs;
ListBase *do_effector = NULL;
- float iks, ks, kd, gravity[3] = {0.0f,0.0f,0.0f};
+ float iks, ks, kd, gravity[3] = {0.0f, 0.0f, 0.0f};
float fieldfactor = -1.0f, windfactor = 0.25f;
float tune = sb->ballstiff;
- int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero;
+ int a, b, do_deflector, do_selfcollision, do_springcollision, do_aero;
/* jacobian
@@ -2546,7 +2546,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (do_deflector) {
float defforce[3];
- do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow);
+ do_deflector = sb_detect_aabb_collisionCached(defforce, ob->lay, ob, timenow);
}
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
@@ -2557,17 +2557,17 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
//int op =3*sb->totpoint;
/* dF/dV = v */
/* jacobioan
- nlMatrixAdd(op+ia,ia,-forcetime);
- nlMatrixAdd(op+ia+1,ia+1,-forcetime);
- nlMatrixAdd(op+ia+2,ia+2,-forcetime);
+ nlMatrixAdd(op+ia, ia, -forcetime);
+ nlMatrixAdd(op+ia+1, ia+1, -forcetime);
+ nlMatrixAdd(op+ia+2, ia+2, -forcetime);
- nlMatrixAdd(ia,ia,1);
- nlMatrixAdd(ia+1,ia+1,1);
- nlMatrixAdd(ia+2,ia+2,1);
+ nlMatrixAdd(ia, ia, 1);
+ nlMatrixAdd(ia+1, ia+1, 1);
+ nlMatrixAdd(ia+2, ia+2, 1);
- nlMatrixAdd(op+ia,op+ia,1);
- nlMatrixAdd(op+ia+1,op+ia+1,1);
- nlMatrixAdd(op+ia+2,op+ia+2,1);
+ nlMatrixAdd(op+ia, op+ia, 1);
+ nlMatrixAdd(op+ia+1, op+ia+1, 1);
+ nlMatrixAdd(op+ia+2, op+ia+2, 1);
*/
@@ -2578,8 +2578,8 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (do_selfcollision) {
int attached;
BodyPoint *obp;
- int c,b;
- float velcenter[3],dvel[3],def[3];
+ int c, b;
+ float velcenter[3], dvel[3], def[3];
float distance;
float compare;
@@ -2608,11 +2608,11 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
float f = tune / (distance) + tune / (compare * compare) * distance - 2.0f * tune/compare;
mid_v3_v3v3(velcenter, bp->vec, obp->vec);
- sub_v3_v3v3(dvel,velcenter,bp->vec);
- mul_v3_fl(dvel,_final_mass(ob,bp));
+ sub_v3_v3v3(dvel, velcenter, bp->vec);
+ mul_v3_fl(dvel, _final_mass(ob, bp));
- Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
- Vec3PlusStVec(bp->force,sb->balldamp,dvel);
+ Vec3PlusStVec(bp->force, f*(1.0f-sb->balldamp), def);
+ Vec3PlusStVec(bp->force, sb->balldamp, dvel);
if (nl_flags & NLF_BUILD) {
//int ia =3*(sb->totpoint-a);
@@ -2621,11 +2621,11 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
//float mvel = forcetime*sb->nodemass*sb->balldamp;
//float mpos = forcetime*tune*(1.0f-sb->balldamp);
/*some quick and dirty entries to the jacobian*/
- //dfdx_goal(ia,ia,op,mpos);
- //dfdv_goal(ia,ia,mvel);
- /* exploit force(a,b) == -force(b,a) part1/2 */
- //dfdx_goal(ic,ic,op,mpos);
- //dfdv_goal(ic,ic,mvel);
+ //dfdx_goal(ia, ia, op, mpos);
+ //dfdv_goal(ia, ia, mvel);
+ /* exploit force(a, b) == -force(b, a) part1/2 */
+ //dfdx_goal(ic, ic, op, mpos);
+ //dfdv_goal(ic, ic, mvel);
/*TODO sit down an X-out the true jacobian entries*/
@@ -2638,12 +2638,12 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
*/
}
- /* exploit force(a,b) == -force(b,a) part2/2 */
- sub_v3_v3v3(dvel,velcenter,obp->vec);
- mul_v3_fl(dvel,(_final_mass(ob,bp)+_final_mass(ob,obp))/2.0f);
+ /* exploit force(a, b) == -force(b, a) part2/2 */
+ sub_v3_v3v3(dvel, velcenter, obp->vec);
+ mul_v3_fl(dvel, (_final_mass(ob, bp)+_final_mass(ob, obp))/2.0f);
- Vec3PlusStVec(obp->force,sb->balldamp,dvel);
- Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
+ Vec3PlusStVec(obp->force, sb->balldamp, dvel);
+ Vec3PlusStVec(obp->force, -f*(1.0f-sb->balldamp), def);
}
@@ -2652,14 +2652,14 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
}
/* naive ball self collision done */
- if (_final_goal(ob,bp) < SOFTGOALSNAP) { /* ommit this bp when it snaps */
+ if (_final_goal(ob, bp) < SOFTGOALSNAP) { /* ommit this bp when it snaps */
float auxvect[3];
float velgoal[3];
/* do goal stuff */
if (ob->softflag & OB_SB_GOAL) {
/* true elastic goal */
- sub_v3_v3v3(auxvect,bp->pos,bp->origT);
+ sub_v3_v3v3(auxvect, bp->pos, bp->origT);
ks = 1.0f / (1.0f- _final_goal(ob, bp) * sb->goalspring) - 1.0f;
bp->force[0]+= -ks*(auxvect[0]);
bp->force[1]+= -ks*(auxvect[1]);
@@ -2669,14 +2669,14 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
//int ia =3*(sb->totpoint-a);
//int op =3*(sb->totpoint);
/* depending on my pos */
- //dfdx_goal(ia,ia,op,ks*forcetime);
+ //dfdx_goal(ia, ia, op, ks*forcetime);
}
/* calulate damping forces generated by goals*/
- sub_v3_v3v3(velgoal,bp->origS, bp->origE);
+ sub_v3_v3v3(velgoal, bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob);
- add_v3_v3v3(auxvect,velgoal,bp->vec);
+ add_v3_v3v3(auxvect, velgoal, bp->vec);
if (forcetime > 0.0f) { /* make sure friction does not become rocket motor on time reversal */
bp->force[0]-= kd * (auxvect[0]);
@@ -2686,7 +2686,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
//int ia =3*(sb->totpoint-a);
normalize_v3(auxvect);
/* depending on my vel */
- //dfdv_goal(ia,ia,kd*forcetime);
+ //dfdv_goal(ia, ia, kd*forcetime);
}
}
@@ -2700,7 +2700,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* gravitation */
- madd_v3_v3fl(bp->force, gravity, _final_mass(ob,bp)); /* individual mass of node here */
+ madd_v3_v3fl(bp->force, gravity, _final_mass(ob, bp)); /* individual mass of node here */
/* particle field & vortex */
@@ -2713,7 +2713,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
/* apply forcefield*/
- mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
+ mul_v3_fl(force, fieldfactor* eval_sb_fric_force_scale);
add_v3_v3(bp->force, force);
/* BP friction in moving media */
@@ -2736,9 +2736,9 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
//int ia =3*(sb->totpoint-a);
/* da/dv = */
- // nlMatrixAdd(ia,ia,forcetime*kd);
- // nlMatrixAdd(ia+1,ia+1,forcetime*kd);
- // nlMatrixAdd(ia+2,ia+2,forcetime*kd);
+ // nlMatrixAdd(ia, ia, forcetime*kd);
+ // nlMatrixAdd(ia+1, ia+1, forcetime*kd);
+ // nlMatrixAdd(ia+2, ia+2, forcetime*kd);
}
}
@@ -2747,10 +2747,10 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
bp->choke2 = 0.0f;
bp->loc_flag &= ~SBF_DOFUZZY;
if (do_deflector) {
- float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion;
+ float cfforce[3], defforce[3] ={0.0f, 0.0f, 0.0f}, vel[3] = {0.0f, 0.0f, 0.0f}, facenormal[3], cf = 1.0f, intrusion;
kd = 1.0f;
- if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)) {
+ if (sb_deflect_face(ob, bp->pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) {
if ((!nl_flags)&&(intrusion < 0.0f)) {
if (G.rt & 0x01) { // 17 we did check for bit 0x10 before
/*fixing bug [17428] this forces adaptive step size to tiny steps
@@ -2763,12 +2763,12 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
in heun step No1 and leave the heun step No2 adapt to it
so we kind of introduced a implicit solver for this case
*/
- Vec3PlusStVec(bp->pos,-intrusion,facenormal);
+ Vec3PlusStVec(bp->pos, -intrusion, facenormal);
}
else {
- sub_v3_v3v3(cfforce,bp->vec,vel);
- Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
+ sub_v3_v3v3(cfforce, bp->vec, vel);
+ Vec3PlusStVec(bp->force, -cf*50.0f, cfforce);
}
@@ -2777,15 +2777,15 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
bp->choke = sb->choke*0.01f;
}
else {
- sub_v3_v3v3(cfforce,bp->vec,vel);
- Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
+ sub_v3_v3v3(cfforce, bp->vec, vel);
+ Vec3PlusStVec(bp->force, -cf*50.0f, cfforce);
}
- Vec3PlusStVec(bp->force,kd,defforce);
+ Vec3PlusStVec(bp->force, kd, defforce);
if (nl_flags & NLF_BUILD) {
// int ia =3*(sb->totpoint-a);
// int op =3*sb->totpoint;
- //dfdx_goal(ia,ia,op,mpos); // don't do unless you know
- //dfdv_goal(ia,ia,-cf);
+ //dfdx_goal(ia, ia, op, mpos); // don't do unless you know
+ //dfdv_goal(ia, ia, -cf);
}
@@ -2805,9 +2805,9 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
bp->choke = bs->cf;
}
- // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags)
+ // sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float forcetime, int nl_flags)
// rather remove nl_falgs from code .. will make things a lot cleaner
- sb_spring_force(ob,sb->totpoint-a,bs,iks,forcetime,0);
+ sb_spring_force(ob, sb->totpoint-a, bs, iks, forcetime, 0);
}/* loop springs */
}/* existing spring list */
}/*any edges*/
@@ -2817,12 +2817,12 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* finally add forces caused by face collision */
- if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow);
+ if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob, timenow);
/* finish matrix and solve */
#if (0) // remove onl linking for now .. still i am not sure .. the jacobian can be useful .. so keep that BM
if (nl_flags & NLF_SOLVE) {
- //double sct,sst=PIL_check_seconds_timer();
+ //double sct, sst=PIL_check_seconds_timer();
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
int iv =3*(sb->totpoint-a);
int ip =3*(2*sb->totpoint-a);
@@ -2847,30 +2847,30 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* for debug purpose .. anyhow cropping B vector looks like working */
if (G.rt ==32)
for (a=2*sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- f=nlGetVariable(0,index);
- printf("(%f ",f);index++;
- f=nlGetVariable(0,index);
- printf("%f ",f);index++;
- f=nlGetVariable(0,index);
- printf("%f)",f);index++;
+ f=nlGetVariable(0, index);
+ printf("(%f ", f);index++;
+ f=nlGetVariable(0, index);
+ printf("%f ", f);index++;
+ f=nlGetVariable(0, index);
+ printf("%f)", f);index++;
}
index =0;
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- f=nlGetVariable(0,index);
+ f=nlGetVariable(0, index);
bp->impdv[0] = f; index++;
- f=nlGetVariable(0,index);
+ f=nlGetVariable(0, index);
bp->impdv[1] = f; index++;
- f=nlGetVariable(0,index);
+ f=nlGetVariable(0, index);
bp->impdv[2] = f; index++;
}
/*
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- f=nlGetVariable(0,index);
+ f=nlGetVariable(0, index);
bp->impdx[0] = f; index++;
- f=nlGetVariable(0,index);
+ f=nlGetVariable(0, index);
bp->impdx[1] = f; index++;
- f=nlGetVariable(0,index);
+ f=nlGetVariable(0, index);
bp->impdx[2] = f; index++;
}
*/
@@ -2878,13 +2878,13 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
else {
printf("Matrix inversion failed\n");
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- copy_v3_v3(bp->impdv,bp->force);
+ copy_v3_v3(bp->impdv, bp->force);
}
}
//sct=PIL_check_seconds_timer();
- //if (sct-sst > 0.01f) printf(" implicit solver time %f %s \r",sct-sst,ob->id.name);
+ //if (sct-sst > 0.01f) printf(" implicit solver time %f %s \r", sct-sst, ob->id.name);
}
/* cleanup */
#endif
@@ -2896,13 +2896,13 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
{
/* time evolution */
/* actually does an explicit euler step mode == 0 */
- /* or heun ~ 2nd order runge-kutta steps, mode 1,2 */
+ /* or heun ~ 2nd order runge-kutta steps, mode 1, 2 */
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
- float dx[3]={0},dv[3],aabbmin[3],aabbmax[3],cm[3]={0.0f,0.0f,0.0f};
- float timeovermass/*,freezeloc=0.00001f,freezeforce=0.00000000001f*/;
- float maxerrpos= 0.0f,maxerrvel = 0.0f;
- int a,fuzzy=0;
+ float dx[3]={0}, dv[3], aabbmin[3], aabbmax[3], cm[3]={0.0f, 0.0f, 0.0f};
+ float timeovermass/*, freezeloc=0.00001f, freezeforce=0.00000000001f*/;
+ float maxerrpos= 0.0f, maxerrvel = 0.0f;
+ int a, fuzzy=0;
forcetime *= sb_time_scale(ob);
@@ -2919,21 +2919,21 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
/* now we have individual masses */
/* claim a minimum mass for vertex */
- if (_final_mass(ob,bp) > 0.009999f) timeovermass = forcetime/_final_mass(ob,bp);
+ if (_final_mass(ob, bp) > 0.009999f) timeovermass = forcetime/_final_mass(ob, bp);
else timeovermass = forcetime/0.009999f;
- if (_final_goal(ob,bp) < SOFTGOALSNAP) {
+ if (_final_goal(ob, bp) < SOFTGOALSNAP) {
/* this makes t~ = t */
- if (mid_flags & MID_PRESERVE) copy_v3_v3(dx,bp->vec);
+ if (mid_flags & MID_PRESERVE) copy_v3_v3(dx, bp->vec);
/* so here is (v)' = a(cceleration) = sum(F_springs)/m + gravitation + some friction forces + more forces*/
/* the ( ... )' operator denotes derivate respective time */
/* the euler step for velocity then becomes */
/* v(t + dt) = v(t) + a(t) * dt */
- mul_v3_fl(bp->force,timeovermass);/* individual mass of node here */
+ mul_v3_fl(bp->force, timeovermass);/* individual mass of node here */
/* some nasty if's to have heun in here too */
- copy_v3_v3(dv,bp->force);
+ copy_v3_v3(dv, bp->force);
if (mode == 1) {
copy_v3_v3(bp->prevvec, bp->vec);
@@ -2946,80 +2946,80 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
bp->vec[1] = bp->prevvec[1] + 0.5f * (dv[1] + bp->prevdv[1]);
bp->vec[2] = bp->prevvec[2] + 0.5f * (dv[2] + bp->prevdv[2]);
/* compare euler to heun to estimate error for step sizing */
- maxerrvel = MAX2(maxerrvel,ABS(dv[0] - bp->prevdv[0]));
- maxerrvel = MAX2(maxerrvel,ABS(dv[1] - bp->prevdv[1]));
- maxerrvel = MAX2(maxerrvel,ABS(dv[2] - bp->prevdv[2]));
+ maxerrvel = MAX2(maxerrvel, ABS(dv[0] - bp->prevdv[0]));
+ maxerrvel = MAX2(maxerrvel, ABS(dv[1] - bp->prevdv[1]));
+ maxerrvel = MAX2(maxerrvel, ABS(dv[2] - bp->prevdv[2]));
}
else { add_v3_v3(bp->vec, bp->force); }
/* this makes t~ = t+dt */
- if (!(mid_flags & MID_PRESERVE)) copy_v3_v3(dx,bp->vec);
+ if (!(mid_flags & MID_PRESERVE)) copy_v3_v3(dx, bp->vec);
/* so here is (x)'= v(elocity) */
/* the euler step for location then becomes */
/* x(t + dt) = x(t) + v(t~) * dt */
- mul_v3_fl(dx,forcetime);
+ mul_v3_fl(dx, forcetime);
/* the freezer coming sooner or later */
/*
- if ((dot_v3v3(dx,dx)<freezeloc )&&(dot_v3v3(bp->force,bp->force)<freezeforce )) {
+ if ((dot_v3v3(dx, dx)<freezeloc )&&(dot_v3v3(bp->force, bp->force)<freezeforce )) {
bp->frozen /=2;
}
else {
- bp->frozen = MIN2(bp->frozen*1.05f,1.0f);
+ bp->frozen = MIN2(bp->frozen*1.05f, 1.0f);
}
- mul_v3_fl(dx,bp->frozen);
+ mul_v3_fl(dx, bp->frozen);
*/
/* again some nasty if's to have heun in here too */
if (mode ==1) {
- copy_v3_v3(bp->prevpos,bp->pos);
- copy_v3_v3(bp->prevdx ,dx);
+ copy_v3_v3(bp->prevpos, bp->pos);
+ copy_v3_v3(bp->prevdx, dx);
}
if (mode ==2) {
bp->pos[0] = bp->prevpos[0] + 0.5f * ( dx[0] + bp->prevdx[0]);
bp->pos[1] = bp->prevpos[1] + 0.5f * ( dx[1] + bp->prevdx[1]);
bp->pos[2] = bp->prevpos[2] + 0.5f * ( dx[2] + bp->prevdx[2]);
- maxerrpos = MAX2(maxerrpos,ABS(dx[0] - bp->prevdx[0]));
- maxerrpos = MAX2(maxerrpos,ABS(dx[1] - bp->prevdx[1]));
- maxerrpos = MAX2(maxerrpos,ABS(dx[2] - bp->prevdx[2]));
+ maxerrpos = MAX2(maxerrpos, ABS(dx[0] - bp->prevdx[0]));
+ maxerrpos = MAX2(maxerrpos, ABS(dx[1] - bp->prevdx[1]));
+ maxerrpos = MAX2(maxerrpos, ABS(dx[2] - bp->prevdx[2]));
/* bp->choke is set when we need to pull a vertex or edge out of the collider.
the collider object signals to get out by pushing hard. on the other hand
we don't want to end up in deep space so we add some <viscosity>
to balance that out */
if (bp->choke2 > 0.0f) {
- mul_v3_fl(bp->vec,(1.0f - bp->choke2));
+ mul_v3_fl(bp->vec, (1.0f - bp->choke2));
}
if (bp->choke > 0.0f) {
- mul_v3_fl(bp->vec,(1.0f - bp->choke));
+ mul_v3_fl(bp->vec, (1.0f - bp->choke));
}
}
else { add_v3_v3(bp->pos, dx);}
}/*snap*/
/* so while we are looping BPs anyway do statistics on the fly */
- aabbmin[0] = MIN2(aabbmin[0],bp->pos[0]);
- aabbmin[1] = MIN2(aabbmin[1],bp->pos[1]);
- aabbmin[2] = MIN2(aabbmin[2],bp->pos[2]);
- aabbmax[0] = MAX2(aabbmax[0],bp->pos[0]);
- aabbmax[1] = MAX2(aabbmax[1],bp->pos[1]);
- aabbmax[2] = MAX2(aabbmax[2],bp->pos[2]);
+ aabbmin[0] = MIN2(aabbmin[0], bp->pos[0]);
+ aabbmin[1] = MIN2(aabbmin[1], bp->pos[1]);
+ aabbmin[2] = MIN2(aabbmin[2], bp->pos[2]);
+ aabbmax[0] = MAX2(aabbmax[0], bp->pos[0]);
+ aabbmax[1] = MAX2(aabbmax[1], bp->pos[1]);
+ aabbmax[2] = MAX2(aabbmax[2], bp->pos[2]);
if (bp->loc_flag & SBF_DOFUZZY) fuzzy =1;
} /*for*/
- if (sb->totpoint) mul_v3_fl(cm,1.0f/sb->totpoint);
+ if (sb->totpoint) mul_v3_fl(cm, 1.0f/sb->totpoint);
if (sb->scratch) {
- copy_v3_v3(sb->scratch->aabbmin,aabbmin);
- copy_v3_v3(sb->scratch->aabbmax,aabbmax);
+ copy_v3_v3(sb->scratch->aabbmin, aabbmin);
+ copy_v3_v3(sb->scratch->aabbmax, aabbmax);
}
if (err) { /* so step size will be controlled by biggest difference in slope */
if (sb->solverflags & SBSO_OLDERR)
- *err = MAX2(maxerrpos,maxerrvel);
+ *err = MAX2(maxerrpos, maxerrvel);
else
*err = maxerrpos;
- //printf("EP %f EV %f\n",maxerrpos,maxerrvel);
+ //printf("EP %f EV %f\n", maxerrpos, maxerrvel);
if (fuzzy) {
*err /= sb->fuzzyness;
}
@@ -3047,19 +3047,19 @@ static void softbody_store_step(Object *ob)
int a;
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);
+ 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)
+static void softbody_store_state(Object *ob, float *ppos, float *pvel)
{
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++) {
@@ -3072,42 +3072,42 @@ static void softbody_store_state(Object *ob,float *ppos,float *pvel)
}
/* used by predictors and correctors */
-static void softbody_retrieve_state(Object *ob,float *ppos,float *pvel)
+static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
{
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++) {
- copy_v3_v3(bp->vec,pv);
+ copy_v3_v3(bp->vec, pv);
pv+=3;
- copy_v3_v3(bp->pos,pp);
+ copy_v3_v3(bp->pos, pp);
pp+=3;
}
}
/* used by predictors and correctors */
-static void softbody_swap_state(Object *ob,float *ppos,float *pvel)
+static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
{
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++) {
copy_v3_v3(temp, bp->vec);
- copy_v3_v3(bp->vec,pv);
- copy_v3_v3(pv,temp);
+ copy_v3_v3(bp->vec, pv);
+ copy_v3_v3(pv, temp);
pv+=3;
copy_v3_v3(temp, bp->pos);
- copy_v3_v3(bp->pos,pp);
- copy_v3_v3(pp,temp);
+ copy_v3_v3(bp->pos, pp);
+ copy_v3_v3(pp, temp);
pp+=3;
}
}
@@ -3127,9 +3127,9 @@ static void softbody_apply_goalsnap(Object *ob)
int a;
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- if (_final_goal(ob,bp) >= SOFTGOALSNAP) {
- copy_v3_v3(bp->prevpos,bp->pos);
- copy_v3_v3(bp->pos,bp->origT);
+ if (_final_goal(ob, bp) >= SOFTGOALSNAP) {
+ copy_v3_v3(bp->prevpos, bp->pos);
+ copy_v3_v3(bp->pos, bp->origT);
}
}
}
@@ -3141,7 +3141,7 @@ static void apply_spring_memory(Object *ob)
BodySpring *bs;
BodyPoint *bp1, *bp2;
int a;
- float b,l,r;
+ float b, l, r;
if (sb && sb->totspring) {
b = sb->plastic;
@@ -3149,7 +3149,7 @@ static void apply_spring_memory(Object *ob)
bs = &sb->bspring[a];
bp1 =&sb->bpoint[bs->v1];
bp2 =&sb->bpoint[bs->v2];
- l = len_v3v3(bp1->pos,bp2->pos);
+ l = len_v3v3(bp1->pos, bp2->pos);
r = bs->len/l;
if (( r > 1.05f) || (r < 0.95f)) {
bs->len = ((100.0f - b) * bs->len + b*l)/100.0f;
@@ -3172,7 +3172,7 @@ static void interpolate_exciter(Object *ob, int timescale, int time)
bp->origT[0] = bp->origS[0] + f*(bp->origE[0] - bp->origS[0]);
bp->origT[1] = bp->origS[1] + f*(bp->origE[1] - bp->origS[1]);
bp->origT[2] = bp->origS[2] + f*(bp->origE[2] - bp->origS[2]);
- if (_final_goal(ob,bp) >= SOFTGOALSNAP) {
+ if (_final_goal(ob, bp) >= SOFTGOALSNAP) {
bp->vec[0] = bp->origE[0] - bp->origS[0];
bp->vec[1] = bp->origE[1] - bp->origS[1];
bp->vec[2] = bp->origE[2] - bp->origS[2];
@@ -3289,7 +3289,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) { /* even this is a deprecated evil hack */
/* I'd like to have it .. if (sb->namedVG_Goal[0]) */
- get_scalar_from_vertexgroup(ob, a,(short) (sb->vertgroup-1), &bp->goal);
+ get_scalar_from_vertexgroup(ob, a, (short) (sb->vertgroup-1), &bp->goal);
/* do this always, regardless successfull read from vertex group */
/* this is where '2.5 every thing is animatable' goes wrong in the first place jow_go_for2_5 */
/* 1st coding action to take : move this to frame level */
@@ -3308,12 +3308,12 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
*/
if (sb->namedVG_Mass[0]) {
- int grp= defgroup_name_index (ob,sb->namedVG_Mass);
- /* printf("VGN %s %d\n",sb->namedVG_Mass,grp); */
+ int grp= defgroup_name_index (ob, sb->namedVG_Mass);
+ /* printf("VGN %s %d\n", sb->namedVG_Mass, grp); */
if (grp > -1) {
- get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->mass);
+ get_scalar_from_vertexgroup(ob, a, (short) (grp), &bp->mass);
/* 2.5 bp->mass = bp->mass * sb->nodemass; */
- /* printf("bp->mass %f\n",bp->mass); */
+ /* printf("bp->mass %f\n", bp->mass); */
}
}
@@ -3321,11 +3321,11 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
bp->springweight = 1.0f;
if (sb->namedVG_Spring_K[0]) {
- int grp= defgroup_name_index (ob,sb->namedVG_Spring_K);
- //printf("VGN %s %d\n",sb->namedVG_Spring_K,grp);
+ int grp= defgroup_name_index (ob, sb->namedVG_Spring_K);
+ //printf("VGN %s %d\n", sb->namedVG_Spring_K, grp);
if (grp > -1) {
- get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->springweight);
- //printf("bp->springweight %f\n",bp->springweight);
+ get_scalar_from_vertexgroup(ob, a, (short) (grp), &bp->springweight);
+ //printf("bp->springweight %f\n", bp->springweight);
}
}
@@ -3352,7 +3352,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
build_bps_springlist(ob); /* scan for springs attached to bodypoints ONCE */
/* insert *other second order* springs if desired */
if (sb->secondspring > 0.0000001f) {
- add_2nd_order_springs(ob,sb->secondspring); /* exploits the the first run of build_bps_springlist(ob);*/
+ add_2nd_order_springs(ob, sb->secondspring); /* exploits the the first run of build_bps_springlist(ob);*/
build_bps_springlist(ob); /* yes we need to do it again*/
}
springs_from_mesh(ob); /* write the 'rest'-length of the springs */
@@ -3373,8 +3373,8 @@ static void mesh_faces_to_scratch(Object *ob)
int a;
/* alloc and copy faces*/
- bodyface = sb->scratch->bodyface = MEM_mallocN(sizeof(BodyFace)*me->totface,"SB_body_Faces");
- //memcpy(sb->scratch->mface,me->mface,sizeof(MFace)*me->totface);
+ bodyface = sb->scratch->bodyface = MEM_mallocN(sizeof(BodyFace)*me->totface, "SB_body_Faces");
+ //memcpy(sb->scratch->mface, me->mface, sizeof(MFace)*me->totface);
mface = me->mface;
for (a=0; a<me->totface; a++, mface++, bodyface++) {
bodyface->v1 = mface->v1;
@@ -3391,20 +3391,20 @@ static void reference_to_scratch(Object *ob)
SoftBody *sb= ob->soft;
ReferenceVert *rp;
BodyPoint *bp;
- float accu_pos[3] ={0.f,0.f,0.f};
+ float accu_pos[3] ={0.f, 0.f, 0.f};
float accu_mass = 0.f;
int a;
- sb->scratch->Ref.ivert = MEM_mallocN(sizeof(ReferenceVert)*sb->totpoint,"SB_Reference");
+ sb->scratch->Ref.ivert = MEM_mallocN(sizeof(ReferenceVert)*sb->totpoint, "SB_Reference");
bp= ob->soft->bpoint;
rp= sb->scratch->Ref.ivert;
for (a=0; a<sb->totpoint; a++, rp++, bp++) {
- copy_v3_v3(rp->pos,bp->pos);
+ copy_v3_v3(rp->pos, bp->pos);
add_v3_v3(accu_pos, bp->pos);
- accu_mass += _final_mass(ob,bp);
+ accu_mass += _final_mass(ob, bp);
}
- mul_v3_fl(accu_pos,1.0f/accu_mass);
- copy_v3_v3(sb->scratch->Ref.com,accu_pos);
+ mul_v3_fl(accu_pos, 1.0f/accu_mass);
+ copy_v3_v3(sb->scratch->Ref.com, accu_pos);
/* printf("reference_to_scratch\n"); */
}
@@ -3412,17 +3412,17 @@ static void reference_to_scratch(Object *ob)
helper function to get proper spring length
when object is rescaled
*/
-static float globallen(float *v1,float *v2,Object *ob)
+static float globallen(float *v1, float *v2, Object *ob)
{
- float p1[3],p2[3];
- copy_v3_v3(p1,v1);
+ float p1[3], p2[3];
+ copy_v3_v3(p1, v1);
mul_m4_v3(ob->obmat, p1);
- copy_v3_v3(p2,v2);
+ copy_v3_v3(p2, v2);
mul_m4_v3(ob->obmat, p2);
- return len_v3v3(p1,p2);
+ return len_v3v3(p1, p2);
}
-static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *ob)
+static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff, Object *ob)
{
BPoint *bp=lt->def, *bpu;
int u, v, w, dv, dw, bpc=0, bpuc;
@@ -3440,21 +3440,21 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *
bs->v1 = bpc;
bs->v2 = bpc-dw;
bs->springtype=SB_EDGE;
- bs->len= globallen((bp-dw)->vec, bp->vec,ob);
+ bs->len= globallen((bp-dw)->vec, bp->vec, ob);
bs++;
}
if (v) {
bs->v1 = bpc;
bs->v2 = bpc-dv;
bs->springtype=SB_EDGE;
- bs->len= globallen((bp-dv)->vec, bp->vec,ob);
+ bs->len= globallen((bp-dv)->vec, bp->vec, ob);
bs++;
}
if (u) {
bs->v1 = bpuc;
bs->v2 = bpc;
bs->springtype=SB_EDGE;
- bs->len= globallen((bpu)->vec, bp->vec,ob);
+ bs->len= globallen((bpu)->vec, bp->vec, ob);
bs++;
}
@@ -3465,14 +3465,14 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *
bs->v1 = bpc;
bs->v2 = bpc-dw-dv-1;
bs->springtype=SB_BEND;
- bs->len= globallen((bp-dw-dv-1)->vec, bp->vec,ob);
+ bs->len= globallen((bp-dw-dv-1)->vec, bp->vec, ob);
bs++;
}
if ( (v < lt->pntsv-1) && (u != 0) ) {
bs->v1 = bpc;
bs->v2 = bpc-dw+dv-1;
bs->springtype=SB_BEND;
- bs->len= globallen((bp-dw+dv-1)->vec, bp->vec,ob);
+ bs->len= globallen((bp-dw+dv-1)->vec, bp->vec, ob);
bs++;
}
}
@@ -3482,14 +3482,14 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *
bs->v1 = bpc;
bs->v2 = bpc+dw-dv-1;
bs->springtype=SB_BEND;
- bs->len= globallen((bp+dw-dv-1)->vec, bp->vec,ob);
+ bs->len= globallen((bp+dw-dv-1)->vec, bp->vec, ob);
bs++;
}
if ( (v < lt->pntsv-1) && (u != 0) ) {
bs->v1 = bpc;
bs->v2 = bpc+dw+dv-1;
bs->springtype=SB_BEND;
- bs->len= globallen((bp+dw+dv-1)->vec, bp->vec,ob);
+ bs->len= globallen((bp+dw+dv-1)->vec, bp->vec, ob);
bs++;
}
}
@@ -3541,7 +3541,7 @@ static void lattice_to_softbody(Scene *scene, Object *ob)
/* create some helper edges to enable SB lattice to be useful at all */
if (ob->softflag & OB_SB_EDGES) {
- makelatticesprings(lt,ob->soft->bspring,ob->softflag & OB_SB_QUADS,ob);
+ makelatticesprings(lt, ob->soft->bspring, ob->softflag & OB_SB_QUADS, ob);
build_bps_springlist(ob); /* link bps to springs */
}
}
@@ -3630,7 +3630,7 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob)
bs->v1= curindex-1;
bs->v2= curindex;
bs->springtype=SB_EDGE;
- bs->len= globallen( (bpnt-1)->vec, bpnt->vec , ob );
+ bs->len= globallen( (bpnt-1)->vec, bpnt->vec, ob );
bs++;
}
}
@@ -3650,7 +3650,7 @@ static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts,
if (sb) {
BodyPoint *bp= sb->bpoint;
int a;
- if (sb->solverflags & SBSO_ESTIMATEIPO) {SB_estimate_transform(ob,sb->lcom,sb->lrot,sb->lscale);}
+ if (sb->solverflags & SBSO_ESTIMATEIPO) {SB_estimate_transform(ob, sb->lcom, sb->lrot, sb->lscale);}
/* inverse matrix is not uptodate... */
invert_m4_m4(ob->imat, ob->obmat);
@@ -3667,7 +3667,7 @@ static void sb_new_scratch(SoftBody *sb)
{
if (!sb) return;
sb->scratch = MEM_callocN(sizeof(SBScratch), "SBScratch");
- sb->scratch->colliderhash = BLI_ghash_new(BLI_ghashutil_ptrhash,BLI_ghashutil_ptrcmp, "sb_new_scratch gh");
+ sb->scratch->colliderhash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "sb_new_scratch gh");
sb->scratch->bodyface = NULL;
sb->scratch->totface = 0;
sb->scratch->aabbmax[0]=sb->scratch->aabbmax[1]=sb->scratch->aabbmax[2] = 1.0e30f;
@@ -3783,7 +3783,7 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
if (!sb || !sb->bpoint)
return;
- for (a=0,bp=sb->bpoint; a<numVerts; a++, bp++) {
+ for (a=0, bp=sb->bpoint; a<numVerts; a++, bp++) {
/* store where goals are now */
copy_v3_v3(bp->origS, bp->origE);
/* copy the position of the goals at desired end time */
@@ -3798,28 +3798,28 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
/* void SB_estimate_transform */
-/* input Object *ob out (says any object that can do SB like mesh,lattice,curve )
- * output float lloc[3],float lrot[3][3],float lscale[3][3]
+/* input Object *ob out (says any object that can do SB like mesh, lattice, curve )
+ * output float lloc[3], float lrot[3][3], float lscale[3][3]
* that is:
* a precise position vector denoting the motion of the center of mass
* give a rotation/scale matrix using averaging method, that's why estimate and not calculate
* see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
* our advantage here we know the identity of the vertex
* there are others methods giving other results.
- * lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
+ * lloc, lrot, lscale are allowed to be NULL, just in case you don't need it.
* should be pretty useful for pythoneers :)
* not! velocity .. 2nd order stuff
* vcloud_estimate_transform see
*/
-void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3])
+void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3])
{
BodyPoint *bp;
ReferenceVert *rp;
SoftBody *sb = NULL;
float (*opos)[3];
float (*rpos)[3];
- float com[3],rcom[3];
+ float com[3], rcom[3];
int a;
if (!ob ||!ob->soft) return; /* why did we get here ? */
@@ -3829,16 +3829,16 @@ void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscal
rpos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_RPOS");
/* might filter vertex selection with a vertex group */
for (a=0, bp=sb->bpoint, rp=sb->scratch->Ref.ivert; a<sb->totpoint; a++, bp++, rp++) {
- copy_v3_v3(rpos[a],rp->pos);
- copy_v3_v3(opos[a],bp->pos);
+ copy_v3_v3(rpos[a], rp->pos);
+ copy_v3_v3(opos[a], bp->pos);
}
- vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com, rcom,lrot,lscale);
- //sub_v3_v3(com,rcom);
- if (lloc) copy_v3_v3(lloc,com);
- copy_v3_v3(sb->lcom,com);
- if (lscale) copy_m3_m3(sb->lscale,lscale);
- if (lrot) copy_m3_m3(sb->lrot,lrot);
+ vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com, rcom, lrot, lscale);
+ //sub_v3_v3(com, rcom);
+ if (lloc) copy_v3_v3(lloc, com);
+ copy_v3_v3(sb->lcom, com);
+ if (lscale) copy_m3_m3(sb->lscale, lscale);
+ if (lrot) copy_m3_m3(sb->lrot, lrot);
MEM_freeN(opos);
@@ -3850,7 +3850,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
BodyPoint *bp;
int a;
- for (a=0,bp=sb->bpoint; a<numVerts; a++, bp++) {
+ for (a=0, bp=sb->bpoint; a<numVerts; a++, bp++) {
copy_v3_v3(bp->pos, vertexCos[a]);
mul_m4_v3(ob->obmat, bp->pos); /* yep, sofbody is global coords*/
copy_v3_v3(bp->origS, bp->pos);
@@ -3890,8 +3890,8 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
/* we only need that if we want to reconstruct IPO */
if (1) {
reference_to_scratch(ob);
- SB_estimate_transform(ob,NULL,NULL,NULL);
- SB_estimate_transform(ob,NULL,NULL,NULL);
+ SB_estimate_transform(ob, NULL, NULL, NULL);
+ SB_estimate_transform(ob, NULL, NULL, NULL);
}
switch (ob->type) {
case OB_MESH:
@@ -3911,7 +3911,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
{
/* the simulator */
float forcetime;
- double sct,sst;
+ double sct, sst;
sst=PIL_check_seconds_timer();
@@ -3951,26 +3951,26 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
forcetime = forcetimemax; /* hope for integrating in one step */
while ( (ABS(timedone) < ABS(dtime)) && (loops < 2000) ) {
/* set goals in time */
- interpolate_exciter(ob,200,(int)(200.0f*(timedone/dtime)));
+ interpolate_exciter(ob, 200, (int)(200.0f*(timedone/dtime)));
sb->scratch->flag &= ~SBF_DOFUZZY;
/* do predictive euler step */
- softbody_calc_forces(scene, ob, forcetime,timedone/dtime,0);
+ softbody_calc_forces(scene, ob, forcetime, timedone/dtime, 0);
- softbody_apply_forces(ob, forcetime, 1, NULL,mid_flags);
+ softbody_apply_forces(ob, forcetime, 1, NULL, mid_flags);
/* crop new slope values to do averaged slope step */
- softbody_calc_forces(scene, ob, forcetime,timedone/dtime,0);
+ softbody_calc_forces(scene, ob, forcetime, timedone/dtime, 0);
- softbody_apply_forces(ob, forcetime, 2, &err,mid_flags);
+ softbody_apply_forces(ob, forcetime, 2, &err, mid_flags);
softbody_apply_goalsnap(ob);
if (err > SoftHeunTol) { /* error needs to be scaled to some quantity */
if (forcetime > forcetimemin) {
- forcetime = MAX2(forcetime / 2.0f,forcetimemin);
+ forcetime = MAX2(forcetime / 2.0f, forcetimemin);
softbody_restore_prev_step(ob);
- //printf("down,");
+ //printf("down, ");
}
else {
timedone += forcetime;
@@ -3990,17 +3990,17 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
}
}
timedone += forcetime;
- newtime=MIN2(forcetimemax,MAX2(newtime,forcetimemin));
- //if (newtime > forcetime) printf("up,");
+ newtime=MIN2(forcetimemax, MAX2(newtime, forcetimemin));
+ //if (newtime > forcetime) printf("up, ");
if (forcetime > 0.0f)
- forcetime = MIN2(dtime - timedone,newtime);
+ forcetime = MIN2(dtime - timedone, newtime);
else
- forcetime = MAX2(dtime - timedone,newtime);
+ forcetime = MAX2(dtime - timedone, newtime);
}
loops++;
if (sb->solverflags & SBSO_MONITOR ) {
sct=PIL_check_seconds_timer();
- if (sct-sst > 0.5f) printf("%3.0f%% \r",100.0f*timedone/dtime);
+ if (sct-sst > 0.5f) printf("%3.0f%% \r", 100.0f*timedone/dtime);
}
/* ask for user break */
if (SB_localInterruptCallBack && SB_localInterruptCallBack()) break;
@@ -4013,7 +4013,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
// if (G.debug & G_DEBUG) {
if (sb->solverflags & SBSO_MONITOR ) {
if (loops > HEUNWARNLIMIT) /* monitor high loop counts */
- printf("\r needed %d steps/frame",loops);
+ printf("\r needed %d steps/frame", loops);
}
}
@@ -4036,7 +4036,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
if (sb->solverflags & SBSO_MONITOR ) {
sct=PIL_check_seconds_timer();
- if ((sct-sst > 0.5f) || (G.debug & G_DEBUG)) printf(" solver time %f sec %s\n",sct-sst,ob->id.name);
+ if ((sct-sst > 0.5f) || (G.debug & G_DEBUG)) printf(" solver time %f sec %s\n", sct-sst, ob->id.name);
}
}
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 29b9505f449..7f617620642 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -1056,8 +1056,8 @@ void make_local_texture(Tex *tex)
void autotexname(Tex *tex)
{
Main *bmain= G.main;
- char texstr[20][15]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend",
- "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave",
+ char texstr[20][15]= {"None", "Clouds", "Wood", "Marble", "Magic", "Blend",
+ "Stucci", "Noise", "Image", "Plugin", "EnvMap", "Musgrave",
"Voronoi", "DistNoise", "Point Density", "Voxel Data", "Ocean", "", "", ""};
Image *ima;
char di[FILE_MAXDIR], fi[FILE_MAXFILE];
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 48e939be7e9..03afc97f324 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -251,7 +251,7 @@ static struct bUnitDef buNaturalTimeDef[] = {
{"hour", "hours", "hr", "h", "Hours", 3600.0, 0.0, B_UNIT_DEF_NONE},
{"minute", "minutes", "min", "m", "Minutes", 60.0, 0.0, B_UNIT_DEF_NONE},
{"second", "seconds", "sec", "s", "Seconds", 1.0, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"millisecond", "milliseconds", "ms", NULL, "Milliseconds", 0.001, 0.0 , B_UNIT_DEF_NONE},
+ {"millisecond", "milliseconds", "ms", NULL, "Milliseconds", 0.001, 0.0, B_UNIT_DEF_NONE},
{"microsecond", "microseconds", "µs", "us", "Microseconds", 0.000001, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c
index 62e921f3311..6c818965e9a 100644
--- a/source/blender/blenkernel/intern/writeframeserver.c
+++ b/source/blender/blenkernel/intern/writeframeserver.c
@@ -70,7 +70,7 @@ static int render_height;
static int startup_socket_system(void)
{
WSADATA wsa;
- return (WSAStartup(MAKEWORD(2,0),&wsa) == 0);
+ return (WSAStartup(MAKEWORD(2, 0), &wsa) == 0);
}
static void shutdown_socket_system(void)
diff --git a/source/blender/blenlib/BLI_fileops_types.h b/source/blender/blenlib/BLI_fileops_types.h
index 8e4b5b3e411..d9f8549e8f5 100644
--- a/source/blender/blenlib/BLI_fileops_types.h
+++ b/source/blender/blenlib/BLI_fileops_types.h
@@ -70,7 +70,7 @@ struct direntry{
struct dirlink
{
- struct dirlink *next,*prev;
+ struct dirlink *next, *prev;
char *name;
};
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 9b5e3638609..85129d5b68d 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -244,14 +244,14 @@ void tangent_from_uv(float uv1[2], float uv2[2], float uv3[2],
void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,
float (*rpos)[3], float *rweight,
- float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3]);
+ float lloc[3], float rloc[3], float lrot[3][3], float lscale[3][3]);
/****************************** Spherical Harmonics *************************/
/* Uses 2nd order SH => 9 coefficients, stored in this order:
- * 0 = (0,0),
- * 1 = (1,-1), 2 = (1,0), 3 = (1,1),
- * 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
+ * 0 = (0, 0),
+ * 1 = (1, -1), 2 = (1, 0), 3 = (1, 1),
+ * 4 = (2, -2), 5 = (2, -1), 6 = (2, 0), 7 = (2, 1), 8 = (2, 2) */
MINLINE void zero_sh(float r[9]);
MINLINE void copy_sh_sh(float r[9], const float a[9]);
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index df5199e19e7..249f2265440 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -126,7 +126,7 @@ MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3]);
MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3]);
-MINLINE void star_m3_v3(float rmat[3][3],float a[3]);
+MINLINE void star_m3_v3(float rmat[3][3], float a[3]);
/*********************************** Length **********************************/
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index e02b48feda7..1d085a46a19 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -109,7 +109,7 @@ void BLI_newname(char * name, int add);
int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen);
void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic);
int BLI_split_name_num(char *left, int *nr, const char *name, const char delim);
-void BLI_splitdirstring(char *di,char *fi);
+void BLI_splitdirstring(char *di, char *fi);
/* make sure path separators conform to system one */
void BLI_clean(char *path);
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index 3921c01d2cf..3e1561136cc 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -129,7 +129,7 @@ static float KDOP_AXES[13][3] =
/*
* Generic push and pop heap
*/
-#define PUSH_HEAP_BODY(HEAP_TYPE,PRIORITY,heap,heap_size) \
+#define PUSH_HEAP_BODY(HEAP_TYPE, PRIORITY, heap, heap_size) \
{ \
HEAP_TYPE element = heap[heap_size-1]; \
int child = heap_size-1; \
@@ -146,7 +146,7 @@ static float KDOP_AXES[13][3] =
heap[child] = element; \
}
-#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY,heap,heap_size) \
+#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY, heap, heap_size) \
{ \
HEAP_TYPE element = heap[heap_size-1]; \
int parent = 0; \
@@ -215,7 +215,7 @@ static int floor_lg(int a)
*/
static void bvh_insertionsort(BVHNode **a, int lo, int hi, int axis)
{
- int i,j;
+ int i, j;
BVHNode *t;
for (i=lo; i < hi; i++) {
j=i;
@@ -237,7 +237,7 @@ static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis)
while (x->bv[axis] < (a[j])->bv[axis]) j--;
if (!(i < j))
return i;
- SWAP( BVHNode* , a[i], a[j]);
+ SWAP(BVHNode *, a[i], a[j]);
i++;
}
}
@@ -269,12 +269,12 @@ static void bvh_heapsort(BVHNode **a, int lo, int hi, int axis)
int n = hi-lo, i;
for (i=n/2; i>=1; i=i-1)
{
- bvh_downheap(a, i,n,lo, axis);
+ bvh_downheap(a, i, n, lo, axis);
}
for (i=n; i>1; i=i-1)
{
- SWAP(BVHNode*, a[lo],a[lo+i-1]);
- bvh_downheap(a, 1,i-1,lo, axis);
+ SWAP(BVHNode*, a[lo], a[lo+i-1]);
+ bvh_downheap(a, 1, i-1, lo, axis);
}
}
#endif
@@ -409,7 +409,7 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, const float *co, int
// depends on the fact that the BVH's for each face is already build
static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end)
{
- float newmin,newmax;
+ float newmin, newmax;
int i, j;
float *bv = node->bv;
@@ -671,7 +671,7 @@ static int implicit_needed_branches(int tree_type, int leafs)
* - if all elements are different all partition will get the same subset of elements
* as if the array was sorted.
*
- * partition P is described as the elements in the range ( nth[P] , nth[P+1] ]
+ * partition P is described as the elements in the range ( nth[P], nth[P+1] ]
*
* TODO: This can be optimized a bit by doing a specialized nth_element instead of K nth_elements
*/
@@ -1180,14 +1180,14 @@ typedef struct NodeDistance
} NodeDistance;
-#define NodeDistance_priority(a,b) ( (a).dist < (b).dist )
+#define NodeDistance_priority(a, b) ( (a).dist < (b).dist )
// TODO: use a priority queue to reduce the number of nodes looked on
static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
{
if (node->totnode == 0) {
if (data->callback)
- data->callback(data->userdata , node->index, data->co, &data->nearest);
+ data->callback(data->userdata, node->index, data->co, &data->nearest);
else {
data->nearest.index = node->index;
data->nearest.dist = calc_nearest_point(data->proj, node, data->nearest.co);
@@ -1329,7 +1329,7 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *n
}
if (nearest) {
- memcpy( &data.nearest , nearest, sizeof(*nearest) );
+ memcpy( &data.nearest, nearest, sizeof(*nearest) );
}
else {
data.nearest.index = -1;
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c
index ee06f32a934..a518d1445e3 100644
--- a/source/blender/blenlib/intern/BLI_kdtree.c
+++ b/source/blender/blenlib/intern/BLI_kdtree.c
@@ -167,7 +167,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
root= tree->root;
min_node= root;
- min_dist= squared_distance(root->co,co,root->nor,nor);
+ min_dist= squared_distance(root->co, co, root->nor, nor);
if (co[root->d] < root->co[root->d]) {
if (root->right)
@@ -191,7 +191,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
cur_dist= -cur_dist*cur_dist;
if (-cur_dist<min_dist) {
- cur_dist=squared_distance(node->co,co,node->nor,nor);
+ cur_dist=squared_distance(node->co, co, node->nor, nor);
if (cur_dist<min_dist) {
min_dist=cur_dist;
min_node=node;
@@ -206,7 +206,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
cur_dist= cur_dist*cur_dist;
if (cur_dist<min_dist) {
- cur_dist=squared_distance(node->co,co,node->nor,nor);
+ cur_dist=squared_distance(node->co, co, node->nor, nor);
if (cur_dist<min_dist) {
min_dist=cur_dist;
min_node=node;
@@ -219,7 +219,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
}
if (cur+3 > totstack) {
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
- memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
+ memcpy(temp, stack, totstack*sizeof(KDTreeNode*));
if (stack != defaultstack)
MEM_freeN(stack);
stack=temp;
@@ -273,8 +273,8 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
root= tree->root;
- cur_dist= squared_distance(root->co,co,root->nor,nor);
- add_nearest(nearest,&found,n,root->index,cur_dist,root->co);
+ cur_dist= squared_distance(root->co, co, root->nor, nor);
+ add_nearest(nearest, &found, n, root->index, cur_dist, root->co);
if (co[root->d] < root->co[root->d]) {
if (root->right)
@@ -298,10 +298,10 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
cur_dist= -cur_dist*cur_dist;
if (found<n || -cur_dist<nearest[found-1].dist) {
- cur_dist=squared_distance(node->co,co,node->nor,nor);
+ cur_dist=squared_distance(node->co, co, node->nor, nor);
if (found<n || cur_dist<nearest[found-1].dist)
- add_nearest(nearest,&found,n,node->index,cur_dist,node->co);
+ add_nearest(nearest, &found, n, node->index, cur_dist, node->co);
if (node->left)
stack[cur++]=node->left;
@@ -313,9 +313,9 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
cur_dist= cur_dist*cur_dist;
if (found<n || cur_dist<nearest[found-1].dist) {
- cur_dist=squared_distance(node->co,co,node->nor,nor);
+ cur_dist=squared_distance(node->co, co, node->nor, nor);
if (found<n || cur_dist<nearest[found-1].dist)
- add_nearest(nearest,&found,n,node->index,cur_dist,node->co);
+ add_nearest(nearest, &found, n, node->index, cur_dist, node->co);
if (node->right)
stack[cur++]=node->right;
@@ -325,7 +325,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
}
if (cur+3 > totstack) {
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
- memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
+ memcpy(temp, stack, totstack * sizeof(KDTreeNode*));
if (stack != defaultstack)
MEM_freeN(stack);
stack=temp;
@@ -432,7 +432,7 @@ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KD
if (cur+3 > totstack) {
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
- memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
+ memcpy(temp, stack, totstack*sizeof(KDTreeNode*));
if (stack != defaultstack)
MEM_freeN(stack);
stack=temp;
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 8990f0f79d3..0a5e4d9fd48 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -82,7 +82,7 @@ int BLI_file_gzip(const char *from, const char *to)
gzfile = BLI_gzopen(to, "wb1");
if (gzfile == NULL)
return -1;
- file = BLI_open(from, O_BINARY|O_RDONLY,0);
+ file = BLI_open(from, O_BINARY|O_RDONLY, 0);
if (file < 0)
return -2;
@@ -223,17 +223,17 @@ void *BLI_gzopen(const char *filename, const char *mode)
/* xxx Creates file before transcribing the path */
if (mode[0] == 'w')
- fclose(ufopen(filename,"a"));
+ fclose(ufopen(filename, "a"));
UTF16_ENCODE(filename);
- GetShortPathNameW(filename_16,short_name_16, 256);
+ GetShortPathNameW(filename_16, short_name_16, 256);
for (i = 0; i < 256; i++) {
short_name[i] = (char)short_name_16[i];
}
- gzfile = gzopen(short_name,mode);
+ gzfile = gzopen(short_name, mode);
UTF16_UN_ENCODE(filename);
}
@@ -367,7 +367,7 @@ void BLI_dir_create_recursive(const char *dirname)
if (dirname[0]) /* patch, this recursive loop tries to create a nameless directory */
if (umkdir(dirname)==-1)
- printf("Unable to create directory %s\n",dirname);
+ printf("Unable to create directory %s\n", dirname);
}
int BLI_rename(const char *from, const char *to)
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 8f2a2e6f8b5..a26c56a16f3 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -82,7 +82,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
FT_Outline ftoutline;
float scale, height;
float dx, dy;
- int j,k,l,m=0;
+ int j, k, l, m=0;
// adjust font size
height= ((double) face->bbox.yMax - (double) face->bbox.yMin);
@@ -116,8 +116,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
che->width= glyph->advance.x * scale;
// Start converting the FT data
- npoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"endpoints");
- onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"onpoints");
+ npoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int), "endpoints");
+ onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int), "onpoints");
// calculate total points of each contour
for (j = 0; j < ftoutline.n_contours; j++) {
@@ -271,7 +271,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
// len_squared_v2v2, see if there's a distance between the three points
// len_squared_v2v2 again, to check the angle between the handles
// finally, check if one of them is a vector handle
- if ((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001f) &&
+ if ((dist_to_line_v2(bezt->vec[0], bezt->vec[1], bezt->vec[2]) < 0.001f) &&
(len_squared_v2v2(bezt->vec[0], bezt->vec[1]) > 0.0001f*0.0001f) &&
(len_squared_v2v2(bezt->vec[1], bezt->vec[2]) > 0.0001f*0.0001f) &&
(len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > 0.0002f*0.0001f) &&
@@ -620,7 +620,7 @@ font driver produces such outlines.
Each glyph's original outline points are located on a grid of indivisible units. The points are stored
-in the font file as 16-bit integer grid coordinates, with the grid origin's being at (0,0); they thus
+in the font file as 16-bit integer grid coordinates, with the grid origin's being at (0, 0); they thus
range from -16384 to 16383.
Convert conic to bezier arcs:
diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c
index fbdf698cc87..35651323ac4 100644
--- a/source/blender/blenlib/intern/jitter.c
+++ b/source/blender/blenlib/intern/jitter.c
@@ -43,7 +43,7 @@
void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
{
- int i , j , k;
+ int i, j, k;
float vecx, vecy, dvecx, dvecy, x, y, len;
for (i = 2*num-2; i>=0 ; i-=2) {
@@ -96,7 +96,7 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
jit2[i] = x;
jit2[i+1] = y;
}
- memcpy(jit1,jit2,2 * num * sizeof(float));
+ memcpy(jit1, jit2, 2 * num * sizeof(float));
}
void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2)
@@ -135,7 +135,7 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2)
jit2[i] = x;
jit2[i+1] = y;
}
- memcpy(jit1,jit2,2 * num * sizeof(float));
+ memcpy(jit1, jit2, 2 * num * sizeof(float));
}
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index f7114822dfd..19cae7456c9 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -126,7 +126,7 @@ void BLI_freelinkN(ListBase *listbase, void *vlink)
if (link == NULL) return;
if (listbase == NULL) return;
- BLI_remlink(listbase,link);
+ BLI_remlink(listbase, link);
MEM_freeN(link);
}
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 76b986d7346..bb0b8897b15 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1674,8 +1674,8 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
// Calculate the shift.
float scale = maxf(maxf(maxf(maxf(
- fabsf(s[p - 1]),fabsf(s[p - 2])),fabsf(e[p - 2])),
- fabsf(s[k])),fabsf(e[k]));
+ fabsf(s[p - 1]), fabsf(s[p - 2])), fabsf(e[p - 2])),
+ fabsf(s[k])), fabsf(e[k]));
float invscale = 1.0f / scale;
float sp = s[p - 1] * invscale;
float spm1 = s[p - 2] * invscale;
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index f52921cd19b..a6b851ca488 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -135,7 +135,7 @@ int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *nu
if (found) {
if (tail) strcpy(tail, &string[nume+1]);
if (head) {
- strcpy(head,string);
+ strcpy(head, string);
head[nums]=0;
}
if (numlen) *numlen = nume-nums+1;
@@ -364,12 +364,12 @@ void BLI_cleanup_path(const char *relabase, char *dir)
}
}
- while ( (start = strstr(dir,"\\.\\")) ) {
+ while ( (start = strstr(dir, "\\.\\")) ) {
eind = start + strlen("\\.\\") - 1;
memmove(start, eind, strlen(eind) + 1);
}
- while ( (start = strstr(dir,"\\\\" )) ) {
+ while ( (start = strstr(dir, "\\\\" )) ) {
eind = start + strlen("\\\\") - 1;
memmove(start, eind, strlen(eind) + 1);
}
@@ -402,12 +402,12 @@ void BLI_cleanup_path(const char *relabase, char *dir)
}
}
- while ( (start = strstr(dir,"/./")) ) {
+ while ( (start = strstr(dir, "/./")) ) {
eind = start + (3 - 1) /* strlen("/./") - 1 */;
memmove(start, eind, strlen(eind) + 1);
}
- while ( (start = strstr(dir,"//" )) ) {
+ while ( (start = strstr(dir, "//" )) ) {
eind = start + (2 - 1) /* strlen("//") - 1 */;
memmove(start, eind, strlen(eind) + 1);
}
@@ -835,7 +835,7 @@ const char *BLI_getDefaultDocumentFolder(void)
HRESULT hResult;
/* Check for %HOME% env var */
- if (uput_getenv("HOME",documentfolder,MAXPATHLEN)) {
+ if (uput_getenv("HOME", documentfolder, MAXPATHLEN)) {
if (BLI_is_dir(documentfolder)) return documentfolder;
}
@@ -1265,7 +1265,7 @@ void BLI_make_exist(char *dir)
#ifdef WIN32
get_default_root(dir);
#else
- strcpy(dir,"/");
+ strcpy(dir, "/");
#endif
break;
}
@@ -1798,7 +1798,7 @@ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name
#ifdef _WIN32
wchar_t * fullname_16 = MEM_mallocN(maxlen*sizeof(wchar_t), "ProgramPath");
if (GetModuleFileNameW(0, fullname_16, maxlen)) {
- conv_utf_16_to_8(fullname_16,fullname, maxlen);
+ conv_utf_16_to_8(fullname_16, fullname, maxlen);
if (!BLI_exists(fullname)) {
printf("path can't be found: \"%.*s\"\n", maxlen, fullname);
MessageBox(NULL, "path contains invalid characters or is too long (see console)", "Error", MB_OK);
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 1c55d5b5a39..0245a9c90af 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -95,7 +95,7 @@
#include "BKE_utildefines.h"
/* vars: */
-static int totnum,actnum;
+static int totnum, actnum;
static struct direntry *files;
static struct ListBase dirbase_={NULL, NULL};
@@ -139,7 +139,7 @@ static int bli_compare(struct direntry *entry1, struct direntry *entry2)
if ( strcmp(entry1->relname, "..")==0 ) return (-1);
if ( strcmp(entry2->relname, "..")==0 ) return (1);
- return (BLI_natstrcmp(entry1->relname,entry2->relname));
+ return (BLI_natstrcmp(entry1->relname, entry2->relname));
}
@@ -161,7 +161,7 @@ double BLI_dir_free_space(const char *dir)
tmp[3]=0;
}
- GetDiskFreeSpace(tmp,&sectorspc, &bytesps, &freec, &clusters);
+ GetDiskFreeSpace(tmp, &sectorspc, &bytesps, &freec, &clusters);
return (double) (freec*bytesps*sectorspc);
#else
@@ -171,19 +171,19 @@ double BLI_dir_free_space(const char *dir)
#else
struct statfs disk;
#endif
- char name[FILE_MAXDIR],*slash;
+ char name[FILE_MAXDIR], *slash;
int len = strlen(dir);
if (len >= FILE_MAXDIR) /* path too long */
return -1;
- strcpy(name,dir);
+ strcpy(name, dir);
if (len) {
- slash = strrchr(name,'/');
+ slash = strrchr(name, '/');
if (slash) slash[1] = 0;
}
- else strcpy(name,"/");
+ else strcpy(name, "/");
#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
if (statfs(name, &disk)) return(-1);
@@ -234,9 +234,9 @@ static void bli_builddir(const char *dirname, const char *relname)
while ((fname = (struct dirent*) readdir(dir)) != NULL) {
dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
if (dlink) {
- BLI_strncpy(buf + rellen ,fname->d_name, sizeof(buf) - rellen);
+ BLI_strncpy(buf + rellen, fname->d_name, sizeof(buf) - rellen);
dlink->name = BLI_strdup(buf);
- BLI_addhead(dirbase,dlink);
+ BLI_addhead(dirbase, dlink);
newnum++;
}
}
@@ -260,22 +260,22 @@ static void bli_builddir(const char *dirname, const char *relname)
if (files) {
dlink = (struct dirlink *) dirbase->first;
while (dlink) {
- memset(&files[actnum], 0 , sizeof(struct direntry));
+ memset(&files[actnum], 0, sizeof(struct direntry));
files[actnum].relname = dlink->name;
files[actnum].path = BLI_strdupcat(dirname, dlink->name);
// use 64 bit file size, only needed for WIN32 and WIN64.
// Excluding other than current MSVC compiler until able to test
#ifdef WIN32
- {wchar_t * name_16 = alloc_utf16_from_8(dlink->name,0);
+ {wchar_t * name_16 = alloc_utf16_from_8(dlink->name, 0);
#if (defined(WIN32) || defined(WIN64)) && (_MSC_VER>=1500)
- _wstat64(name_16,&files[actnum].s);
+ _wstat64(name_16, &files[actnum].s);
#elif defined(__MINGW32__)
- _stati64(dlink->name,&files[actnum].s);
+ _stati64(dlink->name, &files[actnum].s);
#endif
free(name_16);};
#else
- stat(dlink->name,&files[actnum].s);
+ stat(dlink->name, &files[actnum].s);
#endif
files[actnum].type=files[actnum].s.st_mode;
files[actnum].flags = 0;
@@ -290,16 +290,16 @@ static void bli_builddir(const char *dirname, const char *relname)
}
BLI_freelist(dirbase);
- if (files) qsort(files, actnum, sizeof(struct direntry), (int (*)(const void *,const void*))bli_compare);
+ if (files) qsort(files, actnum, sizeof(struct direntry), (int (*)(const void *, const void*))bli_compare);
}
else {
- printf("%s empty directory\n",dirname);
+ printf("%s empty directory\n", dirname);
}
closedir(dir);
}
else {
- printf("%s non-existant directory\n",dirname);
+ printf("%s non-existant directory\n", dirname);
}
}
@@ -349,7 +349,7 @@ static void bli_adddirstrings(void)
#endif
#ifdef WIN32
- strcpy(file->owner,"user");
+ strcpy(file->owner, "user");
#else
{
struct passwd *pwuser;
@@ -426,7 +426,7 @@ unsigned int BLI_dir_contents(const char *dirname, struct direntry **filelist)
actnum = totnum = 0;
files = NULL;
- bli_builddir(dirname,"");
+ bli_builddir(dirname, "");
bli_adddirstrings();
if (files) {
@@ -488,7 +488,7 @@ int BLI_exists(const char *name)
if (res == -1) return(0);
#else
struct stat st;
- if (stat(name,&st)) return(0);
+ if (stat(name, &st)) return(0);
#endif
return(st.st_mode);
}
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index b2245226a3c..d880b895ced 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -391,10 +391,10 @@ void BLI_timestr(double _time, char *str)
int hun= ( (int) (_time * 100.0)) % 100;
if (hr) {
- sprintf(str, "%.2d:%.2d:%.2d.%.2d",hr,min,sec,hun);
+ sprintf(str, "%.2d:%.2d:%.2d.%.2d", hr, min, sec, hun);
}
else {
- sprintf(str, "%.2d:%.2d.%.2d",min,sec,hun);
+ sprintf(str, "%.2d:%.2d.%.2d", min, sec, hun);
}
str[11]=0;
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index 20c5c8082ce..77bebfaf2e8 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -46,14 +46,14 @@
* it's hard to know how many characters there are! */
static const char trailingBytesForUTF8[256] = {
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5
};
int BLI_utf8_invalid_byte(const char *str, int length)
@@ -153,14 +153,14 @@ int BLI_utf8_invalid_strip(char *str, int length)
* note: this looks to be at odd's with 'trailingBytesForUTF8',
* need to find out what gives here! - campbell */
static const size_t utf8_skip_data[256] = {
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
};
#define BLI_STR_UTF8_CPY(dst, src, maxncpy) \
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index f3cb0dd6f84..6c8754eeff3 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -58,12 +58,12 @@ int BLI_getInstallationDir(char * str)
char dir[FILE_MAXDIR];
int a;
/*change to utf support*/
- GetModuleFileName(NULL,str,FILE_MAX);
+ GetModuleFileName(NULL, str, FILE_MAX);
BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */
a = strlen(dir);
if (dir[a-1] == '\\') dir[a-1]=0;
- strcpy(str,dir);
+ strcpy(str, dir);
return 1;
}
@@ -74,8 +74,8 @@ void RegisterBlendExtension_Fail(HKEY root)
if (root)
RegCloseKey(root);
if (!G.background)
- MessageBox(0,"Could not register file extension.","Blender error",MB_OK|MB_ICONERROR);
- TerminateProcess(GetCurrentProcess(),1);
+ MessageBox(0, "Could not register file extension.", "Blender error", MB_OK|MB_ICONERROR);
+ TerminateProcess(GetCurrentProcess(), 1);
}
void RegisterBlendExtension(void)
@@ -96,7 +96,7 @@ void RegisterBlendExtension(void)
BOOL IsWOW64;
printf("Registering file extension...");
- GetModuleFileName(0,BlPath,MAX_PATH);
+ GetModuleFileName(0, BlPath, MAX_PATH);
// root is HKLM by default
lresult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Classes", 0, KEY_ALL_ACCESS, &root);
@@ -111,7 +111,7 @@ void RegisterBlendExtension(void)
lresult = RegCreateKeyEx(root, "blendfile", 0,
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
if (lresult == ERROR_SUCCESS) {
- strcpy(buffer,"Blender File");
+ strcpy(buffer, "Blender File");
lresult = RegSetValueEx(hkey, NULL, 0, REG_SZ, (BYTE*)buffer, strlen(buffer) + 1);
RegCloseKey(hkey);
}
@@ -131,7 +131,7 @@ void RegisterBlendExtension(void)
lresult = RegCreateKeyEx(root, "blendfile\\DefaultIcon", 0,
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
if (lresult == ERROR_SUCCESS) {
- sprintf(buffer, "\"%s\",1", BlPath);
+ sprintf(buffer, "\"%s\", 1", BlPath);
lresult = RegSetValueEx(hkey, NULL, 0, REG_SZ, (BYTE*)buffer, strlen(buffer) + 1);
RegCloseKey(hkey);
}
@@ -149,26 +149,26 @@ void RegisterBlendExtension(void)
RegisterBlendExtension_Fail(root);
BLI_getInstallationDir(InstallDir);
- GetSystemDirectory(SysDir,FILE_MAXDIR);
+ GetSystemDirectory(SysDir, FILE_MAXDIR);
#ifdef WIN64
ThumbHandlerDLL = "BlendThumb64.dll";
#else
- IsWow64Process(GetCurrentProcess(),&IsWOW64);
+ IsWow64Process(GetCurrentProcess(), &IsWOW64);
if (IsWOW64 == TRUE)
ThumbHandlerDLL = "BlendThumb64.dll";
else
ThumbHandlerDLL = "BlendThumb.dll";
#endif
- snprintf(RegCmd,MAX_PATH*2,"%s\\regsvr32 /s \"%s\\%s\"",SysDir,InstallDir,ThumbHandlerDLL);
+ snprintf(RegCmd, MAX_PATH*2, "%s\\regsvr32 /s \"%s\\%s\"", SysDir, InstallDir, ThumbHandlerDLL);
system(RegCmd);
RegCloseKey(root);
- printf("success (%s)\n",usr_mode ? "user" : "system");
+ printf("success (%s)\n", usr_mode ? "user" : "system");
if (!G.background) {
- sprintf(MBox,"File extension registered for %s.",usr_mode ? "the current user. To register for all users, run as an administrator" : "all users");
- MessageBox(0,MBox,"Blender",MB_OK|MB_ICONINFORMATION);
+ sprintf(MBox, "File extension registered for %s.", usr_mode ? "the current user. To register for all users, run as an administrator" : "all users");
+ MessageBox(0, MBox, "Blender", MB_OK|MB_ICONINFORMATION);
}
- TerminateProcess(GetCurrentProcess(),0);
+ TerminateProcess(GetCurrentProcess(), 0);
}
DIR *opendir (const char *path)
@@ -179,7 +179,7 @@ DIR *opendir (const char *path)
DIR *newd= MEM_mallocN(sizeof(DIR), "opendir");
newd->handle = INVALID_HANDLE_VALUE;
- sprintf(newd->path, "%s\\*",path);
+ sprintf(newd->path, "%s\\*", path);
newd->direntry.d_ino= 0;
newd->direntry.d_off= 0;
@@ -200,8 +200,8 @@ static char *BLI_alloc_utf_8_from_16(wchar_t *in16, size_t add)
size_t bsize = count_utf_8_from_16(in16);
char *out8 = NULL;
if (!bsize) return NULL;
- out8 = (char*)MEM_mallocN(sizeof(char) * (bsize + add),"UTF-8 String");
- conv_utf_16_to_8(in16,out8, bsize);
+ out8 = (char*)MEM_mallocN(sizeof(char) * (bsize + add), "UTF-8 String");
+ conv_utf_16_to_8(in16, out8, bsize);
return out8;
}
@@ -211,7 +211,7 @@ static wchar_t *UNUSED_FUNCTION(BLI_alloc_utf16_from_8)(char *in8, size_t add)
wchar_t *out16 = NULL;
if (!bsize) return NULL;
out16 =(wchar_t*) MEM_mallocN(sizeof(wchar_t) * (bsize + add), "UTF-16 String");
- conv_utf_8_to_16(in8,out16, bsize);
+ conv_utf_8_to_16(in8, out16, bsize);
return out16;
}
@@ -236,7 +236,7 @@ struct dirent *readdir(DIR *dp)
return &dp->direntry;
}
else if (FindNextFileW (dp->handle, &(dp->data))) {
- dp->direntry.d_name= BLI_alloc_utf_8_from_16(dp->data.cFileName,0);
+ dp->direntry.d_name= BLI_alloc_utf_8_from_16(dp->data.cFileName, 0);
return &dp->direntry;
}
@@ -262,7 +262,7 @@ void get_default_root(char *root)
/* the default drive to resolve a directory without a specified drive
* should be the Windows installation drive, since this was what the OS
* assumes. */
- if (GetWindowsDirectory(str,MAX_PATH+1)) {
+ if (GetWindowsDirectory(str, MAX_PATH+1)) {
root[0] = str[0];
root[1] = ':';
root[2] = '\\';
@@ -271,7 +271,7 @@ void get_default_root(char *root)
else {
/* if GetWindowsDirectory fails, something has probably gone wrong,
* we are trying the blender install dir though */
- if (GetModuleFileName(NULL,str,MAX_PATH+1)) {
+ if (GetModuleFileName(NULL, str, MAX_PATH+1)) {
printf("Error! Could not get the Windows Directory - Defaulting to Blender installation Dir!");
root[0] = str[0];
root[1] = ':';
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 9aa87a86b3e..32768168e7e 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3540,7 +3540,7 @@ static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase
}
else {
/* particle modifier must be removed before particle system */
- ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys);
+ ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
BLI_remlink(&ob->modifiers, psmd);
modifier_free((ModifierData *)psmd);
@@ -3556,15 +3556,15 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
int a;
for (psys=particles->first; psys; psys=psys->next) {
- psys->particles=newdataadr(fd,psys->particles);
+ psys->particles=newdataadr(fd, psys->particles);
if (psys->particles && psys->particles->hair) {
- for (a=0,pa=psys->particles; a<psys->totpart; a++, pa++)
- pa->hair=newdataadr(fd,pa->hair);
+ for (a=0, pa=psys->particles; a<psys->totpart; a++, pa++)
+ pa->hair=newdataadr(fd, pa->hair);
}
if (psys->particles && psys->particles->keys) {
- for (a=0,pa=psys->particles; a<psys->totpart; a++, pa++) {
+ for (a=0, pa=psys->particles; a<psys->totpart; a++, pa++) {
pa->keys= NULL;
pa->totkey= 0;
}
@@ -3575,17 +3575,17 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
if (psys->particles && psys->particles->boid) {
pa = psys->particles;
pa->boid = newdataadr(fd, pa->boid);
- for (a=1,pa++; a<psys->totpart; a++, pa++)
+ for (a=1, pa++; a<psys->totpart; a++, pa++)
pa->boid = (pa-1)->boid + 1;
}
else if (psys->particles) {
- for (a=0,pa=psys->particles; a<psys->totpart; a++, pa++)
+ for (a=0, pa=psys->particles; a<psys->totpart; a++, pa++)
pa->boid = NULL;
}
psys->fluid_springs = newdataadr(fd, psys->fluid_springs);
- psys->child = newdataadr(fd,psys->child);
+ psys->child = newdataadr(fd, psys->child);
psys->effectors = NULL;
link_list(fd, &psys->targets);
@@ -4453,9 +4453,9 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
collmd->xnew = newdataadr(fd, collmd->xnew);
collmd->mfaces = newdataadr(fd, collmd->mfaces);
- collmd->current_x = MEM_callocN(sizeof(MVert)*collmd->numverts,"current_x");
- collmd->current_xnew = MEM_callocN(sizeof(MVert)*collmd->numverts,"current_xnew");
- collmd->current_v = MEM_callocN(sizeof(MVert)*collmd->numverts,"current_v");
+ collmd->current_x = MEM_callocN(sizeof(MVert)*collmd->numverts, "current_x");
+ collmd->current_xnew = MEM_callocN(sizeof(MVert)*collmd->numverts, "current_xnew");
+ collmd->current_v = MEM_callocN(sizeof(MVert)*collmd->numverts, "current_v");
*/
collmd->x = NULL;
@@ -4681,7 +4681,7 @@ static void direct_link_object(FileData *fd, Object *ob)
ob->fluidsimSettings= newdataadr(fd, ob->fluidsimSettings); /* NT */
link_list(fd, &ob->particlesystem);
- direct_link_particlesystems(fd,&ob->particlesystem);
+ direct_link_particlesystems(fd, &ob->particlesystem);
link_list(fd, &ob->prop);
prop= ob->prop.first;
@@ -8389,7 +8389,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* in future, distinguish between different
* object bounding shapes */
ob->formfactor = 0.4f;
- /* patch form factor , note that inertia equiv radius
+ /* patch form factor, note that inertia equiv radius
* of a rotation symmetrical obj */
if (ob->inertia != 1.0f) {
ob->formfactor /= ob->inertia * ob->inertia;
@@ -9141,7 +9141,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
while (sce) {
if (sce->toolsettings == NULL) {
- sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct");
+ sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings), "Tool Settings Struct");
sce->toolsettings->cornertype=0;
sce->toolsettings->degr = 90;
sce->toolsettings->step = 9;
@@ -14318,7 +14318,7 @@ static void expand_main(FileData *fd, Main *mainvar)
expand_lattice(fd, mainvar, (Lattice *)id);
break;
case ID_LA:
- expand_lamp(fd, mainvar,(Lamp *)id);
+ expand_lamp(fd, mainvar, (Lamp *)id);
break;
case ID_KE:
expand_key(fd, mainvar, (Key *)id);
@@ -14327,7 +14327,7 @@ static void expand_main(FileData *fd, Main *mainvar)
expand_camera(fd, mainvar, (Camera *)id);
break;
case ID_SPK:
- expand_speaker(fd, mainvar,(Speaker *)id);
+ expand_speaker(fd, mainvar, (Speaker *)id);
break;
case ID_SO:
expand_sound(fd, mainvar, (bSound *)id);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 42736b6b787..a27801f62a7 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -974,7 +974,7 @@ static void write_particlesystems(WriteData *wd, ListBase *particles)
writestruct(wd, DATA, "ParticleSystem", 1, psys);
if (psys->particles) {
- writestruct(wd, DATA, "ParticleData", psys->totpart ,psys->particles);
+ writestruct(wd, DATA, "ParticleData", psys->totpart, psys->particles);
if (psys->particles->hair) {
ParticleData *pa = psys->particles;
@@ -993,7 +993,7 @@ static void write_particlesystems(WriteData *wd, ListBase *particles)
for (; pt; pt=pt->next)
writestruct(wd, DATA, "ParticleTarget", 1, pt);
- if (psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild ,psys->child);
+ if (psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild, psys->child);
if (psys->clmd) {
writestruct(wd, DATA, "ClothModifierData", 1, psys->clmd);
@@ -2891,7 +2891,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
/* open temporary file, so we preserve the original in case we crash */
BLI_snprintf(tempname, sizeof(tempname), "%s@", filepath);
- file = BLI_open(tempname,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
+ file = BLI_open(tempname, O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
if (file == -1) {
BKE_reportf(reports, RPT_ERROR, "Can't open file %s for writing: %s.", tempname, strerror(errno));
return 0;
@@ -2929,7 +2929,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
makeFilesRelative(mainvar, filepath, NULL); /* note, making relative to something OTHER then G.main->name */
/* actual file writing */
- err= write_file_handle(mainvar, file, NULL,NULL, write_user_block, write_flags, thumb);
+ err= write_file_handle(mainvar, file, NULL, NULL, write_user_block, write_flags, thumb);
close(file);
if (err) {
diff --git a/source/blender/blenpluginapi/iff.h b/source/blender/blenpluginapi/iff.h
index 450dfc7f8d1..6a6764cd961 100644
--- a/source/blender/blenpluginapi/iff.h
+++ b/source/blender/blenpluginapi/iff.h
@@ -83,15 +83,15 @@ typedef struct ImBuf {
int refcounter; /* reference counter for multiple users */
} ImBuf;
-LIBIMPORT struct ImBuf *allocImBuf(short,short,uchar,uint);
+LIBIMPORT struct ImBuf *allocImBuf(short, short, uchar, uint);
LIBIMPORT struct ImBuf *dupImBuf(struct ImBuf *);
LIBIMPORT void freeImBuf(struct ImBuf*);
-LIBIMPORT short saveiff(struct ImBuf *,char *,int);
+LIBIMPORT short saveiff(struct ImBuf *, char *, int);
-LIBIMPORT struct ImBuf *loadifffile(int,int);
-LIBIMPORT struct ImBuf *loadiffname(char *,int);
-LIBIMPORT struct ImBuf *testiffname(char *,int);
+LIBIMPORT struct ImBuf *loadifffile(int, int);
+LIBIMPORT struct ImBuf *loadiffname(char *, int);
+LIBIMPORT struct ImBuf *testiffname(char *, int);
LIBIMPORT struct ImBuf *onehalf(struct ImBuf *);
LIBIMPORT struct ImBuf *half_x(struct ImBuf *);
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index ec4b97d59f3..01c269657dc 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -838,7 +838,7 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
{
BMwEdgeringWalker *lwalk = BMW_current_state(walker);
BMEdge *e, *wireedge = lwalk->wireedge;
- BMLoop *l = lwalk->l , *origl = lwalk->l;
+ BMLoop *l = lwalk->l, *origl = lwalk->l;
#ifdef BMW_EDGERING_NGON
int i, len;
#endif
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index c93ee832fe6..6565a9e0c2e 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -80,7 +80,7 @@ void AnimationExporter::operator() (Object *ob)
(!strcmp(transformName, "rotation_euler") && ob->rotmode == ROT_MODE_EUL)||
(!strcmp(transformName, "rotation_quaternion")))
{
- dae_animation(ob ,fcu, transformName, false);
+ dae_animation(ob, fcu, transformName, false);
}
fcu = fcu->next;
}
@@ -96,7 +96,7 @@ void AnimationExporter::operator() (Object *ob)
if ((!strcmp(transformName, "color")) || (!strcmp(transformName, "spot_size"))||
(!strcmp(transformName, "spot_blend")) || (!strcmp(transformName, "distance")))
{
- dae_animation(ob , fcu, transformName, true);
+ dae_animation(ob, fcu, transformName, true);
}
fcu = fcu->next;
}
@@ -112,7 +112,7 @@ void AnimationExporter::operator() (Object *ob)
(!strcmp(transformName, "ortho_scale"))||
(!strcmp(transformName, "clip_end"))||(!strcmp(transformName, "clip_start")))
{
- dae_animation(ob , fcu, transformName, true);
+ dae_animation(ob, fcu, transformName, true);
}
fcu = fcu->next;
}
@@ -132,7 +132,7 @@ void AnimationExporter::operator() (Object *ob)
(!strcmp(transformName, "diffuse_color"))||(!strcmp(transformName, "alpha")) ||
(!strcmp(transformName, "ior")))
{
- dae_animation(ob ,fcu, transformName, true, ma );
+ dae_animation(ob, fcu, transformName, true, ma );
}
fcu = fcu->next;
}
@@ -165,7 +165,7 @@ float * AnimationExporter::get_eul_source_for_quat(Object *ob )
for ( int j = 0;j<4;j++)
temp_quat[j] = quat[(i*4)+j];
- quat_to_eul(temp_eul,temp_quat);
+ quat_to_eul(temp_eul, temp_quat);
for (int k = 0;k<3;k++)
eul[i*3 + k] = temp_eul[k];
@@ -177,13 +177,13 @@ float * AnimationExporter::get_eul_source_for_quat(Object *ob )
}
//Get proper name for bones
-std::string AnimationExporter::getObjectBoneName( Object* ob,const FCurve* fcu )
+std::string AnimationExporter::getObjectBoneName( Object* ob, const FCurve* fcu )
{
//hard-way to derive the bone name from rna_path. Must find more compact method
std::string rna_path = std::string(fcu->rna_path);
char* boneName = strtok((char *)rna_path.c_str(), "\"");
- boneName = strtok(NULL,"\"");
+ boneName = strtok(NULL, "\"");
if ( boneName != NULL )
return /*id_name(ob) + "_" +*/ std::string(boneName);
@@ -192,7 +192,7 @@ std::string AnimationExporter::getObjectBoneName( Object* ob,const FCurve* fcu )
}
//convert f-curves to animation curves and write
-void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformName , bool is_param, Material * ma )
+void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformName, bool is_param, Material * ma )
{
const char *axis_name = NULL;
char anim_id[200];
@@ -232,7 +232,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
//Create anim Id
if (ob->type == OB_ARMATURE) {
- ob_name = getObjectBoneName( ob , fcu);
+ ob_name = getObjectBoneName(ob, fcu);
BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s.%s", (char*)translate_id(ob_name).c_str(),
transformName, axis_name);
}
@@ -260,7 +260,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
for (int i = 0 ; i< fcu->totvert ; i++) {
eul_axis[i] = eul[i*3 + fcu->array_index];
}
- output_id= create_source_from_array(COLLADASW::InputSemantic::OUTPUT, eul_axis , fcu->totvert, quatRotation, anim_id, axis_name);
+ output_id= create_source_from_array(COLLADASW::InputSemantic::OUTPUT, eul_axis, fcu->totvert, quatRotation, anim_id, axis_name);
MEM_freeN(eul);
MEM_freeN(eul_axis);
}
@@ -364,8 +364,8 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
FCurve* fcu = (FCurve*)ob_arm->adt->action->curves.first;
while (fcu) {
- std::string bone_name = getObjectBoneName(ob_arm,fcu);
- int val = BLI_strcasecmp((char*)bone_name.c_str(),bone->name);
+ std::string bone_name = getObjectBoneName(ob_arm, fcu);
+ int val = BLI_strcasecmp((char*)bone_name.c_str(), bone->name);
if (val==0) break;
fcu = fcu->next;
}
@@ -383,7 +383,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
}
if (fra.size()) {
- dae_baked_animation(fra ,ob_arm, bone );
+ dae_baked_animation(fra, ob_arm, bone );
}
if (flag & ARM_RESTPOS)
@@ -391,7 +391,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
where_is_pose(scene, ob_arm);
}
-void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_arm , Bone *bone)
+void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_arm, Bone *bone)
{
std::string ob_name = id_name(ob_arm);
std::string bone_name = bone->name;
@@ -410,7 +410,7 @@ void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_
// create output source
std::string output_id;
- output_id = create_4x4_source( fra, ob_arm , bone , anim_id);
+ output_id = create_4x4_source( fra, ob_arm, bone, anim_id);
// create interpolations source
std::string interpolation_id = fake_interpolation_source(fra.size(), anim_id, "");
@@ -719,7 +719,7 @@ std::string AnimationExporter::create_source_from_vector(COLLADASW::InputSemanti
return source_id;
}
-std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Object * ob_arm, Bone *bone , const std::string& anim_id)
+std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Object * ob_arm, Bone *bone, const std::string& anim_id)
{
COLLADASW::InputSemantic::Semantics semantic = COLLADASW::InputSemantic::OUTPUT;
std::string source_id = anim_id + get_semantic_suffix(semantic);
@@ -755,7 +755,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
float ctime = BKE_frame_to_ctime(scene, *it);
- BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
// compute bone local mat
@@ -787,7 +787,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
}
float outmat[4][4];
- converter.mat4_to_dae(outmat,mat);
+ converter.mat4_to_dae(outmat, mat);
source.appendValues(outmat);
@@ -1281,7 +1281,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
float ctime = BKE_frame_to_ctime(scene, *it);
- BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
// compute bone local mat
diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h
index ba7ec6859cc..1313687db28 100644
--- a/source/blender/collada/AnimationExporter.h
+++ b/source/blender/collada/AnimationExporter.h
@@ -96,7 +96,7 @@ public:
protected:
const ExportSettings *export_settings;
- void dae_animation(Object* ob, FCurve *fcu, char* transformName , bool is_param, Material *ma = NULL);
+ void dae_animation(Object* ob, FCurve *fcu, char* transformName, bool is_param, Material *ma = NULL);
void write_bone_animation_matrix(Object *ob_arm, Bone *bone);
@@ -116,7 +116,7 @@ protected:
// (blend this into dae_bone_animation)
void dae_bone_animation(std::vector<float> &fra, float *v, int tm_type, int axis, std::string ob_name, std::string bone_name);
- void dae_baked_animation(std::vector<float> &fra, Object *ob_arm , Bone *bone);
+ void dae_baked_animation(std::vector<float> &fra, Object *ob_arm, Bone *bone);
float convert_time(float frame);
@@ -125,7 +125,7 @@ protected:
std::string get_semantic_suffix(COLLADASW::InputSemantic::Semantics semantic);
void add_source_parameters(COLLADASW::SourceBase::ParameterNameList& param,
- COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis , bool transform);
+ COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform);
void get_source_values(BezTriple *bezt, COLLADASW::InputSemantic::Semantics semantic, bool rotation, float *values, int *length);
@@ -139,7 +139,7 @@ protected:
std::string create_xyz_source(float *v, int tot, const std::string& anim_id);
- std::string create_4x4_source(std::vector<float> &frames , Object * ob_arm, Bone *bone , const std::string& anim_id);
+ std::string create_4x4_source(std::vector<float> &frames, Object * ob_arm, Bone *bone, const std::string& anim_id);
std::string create_interpolation_source(FCurve *fcu, const std::string& anim_id, const char *axis_name, bool *has_tangents);
@@ -161,5 +161,5 @@ protected:
char* extract_transform_name(char *rna_path);
- std::string getObjectBoneName ( Object *ob,const FCurve * fcu);
+ std::string getObjectBoneName(Object *ob, const FCurve * fcu);
};
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 8ef2235b6fb..6ba0aeb2850 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -423,7 +423,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
//sets the rna_path and array index to curve
-void AnimationImporter::modify_fcurve(std::vector<FCurve*>* curves , const char* rna_path , int array_index )
+void AnimationImporter::modify_fcurve(std::vector<FCurve*>* curves, const char* rna_path, int array_index )
{
std::vector<FCurve*>::iterator it;
int i;
@@ -438,7 +438,7 @@ void AnimationImporter::modify_fcurve(std::vector<FCurve*>* curves , const char*
}
}
-void AnimationImporter::find_frames( std::vector<float>* frames , std::vector<FCurve*>* curves)
+void AnimationImporter::find_frames( std::vector<float>* frames, std::vector<FCurve*>* curves)
{
std::vector<FCurve*>::iterator iter;
for (iter = curves->begin(); iter != curves->end(); iter++) {
@@ -456,7 +456,7 @@ void AnimationImporter::find_frames( std::vector<float>* frames , std::vector<FC
}
//creates the rna_paths and array indices of fcurves from animations using transformation and bound animation class of each animation.
-void AnimationImporter:: Assign_transform_animations(COLLADAFW::Transformation * transform ,
+void AnimationImporter:: Assign_transform_animations(COLLADAFW::Transformation * transform,
const COLLADAFW::AnimationList::AnimationBinding * binding,
std::vector<FCurve*>* curves, bool is_joint, char * joint_path)
{
@@ -563,10 +563,10 @@ void AnimationImporter:: Assign_transform_animations(COLLADAFW::Transformation *
}
//creates the rna_paths and array indices of fcurves from animations using color and bound animation class of each animation.
-void AnimationImporter:: Assign_color_animations(const COLLADAFW::UniqueId& listid, ListBase *AnimCurves ,const char * anim_type)
+void AnimationImporter:: Assign_color_animations(const COLLADAFW::UniqueId& listid, ListBase *AnimCurves, const char * anim_type)
{
char rna_path[100];
- BLI_strncpy(rna_path,anim_type, sizeof(rna_path));
+ BLI_strncpy(rna_path, anim_type, sizeof(rna_path));
const COLLADAFW::AnimationList *animlist = animlist_map[listid];
const COLLADAFW::AnimationList::AnimationBindings& bindings = animlist->getAnimationBindings();
@@ -621,7 +621,7 @@ void AnimationImporter:: Assign_float_animations(const COLLADAFW::UniqueId& list
for (unsigned int j = 0; j < bindings.getCount(); j++) {
animcurves = curve_map[bindings[j].animation];
- BLI_strncpy(rna_path, anim_type , sizeof(rna_path));
+ BLI_strncpy(rna_path, anim_type, sizeof(rna_path));
modify_fcurve(&animcurves, rna_path, 0 );
std::vector<FCurve*>::iterator iter;
//Add the curves of the current animation to the object
@@ -634,7 +634,7 @@ void AnimationImporter:: Assign_float_animations(const COLLADAFW::UniqueId& list
}
-void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root ,COLLADAFW::Node* node,
+void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root, COLLADAFW::Node* node,
COLLADAFW::Transformation * tm )
{
bool is_joint = node->getType() == COLLADAFW::Node::JOINT;
@@ -725,7 +725,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>&
calc_joint_parent_mat_rest(par, NULL, root, node);
mult_m4_m4m4(temp, par, matfra);
- // evaluate_joint_world_transform_at_frame(temp, NULL, , node, fra);
+ // evaluate_joint_world_transform_at_frame(temp, NULL, node, fra);
// calc special matrix
mul_serie_m4(mat, irest, temp, irest_dae, rest, NULL, NULL, NULL, NULL);
@@ -778,7 +778,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>&
}
-void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
+void AnimationImporter::translate_Animations ( COLLADAFW::Node * node,
std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
std::map<COLLADAFW::UniqueId, Object*>& object_map,
std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map)
@@ -834,7 +834,7 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
for (unsigned int j = 0; j < bindings.getCount(); j++) {
animcurves = curve_map[bindings[j].animation];
if ( is_matrix ) {
- apply_matrix_curves(ob, animcurves, root , node, transform );
+ apply_matrix_curves(ob, animcurves, root, node, transform );
}
else {
@@ -886,13 +886,13 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
const COLLADAFW::AnimatableFloat *foa = &(light->getFallOffAngle());
const COLLADAFW::UniqueId& listid = foa->getAnimationList();
- Assign_float_animations( listid ,AnimCurves, "spot_size");
+ Assign_float_animations( listid, AnimCurves, "spot_size");
}
if ( (animType->light & LIGHT_FOE) != 0 ) {
const COLLADAFW::AnimatableFloat *foe = &(light->getFallOffExponent());
const COLLADAFW::UniqueId& listid = foe->getAnimationList();
- Assign_float_animations( listid ,AnimCurves, "spot_blend");
+ Assign_float_animations( listid, AnimCurves, "spot_blend");
}
}
@@ -913,25 +913,25 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
if ((animType->camera & CAMERA_XFOV) != 0 ) {
const COLLADAFW::AnimatableFloat *xfov = &(camera->getXFov());
const COLLADAFW::UniqueId& listid = xfov->getAnimationList();
- Assign_float_animations( listid ,AnimCurves, "lens");
+ Assign_float_animations( listid, AnimCurves, "lens");
}
else if ((animType->camera & CAMERA_XMAG) != 0 ) {
const COLLADAFW::AnimatableFloat *xmag = &(camera->getXMag());
const COLLADAFW::UniqueId& listid = xmag->getAnimationList();
- Assign_float_animations( listid ,AnimCurves, "ortho_scale");
+ Assign_float_animations( listid, AnimCurves, "ortho_scale");
}
if ((animType->camera & CAMERA_ZFAR) != 0 ) {
const COLLADAFW::AnimatableFloat *zfar = &(camera->getFarClippingPlane());
const COLLADAFW::UniqueId& listid = zfar->getAnimationList();
- Assign_float_animations( listid ,AnimCurves, "clip_end");
+ Assign_float_animations( listid, AnimCurves, "clip_end");
}
if ((animType->camera & CAMERA_ZNEAR) != 0 ) {
const COLLADAFW::AnimatableFloat *znear = &(camera->getNearClippingPlane());
const COLLADAFW::UniqueId& listid = znear->getAnimationList();
- Assign_float_animations( listid ,AnimCurves, "clip_start");
+ Assign_float_animations( listid, AnimCurves, "clip_start");
}
}
@@ -955,25 +955,25 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
if ((animType->material & MATERIAL_SHININESS) != 0) {
const COLLADAFW::FloatOrParam *shin = &(efc->getShininess());
const COLLADAFW::UniqueId& listid = shin->getAnimationList();
- Assign_float_animations( listid, AnimCurves , "specular_hardness" );
+ Assign_float_animations( listid, AnimCurves, "specular_hardness" );
}
if ((animType->material & MATERIAL_IOR) != 0) {
const COLLADAFW::FloatOrParam *ior = &(efc->getIndexOfRefraction());
const COLLADAFW::UniqueId& listid = ior->getAnimationList();
- Assign_float_animations( listid, AnimCurves , "raytrace_transparency.ior" );
+ Assign_float_animations( listid, AnimCurves, "raytrace_transparency.ior" );
}
if ((animType->material & MATERIAL_SPEC_COLOR) != 0) {
const COLLADAFW::ColorOrTexture *cot = &(efc->getSpecular());
const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
- Assign_color_animations( listid, AnimCurves , "specular_color" );
+ Assign_color_animations( listid, AnimCurves, "specular_color" );
}
if ((animType->material & MATERIAL_DIFF_COLOR) != 0) {
const COLLADAFW::ColorOrTexture *cot = &(efc->getDiffuse());
const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
- Assign_color_animations( listid, AnimCurves , "diffuse_color" );
+ Assign_color_animations( listid, AnimCurves, "diffuse_color" );
}
}
}
@@ -1078,7 +1078,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCur
calc_joint_parent_mat_rest(par, NULL, root, node);
mult_m4_m4m4(temp, par, matfra);
- // evaluate_joint_world_transform_at_frame(temp, NULL, , node, fra);
+ // evaluate_joint_world_transform_at_frame(temp, NULL,, node, fra);
// calc special matrix
mul_serie_m4(mat, irest, temp, irest_dae, rest, NULL, NULL, NULL, NULL);
@@ -1113,7 +1113,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCur
//Check if object is animated by checking if animlist_map holds the animlist_id of node transforms
-AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLADAFW::Node * node ,
+AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLADAFW::Node * node,
std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map)
{
AnimMix *types = new AnimMix();
@@ -1138,9 +1138,9 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
for (unsigned int i = 0; i < nodeLights.getCount(); i++) {
const COLLADAFW::Light *light = (COLLADAFW::Light *) FW_object_map[nodeLights[i]->getInstanciatedObjectId()];
- types->light = setAnimType(&(light->getColor()),(types->light), LIGHT_COLOR);
- types->light = setAnimType(&(light->getFallOffAngle()),(types->light), LIGHT_FOA);
- types->light = setAnimType(&(light->getFallOffExponent()),(types->light), LIGHT_FOE);
+ types->light = setAnimType(&(light->getColor()), (types->light), LIGHT_COLOR);
+ types->light = setAnimType(&(light->getFallOffAngle()), (types->light), LIGHT_FOA);
+ types->light = setAnimType(&(light->getFallOffExponent()), (types->light), LIGHT_FOE);
if ( types->light != 0) break;
@@ -1151,13 +1151,13 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
const COLLADAFW::Camera *camera = (COLLADAFW::Camera *) FW_object_map[nodeCameras[i]->getInstanciatedObjectId()];
if ( camera->getCameraType() == COLLADAFW::Camera::PERSPECTIVE ) {
- types->camera = setAnimType(&(camera->getXMag()),(types->camera), CAMERA_XFOV);
+ types->camera = setAnimType(&(camera->getXMag()), (types->camera), CAMERA_XFOV);
}
else {
- types->camera = setAnimType(&(camera->getXMag()),(types->camera), CAMERA_XMAG);
+ types->camera = setAnimType(&(camera->getXMag()), (types->camera), CAMERA_XMAG);
}
- types->camera = setAnimType(&(camera->getFarClippingPlane()),(types->camera), CAMERA_ZFAR);
- types->camera = setAnimType(&(camera->getNearClippingPlane()),(types->camera), CAMERA_ZNEAR);
+ types->camera = setAnimType(&(camera->getFarClippingPlane()), (types->camera), CAMERA_ZFAR);
+ types->camera = setAnimType(&(camera->getNearClippingPlane()), (types->camera), CAMERA_ZNEAR);
if ( types->camera != 0) break;
@@ -1173,11 +1173,11 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
if (!commonEffects.empty()) {
COLLADAFW::EffectCommon *efc = commonEffects[0];
- types->material = setAnimType(&(efc->getShininess()),(types->material), MATERIAL_SHININESS);
- types->material = setAnimType(&(efc->getSpecular().getColor()),(types->material), MATERIAL_SPEC_COLOR);
- types->material = setAnimType(&(efc->getDiffuse().getColor()),(types->material), MATERIAL_DIFF_COLOR);
- // types->material = setAnimType(&(efc->get()),(types->material), MATERIAL_TRANSPARENCY);
- types->material = setAnimType(&(efc->getIndexOfRefraction()),(types->material), MATERIAL_IOR);
+ types->material = setAnimType(&(efc->getShininess()), (types->material), MATERIAL_SHININESS);
+ types->material = setAnimType(&(efc->getSpecular().getColor()), (types->material), MATERIAL_SPEC_COLOR);
+ types->material = setAnimType(&(efc->getDiffuse().getColor()), (types->material), MATERIAL_DIFF_COLOR);
+ // types->material = setAnimType(&(efc->get()), (types->material), MATERIAL_TRANSPARENCY);
+ types->material = setAnimType(&(efc->getIndexOfRefraction()), (types->material), MATERIAL_IOR);
}
}
}
@@ -1185,7 +1185,7 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
return types;
}
-int AnimationImporter::setAnimType ( const COLLADAFW::Animatable * prop , int types, int addition)
+int AnimationImporter::setAnimType ( const COLLADAFW::Animatable * prop, int types, int addition)
{
const COLLADAFW::UniqueId& listid = prop->getAnimationList();
if (animlist_map.find(listid) != animlist_map.end())
@@ -1194,7 +1194,7 @@ int AnimationImporter::setAnimType ( const COLLADAFW::Animatable * prop , int ty
}
// Is not used anymore.
-void AnimationImporter::find_frames_old(std::vector<float> * frames, COLLADAFW::Node * node , COLLADAFW::Transformation::TransformationType tm_type)
+void AnimationImporter::find_frames_old(std::vector<float> * frames, COLLADAFW::Node * node, COLLADAFW::Transformation::TransformationType tm_type)
{
bool is_matrix = tm_type == COLLADAFW::Transformation::MATRIX;
bool is_rotation = tm_type == COLLADAFW::Transformation::ROTATE;
@@ -1279,7 +1279,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node,
// frames at which to sample
std::vector<float> frames;
- find_frames_old(&frames, node , tm_type);
+ find_frames_old(&frames, node, tm_type);
unsigned int i;
@@ -1396,7 +1396,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node,
calc_joint_parent_mat_rest(par, NULL, root, node);
mult_m4_m4m4(temp, par, matfra);
- // evaluate_joint_world_transform_at_frame(temp, NULL, , node, fra);
+ // evaluate_joint_world_transform_at_frame(temp, NULL,, node, fra);
// calc special matrix
mul_serie_m4(mat, irest, temp, irest_dae, rest, NULL, NULL, NULL, NULL);
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index e42a1cc7a55..953c454c73c 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Nathan Letwory , Sukhitha Jayathilake.
+ * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Nathan Letwory, Sukhitha Jayathilake.
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -143,38 +143,38 @@ public:
virtual void change_eul_to_quat(Object *ob, bAction *act);
#endif
- void translate_Animations( COLLADAFW::Node * Node ,
- std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
- std::map<COLLADAFW::UniqueId, Object*>& object_map ,
- std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map);
+ void translate_Animations(COLLADAFW::Node * Node,
+ std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
+ std::map<COLLADAFW::UniqueId, Object*>& object_map,
+ std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map);
- AnimMix* get_animation_type( const COLLADAFW::Node * node , std::map<COLLADAFW::UniqueId,const COLLADAFW::Object*> FW_object_map );
+ AnimMix* get_animation_type( const COLLADAFW::Node * node, std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map );
- void apply_matrix_curves( Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root ,COLLADAFW::Node* node,
- COLLADAFW::Transformation * tm );
-
- void add_bone_animation_sampled(Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root ,COLLADAFW::Node* node, COLLADAFW::Transformation * tm);
+ void apply_matrix_curves(Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root, COLLADAFW::Node* node,
+ COLLADAFW::Transformation * tm );
+
+ void add_bone_animation_sampled(Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root, COLLADAFW::Node* node, COLLADAFW::Transformation * tm);
- void Assign_transform_animations(COLLADAFW::Transformation* transform ,
- const COLLADAFW::AnimationList::AnimationBinding * binding,
- std::vector<FCurve*>* curves, bool is_joint, char * joint_path);
+ void Assign_transform_animations(COLLADAFW::Transformation* transform,
+ const COLLADAFW::AnimationList::AnimationBinding * binding,
+ std::vector<FCurve*>* curves, bool is_joint, char * joint_path);
void Assign_color_animations(const COLLADAFW::UniqueId& listid, ListBase *AnimCurves, const char * anim_type);
void Assign_float_animations(const COLLADAFW::UniqueId& listid, ListBase *AnimCurves, const char * anim_type);
- int setAnimType ( const COLLADAFW::Animatable * prop , int type, int addition);
+ int setAnimType ( const COLLADAFW::Animatable * prop, int type, int addition);
- void modify_fcurve(std::vector<FCurve*>* curves , const char* rna_path , int array_index );
+ void modify_fcurve(std::vector<FCurve*>* curves, const char* rna_path, int array_index );
// prerequisites:
// animlist_map - map animlist id -> animlist
// curve_map - map anim id -> curve(s)
Object * translate_animation_OLD(COLLADAFW::Node *node,
- std::map<COLLADAFW::UniqueId, Object*>& object_map,
- std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
- COLLADAFW::Transformation::TransformationType tm_type,
- Object *par_job = NULL);
+ std::map<COLLADAFW::UniqueId, Object*>& object_map,
+ std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
+ COLLADAFW::Transformation::TransformationType tm_type,
+ Object *par_job = NULL);
- void find_frames( std::vector<float>* frames , std::vector<FCurve*>* curves );
+ void find_frames( std::vector<float>* frames, std::vector<FCurve*>* curves );
void find_frames_old( std::vector<float>* frames, COLLADAFW::Node * node, COLLADAFW::Transformation::TransformationType tm_type );
// internal, better make it private
// warning: evaluates only rotation
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp
index 0d45df37796..d5a3b4cb0a2 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -289,7 +289,7 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
}
}
- TransformWriter::add_node_transform(node, mat,NULL );
+ TransformWriter::add_node_transform(node, mat, NULL);
}
std::string ArmatureExporter::get_controller_id(Object *ob_arm, Object *ob)
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 05a2e5643f2..833904e20c2 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -81,7 +81,7 @@ void ArmatureImporter::create_unskinned_bone( COLLADAFW::Node *node, EditBone *p
float parent_mat[][4], Object * ob_arm)
{
std::vector<COLLADAFW::Node*>::iterator it;
- it = std::find(finished_joints.begin(),finished_joints.end(),node);
+ it = std::find(finished_joints.begin(), finished_joints.end(), node);
if ( it != finished_joints.end()) return;
float mat[4][4];
@@ -159,7 +159,7 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
{
//Checking if bone is already made.
std::vector<COLLADAFW::Node*>::iterator it;
- it = std::find(finished_joints.begin(),finished_joints.end(),node);
+ it = std::find(finished_joints.begin(), finished_joints.end(), node);
if ( it != finished_joints.end()) return;
float joint_inv_bind_mat[4][4];
@@ -189,7 +189,7 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
else
copy_m4_m4(mat, obmat);
- float loc[3], size[3], rot[3][3] , angle;
+ float loc[3], size[3], rot[3][3], angle;
mat4_to_loc_rot_size( loc, rot, size, obmat);
mat3_to_vec_roll(rot, NULL, &angle );
bone->roll=angle;
@@ -261,7 +261,7 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
// in second case it's not a leaf bone, but we handle it the same way
if (!children.getCount() || children.getCount() > 1) {
- add_leaf_bone(mat, bone , node);
+ add_leaf_bone(mat, bone, node);
}
finished_joints.push_back(node);
@@ -282,11 +282,11 @@ void ArmatureImporter::add_leaf_bone(float mat[][4], EditBone *bone, COLLADAFW:
et = etit->second;
//else return;
- float x,y,z;
- et->setData("tip_x",&x);
- et->setData("tip_y",&y);
- et->setData("tip_z",&z);
- float vec[3] = {x,y,z};
+ float x, y, z;
+ et->setData("tip_x", &x);
+ et->setData("tip_y", &y);
+ et->setData("tip_z", &z);
+ float vec[3] = {x, y, z};
copy_v3_v3(leaf.bone->tail, leaf.bone->head);
add_v3_v3v3(leaf.bone->tail, leaf.bone->head, vec);
}else
@@ -440,7 +440,7 @@ void ArmatureImporter::create_armature_bones( )
ED_armature_from_edit(ob_arm);
- set_pose(ob_arm , *ri, NULL, NULL );
+ set_pose(ob_arm, *ri, NULL, NULL );
ED_armature_edit_free(ob_arm);
DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB|OB_RECALC_DATA);
@@ -569,7 +569,7 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
// is a child of a node (not joint), root should be true since
// this is where we build armature bones from
-void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node , const char *parentname, float parent_mat[][4])
+void ArmatureImporter::set_pose(Object * ob_arm, COLLADAFW::Node * root_node, const char *parentname, float parent_mat[][4])
{
char * bone_name = (char *) bc_get_joint_name ( root_node);
float mat[4][4];
@@ -582,7 +582,7 @@ void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node
get_node_mat(obmat, root_node, NULL, NULL);
//if (*edbone)
- bPoseChannel * pchan = get_pose_channel(ob_arm -> pose , bone_name);
+ bPoseChannel * pchan = get_pose_channel(ob_arm -> pose, bone_name);
//else fprintf ( "",
// get world-space
@@ -600,7 +600,7 @@ void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node
mult_m4_m4m4(pchan->pose_mat, invObmat, mat);
}
- mat4_to_axis_angle(ax,&angle,mat);
+ mat4_to_axis_angle(ax, &angle, mat);
pchan->bone->roll = angle;
diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h
index 0c95ee81272..eead45353af 100644
--- a/source/blender/collada/ArmatureImporter.h
+++ b/source/blender/collada/ArmatureImporter.h
@@ -113,7 +113,7 @@ private:
void fix_leaf_bones();
- void set_pose ( Object * ob_arm , COLLADAFW::Node * root_node , const char *parentname, float parent_mat[][4]);
+ void set_pose ( Object * ob_arm, COLLADAFW::Node * root_node, const char *parentname, float parent_mat[][4]);
#if 0
diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp
index 8640e544dbf..c3614ac49a2 100644
--- a/source/blender/collada/CameraExporter.cpp
+++ b/source/blender/collada/CameraExporter.cpp
@@ -71,18 +71,18 @@ void CamerasExporter::operator()(Object *ob, Scene *sce)
if (cam->type == CAM_PERSP) {
COLLADASW::PerspectiveOptic persp(mSW);
persp.setXFov(RAD2DEGF(focallength_to_fov(cam->lens, cam->sensor_x)), "xfov");
- persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio");
- persp.setZFar(cam->clipend, false , "zfar");
- persp.setZNear(cam->clipsta,false , "znear");
+ persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch), false, "aspect_ratio");
+ persp.setZFar(cam->clipend, false, "zfar");
+ persp.setZNear(cam->clipsta, false, "znear");
COLLADASW::Camera ccam(mSW, &persp, cam_id, cam_name);
addCamera(ccam);
}
else {
COLLADASW::OrthographicOptic ortho(mSW);
- ortho.setXMag(cam->ortho_scale,"xmag");
- ortho.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio");
- ortho.setZFar(cam->clipend , false , "zfar");
- ortho.setZNear(cam->clipsta, false , "znear");
+ ortho.setXMag(cam->ortho_scale, "xmag");
+ ortho.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch), false, "aspect_ratio");
+ ortho.setZFar(cam->clipend, false, "zfar");
+ ortho.setZNear(cam->clipsta, false, "znear");
COLLADASW::Camera ccam(mSW, &ortho, cam_id, cam_name);
addCamera(ccam);
}
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index d81ffebae66..352f477c9d8 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -208,7 +208,7 @@ void DocumentImporter::finish()
const COLLADAFW::NodePointerArray& roots = (*it)->getRootNodes();
for (unsigned int i = 0; i < roots.getCount(); i++)
- translate_anim_recursive(roots[i],NULL,NULL);
+ translate_anim_recursive(roots[i], NULL, NULL);
}
if (libnode_ob.size()) {
@@ -396,7 +396,7 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
if ( par ) {
Object * empty = par;
par = add_object(sce, OB_ARMATURE);
- bc_set_parent(par,empty->parent, mContext);
+ bc_set_parent(par, empty->parent, mContext);
//remove empty : todo
object_map[parent_node->getUniqueId()] = par;
}
diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp
index bbc7677c279..36ed6867525 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -93,10 +93,10 @@ void EffectsExporter::writeBlinn(COLLADASW::EffectProfile &ep, Material *ma)
COLLADASW::ColorOrTexture cot;
ep.setShaderType(COLLADASW::EffectProfile::BLINN);
// shininess
- ep.setShininess(ma->har, false , "shininess");
+ ep.setShininess(ma->har, false, "shininess");
// specular
cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f);
- ep.setSpecular(cot, false , "specular" );
+ ep.setSpecular(cot, false, "specular" );
}
void EffectsExporter::writeLambert(COLLADASW::EffectProfile &ep, Material *ma)
@@ -110,10 +110,10 @@ void EffectsExporter::writePhong(COLLADASW::EffectProfile &ep, Material *ma)
COLLADASW::ColorOrTexture cot;
ep.setShaderType(COLLADASW::EffectProfile::PHONG);
// shininess
- ep.setShininess(ma->har , false , "shininess" );
+ ep.setShininess(ma->har, false, "shininess" );
// specular
cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f);
- ep.setSpecular(cot, false , "specular" );
+ ep.setSpecular(cot, false, "specular" );
}
void EffectsExporter::operator()(Material *ma, Object *ob)
@@ -150,10 +150,10 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// index of refraction
if (ma->mode & MA_RAYTRANSP) {
- ep.setIndexOfRefraction(ma->ang, false , "index_of_refraction");
+ ep.setIndexOfRefraction(ma->ang, false, "index_of_refraction");
}
else {
- ep.setIndexOfRefraction(1.0f, false , "index_of_refraction");
+ ep.setIndexOfRefraction(1.0f, false, "index_of_refraction");
}
COLLADASW::ColorOrTexture cot;
@@ -161,18 +161,18 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// transparency
if (ma->mode & MA_TRANSP) {
// Tod: because we are in A_ONE mode transparency is calculated like this:
- ep.setTransparency(ma->alpha, false , "transparency");
+ ep.setTransparency(ma->alpha, false, "transparency");
// cot = getcol(1.0f, 1.0f, 1.0f, 1.0f);
// ep.setTransparent(cot);
}
// emission
cot=getcol(ma->emit, ma->emit, ma->emit, 1.0f);
- ep.setEmission(cot, false , "emission");
+ ep.setEmission(cot, false, "emission");
// diffuse multiplied by diffuse intensity
cot = getcol(ma->r * ma->ref, ma->g * ma->ref, ma->b * ma->ref, 1.0f);
- ep.setDiffuse(cot, false , "diffuse");
+ ep.setDiffuse(cot, false, "diffuse");
// ambient
/* ma->ambX is calculated only on render, so lets do it here manually and not rely on ma->ambX. */
@@ -181,7 +181,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
else
cot = getcol(ma->amb, ma->amb, ma->amb, 1.0f);
- ep.setAmbient(cot, false , "ambient");
+ ep.setAmbient(cot, false, "ambient");
// reflective, reflectivity
if (ma->mode & MA_RAYMIRROR) {
@@ -198,7 +198,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// specular
if (ep.getShaderType() != COLLADASW::EffectProfile::LAMBERT) {
cot = getcol(ma->specr * ma->spec, ma->specg * ma->spec, ma->specb * ma->spec, 1.0f);
- ep.setSpecular(cot, false , "specular");
+ ep.setSpecular(cot, false, "specular");
}
// XXX make this more readable if possible
@@ -279,19 +279,19 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
// color
if (t->mapto & (MAP_COL | MAP_COLSPEC)) {
- ep.setDiffuse(createTexture(ima, uvname, sampler), false , "diffuse");
+ ep.setDiffuse(createTexture(ima, uvname, sampler), false, "diffuse");
}
// ambient
if (t->mapto & MAP_AMB) {
- ep.setAmbient(createTexture(ima, uvname, sampler), false , "ambient");
+ ep.setAmbient(createTexture(ima, uvname, sampler), false, "ambient");
}
// specular
if (t->mapto & MAP_SPEC) {
- ep.setSpecular(createTexture(ima, uvname, sampler), false , "specular");
+ ep.setSpecular(createTexture(ima, uvname, sampler), false, "specular");
}
// emission
if (t->mapto & MAP_EMIT) {
- ep.setEmission(createTexture(ima, uvname, sampler), false , "emission");
+ ep.setEmission(createTexture(ima, uvname, sampler), false, "emission");
}
// reflective
if (t->mapto & MAP_REF) {
@@ -350,7 +350,7 @@ COLLADASW::ColorOrTexture EffectsExporter::createTexture(Image *ima,
COLLADASW::ColorOrTexture EffectsExporter::getcol(float r, float g, float b, float a)
{
- COLLADASW::Color color(r,g,b,a);
+ COLLADASW::Color color(r, g, b, a);
COLLADASW::ColorOrTexture cot(color);
return cot;
}
diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp
index 1d7afb9b1a1..6d276cd782f 100644
--- a/source/blender/collada/LightExporter.cpp
+++ b/source/blender/collada/LightExporter.cpp
@@ -84,7 +84,7 @@ void LightsExporter::operator()(Object *ob)
// sun
if (la->type == LA_SUN) {
COLLADASW::DirectionalLight cla(mSW, la_id, la_name);
- cla.setColor(col,false,"color");
+ cla.setColor(col, false, "color");
cla.setConstantAttenuation(constatt);
exportBlenderProfile(cla, la);
addLight(cla);
@@ -92,7 +92,7 @@ void LightsExporter::operator()(Object *ob)
// hemi
else if (la->type == LA_HEMI) {
COLLADASW::AmbientLight cla(mSW, la_id, la_name);
- cla.setColor(col,false,"color");
+ cla.setColor(col, false, "color");
cla.setConstantAttenuation(constatt);
exportBlenderProfile(cla, la);
addLight(cla);
@@ -100,9 +100,9 @@ void LightsExporter::operator()(Object *ob)
// spot
else if (la->type == LA_SPOT) {
COLLADASW::SpotLight cla(mSW, la_id, la_name);
- cla.setColor(col,false,"color");
- cla.setFallOffAngle(la->spotsize,false,"fall_off_angle");
- cla.setFallOffExponent(la->spotblend,false,"fall_off_exponent");
+ cla.setColor(col, false, "color");
+ cla.setFallOffAngle(la->spotsize, false, "fall_off_angle");
+ cla.setFallOffExponent(la->spotblend, false, "fall_off_exponent");
cla.setConstantAttenuation(constatt);
cla.setLinearAttenuation(linatt);
cla.setQuadraticAttenuation(quadatt);
@@ -112,7 +112,7 @@ void LightsExporter::operator()(Object *ob)
// lamp
else if (la->type == LA_LOCAL) {
COLLADASW::PointLight cla(mSW, la_id, la_name);
- cla.setColor(col,false,"color");
+ cla.setColor(col, false, "color");
cla.setConstantAttenuation(constatt);
cla.setLinearAttenuation(linatt);
cla.setQuadraticAttenuation(quadatt);
@@ -123,7 +123,7 @@ void LightsExporter::operator()(Object *ob)
// it will be exported as a local lamp
else {
COLLADASW::PointLight cla(mSW, la_id, la_name);
- cla.setColor(col,false,"color");
+ cla.setColor(col, false, "color");
cla.setConstantAttenuation(constatt);
cla.setLinearAttenuation(linatt);
cla.setQuadraticAttenuation(quadatt);
diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp
index f96aff8aa90..4974566bba1 100644
--- a/source/blender/collada/TransformWriter.cpp
+++ b/source/blender/collada/TransformWriter.cpp
@@ -48,11 +48,11 @@ void TransformWriter::add_node_transform(COLLADASW::Node& node, float mat[][4],
double dmat[4][4];
UnitConverter* converter = new UnitConverter();
- converter->mat4_to_dae_double(dmat,local);
+ converter->mat4_to_dae_double(dmat, local);
TransformBase::decompose(local, loc, rot, NULL, scale);
if ( node.getType() == COLLADASW::Node::JOINT)
- node.addMatrix("transform",dmat);
+ node.addMatrix("transform", dmat);
else
add_transform(node, loc, rot, scale);
}
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 8aafdc6ab40..714a91ad0b5 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -291,7 +291,7 @@ static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
offset += 21;
}
/* materials and particles animdata */
- else if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
+ else if (ELEM(GS(ale->id->name), ID_MA, ID_PA))
offset += 14;
/* if not in Action Editor mode, action-groups (and their children) must carry some offset too... */
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 94d9d426932..78c5ced60c4 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -509,7 +509,7 @@ static int ed_markers_poll_markers_exist(bContext *C)
* exec() callback will be called instead in the appropriate places.
*/
static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent *evt,
- int (*invoke_func)(bContext*,wmOperator*,wmEvent*))
+ int (*invoke_func)(bContext *, wmOperator *, wmEvent *))
{
ScrArea *sa = CTX_wm_area(C);
int retval = OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index cd698bbf09f..969127325e6 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -680,7 +680,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
* 2. remove this from the 'visual' y-rotation
*/
{
- float premat[3][3], imat[3][3],pmat[3][3], tmat[3][3];
+ float premat[3][3], imat[3][3], pmat[3][3], tmat[3][3];
float delta[3], eul[3];
/* obtain new auto y-rotation */
@@ -693,7 +693,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
/* remove auto from visual and get euler rotation */
mul_m3_m3m3(tmat, imat, pmat);
- mat3_to_eul( eul,tmat);
+ mat3_to_eul( eul, tmat);
/* just use this euler-y as new roll value */
curbone->roll= eul[1];
@@ -2285,7 +2285,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op))
View3D *v3d;
bArmature *arm;
EditBone *ebone, *newbone, *flipbone;
- float *curs, mat[3][3],imat[3][3];
+ float *curs, mat[3][3], imat[3][3];
int a, to_root= 0;
Object *obedit;
Scene *scene;
@@ -3457,7 +3457,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "name", name);
- copy_v3_v3(curs, give_cursor(CTX_data_scene(C),CTX_wm_view3d(C)));
+ copy_v3_v3(curs, give_cursor(CTX_data_scene(C), CTX_wm_view3d(C)));
/* Get inverse point for head and orientation for tail */
invert_m4_m4(obedit->imat, obedit->obmat);
@@ -4440,7 +4440,7 @@ static int vgroup_add_unique_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
* If such a vertex group aleady exist the routine exits.
*/
if (!(bone->flag & BONE_NO_DEFORM)) {
- if (!defgroup_find_name(ob,bone->name)) {
+ if (!defgroup_find_name(ob, bone->name)) {
ED_vgroup_add_name(ob, bone->name);
return 1;
}
@@ -4828,7 +4828,7 @@ static void pchan_clear_rot(bPoseChannel *pchan)
quat_to_eul(oldeul, quat1);
}
else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
- axis_angle_to_eulO( oldeul, EULER_ORDER_DEFAULT,pchan->rotAxis, pchan->rotAngle);
+ axis_angle_to_eulO( oldeul, EULER_ORDER_DEFAULT, pchan->rotAxis, pchan->rotAngle);
}
else {
copy_v3_v3(oldeul, pchan->eul);
@@ -4855,7 +4855,7 @@ static void pchan_clear_rot(bPoseChannel *pchan)
}
}
else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
- eulO_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,eul, EULER_ORDER_DEFAULT);
+ eulO_to_axis_angle( pchan->rotAxis, &pchan->rotAngle, eul, EULER_ORDER_DEFAULT);
}
else {
copy_v3_v3(pchan->eul, eul);
@@ -5094,7 +5094,7 @@ void POSE_OT_select_all(wmOperatorType *ot)
static int pose_select_parent_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob= object_pose_armature_get(CTX_data_active_object(C));
- bPoseChannel *pchan,*parent;
+ bPoseChannel *pchan, *parent;
/* Determine if there is an active bone */
pchan=CTX_data_active_pose_bone(C);
@@ -5737,8 +5737,8 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
/* Copy orientation from source */
copy_v3_v3(dst->loc, src->obmat[3]);
- mat4_to_eul( dst->rot,src->obmat);
- mat4_to_size( dst->size,src->obmat);
+ mat4_to_eul(dst->rot, src->obmat);
+ mat4_to_size(dst->size, src->obmat);
where_is_object(scene, obedit);
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 59a7437e753..a5db3dc118f 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -584,7 +584,7 @@ static void heat_calc_vnormals(LaplacianSystem *sys)
v2= (*face)[1];
v3= (*face)[2];
- normal_tri_v3( fnor,sys->verts[v1], sys->verts[v2], sys->verts[v3]);
+ normal_tri_v3(fnor, sys->verts[v1], sys->verts[v2], sys->verts[v3]);
add_v3_v3(sys->heat.vnors[v1], fnor);
add_v3_v3(sys->heat.vnors[v2], fnor);
@@ -945,7 +945,7 @@ void rigid_deform_iteration()
}
}
- /* solve for positions, for X,Y and Z separately */
+ /* solve for positions, for X, Y and Z separately */
for (i=0; i<3; i++) {
laplacian_begin_solve(sys, i);
@@ -1069,7 +1069,7 @@ void rigid_deform_end(int cancel)
#define MESHDEFORM_MIN_INFLUENCE 0.0005f
static int MESHDEFORM_OFFSET[7][3] =
- {{0,0,0}, {1,0,0}, {-1,0,0}, {0,1,0}, {0,-1,0}, {0,0,1}, {0,0,-1}};
+ {{0, 0, 0}, {1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0}, {0, 0, 1}, {0, 0, -1}};
typedef struct MDefBoundIsect {
float co[3], uvw[4];
@@ -1128,10 +1128,10 @@ typedef struct MeshDeformIsect {
/* our own triangle intersection, so we can fully control the epsilons and
* prevent corner case from going wrong*/
static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
- float vert1[3], float vert2[3], float *isectco, float *uvw)
+ float vert1[3], float vert2[3], float *isectco, float *uvw)
{
float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3];
- float det,inv_det, u, v, dir[3], isectdir[3];
+ float det, inv_det, u, v, dir[3], isectdir[3];
sub_v3_v3v3(dir, end, orig);
@@ -1208,16 +1208,16 @@ static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec)
hit = meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw);
if (hit) {
- normal_tri_v3( nor,face[0], face[1], face[2]);
+ normal_tri_v3(nor, face[0], face[1], face[2]);
}
else {
hit= meshdeform_tri_intersect(isec->start, end, face[0], face[2], face[3], co, uvw);
- normal_tri_v3( nor,face[0], face[2], face[3]);
+ normal_tri_v3(nor, face[0], face[2], face[3]);
}
}
else {
hit= meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw);
- normal_tri_v3( nor,face[0], face[1], face[2]);
+ normal_tri_v3(nor, face[0], face[1], face[2]);
}
if (hit) {
@@ -1281,7 +1281,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
copy_v3_v3(vert[1], cagecos[mface->v2]);
copy_v3_v3(vert[2], cagecos[mface->v3]);
if (mface->v4) copy_v3_v3(vert[3], cagecos[mface->v4]);
- interp_weights_poly_v3( isect->uvw,vert, isect->nvert, isect->co);
+ interp_weights_poly_v3( isect->uvw, vert, isect->nvert, isect->co);
return isect;
}
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index f54cdb330e3..87cf25e99be 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -792,7 +792,7 @@ static void pose_copy_menu(Scene *scene)
if (nr != 5) {
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ( (arm->layer & pchan->bone->layer) &&
+ if ((arm->layer & pchan->bone->layer) &&
(pchan->bone->flag & BONE_SELECTED) &&
(pchan != pchanact) )
{
@@ -861,13 +861,13 @@ static void pose_copy_menu(Scene *scene)
float tmp_quat[4];
/* need to convert to quat first (in temp var)... */
- mat4_to_quat( tmp_quat,delta_mat);
- quat_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,tmp_quat);
+ mat4_to_quat(tmp_quat, delta_mat);
+ quat_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, tmp_quat);
}
else if (pchan->rotmode == ROT_MODE_QUAT)
- mat4_to_quat( pchan->quat,delta_mat);
+ mat4_to_quat(pchan->quat, delta_mat);
else
- mat4_to_eulO( pchan->eul, pchan->rotmode,delta_mat);
+ mat4_to_eulO(pchan->eul, pchan->rotmode, delta_mat);
}
break;
case 11: /* Visual Size */
@@ -875,7 +875,7 @@ static void pose_copy_menu(Scene *scene)
float delta_mat[4][4], size[4];
armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
- mat4_to_size( size,delta_mat);
+ mat4_to_size(size, delta_mat);
copy_v3_v3(pchan->size, size);
}
}
@@ -914,7 +914,7 @@ static void pose_copy_menu(Scene *scene)
/* Copy the temo listbase to the selected posebones */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ( (arm->layer & pchan->bone->layer) &&
+ if ((arm->layer & pchan->bone->layer) &&
(pchan->bone->flag & BONE_SELECTED) &&
(pchan!=pchanact) )
{
@@ -1050,9 +1050,9 @@ static bPoseChannel *pose_bone_do_paste (Object *ob, bPoseChannel *chan, short s
else if (pchan->rotmode > 0) {
/* quat/axis-angle to euler */
if (chan->rotmode == ROT_MODE_AXISANGLE)
- axis_angle_to_eulO( pchan->eul, pchan->rotmode,chan->rotAxis, chan->rotAngle);
+ axis_angle_to_eulO(pchan->eul, pchan->rotmode, chan->rotAxis, chan->rotAngle);
else
- quat_to_eulO( pchan->eul, pchan->rotmode,chan->quat);
+ quat_to_eulO(pchan->eul, pchan->rotmode, chan->quat);
}
else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
/* quat/euler to axis angle */
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c
index eebdeafcea9..efcbab78884 100644
--- a/source/blender/editors/armature/reeb.c
+++ b/source/blender/editors/armature/reeb.c
@@ -197,7 +197,7 @@ void REEB_freeGraph(ReebGraph *rg)
// free arcs
arc = rg->arcs.first;
- while ( arc ) {
+ while (arc) {
ReebArc *next = arc->next;
REEB_freeArc((BArc*)arc);
arc = next;
@@ -1683,7 +1683,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
int merging = 0;
int total = BLI_ghash_size(arc->faces);
float avg_angle = 0;
- float avg_vec[3] = {0,0,0};
+ float avg_vec[3] = {0, 0, 0};
for (BLI_ghashIterator_init(&ghi, arc->faces);
!BLI_ghashIterator_isDone(&ghi);
@@ -1873,7 +1873,7 @@ static void finalizeGraph(ReebGraph *rg, char passes, char method)
/************************************** WEIGHT SPREADING ***********************************************/
-static int compareVerts( const void* a, const void* b )
+static int compareVerts(const void* a, const void* b)
{
EditVert *va = *(EditVert**)a;
EditVert *vb = *(EditVert**)b;
@@ -2090,7 +2090,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d
e->arc = aDst; // Edge is stolen by new arc
}
- BLI_movelisttolist(&aDst->edges , &aSrc->edges);
+ BLI_movelisttolist(&aDst->edges, &aSrc->edges);
}
else {
for (e = aSrc->edges.first; e; e = e->next) {
@@ -3470,18 +3470,18 @@ void REEB_draw()
glColor3f(0, 1, 0);
glRasterPos3fv(vec);
- BMF_DrawString( G.fonts, text);
+ BMF_DrawString(G.fonts, text);
}
if (G.scene->toolsettings->skgen_options & SKGEN_DISP_INDEX)
{
sprintf(text, " %i", arc->head->index);
glRasterPos3fv(arc->head->p);
- BMF_DrawString( G.fonts, text);
+ BMF_DrawString(G.fonts, text);
sprintf(text, " %i", arc->tail->index);
glRasterPos3fv(arc->tail->p);
- BMF_DrawString( G.fonts, text);
+ BMF_DrawString(G.fonts, text);
}
}
glEnable(GL_DEPTH_TEST);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index e65b4280dc9..37bbedbc9dd 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -108,7 +108,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu
static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short selstatus);
/* still need to eradicate a few :( */
-#define callocstructN(x,y,name) (x*)MEM_callocN((y)* sizeof(x),name)
+#define callocstructN(x, y, name) (x*)MEM_callocN((y)* sizeof(x), name)
static float nurbcircle[8][2]= {
{0.0, -1.0}, {-1.0, -1.0}, {-1.0, 0.0}, {-1.0, 1.0},
@@ -4224,10 +4224,10 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen
Curve *cu= (Curve*)obedit->data;
ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu;
- float si,phi,n[3],q[4],cmat[3][3],tmat[3][3],imat[3][3];
+ float si, phi, n[3], q[4], cmat[3][3], tmat[3][3], imat[3][3];
float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3];
float persmat[3][3], persinv[3][3];
- short a,ok, changed= 0;
+ short a, ok, changed= 0;
copy_m3_m4(persmat, viewmat);
invert_m3_m3(persinv, persmat);
@@ -4244,7 +4244,7 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen
q[1]= n[0]*si;
q[2]= n[1]*si;
q[3]= n[2]*si;
- quat_to_mat3( cmat,q);
+ quat_to_mat3(cmat, q);
mul_m3_m3m3(tmat, cmat, bmat);
mul_m3_m3m3(rotmat, imat, tmat);
@@ -4252,19 +4252,19 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen
scalemat1[0][0]= M_SQRT2;
scalemat1[1][1]= M_SQRT2;
- mul_m3_m3m3(tmat,persmat,bmat);
- mul_m3_m3m3(cmat,scalemat1,tmat);
- mul_m3_m3m3(tmat,persinv,cmat);
- mul_m3_m3m3(scalemat1,imat,tmat);
+ mul_m3_m3m3(tmat, persmat, bmat);
+ mul_m3_m3m3(cmat, scalemat1, tmat);
+ mul_m3_m3m3(tmat, persinv, cmat);
+ mul_m3_m3m3(scalemat1, imat, tmat);
unit_m3(scalemat2);
- scalemat2[0][0]/= (float)M_SQRT2;
- scalemat2[1][1]/= (float)M_SQRT2;
+ scalemat2[0][0] /= (float)M_SQRT2;
+ scalemat2[1][1] /= (float)M_SQRT2;
- mul_m3_m3m3(tmat,persmat,bmat);
- mul_m3_m3m3(cmat,scalemat2,tmat);
- mul_m3_m3m3(tmat,persinv,cmat);
- mul_m3_m3m3(scalemat2,imat,tmat);
+ mul_m3_m3m3(tmat, persmat, bmat);
+ mul_m3_m3m3(cmat, scalemat2, tmat);
+ mul_m3_m3m3(tmat, persinv, cmat);
+ mul_m3_m3m3(scalemat2, imat, tmat);
ok= 1;
@@ -4533,7 +4533,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
}
else {
mul_v3_m4v3(newbezt->vec[1], imat, location);
- sub_v3_v3v3(temp, newbezt->vec[1],temp);
+ sub_v3_v3v3(temp, newbezt->vec[1], temp);
if (bezt_recalc[1]) {
const char h1 = bezt_recalc[1]->h1, h2 = bezt_recalc[1]->h2;
@@ -4543,8 +4543,8 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
bezt_recalc[1]->h2 = h2;
}
else {
- add_v3_v3v3(newbezt->vec[0], bezt->vec[0],temp);
- add_v3_v3v3(newbezt->vec[2], bezt->vec[2],temp);
+ add_v3_v3v3(newbezt->vec[0], bezt->vec[0], temp);
+ add_v3_v3v3(newbezt->vec[2], bezt->vec[2], temp);
}
@@ -6268,7 +6268,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bp->vec[0]+= 1.5f*grid;
bp= nu->bp;
- for (a=0;a<4;a++, bp++) mul_m4_v3(mat,bp->vec);
+ for (a=0;a<4;a++, bp++) mul_m4_v3(mat, bp->vec);
if (cutype==CU_NURBS) {
nu->knotsu= NULL; /* nurbs_knot_calc_u allocates */
@@ -6302,7 +6302,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bp->vec[0]+= 2.0f*grid;
bp= nu->bp;
- for (a=0;a<5;a++, bp++) mul_m4_v3(mat,bp->vec);
+ for (a=0;a<5;a++, bp++) mul_m4_v3(mat, bp->vec);
if (cutype==CU_NURBS) {
nu->knotsu= NULL; /* nurbs_knot_calc_u allocates */
@@ -6323,28 +6323,28 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][0]+= -grid;
- for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
bezt++;
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][1]+= grid;
- for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
bezt++;
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][0]+= grid;
- for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
bezt++;
bezt->h1= bezt->h2= HD_AUTO;
bezt->f1= bezt->f2= bezt->f3= SELECT;
bezt->vec[1][1]+= -grid;
- for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]);
+ for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]);
bezt->radius = bezt->weight = 1.0;
BKE_nurb_handles_calc(nu);
@@ -6369,7 +6369,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
}
if (a & 1) bp->vec[3]= 0.25*M_SQRT2;
else bp->vec[3]= 1.0;
- mul_m4_v3(mat,bp->vec);
+ mul_m4_v3(mat, bp->vec);
bp->radius = bp->weight = 1.0;
bp++;
@@ -6401,7 +6401,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
if (a==1 || a==2) if (b==1 || b==2) {
bp->vec[2]+= grid;
}
- mul_m4_v3(mat,bp->vec);
+ mul_m4_v3(mat, bp->vec);
bp->vec[3]= 1.0;
bp++;
}
@@ -6465,7 +6465,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
bp->vec[2]+= nurbcircle[a][1]*grid;
if (a & 1) bp->vec[3]= 0.5*M_SQRT2;
else bp->vec[3]= 1.0;
- mul_m4_v3(mat,bp->vec);
+ mul_m4_v3(mat, bp->vec);
bp++;
}
nu->flagu= CU_NURB_BEZIER;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 131034848de..891b5048fa5 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -403,7 +403,7 @@ static int key_test_depth(PEData *data, const float co[3])
View3D *v3d= data->vc.v3d;
double ux, uy, uz;
float depth;
- short wco[3], x,y;
+ short wco[3], x, y;
/* nothing to do */
if ((v3d->drawtype<=OB_WIRE) || (v3d->flag & V3D_ZBUF_SELECT)==0)
@@ -414,7 +414,7 @@ static int key_test_depth(PEData *data, const float co[3])
if (wco[0] == IS_CLIPPED)
return 0;
- gluProject(co[0],co[1],co[2], data->mats.modelview, data->mats.projection,
+ gluProject(co[0], co[1], co[2], data->mats.modelview, data->mats.projection,
(GLint *)data->mats.viewport, &ux, &uy, &uz);
x=wco[0];
@@ -473,7 +473,7 @@ static int key_inside_rect(PEData *data, const float co[3])
{
int sco[2];
- project_int(data->vc.ar, co,sco);
+ project_int(data->vc.ar, co, sco);
if (sco[0] == IS_CLIPPED)
return 0;
@@ -622,7 +622,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat);
- invert_m4_m4(imat,mat);
+ invert_m4_m4(imat, mat);
}
func(data, mat, imat, p, point->totkey-1, key);
@@ -636,7 +636,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat);
- invert_m4_m4(imat,mat);
+ invert_m4_m4(imat, mat);
}
func(data, mat, imat, p, k, key);
@@ -902,7 +902,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
return;
psys = edit->psys;
- psmd = psys_get_modifier(ob,psys);
+ psmd = psys_get_modifier(ob, psys);
if (!psmd->dm)
return;
@@ -920,26 +920,26 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
dist_1st *= 0.75f * pset->emitterdist;
}
else {
- index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL);
+ index= BLI_kdtree_find_nearest(edit->emitter_field, key->co, NULL, NULL);
vec=edit->emitter_cosnos +index*6;
nor=vec+3;
sub_v3_v3v3(dvec, key->co, vec);
- dot=dot_v3v3(dvec,nor);
- copy_v3_v3(dvec,nor);
+ dot=dot_v3v3(dvec, nor);
+ copy_v3_v3(dvec, nor);
if (dot>0.0f) {
if (dot<dist_1st) {
normalize_v3(dvec);
- mul_v3_fl(dvec,dist_1st-dot);
+ mul_v3_fl(dvec, dist_1st-dot);
add_v3_v3(key->co, dvec);
}
}
else {
normalize_v3(dvec);
- mul_v3_fl(dvec,dist_1st-dot);
+ mul_v3_fl(dvec, dist_1st-dot);
add_v3_v3(key->co, dvec);
}
if (k==1)
@@ -947,7 +947,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
}
}
- invert_m4_m4(hairimat,hairmat);
+ invert_m4_m4(hairimat, hairmat);
LOOP_KEYS {
mul_m4_v3(hairimat, key->co);
@@ -1053,7 +1053,7 @@ static void recalc_lengths(PTCacheEdit *edit)
/* calculate a tree for finding nearest emitter's vertice */
static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
{
- DerivedMesh *dm=psys_get_modifier(ob,psys)->dm;
+ DerivedMesh *dm=psys_get_modifier(ob, psys)->dm;
PTCacheEdit *edit= psys->edit;
float *vec, *nor;
int i, totface /*, totvert*/;
@@ -1069,7 +1069,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
totface=dm->getNumTessFaces(dm);
/*totvert=dm->getNumVerts(dm);*/ /*UNSUED*/
- edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float),"emitter cosnos");
+ edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float), "emitter cosnos");
edit->emitter_field= BLI_kdtree_new(totface);
@@ -1077,30 +1077,30 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
nor=vec+3;
for (i=0; i<totface; i++, vec+=6, nor+=6) {
- MFace *mface=dm->getTessFaceData(dm,i,CD_MFACE);
+ MFace *mface=dm->getTessFaceData(dm, i, CD_MFACE);
MVert *mvert;
- mvert=dm->getVertData(dm,mface->v1,CD_MVERT);
- copy_v3_v3(vec,mvert->co);
- VECCOPY(nor,mvert->no);
+ mvert=dm->getVertData(dm, mface->v1, CD_MVERT);
+ copy_v3_v3(vec, mvert->co);
+ VECCOPY(nor, mvert->no);
- mvert=dm->getVertData(dm,mface->v2,CD_MVERT);
- add_v3_v3v3(vec,vec,mvert->co);
- VECADD(nor,nor,mvert->no);
+ mvert=dm->getVertData(dm, mface->v2, CD_MVERT);
+ add_v3_v3v3(vec, vec, mvert->co);
+ VECADD(nor, nor, mvert->no);
- mvert=dm->getVertData(dm,mface->v3,CD_MVERT);
- add_v3_v3v3(vec,vec,mvert->co);
- VECADD(nor,nor,mvert->no);
+ mvert=dm->getVertData(dm, mface->v3, CD_MVERT);
+ add_v3_v3v3(vec, vec, mvert->co);
+ VECADD(nor, nor, mvert->no);
if (mface->v4) {
- mvert=dm->getVertData(dm,mface->v4,CD_MVERT);
- add_v3_v3v3(vec,vec,mvert->co);
- VECADD(nor,nor,mvert->no);
+ mvert=dm->getVertData(dm, mface->v4, CD_MVERT);
+ add_v3_v3v3(vec, vec, mvert->co);
+ VECADD(nor, nor, mvert->no);
- mul_v3_fl(vec,0.25);
+ mul_v3_fl(vec, 0.25);
}
else
- mul_v3_fl(vec,0.3333f);
+ mul_v3_fl(vec, 0.3333f);
normalize_v3(nor);
@@ -1154,7 +1154,7 @@ static void update_world_cos(Object *ob, PTCacheEdit *edit)
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat);
LOOP_KEYS {
- copy_v3_v3(key->world_co,key->co);
+ copy_v3_v3(key->world_co, key->co);
if (!(psys->flag & PSYS_GLOBAL_HAIR))
mul_m4_v3(hairmat, key->world_co);
}
@@ -1239,7 +1239,7 @@ void PE_update_object(Scene *scene, Object *ob, int useflag)
pe_deflect_emitter(scene, ob, edit);
PE_apply_lengths(scene, edit);
if (pe_x_mirror(ob))
- PE_apply_mirror(ob,edit->psys);
+ PE_apply_mirror(ob, edit->psys);
if (edit->psys)
update_world_cos(ob, edit);
if (pset->flag & PE_AUTO_VELOCITY)
@@ -1637,7 +1637,7 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
project_int(ar, co, vertco);
- if (BLI_lasso_is_point_inside(mcords,moves,vertco[0],vertco[1], IS_CLIPPED) &&
+ if (BLI_lasso_is_point_inside(mcords, moves, vertco[0], vertco[1], IS_CLIPPED) &&
key_test_depth(&data, co))
{
if (select && !(key->flag & PEK_SELECT)) {
@@ -1656,8 +1656,8 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
- project_int(ar, co,vertco);
- if (BLI_lasso_is_point_inside(mcords,moves,vertco[0],vertco[1], IS_CLIPPED) &&
+ project_int(ar, co, vertco);
+ if (BLI_lasso_is_point_inside(mcords, moves, vertco[0], vertco[1], IS_CLIPPED) &&
key_test_depth(&data, co))
{
if (select && !(key->flag & PEK_SELECT)) {
@@ -1908,7 +1908,7 @@ static void rekey_particle(PEData *data, int pa_index)
pa->flag |= PARS_REKEY;
- key= new_keys= MEM_callocN(data->totrekey * sizeof(HairKey),"Hair re-key keys");
+ key= new_keys= MEM_callocN(data->totrekey * sizeof(HairKey), "Hair re-key keys");
okey = pa->hair;
/* root and tip stay the same */
@@ -1920,7 +1920,7 @@ static void rekey_particle(PEData *data, int pa_index)
dval= (end - sta) / (float)(data->totrekey - 1);
/* interpolate new keys from old ones */
- for (k=1,key++; k<data->totrekey-1; k++,key++) {
+ for (k=1, key++; k<data->totrekey-1; k++, key++) {
state.time= (float)k / (float)(data->totrekey-1);
psys_get_particle_on_path(&sim, pa_index, &state, 0);
copy_v3_v3(key->co, state.co);
@@ -1937,7 +1937,7 @@ static void rekey_particle(PEData *data, int pa_index)
if (point->keys)
MEM_freeN(point->keys);
- ekey= point->keys= MEM_callocN(pa->totkey * sizeof(PTCacheEditKey),"Hair re-key edit keys");
+ ekey= point->keys= MEM_callocN(pa->totkey * sizeof(PTCacheEditKey), "Hair re-key edit keys");
for (k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) {
ekey->co= key->co;
@@ -2223,7 +2223,7 @@ static void subdivide_particle(PEData *data, int pa_index)
sim.ob= data->ob;
sim.psys= edit->psys;
- for (k=0, ekey=point->keys; k<pa->totkey-1; k++,ekey++) {
+ for (k=0, ekey=point->keys; k<pa->totkey-1; k++, ekey++) {
if (ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT)
totnewkey++;
}
@@ -2232,16 +2232,16 @@ static void subdivide_particle(PEData *data, int pa_index)
pa->flag |= PARS_REKEY;
- nkey= new_keys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)),"Hair subdivide keys");
- nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(PTCacheEditKey)),"Hair subdivide edit keys");
+ nkey= new_keys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)), "Hair subdivide keys");
+ nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(PTCacheEditKey)), "Hair subdivide edit keys");
key = pa->hair;
endtime= key[pa->totkey-1].time;
for (k=0, ekey=point->keys; k<pa->totkey-1; k++, key++, ekey++) {
- memcpy(nkey,key,sizeof(HairKey));
- memcpy(nekey,ekey,sizeof(PTCacheEditKey));
+ memcpy(nkey, key, sizeof(HairKey));
+ memcpy(nekey, ekey, sizeof(PTCacheEditKey));
nekey->co= nkey->co;
nekey->time= &nkey->time;
@@ -2266,8 +2266,8 @@ static void subdivide_particle(PEData *data, int pa_index)
}
}
/*tip still not copied*/
- memcpy(nkey,key,sizeof(HairKey));
- memcpy(nekey,ekey,sizeof(PTCacheEditKey));
+ memcpy(nkey, key, sizeof(HairKey));
+ memcpy(nekey, ekey, sizeof(PTCacheEditKey));
nekey->co= nkey->co;
nekey->time= &nkey->time;
@@ -2356,7 +2356,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
copy_v3_v3(co, point->keys->co);
mul_m4_v3(mat, co);
- totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest);
+ totn= BLI_kdtree_find_n_nearest(tree, 10, co, NULL, nearest);
for (n=0; n<totn; n++) {
/* this needs a custom threshold still */
@@ -2666,7 +2666,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
/* assign face inddex */
newpa->num= mirrorfaces[pa->num*2];
- newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL);
+ newpa->num_dmcache= psys_particle_dm_face_lookup(ob, psmd->dm, newpa->num, newpa->fuv, NULL);
/* update edit key pointers */
key= newpoint->keys;
@@ -2730,8 +2730,8 @@ static void brush_comb(PEData *data, float UNUSED(mat[][4]), float imat[][4], in
fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->combfac);
- copy_v3_v3(cvec,data->dvec);
- mul_mat3_m4_v3(imat,cvec);
+ copy_v3_v3(cvec, data->dvec);
+ mul_mat3_m4_v3(imat, cvec);
mul_v3_fl(cvec, fac);
add_v3_v3(key->co, cvec);
@@ -2840,17 +2840,17 @@ static void brush_length(PEData *data, int point_index)
PTCacheEdit *edit= data->edit;
PTCacheEditPoint *point = edit->points + point_index;
KEY_K;
- float dvec[3],pvec[3] = {0.0f, 0.0f, 0.0f};
+ float dvec[3], pvec[3] = {0.0f, 0.0f, 0.0f};
LOOP_KEYS {
if (k==0) {
- copy_v3_v3(pvec,key->co);
+ copy_v3_v3(pvec, key->co);
}
else {
- sub_v3_v3v3(dvec,key->co,pvec);
- copy_v3_v3(pvec,key->co);
- mul_v3_fl(dvec,data->growfac);
- add_v3_v3v3(key->co,(key-1)->co,dvec);
+ sub_v3_v3v3(dvec, key->co, pvec);
+ copy_v3_v3(pvec, key->co);
+ mul_v3_fl(dvec, data->growfac);
+ add_v3_v3v3(key->co, (key-1)->co, dvec);
}
}
@@ -2877,7 +2877,7 @@ static void brush_puff(PEData *data, int point_index)
if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, psys->particles + point_index, mat);
- invert_m4_m4(imat,mat);
+ invert_m4_m4(imat, mat);
}
else {
unit_m4(mat);
@@ -3009,8 +3009,8 @@ static void brush_smooth_get(PEData *data, float mat[][4], float UNUSED(imat[][4
if (key_index) {
float dvec[3];
- sub_v3_v3v3(dvec,key->co,(key-1)->co);
- mul_mat3_m4_v3(mat,dvec);
+ sub_v3_v3v3(dvec, key->co, (key-1)->co);
+ mul_mat3_m4_v3(mat, dvec);
add_v3_v3(data->vec, dvec);
data->tot++;
}
@@ -3022,12 +3022,12 @@ static void brush_smooth_do(PEData *data, float UNUSED(mat[][4]), float imat[][4
if (key_index) {
copy_v3_v3(vec, data->vec);
- mul_mat3_m4_v3(imat,vec);
+ mul_mat3_m4_v3(imat, vec);
- sub_v3_v3v3(dvec,key->co,(key-1)->co);
+ sub_v3_v3v3(dvec, key->co, (key-1)->co);
- sub_v3_v3v3(dvec,vec,dvec);
- mul_v3_fl(dvec,data->smoothfac);
+ sub_v3_v3v3(dvec, vec, dvec);
+ mul_v3_fl(dvec, data->smoothfac);
add_v3_v3(key->co, dvec);
}
@@ -3063,7 +3063,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
MFace *mface= NULL;
MVert *mvert= NULL;
int i, totface, intersect=0;
- float cur_d, cur_uv[2], v1[3], v2[3], v3[3], v4[3], min[3], max[3], p_min[3],p_max[3];
+ float cur_d, cur_uv[2], v1[3], v2[3], v3[3], v4[3], min[3], max[3], p_min[3], p_max[3];
float cur_ipoint[3];
if (dm == NULL) {
@@ -3084,50 +3084,50 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
if (pa_minmax==0) {
- INIT_MINMAX(p_min,p_max);
- DO_MINMAX(co1,p_min,p_max);
- DO_MINMAX(co2,p_min,p_max);
+ INIT_MINMAX(p_min, p_max);
+ DO_MINMAX(co1, p_min, p_max);
+ DO_MINMAX(co2, p_min, p_max);
}
else {
- copy_v3_v3(p_min,pa_minmax);
- copy_v3_v3(p_max,pa_minmax+3);
+ copy_v3_v3(p_min, pa_minmax);
+ copy_v3_v3(p_max, pa_minmax+3);
}
totface=dm->getNumTessFaces(dm);
- mface=dm->getTessFaceDataArray(dm,CD_MFACE);
- mvert=dm->getVertDataArray(dm,CD_MVERT);
+ mface=dm->getTessFaceDataArray(dm, CD_MFACE);
+ mvert=dm->getVertDataArray(dm, CD_MVERT);
/* lets intersect the faces */
- for (i=0; i<totface; i++,mface++) {
+ for (i=0; i<totface; i++, mface++) {
if (vert_cos) {
- copy_v3_v3(v1,vert_cos+3*mface->v1);
- copy_v3_v3(v2,vert_cos+3*mface->v2);
- copy_v3_v3(v3,vert_cos+3*mface->v3);
+ copy_v3_v3(v1, vert_cos+3*mface->v1);
+ copy_v3_v3(v2, vert_cos+3*mface->v2);
+ copy_v3_v3(v3, vert_cos+3*mface->v3);
if (mface->v4)
- copy_v3_v3(v4,vert_cos+3*mface->v4);
+ copy_v3_v3(v4, vert_cos+3*mface->v4);
}
else {
- copy_v3_v3(v1,mvert[mface->v1].co);
- copy_v3_v3(v2,mvert[mface->v2].co);
- copy_v3_v3(v3,mvert[mface->v3].co);
+ copy_v3_v3(v1, mvert[mface->v1].co);
+ copy_v3_v3(v2, mvert[mface->v2].co);
+ copy_v3_v3(v3, mvert[mface->v3].co);
if (mface->v4)
- copy_v3_v3(v4,mvert[mface->v4].co);
+ copy_v3_v3(v4, mvert[mface->v4].co);
}
if (face_minmax==0) {
- INIT_MINMAX(min,max);
- DO_MINMAX(v1,min,max);
- DO_MINMAX(v2,min,max);
- DO_MINMAX(v3,min,max);
+ INIT_MINMAX(min, max);
+ DO_MINMAX(v1, min, max);
+ DO_MINMAX(v2, min, max);
+ DO_MINMAX(v3, min, max);
if (mface->v4)
DO_MINMAX(v4, min, max);
- if (isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
+ if (isect_aabb_aabb_v3(min, max, p_min, p_max)==0)
continue;
}
else {
copy_v3_v3(min, face_minmax+6*i);
copy_v3_v3(max, face_minmax+6*i+3);
- if (isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
+ if (isect_aabb_aabb_v3(min, max, p_min, p_max)==0)
continue;
}
@@ -3135,7 +3135,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
if (isect_sweeping_sphere_tri_v3(co1, co2, radius, v2, v3, v1, &cur_d, cur_ipoint)) {
if (cur_d<*min_d) {
*min_d=cur_d;
- copy_v3_v3(ipoint,cur_ipoint);
+ copy_v3_v3(ipoint, cur_ipoint);
*min_face=i;
intersect=1;
}
@@ -3144,7 +3144,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
if (isect_sweeping_sphere_tri_v3(co1, co2, radius, v4, v1, v3, &cur_d, cur_ipoint)) {
if (cur_d<*min_d) {
*min_d=cur_d;
- copy_v3_v3(ipoint,cur_ipoint);
+ copy_v3_v3(ipoint, cur_ipoint);
*min_face=i;
intersect=1;
}
@@ -3190,8 +3190,8 @@ static int brush_add(PEData *data, short number)
Object *ob= data->ob;
PTCacheEdit *edit = data->edit;
ParticleSystem *psys= edit->psys;
- ParticleData *add_pars= MEM_callocN(number*sizeof(ParticleData),"ParticleData add");
- ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys);
+ ParticleData *add_pars= MEM_callocN(number*sizeof(ParticleData), "ParticleData add");
+ ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
ParticleSimulationData sim= {0};
ParticleEditSettings *pset= PE_settings(scene);
int i, k, n= 0, totpart= psys->totpart;
@@ -3202,7 +3202,7 @@ static int brush_add(PEData *data, short number)
short size= pset->brush[PE_BRUSH_ADD].size;
short size2= size*size;
DerivedMesh *dm=0;
- invert_m4_m4(imat,ob->obmat);
+ invert_m4_m4(imat, ob->obmat);
if (psys->flag & PSYS_GLOBAL_HAIR)
return 0;
@@ -3235,13 +3235,13 @@ static int brush_add(PEData *data, short number)
mco[1]= data->mval[1] + dmy;
ED_view3d_win_to_segment_clip(data->vc.ar, data->vc.v3d, mco, co1, co2);
- mul_m4_v3(imat,co1);
- mul_m4_v3(imat,co2);
+ mul_m4_v3(imat, co1);
+ mul_m4_v3(imat, co2);
min_d=2.0;
/* warning, returns the derived mesh face */
- if (particle_intersect_dm(scene, ob,dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)) {
- add_pars[n].num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,add_pars[n].num,add_pars[n].fuv,NULL);
+ if (particle_intersect_dm(scene, ob, dm, 0, co1, co2, &min_d, &add_pars[n].num, add_pars[n].fuv, 0, 0, 0, 0)) {
+ add_pars[n].num_dmcache= psys_particle_dm_face_lookup(ob, psmd->dm, add_pars[n].num, add_pars[n].fuv, NULL);
n++;
}
}
@@ -3249,8 +3249,8 @@ static int brush_add(PEData *data, short number)
int newtotpart=totpart+n;
float hairmat[4][4], cur_co[3];
KDTree *tree=0;
- ParticleData *pa, *new_pars= MEM_callocN(newtotpart*sizeof(ParticleData),"ParticleData new");
- PTCacheEditPoint *point, *new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint),"PTCacheEditPoint array new");
+ ParticleData *pa, *new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new");
+ PTCacheEditPoint *point, *new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint), "PTCacheEditPoint array new");
PTCacheEditKey *key;
HairKey *hkey;
@@ -3275,7 +3275,7 @@ static int brush_add(PEData *data, short number)
tree=BLI_kdtree_new(psys->totpart);
for (i=0, pa=psys->particles; i<totpart; i++, pa++) {
- psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,cur_co,0,0,0,0,0);
+ psys_particle_on_dm(psmd->dm, psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, cur_co, 0, 0, 0, 0, 0);
BLI_kdtree_insert(tree, i, cur_co, NULL);
}
@@ -3303,7 +3303,7 @@ static int brush_add(PEData *data, short number)
}
pa->size= 1.0f;
- initialize_particle(&sim, pa,i);
+ initialize_particle(&sim, pa, i);
reset_particle(&sim, pa, 0.0, 1.0);
point->flag |= PEP_EDIT_RECALC;
if (pe_x_mirror(ob))
@@ -3319,8 +3319,8 @@ static int brush_add(PEData *data, short number)
int w, maxw;
float maxd, totw=0.0, weight[3];
- psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co1,0,0,0,0,0);
- maxw= BLI_kdtree_find_n_nearest(tree,3,co1,NULL,ptn);
+ psys_particle_on_dm(psmd->dm, psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co1, 0, 0, 0, 0, 0);
+ maxw= BLI_kdtree_find_n_nearest(tree, 3, co1, NULL, ptn);
maxd= ptn[maxw-1].dist;
@@ -3379,7 +3379,7 @@ static int brush_add(PEData *data, short number)
}
for (k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) {
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
- invert_m4_m4(imat,hairmat);
+ invert_m4_m4(imat, hairmat);
mul_m4_v3(imat, hkey->co);
}
}
@@ -3635,7 +3635,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
if (pset->brushtype == PE_BRUSH_ADD && pe_x_mirror(ob))
PE_mirror_x(scene, ob, 1);
- update_world_cos(ob,edit);
+ update_world_cos(ob, edit);
psys_free_path_cache(NULL, edit);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
@@ -3931,7 +3931,7 @@ void PE_undo_push(Scene *scene, const char *str)
}
/* copy */
- make_PTCacheUndo(edit,edit->curundo);
+ make_PTCacheUndo(edit, edit->curundo);
}
void PE_undo_step(Scene *scene, int step)
@@ -3941,7 +3941,7 @@ void PE_undo_step(Scene *scene, int step)
if (!edit) return;
if (step==0) {
- get_PTCacheUndo(edit,edit->curundo);
+ get_PTCacheUndo(edit, edit->curundo);
}
else if (step==1) {
@@ -4100,7 +4100,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
totpoint = psys ? psys->totpart : (int)((PTCacheMem*)cache->mem_cache.first)->totpoint;
edit= MEM_callocN(sizeof(PTCacheEdit), "PE_create_particle_edit");
- edit->points=MEM_callocN(totpoint*sizeof(PTCacheEditPoint),"PTCacheEditPoints");
+ edit->points=MEM_callocN(totpoint*sizeof(PTCacheEditPoint), "PTCacheEditPoints");
edit->totpoint = totpoint;
if (psys && !cache) {
@@ -4115,7 +4115,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
pa = psys->particles;
LOOP_POINTS {
point->totkey = pa->totkey;
- point->keys= MEM_callocN(point->totkey*sizeof(PTCacheEditKey),"ParticleEditKeys");
+ point->keys= MEM_callocN(point->totkey*sizeof(PTCacheEditKey), "ParticleEditKeys");
point->flag |= PEP_EDIT_RECALC;
hkey = pa->hair;
@@ -4151,7 +4151,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache,
continue;
if (!point->totkey) {
- key = point->keys = MEM_callocN(totframe*sizeof(PTCacheEditKey),"ParticleEditKeys");
+ key = point->keys = MEM_callocN(totframe*sizeof(PTCacheEditKey), "ParticleEditKeys");
point->flag |= PEP_EDIT_RECALC;
}
else
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 3d50ec26a40..3764866cb7f 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -532,7 +532,7 @@ void PARTICLE_OT_dupliob_move_down(wmOperatorType *ot)
static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
{
- ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
+ ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
ParticleEditSettings *pset= PE_settings(scene);
ParticleData *pa;
PTCacheEdit *edit;
@@ -551,7 +551,7 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
edit = psys->edit;
point= edit ? edit->points : NULL;
- for (i=0, pa=psys->particles; i<psys->totpart; i++,pa++) {
+ for (i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
if (point) {
ekey = point->keys;
point++;
@@ -559,8 +559,8 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
- for (k=0,key=pa->hair; k<pa->totkey; k++,key++) {
- mul_m4_v3(hairmat,key->co);
+ for (k=0, key=pa->hair; k<pa->totkey; k++, key++) {
+ mul_m4_v3(hairmat, key->co);
if (ekey) {
ekey->flag &= ~PEK_USE_WCO;
@@ -622,7 +622,7 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
{
- ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
+ ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
ParticleData *pa;
PTCacheEdit *edit;
PTCacheEditPoint *point;
@@ -661,7 +661,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6);
- for (i=0, pa= psys->particles; i<psys->totpart; i++,pa++) {
+ for (i=0, pa= psys->particles; i<psys->totpart; i++, pa++) {
key = pa->hair;
nearest.index = -1;
@@ -675,23 +675,23 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
continue;
}
- mface = CDDM_get_tessface(dm,nearest.index);
+ mface = CDDM_get_tessface(dm, nearest.index);
- copy_v3_v3(v[0], CDDM_get_vert(dm,mface->v1)->co);
- copy_v3_v3(v[1], CDDM_get_vert(dm,mface->v2)->co);
- copy_v3_v3(v[2], CDDM_get_vert(dm,mface->v3)->co);
+ copy_v3_v3(v[0], CDDM_get_vert(dm, mface->v1)->co);
+ copy_v3_v3(v[1], CDDM_get_vert(dm, mface->v2)->co);
+ copy_v3_v3(v[2], CDDM_get_vert(dm, mface->v3)->co);
if (mface->v4) {
- copy_v3_v3(v[3], CDDM_get_vert(dm,mface->v4)->co);
- interp_weights_poly_v3( pa->fuv,v, 4, nearest.co);
+ copy_v3_v3(v[3], CDDM_get_vert(dm, mface->v4)->co);
+ interp_weights_poly_v3( pa->fuv, v, 4, nearest.co);
}
else
- interp_weights_poly_v3( pa->fuv,v, 3, nearest.co);
+ interp_weights_poly_v3( pa->fuv, v, 3, nearest.co);
pa->num = nearest.index;
- pa->num_dmcache = psys_particle_dm_face_lookup(ob,psmd->dm,pa->num,pa->fuv,NULL);
+ pa->num_dmcache = psys_particle_dm_face_lookup(ob, psmd->dm, pa->num, pa->fuv, NULL);
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
- invert_m4_m4(imat,hairmat);
+ invert_m4_m4(imat, hairmat);
sub_v3_v3v3(vec, nearest.co, key->co);
@@ -700,9 +700,9 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
point++;
}
- for (k=0,key=pa->hair; k<pa->totkey; k++,key++) {
+ for (k=0, key=pa->hair; k<pa->totkey; k++, key++) {
add_v3_v3(key->co, vec);
- mul_m4_v3(imat,key->co);
+ mul_m4_v3(imat, key->co);
if (ekey) {
ekey->flag |= PEK_USE_WCO;
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index c0d3e505873..9b637824b3e 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -150,8 +150,8 @@ static int fluid_is_animated_mesh(FluidsimSettings *fss)
/* helper function */
void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname)
{
- //BLI_snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name);
- BLI_snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name);
+ //BLI_snprintf(dst, FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name);
+ BLI_snprintf(dst, FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name);
}
#endif
@@ -199,7 +199,7 @@ typedef struct FluidObject {
#if 0
static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char *str, int entries)
{
- int i,j;
+ int i, j;
int channelSize = paramsize;
if (entries==3) {
@@ -214,12 +214,12 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
fprintf(file, " CHANNEL %s =\n", str);
for (i=0; i<channelSize;i++) {
- fprintf(file," ");
+ fprintf(file, " ");
for (j=0;j<=entries;j++) { // also print time value
- fprintf(file," %f ", channel[i*(entries+1)+j] );
- if (j==entries-1) { fprintf(file," "); }
+ fprintf(file, " %f ", channel[i*(entries+1)+j] );
+ if (j==entries-1) { fprintf(file, " "); }
}
- fprintf(file,"\n");
+ fprintf(file, "\n");
}
fprintf(file, " ;\n" );
@@ -679,7 +679,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
if (fileCfg) {
dirExist = 1; fclose(fileCfg);
// remove cfg dummy from directory test
- BLI_delete(targetFile, 0,0);
+ BLI_delete(targetFile, 0, 0);
}
if (targetDir[0] == '\0' || (!dirExist)) {
@@ -691,7 +691,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
BLI_splitdirstring(blendDir, blendFile);
BLI_replace_extension(blendFile, FILE_MAX, ""); /* strip .blend */
- BLI_snprintf(newSurfdataPath, FILE_MAX ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
+ BLI_snprintf(newSurfdataPath, FILE_MAX, "//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
BLI_snprintf(debugStrBuffer, 256, "fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath);
elbeemDebugOut(debugStrBuffer);
@@ -703,7 +703,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
if (outStringsChanged) {
char dispmsg[FILE_MAX+256];
int selection=0;
- BLI_strncpy(dispmsg,"Output settings set to: '", sizeof(dispmsg));
+ BLI_strncpy(dispmsg, "Output settings set to: '", sizeof(dispmsg));
strcat(dispmsg, newSurfdataPath);
strcat(dispmsg, "'%t|Continue with changed settings%x1|Discard and abort%x0");
@@ -792,7 +792,7 @@ int runSimulationCallback(void *data, int status, int frame)
if (status == FLUIDSIM_CBSTATUS_NEWFRAME) {
fluidbake_updatejob(fb, frame / (float)settings->noOfFrames);
- //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d\n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG
+ //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d\n", status, frame, settings->domainId, settings->noOfFrames ); // DEBUG
}
if (fluidbake_breakjob(fb)) {
@@ -898,7 +898,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
if (getenv(strEnvName)) {
int dlevel = atoi(getenv(strEnvName));
elbeemSetDebugLevel(dlevel);
- BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName);
+ BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::msg: Debug messages activated due to envvar '%s'\n", strEnvName);
elbeemDebugOut(debugStrBuffer);
}
@@ -935,7 +935,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* rough check of settings... */
if (domainSettings->previewresxyz > domainSettings->resolutionxyz) {
- BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz);
+ BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz, domainSettings->resolutionxyz);
elbeemDebugOut(debugStrBuffer);
domainSettings->previewresxyz = domainSettings->resolutionxyz;
}
@@ -958,7 +958,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
else {
gridlevels = domainSettings->maxRefine;
}
- BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels );
+ BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name, gridlevels );
elbeemDebugOut(debugStrBuffer);
@@ -978,7 +978,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* ******** init domain object's matrix ******** */
copy_m4_m4(domainMat, fsDomain->obmat);
if (!invert_m4_m4(invDomMat, domainMat)) {
- BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::error - Invalid obj matrix?\n");
+ BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::error - Invalid obj matrix?\n");
elbeemDebugOut(debugStrBuffer);
BKE_report(reports, RPT_ERROR, "Invalid object matrix");
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index f9737b02a01..cb98c8283eb 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -348,7 +348,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
oglrender->is_sequencer = is_sequencer;
if (is_sequencer) {
- oglrender->sseq = CTX_wm_space_seq(C);;
+ oglrender->sseq = CTX_wm_space_seq(C);
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 2a561a6bc6c..8a43e15eb9f 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -84,19 +84,19 @@ static void region_draw_emboss(ARegion *ar, rcti *scirct)
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
/* right */
- glColor4ub(0,0,0, 30);
+ glColor4ub(0, 0, 0, 30);
sdrawline(rect.xmax, rect.ymin, rect.xmax, rect.ymax);
/* bottom */
- glColor4ub(0,0,0, 30);
+ glColor4ub(0, 0, 0, 30);
sdrawline(rect.xmin, rect.ymin, rect.xmax, rect.ymin);
/* top */
- glColor4ub(255,255,255, 30);
+ glColor4ub(255, 255, 255, 30);
sdrawline(rect.xmin, rect.ymax, rect.xmax, rect.ymax);
/* left */
- glColor4ub(255,255,255, 30);
+ glColor4ub(255, 255, 255, 30);
sdrawline(rect.xmin, rect.ymin, rect.xmin, rect.ymax);
glDisable( GL_BLEND );
@@ -1530,17 +1530,17 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
if (sa->flag & HEADER_NO_PULLDOWN) {
but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
- ICON_DISCLOSURE_TRI_RIGHT,
- xco,yco,UI_UNIT_X,UI_UNIT_Y-2,
- &(sa->flag), 0, 0, 0, 0,
- "Show pulldown menus");
+ ICON_DISCLOSURE_TRI_RIGHT,
+ xco, yco, UI_UNIT_X, UI_UNIT_Y - 2,
+ &(sa->flag), 0, 0, 0, 0,
+ "Show pulldown menus");
}
else {
but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
- ICON_DISCLOSURE_TRI_DOWN,
- xco,yco,UI_UNIT_X,UI_UNIT_Y-2,
- &(sa->flag), 0, 0, 0, 0,
- "Hide pulldown menus");
+ ICON_DISCLOSURE_TRI_DOWN,
+ xco, yco, UI_UNIT_X, UI_UNIT_Y - 2,
+ &(sa->flag), 0, 0, 0, 0,
+ "Hide pulldown menus");
}
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
@@ -1803,7 +1803,7 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
rect.ymax = ar->winrct.ymax - ar->winrct.ymin;
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.0f, 0.0f, 0.0f, alpha);
glRecti(rect.xmin, rect.ymin, rect.xmax+1, rect.ymax+1);
glDisable(GL_BLEND);
@@ -1820,7 +1820,7 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
float fac, blendfac;
int x1, y1, x2, y2;
- /* the image is located inside (0,0),(1, 1) as set by view2d */
+ /* the image is located inside (0, 0), (1, 1) as set by view2d */
UI_ThemeColorShade(TH_BACK, 20);
UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x1, &y1);
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 5b73645abde..50430399f09 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -81,14 +81,14 @@ GLubyte stipple_halftone[128] = {
GLubyte stipple_quarttone[128] = {
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0};
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0,
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0,
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0,
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0,
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0,
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0,
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0,
+ 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0};
GLubyte stipple_diag_stripes_pos[128] = {
@@ -195,16 +195,15 @@ void fdrawcheckerboard(float x1, float y1, float x2, float y2)
{
unsigned char col1[4]= {40, 40, 40}, col2[4]= {50, 50, 50};
- GLubyte checker_stipple[32*32/8] = {
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
- 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
- };
+ GLubyte checker_stipple[32 * 32 / 8] = {
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255,
+ 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255};
glColor3ubv(col1);
glRectf(x1, y1, x2, y2);
@@ -370,8 +369,8 @@ void fdrawXORellipse(float xofs, float yofs, float hw, float hh)
set_inverted_drawing(1);
glPushMatrix();
- glTranslatef(xofs, yofs, 0.0);
- glScalef(1,hh/hw,1);
+ glTranslatef(xofs, yofs, 0.0f);
+ glScalef(1.0f, hh / hw, 1.0f);
glutil_draw_lined_arc(0.0, M_PI*2.0, hw, 20);
glPopMatrix();
@@ -786,10 +785,10 @@ void glaEnd2DDraw(gla2DDrawInfo *di)
static int curmode=0;
static int pointhack=0;
-static GLubyte Squaredot[16] = { 0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff};
+static GLubyte Squaredot[16] = {0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff};
void bglBegin(int mode)
{
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 3777547fa90..49672b77d43 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1505,13 +1505,13 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event)
RNA_enum_set(op->ptr, "direction", 'h');
sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_H;
- WM_cursor_set(CTX_wm_window(C),CURSOR_X_MOVE);
+ WM_cursor_set(CTX_wm_window(C), CURSOR_X_MOVE);
}
else {
RNA_enum_set(op->ptr, "direction", 'v');
sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_V;
- WM_cursor_set(CTX_wm_window(C),CURSOR_Y_MOVE);
+ WM_cursor_set(CTX_wm_window(C), CURSOR_Y_MOVE);
}
}
}
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 36b38661463..10db1bb1f12 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -279,7 +279,7 @@ static int get_file_icon(struct direntry *file)
static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, int width, int height)
{
uiBut *but;
- int x,y;
+ int x, y;
/*float alpha=1.0f;*/
x = sx;
@@ -301,7 +301,7 @@ static void file_draw_string(int sx, int sy, const char* string, float width, in
fs.align = align;
- BLI_strncpy(fname,string, FILE_MAXFILE);
+ BLI_strncpy(fname, string, FILE_MAXFILE);
file_shorten_string(fname, width + 1.0f, 0);
/* no text clipping needed, uiStyleFontDraw does it but is a bit too strict (for buttons it works) */
@@ -512,7 +512,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
is_icon = 0;
imb = filelist_getimage(files, i);
if (!imb) {
- imb = filelist_geticon(files,i);
+ imb = filelist_geticon(files, i);
is_icon = 1;
}
@@ -526,8 +526,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
UI_ThemeColor4(TH_TEXT);
if (file->selflag & EDITING_FILE) {
- uiBut *but = uiDefBut(block, TEX, 1, "", sx , sy-layout->tile_h-3,
- textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit),0,0,"");
+ uiBut *but = uiDefBut(block, TEX, 1, "", sx, sy-layout->tile_h-3,
+ textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit), 0, 0, "");
uiButSetRenameFunc(but, renamebutton_cb, file);
uiButSetFlag(but, UI_BUT_NO_UTF8); /* allow non utf8 names */
uiButClearFlag(but, UI_BUT_UNDO);
@@ -562,14 +562,14 @@ void file_draw_list(const bContext *C, ARegion *ar)
file_draw_string(sx, sy, file->mode3, layout->column_widths[COLUMN_MODE3], layout->tile_h, align);
sx += layout->column_widths[COLUMN_MODE3] + 12;
- file_draw_string(sx, sy, file->owner, layout->column_widths[COLUMN_OWNER] , layout->tile_h, align);
+ file_draw_string(sx, sy, file->owner, layout->column_widths[COLUMN_OWNER], layout->tile_h, align);
sx += layout->column_widths[COLUMN_OWNER] + 12;
#endif
file_draw_string(sx, sy, file->date, layout->column_widths[COLUMN_DATE], layout->tile_h, align);
sx += (int)layout->column_widths[COLUMN_DATE] + 12;
- file_draw_string(sx, sy, file->time, layout->column_widths[COLUMN_TIME] , layout->tile_h, align);
+ file_draw_string(sx, sy, file->time, layout->column_widths[COLUMN_TIME], layout->tile_h, align);
sx += (int)layout->column_widths[COLUMN_TIME] + 12;
if (!(file->type & S_IFDIR)) {
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index 9455f6390f7..d3598ffd4e7 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -88,7 +88,7 @@ int file_previous_exec(bContext *C, struct wmOperator *unused);
int file_next_exec(bContext *C, struct wmOperator *unused);
int file_filename_exec(bContext *C, struct wmOperator *unused);
int file_directory_exec(bContext *C, struct wmOperator *unused);
-int file_directory_new_exec(bContext *C,struct wmOperator *unused);
+int file_directory_new_exec(bContext *C, struct wmOperator *unused);
int file_delete_exec(bContext *C, struct wmOperator *unused);
int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index aa1ab823ee1..f340c53f528 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -73,7 +73,7 @@
static FileSelection find_file_mouse_rect(SpaceFile *sfile, struct ARegion* ar, const rcti* rect)
{
FileSelection sel;
- float fxmin,fymin,fxmax, fymax;
+ float fxmin, fymin, fxmax, fymax;
View2D* v2d = &ar->v2d;
rcti rect_view;
@@ -1035,7 +1035,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
SpaceFile *sfile= CTX_wm_space_file(C);
if (!sfile->params) {
- BKE_report(op->reports,RPT_WARNING, "No parent directory given");
+ BKE_report(op->reports, RPT_WARNING, "No parent directory given");
return OPERATOR_CANCELLED;
}
@@ -1049,7 +1049,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
if (generate_name) {
/* create a new, non-existing folder name */
if (!new_folder_path(sfile->params->dir, path, name)) {
- BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder name");
+ BKE_report(op->reports, RPT_ERROR, "Couldn't create new folder name");
return OPERATOR_CANCELLED;
}
}
@@ -1058,7 +1058,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
BLI_dir_create_recursive(path);
if (!BLI_exists(path)) {
- BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder");
+ BKE_report(op->reports, RPT_ERROR, "Couldn't create new folder");
return OPERATOR_CANCELLED;
}
@@ -1330,7 +1330,7 @@ void FILE_OT_filenum(struct wmOperatorType *ot)
ot->poll = ED_operator_file_active; /* <- important, handler is on window level */
/* props */
- RNA_def_int(ot->srna, "increment", 1, -100, 100, "Increment", "", -100,100);
+ RNA_def_int(ot->srna, "increment", 1, -100, 100, "Increment", "", -100, 100);
}
static int file_rename_exec(bContext *C, wmOperator *UNUSED(op))
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 596721bff07..9fe1940e87b 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -116,7 +116,7 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
BLI_strncpy(dir, entry, FILE_MAX);
/* create list item */
- but = uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0,0,UI_UNIT_X*10,UI_UNIT_Y, nr, 0, i, 0, 0, entry);
+ but = uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, nr, 0, i, 0, 0, entry);
uiButSetFunc(but, file_panel_cb, entry, NULL);
uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT);
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index a05eba2daeb..c72d95f63a7 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -179,7 +179,7 @@ static int compare_name(const void *a1, const void *a2)
if ( strcmp(entry1->relname, "..")==0 ) return (-1);
if ( strcmp(entry2->relname, "..")==0 ) return (1);
- return (BLI_natstrcmp(entry1->relname,entry2->relname));
+ return (BLI_natstrcmp(entry1->relname, entry2->relname));
}
static int compare_date(const void *a1, const void *a2)
@@ -212,7 +212,7 @@ static int compare_date(const void *a1, const void *a2)
if ( entry1->s.st_mtime < entry2->s.st_mtime) return 1;
if ( entry1->s.st_mtime > entry2->s.st_mtime) return -1;
- else return BLI_natstrcmp(entry1->relname,entry2->relname);
+ else return BLI_natstrcmp(entry1->relname, entry2->relname);
}
static int compare_size(const void *a1, const void *a2)
@@ -244,7 +244,7 @@ static int compare_size(const void *a1, const void *a2)
if ( entry1->s.st_size < entry2->s.st_size) return 1;
if ( entry1->s.st_size > entry2->s.st_size) return -1;
- else return BLI_natstrcmp(entry1->relname,entry2->relname);
+ else return BLI_natstrcmp(entry1->relname, entry2->relname);
}
static int compare_extension(const void *a1, const void *a2)
@@ -456,7 +456,7 @@ void folderlist_pushdir(ListBase* folderlist, const char *dir)
}
// create next folder element
- folder = (FolderList*)MEM_mallocN(sizeof(FolderList),"FolderList");
+ folder = (FolderList*)MEM_mallocN(sizeof(FolderList), "FolderList");
folder->foldername = (char*)MEM_mallocN(sizeof(char)*(strlen(dir)+1), "foldername");
folder->foldername[0] = '\0';
@@ -1144,7 +1144,7 @@ void filelist_from_main(struct FileList *filelist)
filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry));
for (a=0; a<filelist->numfiles; a++) {
- memset( &(filelist->filelist[a]), 0 , sizeof(struct direntry));
+ memset( &(filelist->filelist[a]), 0, sizeof(struct direntry));
filelist->filelist[a].type |= S_IFDIR;
}
@@ -1198,7 +1198,7 @@ void filelist_from_main(struct FileList *filelist)
files = filelist->filelist;
if (!filelist->hide_parent) {
- memset( &(filelist->filelist[0]), 0 , sizeof(struct direntry));
+ memset( &(filelist->filelist[0]), 0, sizeof(struct direntry));
filelist->filelist[0].relname= BLI_strdup("..");
filelist->filelist[0].type |= S_IFDIR;
@@ -1212,7 +1212,7 @@ void filelist_from_main(struct FileList *filelist)
ok = 1;
if (ok) {
if (!filelist->hide_dot || id->name[2] != '.') {
- memset( files, 0 , sizeof(struct direntry));
+ memset(files, 0, sizeof(struct direntry));
if (id->lib==NULL)
files->relname= BLI_strdup(id->name+2);
else {
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index a4da1975c56..0c94bff8803 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -315,7 +315,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
/* Adding Desktop and My Documents */
SHGetSpecialFolderPath(0, line, CSIDL_PERSONAL, 0);
- fsmenu_insert_entry(fsmenu,FS_CATEGORY_BOOKMARKS, line, 1, 0);
+ fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0);
SHGetSpecialFolderPath(0, line, CSIDL_DESKTOPDIRECTORY, 0);
fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0);
}
@@ -399,7 +399,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
pathString = CFURLCopyFileSystemPath(cfURL, kCFURLPOSIXPathStyle);
- if (!CFStringGetCString(pathString,line,256,kCFStringEncodingASCII))
+ if (!CFStringGetCString(pathString, line, 256, kCFStringEncodingASCII))
continue;
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, 1, 0);
@@ -448,7 +448,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
pathString = CFURLCopyFileSystemPath(cfURL, kCFURLPOSIXPathStyle);
- if (!CFStringGetCString(pathString,line,256,kCFStringEncodingASCII))
+ if (!CFStringGetCString(pathString, line, 256, kCFStringEncodingASCII))
continue;
fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0);
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index e166914b36f..dac5d1e1347 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -218,7 +218,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
}
else {
if (params->display == FILE_IMGDISPLAY) {
- if (!thumbnails_running(sfile->files,C)) {
+ if (!thumbnails_running(sfile->files, C)) {
thumbnails_start(sfile->files, C);
}
}
@@ -432,12 +432,12 @@ static void file_keymap(struct wmKeyConfig *keyconf)
RNA_int_set(kmi->ptr, "increment", 10);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
RNA_int_set(kmi->ptr, "increment", 100);
- kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0,0);
+ kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0, 0);
RNA_int_set(kmi->ptr, "increment", -1);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT, 0);
RNA_int_set(kmi->ptr, "increment", -10);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL, 0);
- RNA_int_set(kmi->ptr, "increment",-100);
+ RNA_int_set(kmi->ptr, "increment", -100);
/* keys for button area (top) */
@@ -450,10 +450,10 @@ static void file_keymap(struct wmKeyConfig *keyconf)
RNA_int_set(kmi->ptr, "increment", 100);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0, 0);
RNA_int_set(kmi->ptr, "increment", -1);
- kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT,0);
+ kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT, 0);
RNA_int_set(kmi->ptr, "increment", -10);
- kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL,0);
- RNA_int_set(kmi->ptr, "increment",-100);
+ kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL, 0);
+ RNA_int_set(kmi->ptr, "increment", -100);
}
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index cac4fe04765..1e976cebafd 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -198,7 +198,7 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
bActuator *act = ptr.data;
Object *ob = ptr.id.data;
- RNA_string_set(op->ptr, "actuator",act->name);
+ RNA_string_set(op->ptr, "actuator", act->name);
RNA_string_set(op->ptr, "object", ob->id.name+2);
return 1;
}
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 9f5ae19d92c..cd01b52ddcc 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1181,9 +1181,9 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
ts= sens->data;
- // uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property");
- uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material");
- // uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity");
+ // uiDefBut(block, TEX, 1, "Property:", xco, yco-22, width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property");
+ uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:", (short)(xco + 10), (short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material");
+ // uiDefButF(block, NUM, 1, "Margin:", xco+width/2, yco-44, width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity");
yco-= ysize;
break;
}
@@ -1200,11 +1200,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
/* The collision sensor will become a generic collision (i.e. it */
/* absorb the old touch sensor). */
- uiDefButBitS(block, TOG, SENS_COLLISION_PULSE, B_REDR, "Pulse",(short)(xco + 10),(short)(yco - 44),
+ uiDefButBitS(block, TOG, SENS_COLLISION_PULSE, B_REDR, "Pulse", (short)(xco + 10), (short)(yco - 44),
(short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0,
"Changes to the set of colliding objects generated pulses");
- uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",(short)(xco + 10 + (0.20 * (width-20))),(short)(yco - 44),
+ uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P", (short)(xco + 10 + (0.20 * (width-20))), (short)(yco - 44),
(short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0,
"Toggle collision on material or property");
@@ -1219,7 +1219,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
"Only look for Objects with this property");
}
- /* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90,yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */
+ /* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90, yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */
yco-= ysize;
break;
@@ -1234,11 +1234,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
draw_default_sensor_header(sens, block, xco, yco, width);
ns= sens->data;
- uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19,
+ uiDefBut(block, TEX, 1, "Property:", (short)(10+xco), (short)(yco-44), (short)(width-20), 19,
&ns->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property");
- uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19,
+ uiDefButF(block, NUM, 1, "Dist", (short)(10+xco), (short)(yco-68), (short)((width-22)/2), 19,
&ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance");
- uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19,
+ uiDefButF(block, NUM, 1, "Reset", (short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19,
&ns->resetdist, 0.0, 1000.0, 1000, 0, "Reset distance");
yco-= ysize;
break;
@@ -1255,7 +1255,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
rs= sens->data;
uiDefBut(block, TEX, 1, "Prop:",
- (short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19,
+ (short)(10+xco), (short)(yco-44), (short)(0.7 * (width-20)), 19,
&rs->name, 0, MAX_NAME, 0, 0,
"Only look for Objects with this property");
@@ -1338,25 +1338,25 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
str= "Type %t|Equal %x0|Not Equal %x1|Interval %x2|Changed %x3";
/* str= "Type %t|Equal %x0|Not Equal %x1"; */
- uiDefButI(block, MENU, B_REDR, str, xco+30,yco-44,width-60, 19,
+ uiDefButI(block, MENU, B_REDR, str, xco+30, yco-44, width-60, 19,
&ps->type, 0, 31, 0, 0, "Type");
if (ps->type != SENS_PROP_EXPRESSION) {
- uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19,
+ uiDefBut(block, TEX, 1, "Prop: ", xco+30, yco-68, width-60, 19,
ps->name, 0, MAX_NAME, 0, 0, "Property name");
}
if (ps->type == SENS_PROP_INTERVAL) {
- uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19,
+ uiDefBut(block, TEX, 1, "Min: ", xco, yco-92, width/2, 19,
ps->value, 0, MAX_NAME, 0, 0, "check for min value");
- uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19,
+ uiDefBut(block, TEX, 1, "Max: ", xco+width/2, yco-92, width/2, 19,
ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value");
}
else if (ps->type == SENS_PROP_CHANGED) {
/* pass */
}
else {
- uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19,
+ uiDefBut(block, TEX, 1, "Value: ", xco+30, yco-92, width-60, 19,
ps->value, 0, MAX_NAME, 0, 0, "check for value");
}
@@ -1390,11 +1390,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
str= "Type %t|State changed %x0|Lin error below %x1|Lin error above %x2|Rot error below %x3|Rot error above %x4";
- uiDefButI(block, MENU, B_REDR, str, xco+10,yco-66,0.4*(width-20), 19,
+ uiDefButI(block, MENU, B_REDR, str, xco+10, yco-66, 0.4*(width-20), 19,
&arm->type, 0, 31, 0, 0, "Type");
if (arm->type != SENS_ARM_STATE_CHANGED) {
- uiDefButF(block, NUM, 1, "Value: ", xco+10+0.4*(width-20),yco-66,0.6*(width-20), 19,
+ uiDefButF(block, NUM, 1, "Value: ", xco+10+0.4*(width-20), yco-66, 0.6*(width-20), 19,
&arm->value, -10000.0, 10000.0, 100, 0, "Test the error against this value");
}
}
@@ -1412,7 +1412,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
draw_default_sensor_header(sens, block, xco, yco, width);
as= sens->data;
- uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19,
+ uiDefBut(block, TEX, 1, "Act: ", xco+30, yco-44, width-60, 19,
as->name, 0, MAX_NAME, 0, 0, "Actuator name, actuator active state modifications will be detected");
yco-= ysize;
break;
@@ -1428,11 +1428,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
draw_default_sensor_header(sens, block, xco, yco, width);
ds = sens->data;
- uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19,
+ uiDefButS(block, NUM, 0, "Delay", (short)(10+xco), (short)(yco-44), (short)((width-22)*0.4+10), 19,
&ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of logic tics before the positive trigger (default 60 per second)");
- uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19,
+ uiDefButS(block, NUM, 0, "Dur", (short)(10+xco+(width-22)*0.4+10), (short)(yco-44), (short)((width-22)*0.4-10), 19,
&ds->duration, 0.0, 5000.0, 0, 0, "If >0, delay in number of logic tics before the negative trigger following the positive trigger");
- uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP",(short)(xco + 10 + (width-22)*0.8),(short)(yco - 44),
+ uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP", (short)(xco + 10 + (width-22)*0.8), (short)(yco - 44),
(short)(0.20 * (width-22)), 19, &ds->flag, 0.0, 0.0, 0, 0,
"Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics");
yco-= ysize;
@@ -1462,7 +1462,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
"Specify the type of event this mouse sensor should trigger on");
if (ms->type==32) {
- uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44),
+ uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse", (short)(xco + 10) + (width*0.8f)-20, (short)(yco - 44),
(short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0,
"Moving the mouse over a different object generates a pulse");
}
@@ -1481,7 +1481,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
randomSensor = sens->data;
/* some files were wrongly written, avoid crash now */
if (randomSensor) {
- uiDefButI(block, NUM, 1, "Seed: ", xco+10,yco-44,(width-20), 19,
+ uiDefButI(block, NUM, 1, "Seed: ", xco+10, yco-44, (width-20), 19,
&randomSensor->seed, 0, 1000, 0, 0,
"Initial seed of the generator. (Choose 0 for not random)");
}
@@ -1499,7 +1499,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
/* 1. property or material */
uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",
- xco + 10,yco - 44, 0.20 * (width-20), 19,
+ xco + 10, yco - 44, 0.20 * (width-20), 19,
&raySens->mode, 0.0, 0.0, 0, 0,
"Toggle collision on material or property");
@@ -1516,7 +1516,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
/* X-Ray option */
uiDefButBitS(block, TOG, SENS_RAY_XRAY, 1, "X",
- xco + 10,yco - 68, 0.10 * (width-20), 19,
+ xco + 10, yco - 68, 0.10 * (width-20), 19,
&raySens->mode, 0.0, 0.0, 0, 0,
"Toggle X-Ray option (see through objects that don't have the property)");
/* 2. sensing range */
@@ -1612,7 +1612,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
&joy->axis, 1, 8.0, 100, 0,
"Specify which axis pair to use, 1 is useually the main direction input");
- uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19,
+ uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20), yco-44, 0.4 * (width-20), 19,
&joy->precision, 0, 32768.0, 100, 0,
"Specify the precision of the axis");
@@ -1640,7 +1640,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
&joy->axis_single, 1, 16.0, 100, 0,
"Specify a single axis (verticle/horizontal/other) to detect");
- uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19,
+ uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20), yco-44, 0.4 * (width-20), 19,
&joy->precision, 0, 32768.0, 100, 0,
"Specify the precision of the axis");
}
@@ -1668,10 +1668,10 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- /* uiDefBut(block, LABEL, 1, "Not yet...", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, ""); */
+ /* uiDefBut(block, LABEL, 1, "Not yet...", xco, yco-24, 80, 19, NULL, 0, 0, 0, 0, ""); */
ec= cont->data;
- /* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */
- uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19,
+ /* uiDefBut(block, BUT, 1, "Variables", xco, yco-24, 80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */
+ uiDefBut(block, TEX, 1, "Exp:", xco + 10, yco-21, width-20, 19,
ec->str, 0, sizeof(ec->str), 0, 0,
"Expression");
@@ -1689,11 +1689,11 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
uiBlockBeginAlign(block);
- uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4,yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)");
+ uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4, yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)");
if (pc->mode==0)
- uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script");
+ uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70, yco-23, width-74, 19, &pc->text, "Blender textblock to run as a script");
else {
- uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
+ uiDefBut(block, TEX, 1, "", xco+70, yco-23, (width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-23, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting");
}
uiBlockEndAlign(block);
@@ -1930,7 +1930,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "use_additive",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
+ uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "use_additive", xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
}
}
else if (oa->type == ACT_OBJECT_SERVO) {
@@ -2014,22 +2014,22 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
if (aa->type == ACT_ACTION_FROM_PROP) {
- uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position");
+ uiDefBut(block, TEX, 0, "Prop: ", xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position");
}
else {
- uiDefButF(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame");
- uiDefButF(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame");
+ uiDefButF(block, NUM, 0, "Sta: ", xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame");
+ uiDefButF(block, NUM, 0, "End: ", xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame");
}
uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending");
uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack");
- uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property");
+ uiDefBut(block, TEX, 0, "FrameProp: ", xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property");
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
if (aa->type == ACT_ACTION_MOTION) {
- uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action");
+ uiDefButF(block, NUM, 0, "Cycle: ", xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action");
}
#endif
@@ -2109,9 +2109,9 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
pa= act->data;
str= "Type%t|Assign%x0|Add %x1|Copy %x2|Toggle (bool/int/float/timer)%x3";
- uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type");
+ uiDefButI(block, MENU, B_REDR, str, xco+30, yco-24, width-60, 19, &pa->type, 0, 31, 0, 0, "Type");
- uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name");
+ uiDefBut(block, TEX, 1, "Prop: ", xco+30, yco-44, width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name");
if (pa->type==ACT_PROP_TOGGLE) {
@@ -2123,7 +2123,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, MAX_NAME, 0, 0, "Copy this property");
}
else {
- uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, MAX_NAME, 0, 0, "change with this value, use \"\" around strings");
+ uiDefBut(block, TEX, 1, "Value: ", xco+30, yco-64, width-60, 19, pa->value, 0, MAX_NAME, 0, 0, "change with this value, use \"\" around strings");
}
yco-= ysize;
@@ -2147,20 +2147,20 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
IDnames_to_pupstring(&str, "Sound files", NULL, &(bmain->sound), (ID *)sa->sound, &(sa->sndnr));
/* reset this value, it is for handling the event */
sa->sndnr = 0;
- uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, "");
+ uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10, yco-22, 20, 19, &(sa->sndnr), 0, 0, 0, 0, "");
uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19,
"Load a sound file (remember to set caching on for small sounds that are played often)");
if (sa->sound) {
char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|"
"Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
- uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19,
+ uiDefBut(block, TEX, B_IDNAME, "SO:", xco+30, yco-22, wval-20, 19,
((ID *)sa->sound)->name+2, 0.0, MAX_ID_NAME-2, 0, 0, "");
- uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19,
+ uiDefButS(block, MENU, 1, dummy_str, xco+10, yco-44, width-20, 19,
&sa->type, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume,
+ uiDefButF(block, NUM, 0, "Volume:", xco+10, yco-66, wval, 19, &sa->volume,
0.0, 1.0, 0, 0, "Sets the volume of this sound");
- uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0,
+ uiDefButF(block, NUM, 0, "Pitch:", xco+wval+10, yco-66, wval, 19, &sa->pitch, -12.0,
12.0, 0, 0, "Sets the pitch of this sound");
uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19,
&sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space");
@@ -2531,8 +2531,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
ysize = 48;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
-// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
+ uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44, width-20, 19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
+// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64, width-20, 19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
}
#if 0
else if (gma->type == ACT_GAME_START) {
@@ -2540,8 +2540,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file");
- uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
+ uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44, width-20, 19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file");
+ uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64, width-20, 19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
}
#endif
else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG)) {
@@ -2657,7 +2657,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
randAct = act->data;
/* 1. seed */
- uiDefButI(block, NUM, 1, "Seed: ", (xco+10),yco-24, 0.4 *(width-20), 19,
+ uiDefButI(block, NUM, 1, "Seed: ", (xco+10), yco-24, 0.4 *(width-20), 19,
&randAct->seed, 0, 1000, 0, 0,
"Initial seed of the random generator. Use Python for more freedom. "
" (Choose 0 for not random)");
@@ -2777,21 +2777,21 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
/* line 3: Text/Property */
uiDefButBitS(block, TOG, 1, B_REDR, "T/P",
- (xco+10),(yco-(myline*24)), (0.20 * (width-20)), 19,
+ (xco+10), (yco-(myline*24)), (0.20 * (width-20)), 19,
&ma->bodyType, 0.0, 0.0, 0, 0,
"Toggle message type: either Text or a PropertyName");
if (ma->bodyType == ACT_MESG_MESG) {
/* line 3: Message Body */
uiDefBut(block, TEX, 1, "Body: ",
- (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
+ (xco+10+(0.20*(width-20))), (yco-(myline++*24)), (0.8*(width-20)), 19,
&ma->body, 0, MAX_NAME, 0, 0,
"Optional message body Text");
}
else {
/* line 3: Property body (set by property) */
uiDefBut(block, TEX, 1, "Propname: ",
- (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
+ (xco+10+(0.20*(width-20))), (yco-(myline++*24)), (0.8*(width-20)), 19,
&ma->body, 0, MAX_NAME, 0, 0,
"The message body will be set by the Property Value");
}
@@ -2811,11 +2811,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
switch (tdfa->type) {
case ACT_2DFILTER_MOTIONBLUR:
if (!tdfa->flag) {
- uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur");
- uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value");
+ uiDefButS(block, TOG, B_REDR, "D", xco+30, yco-44, 19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur");
+ uiDefButF(block, NUM, B_REDR, "Value:", xco+52, yco-44, width-82, 19, &tdfa->float_arg, 0.0, 1.0, 0.0, 0.0, "Set motion blur value");
}
else {
- uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur");
+ uiDefButS(block, TOG, B_REDR, "Disabled", xco+30, yco-44, width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur");
}
break;
case ACT_2DFILTER_BLUR:
@@ -2831,18 +2831,18 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
case ACT_2DFILTER_NOFILTER:
case ACT_2DFILTER_DISABLED:
case ACT_2DFILTER_ENABLED:
- uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set filter order");
+ uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30, yco-44, width-60, 19, &tdfa->int_arg, 0.0, MAX_RENDER_PASS-1, 0.0, 0.0, "Set filter order");
break;
case ACT_2DFILTER_CUSTOMFILTER:
- uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set filter order");
- uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, "");
+ uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30, yco-44, width-60, 19, &tdfa->int_arg, 0.0, MAX_RENDER_PASS-1, 0.0, 0.0, "Set filter order");
+ uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30, yco-64, width-60, 19, &tdfa->text, "");
break;
}
str= "2D Filter %t|Motion Blur %x1|Blur %x2|Sharpen %x3|Dilation %x4|Erosion %x5|"
"Laplacian %x6|Sobel %x7|Prewitt %x8|Gray Scale %x9|Sepia %x10|Invert %x11|Custom Filter %x12|"
"Enable Filter %x-2|Disable Filter %x-1|Remove Filter %x0|";
- uiDefButS(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type");
+ uiDefButS(block, MENU, B_REDR, str, xco+30, yco-24, width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type");
yco -= ysize;
break;
@@ -2912,7 +2912,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
ysize += 40;
break;
case ACT_ARM_SETWEIGHT:
- uiDefButF(block, NUM, B_REDR, "Weight:", xco+5+(width-10)*0.35,yco-24,(width-10)*0.65,19,&armAct->weight,0.0,1.0,0.0,0.0,"Set weight of this constraint");
+ uiDefButF(block, NUM, B_REDR, "Weight:", xco+5+(width-10)*0.35, yco-24, (width-10)*0.65, 19, &armAct->weight, 0.0, 1.0, 0.0, 0.0, "Set weight of this constraint");
break;
}
}
@@ -3024,7 +3024,7 @@ static uiBlock *controller_menu(bContext *C, ARegion *ar, void *UNUSED(arg))
uiBlockSetButmFunc(block, do_controller_menu, NULL);
uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, 1, "Hide Objects", 0,(short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
+ uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefBut(block, BUTM, 1, "Show Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 2, 2, "");
uiDefBut(block, BUTM, 1, "Hide Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 3, 3, "");
@@ -3846,7 +3846,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance")==1);
uiItemR(sub, ptr, "distance", 0, "", ICON_NONE);
- uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE);
+ uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
split = uiLayoutSplit(layout, 0.15, 0);
uiItemR(split, ptr, "use_material_detect", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
@@ -3867,7 +3867,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext
uiItemR(layout, ptr, "direction_axis_pos", 0, NULL, ICON_NONE);
row=uiLayoutRow(layout, 1);
- uiItemR(row, ptr, "damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE);
+ uiItemR(row, ptr, "damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(row, ptr, "time", 0, NULL, ICON_NONE);
row=uiLayoutRow(layout, 0);
@@ -3881,16 +3881,16 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext
case ACT_CONST_TYPE_FH:
split=uiLayoutSplit(layout, 0.75, 0);
row= uiLayoutRow(split, 0);
- uiItemR(row, ptr, "fh_damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE);
+ uiItemR(row, ptr, "fh_damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(row, ptr, "fh_height", 0, NULL, ICON_NONE);
- uiItemR(split, ptr, "use_fh_paralel_axis", UI_ITEM_R_TOGGLE , NULL, ICON_NONE);
+ uiItemR(split, ptr, "use_fh_paralel_axis", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "direction_axis", 0, NULL, ICON_NONE);
split = uiLayoutSplit(row, 0.9, 0);
uiItemR(split, ptr, "fh_force", 0, NULL, ICON_NONE);
- uiItemR(split, ptr, "use_fh_normal", UI_ITEM_R_TOGGLE , NULL, ICON_NONE);
+ uiItemR(split, ptr, "use_fh_normal", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
split = uiLayoutSplit(layout, 0.15, 0);
uiItemR(split, ptr, "use_material_detect", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
@@ -4549,7 +4549,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemR(split, &settings_ptr, "show_state_panel", UI_ITEM_R_NO_BG, "", ICON_DISCLOSURE_TRI_RIGHT);
row = uiLayoutRow(split, 1);
- uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide controllers");
+ uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide controllers");
if (ob == act_ob)
uiItemMenuEnumO(row, "LOGIC_OT_controller_add", "type", "Add Controller", ICON_NONE);
@@ -4644,7 +4644,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
if ((ob->scavisflag & OB_VIS_SENS) == 0) continue;
row = uiLayoutRow(layout, 1);
- uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
+ uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
if (ob == act_ob)
uiItemMenuEnumO(row, "LOGIC_OT_sensor_add", "type", "Add Sensor", ICON_NONE);
@@ -4710,7 +4710,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
if ( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
row = uiLayoutRow(layout, 1);
- uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
+ uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
if (ob == act_ob)
uiItemMenuEnumO(row, "LOGIC_OT_actuator_add", "type", "Add Actuator", ICON_NONE);
@@ -4839,9 +4839,9 @@ void logic_buttons(bContext *C, ARegion *ar)
/* presume it is only objects for now */
uiBlockBeginAlign(block);
// if (ob->controllers.first) uiSetCurFont(block, UI_HELVB);
- uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Active Object name");
+ uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Active Object name");
// if (ob->controllers.first) uiSetCurFont(block, UI_HELV);
- uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller");
+ uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add", (short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller");
uiBlockEndAlign(block);
yco-=20;
@@ -4878,9 +4878,9 @@ void logic_buttons(bContext *C, ARegion *ar)
}
}
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OB_ALLSTATE, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits");
- uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set the initial state");
- uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info");
+ uiDefButBitS(block, TOG, OB_ALLSTATE, B_SET_STATE_BIT, "All", (short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits");
+ uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini", (short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set the initial state");
+ uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D", (short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info");
uiBlockEndAlign(block);
yco-=35;
@@ -4913,7 +4913,7 @@ void logic_buttons(bContext *C, ARegion *ar)
if (cont->flag & CONT_SHOW) {
cont->otype= cont->type;
- uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type");
+ uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(), (short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type");
but = uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name");
uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0);
@@ -4923,10 +4923,10 @@ void logic_buttons(bContext *C, ARegion *ar)
}
else {
cpack(0x999999);
- glRecti(xco+22, yco, xco+width-22,yco+19);
+ glRecti(xco+22, yco, xco+width-22, yco+19);
but = uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type");
//uiButSetFunc(but, old_sca_move_controller, cont, NULL);
- but = uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name");
+ but = uiDefBut(block, LABEL, 0, cont->name, (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name");
//uiButSetFunc(but, old_sca_move_controller, cont, NULL);
uiBlockBeginAlign(block);
@@ -4942,7 +4942,7 @@ void logic_buttons(bContext *C, ARegion *ar)
but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR);
- uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, "");
+ uiDefIconBut(block, INLINK, 0, ICON_INLINK, (short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, "");
/* offset is >0 if at least one controller was displayed */
offset++;
yco-=20;
@@ -4977,9 +4977,9 @@ void logic_buttons(bContext *C, ARegion *ar)
/* presume it is only objects for now */
uiBlockBeginAlign(block);
// if (ob->sensors.first) uiSetCurFont(block, UI_HELVB);
- uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
+ uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
// if (ob->sensors.first) uiSetCurFont(block, UI_HELV);
- uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor");
+ uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add", (short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor");
uiBlockEndAlign(block);
yco-=20;
@@ -5014,7 +5014,7 @@ void logic_buttons(bContext *C, ARegion *ar)
}
else {
set_col_sensor(sens->type, 1);
- glRecti(xco+22, yco, xco+width-22,yco+19);
+ glRecti(xco + 22, yco, xco + width - 22, yco + 19);
but = uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, "");
//uiButSetFunc(but, old_sca_move_sensor, sens, NULL);
but = uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, "");
@@ -5057,9 +5057,9 @@ void logic_buttons(bContext *C, ARegion *ar)
/* presume it is only objects for now */
uiBlockBeginAlign(block);
// if (ob->actuators.first) uiSetCurFont(block, UI_HELVB);
- uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
+ uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
// if (ob->actuators.first) uiSetCurFont(block, UI_HELV);
- uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator");
+ uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add", (short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator");
uiBlockEndAlign(block);
yco-=20;
@@ -5092,7 +5092,7 @@ void logic_buttons(bContext *C, ARegion *ar)
}
else {
set_col_actuator(act->type, 1);
- glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19));
+ glRecti((short)(xco+22), yco, (short)(xco+width-22), (short)(yco+19));
/* but= */ uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator type");
// uiButSetFunc(but, old_sca_move_actuator, act, NULL);
/* but= */ uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator name");
@@ -5108,7 +5108,7 @@ void logic_buttons(bContext *C, ARegion *ar)
ycoo= yco;
}
- uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, act, LINK_ACTUATOR, 0, 0, 0, "");
+ uiDefIconBut(block, INLINK, 0, ICON_INLINK, (short)(xco - 19), ycoo, UI_UNIT_X, UI_UNIT_Y, act, LINK_ACTUATOR, 0, 0, 0, "");
yco-=20;
}
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 1d323cb6a4f..38f9a83143e 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -211,7 +211,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
/* offset for start of channel (on LHS of channel-list) */
if (ale->id) {
/* special exception for materials and particles */
- if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
+ if (ELEM(GS(ale->id->name), ID_MA, ID_PA))
offset= 21 + NLACHANNEL_BUTTON_WIDTH;
else
offset= 14;
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 91ece361aac..d37a2dc0e5e 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -266,7 +266,7 @@ static void node_draw_socket_new(bNodeSocket *sock, float size)
/* 16 values of sin function */
static float si[16] = {
- 0.00000000f, 0.39435585f,0.72479278f,0.93775213f,
+ 0.00000000f, 0.39435585f, 0.72479278f,0.93775213f,
0.99871650f,0.89780453f,0.65137248f,0.29936312f,
-0.10116832f,-0.48530196f,-0.79077573f,-0.96807711f,
-0.98846832f,-0.84864425f,-0.57126821f,-0.20129852f
@@ -1647,7 +1647,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C)
uiLayout *row, *col;
uiItemL(layout, "Despill Channel:", ICON_NONE);
- row = uiLayoutRow(layout,0);
+ row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
col= uiLayoutColumn(layout, 0);
@@ -1655,7 +1655,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C)
if (RNA_enum_get(ptr, "limit_method")==0) {
uiItemL(col, "Limiting Channel:", ICON_NONE);
- row=uiLayoutRow(col,0);
+ row=uiLayoutRow(col, 0);
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
@@ -1710,7 +1710,7 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED(
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
if (RNA_enum_get(ptr, "limit_method")==0) {
uiItemL(col, "Limiting Channel:", ICON_NONE);
- row=uiLayoutRow(col,0);
+ row=uiLayoutRow(col, 0);
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 040f921b6ac..c8bc2104d73 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -459,17 +459,17 @@ static void node_circle_draw(float x, float y, float size, char *col, int highli
{
/* 16 values of sin function */
static float si[16] = {
- 0.00000000f, 0.39435585f,0.72479278f,0.93775213f,
- 0.99871650f,0.89780453f,0.65137248f,0.29936312f,
- -0.10116832f,-0.48530196f,-0.79077573f,-0.96807711f,
- -0.98846832f,-0.84864425f,-0.57126821f,-0.20129852f
+ 0.00000000f, 0.39435585f, 0.72479278f, 0.93775213f,
+ 0.99871650f, 0.89780453f, 0.65137248f, 0.29936312f,
+ -0.10116832f, -0.48530196f, -0.79077573f, -0.96807711f,
+ -0.98846832f, -0.84864425f, -0.57126821f, -0.20129852f
};
/* 16 values of cos function */
static float co[16] ={
- 1.00000000f,0.91895781f,0.68896691f,0.34730525f,
- -0.05064916f,-0.44039415f,-0.75875812f,-0.95413925f,
- -0.99486932f,-0.87434661f,-0.61210598f,-0.25065253f,
- 0.15142777f,0.52896401f,0.82076344f,0.97952994f,
+ 1.00000000f, 0.91895781f, 0.68896691f, 0.34730525f,
+ -0.05064916f, -0.44039415f, -0.75875812f, -0.95413925f,
+ -0.99486932f, -0.87434661f, -0.61210598f, -0.25065253f,
+ 0.15142777f, 0.52896401f, 0.82076344f, 0.97952994f,
};
int a;
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 4df60e6eede..a540f18b3a5 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -517,7 +517,7 @@ static int node_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_int_set(op->ptr, "mouse_x", event->mval[0]);
RNA_int_set(op->ptr, "mouse_y", event->mval[1]);
- return node_select_exec(C,op);
+ return node_select_exec(C, op);
}
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 7b2bbf3e285..52089c87f61 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -77,7 +77,7 @@ static void outliner_height(SpaceOops *soops, ListBase *lb, int *h)
TreeElement *te= lb->first;
while (te) {
TreeStoreElem *tselem= TREESTORE(te);
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
outliner_height(soops, &te->subtree, h);
(*h) += UI_UNIT_Y;
te= te->next;
@@ -92,7 +92,7 @@ static void outliner_width(SpaceOops *soops, ListBase *lb, int *w)
// TreeStoreElem *tselem= TREESTORE(te);
// XXX fixme... te->xend is not set yet
- if (!TSELEM_OPEN(tselem,soops)) {
+ if (!TSELEM_OPEN(tselem, soops)) {
if (te->xend > *w)
*w = te->xend;
}
@@ -117,7 +117,7 @@ static void outliner_rna_width(SpaceOops *soops, ListBase *lb, int *w, int start
if (startx+100 > *w)
*w = startx+100;
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
outliner_rna_width(soops, &te->subtree, w, startx+UI_UNIT_X);
te= te->next;
}
@@ -505,7 +505,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
}
}
- if (TSELEM_OPEN(tselem,soops)) outliner_draw_restrictbuts(block, scene, ar, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem, soops)) outliner_draw_restrictbuts(block, scene, ar, soops, &te->subtree);
}
}
@@ -546,7 +546,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa
ptr= &te->rnaptr;
prop= te->directdata;
- if (!(RNA_property_type(prop) == PROP_POINTER && (TSELEM_OPEN(tselem,soops))) )
+ if (!(RNA_property_type(prop) == PROP_POINTER && (TSELEM_OPEN(tselem, soops))) )
uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, sizex, (int)te->ys, OL_RNA_COL_SIZEX, UI_UNIT_Y-1);
}
else if (tselem->type == TSE_RNA_ARRAY_ELEM) {
@@ -557,7 +557,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa
}
}
- if (TSELEM_OPEN(tselem,soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree);
+ if (TSELEM_OPEN(tselem, soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree);
}
}
@@ -783,7 +783,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
break;
case OL_KM_MOUSE:
str= keymap_mouse_menu();
- uiDefButS(block, MENU, 0, str, xstart,(int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->type, 0, 0, 0, 0, "Mouse button");
+ uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->type, 0, 0, 0, 0, "Mouse button");
xstart+= butw2+5;
break;
case OL_KM_TWEAK:
@@ -814,7 +814,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
}
}
- if (TSELEM_OPEN(tselem,soops)) outliner_draw_keymapbuts(block, ar, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem, soops)) outliner_draw_keymapbuts(block, ar, soops, &te->subtree);
}
}
@@ -857,7 +857,7 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa
}
}
- if (TSELEM_OPEN(tselem,soops)) outliner_buttons(C, block, ar, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem, soops)) outliner_buttons(C, block, ar, soops, &te->subtree);
}
}
@@ -1332,7 +1332,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
icon_x = startx+5*ufac;
// icons a bit higher
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
UI_icon_draw((float)icon_x, (float)*starty+2*ufac, ICON_DISCLOSURE_TRI_DOWN);
else
UI_icon_draw((float)icon_x, (float)*starty+2*ufac, ICON_DISCLOSURE_TRI_RIGHT);
@@ -1371,7 +1371,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
offsx+= (int)(UI_UNIT_X + UI_GetStringWidth(te->name));
/* closed item, we draw the icons, not when it's a scene, or master-server list though */
- if (!TSELEM_OPEN(tselem,soops)) {
+ if (!TSELEM_OPEN(tselem, soops)) {
if (te->subtree.first) {
if (tselem->type==0 && te->idcode==ID_SCE);
else if (tselem->type!=TSE_R_LAYER) { /* this tree element always has same amount of branches, so don't draw */
@@ -1397,7 +1397,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
te->ys= (float)*starty;
te->xend= startx+offsx;
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
*starty-= UI_UNIT_Y;
for (ten= te->subtree.first; ten; ten= ten->next)
@@ -1430,7 +1430,7 @@ static void outliner_draw_hierarchy(SpaceOops *soops, ListBase *lb, int startx,
*starty-= UI_UNIT_Y;
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
outliner_draw_hierarchy(soops, &te->subtree, startx+UI_UNIT_X, starty);
}
@@ -1454,12 +1454,12 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase *
tselem= TREESTORE(te);
/* selection status */
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
if (tselem->type == TSE_RNA_STRUCT)
glRecti(0, *starty+1, (int)ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, *starty+UI_UNIT_Y-1);
*starty-= UI_UNIT_Y;
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
outliner_draw_struct_marks(ar, soops, &te->subtree, starty);
if (tselem->type == TSE_RNA_STRUCT)
fdrawline(0, (float)*starty+UI_UNIT_Y, ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, (float)*starty+UI_UNIT_Y);
@@ -1480,7 +1480,7 @@ static void outliner_draw_selection(ARegion *ar, SpaceOops *soops, ListBase *lb,
glRecti(0, *starty+1, (int)ar->v2d.cur.xmax, *starty+UI_UNIT_Y-1);
}
*starty-= UI_UNIT_Y;
- if (TSELEM_OPEN(tselem,soops)) outliner_draw_selection(ar, soops, &te->subtree, starty);
+ if (TSELEM_OPEN(tselem, soops)) outliner_draw_selection(ar, soops, &te->subtree, starty);
}
}
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 62d93f62d0f..7b200e9593d 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -652,7 +652,7 @@ static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te,
te->ys= (float)(*starty);
*starty-= UI_UNIT_Y;
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
TreeElement *ten;
for (ten= te->subtree.first; ten; ten= ten->next) {
outliner_set_coordinates_element(soops, ten, startx+UI_UNIT_X, starty);
@@ -875,7 +875,7 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOops *soops, ListBase
}
else tselem->flag |= TSE_CLOSED;
- if (TSELEM_OPEN(tselem,soops)) tree_element_show_hierarchy(scene, soops, &te->subtree);
+ if (TSELEM_OPEN(tselem, soops)) tree_element_show_hierarchy(scene, soops, &te->subtree);
}
}
@@ -1140,7 +1140,7 @@ static void do_outliner_drivers_editop(SpaceOops *soops, ListBase *tree, ReportL
}
/* go over sub-tree */
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
do_outliner_drivers_editop(soops, &te->subtree, reports, mode);
}
}
@@ -1308,7 +1308,7 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
}
/* go over sub-tree */
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
do_outliner_keyingset_editop(soops, ks, &te->subtree, mode);
}
}
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 5515ec45269..00b3979b074 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -99,7 +99,7 @@ static int outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *se
change |= 1;
}
}
- else if (TSELEM_OPEN(tselem,soops)) {
+ else if (TSELEM_OPEN(tselem, soops)) {
/* Only try selecting sub-elements if we haven't hit the right element yet
*
* Hack warning:
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 13e86209f3a..88e3bac7910 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -115,9 +115,9 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb,
}
}
}
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
set_operation_types(soops, &te->subtree,
- scenelevel, objectlevel, idlevel, datalevel);
+ scenelevel, objectlevel, idlevel, datalevel);
}
}
}
@@ -230,7 +230,7 @@ static void outliner_do_libdata_operation(bContext *C, Scene *scene, SpaceOops *
operation_cb(C, scene, te, tsep, tselem);
}
}
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
outliner_do_libdata_operation(C, scene, soops, &te->subtree, operation_cb);
}
}
@@ -388,7 +388,7 @@ void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOops *soop
operation_cb(C, scene_owner ? scene_owner : scene_act, te, NULL, tselem);
}
}
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
outliner_do_object_operation(C, scene_act, soops, &te->subtree, operation_cb);
}
}
@@ -495,7 +495,7 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li
operation_cb(event, te, tselem);
}
}
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
outliner_do_data_operation(soops, type, event, &te->subtree, operation_cb);
}
}
@@ -870,7 +870,7 @@ static void outliner_do_id_set_operation(SpaceOops *soops, int type, ListBase *l
operation_cb(te, tselem, tsep, newid);
}
}
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
outliner_do_id_set_operation(soops, type, &te->subtree, newid, operation_cb);
}
}
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index e2d43386c5e..026132e1f16 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -538,7 +538,7 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
int index;
temod->name = "Modifiers";
- for (index=0,md=ob->modifiers.first; md; index++,md=md->next) {
+ for (index=0, md=ob->modifiers.first; md; index++, md=md->next) {
TreeElement *te = outliner_add_element(soops, &temod->subtree, ob, temod, TSE_MODIFIER, index);
te->name= md->name;
te->directdata = md;
@@ -956,7 +956,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->name= RNA_struct_ui_name(ptr->type);
/* If searching don't expand RNA entries */
- if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
+ if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA", te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
iterprop= RNA_struct_iterator_property(ptr->type);
tot= RNA_property_collection_length(ptr, iterprop);
@@ -966,7 +966,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
if (!tselem->used)
tselem->flag &= ~TSE_CLOSED;
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
for (a=0; a<tot; a++)
outliner_add_element(soops, &te->subtree, (void*)ptr, te, TSE_RNA_PROPERTY, a);
}
@@ -988,13 +988,13 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->rnaptr= *ptr;
/* If searching don't expand RNA entries */
- if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
+ if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA", te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH;
if (proptype == PROP_POINTER) {
pptr= RNA_property_pointer_get(ptr, prop);
if (pptr.data) {
- if (TSELEM_OPEN(tselem,soops))
+ if (TSELEM_OPEN(tselem, soops))
outliner_add_element(soops, &te->subtree, (void*)&pptr, te, TSE_RNA_STRUCT, -1);
else
te->flag |= TE_LAZY_CLOSED;
@@ -1003,7 +1003,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
else if (proptype == PROP_COLLECTION) {
tot= RNA_property_collection_length(ptr, prop);
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
for (a=0; a<tot; a++) {
RNA_property_collection_lookup_int(ptr, prop, a, &pptr);
outliner_add_element(soops, &te->subtree, (void*)&pptr, te, TSE_RNA_STRUCT, a);
@@ -1015,7 +1015,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
else if (ELEM3(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
tot= RNA_property_array_length(ptr, prop);
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
for (a=0; a<tot; a++)
outliner_add_element(soops, &te->subtree, (void*)ptr, te, TSE_RNA_ARRAY_ELEM, a);
}
@@ -1048,7 +1048,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->directdata= idv;
te->name= km->idname;
- if (TSELEM_OPEN(tselem,soops)) {
+ if (TSELEM_OPEN(tselem, soops)) {
a= 0;
for (kmi = km->items.first; kmi; kmi = kmi->next, a++) {
@@ -1351,7 +1351,7 @@ static int outliner_filter_tree(SpaceOops *soops, ListBase *lb)
/* flag as not a found item */
tselem->flag &= ~TSE_SEARCHMATCH;
- if ((!TSELEM_OPEN(tselem,soops)) || outliner_filter_tree(soops, &te->subtree)==0) {
+ if ((!TSELEM_OPEN(tselem, soops)) || outliner_filter_tree(soops, &te->subtree)==0) {
outliner_free_tree(&te->subtree);
BLI_remlink(lb, te);
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index c40a809e6af..e63a3052d26 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -51,7 +51,7 @@ struct ARegion *sequencer_has_buttons_region(struct ScrArea *sa);
/* sequencer_draw.c */
void draw_timeline_seq(const struct bContext *C, struct ARegion *ar);
-void draw_image_seq(const struct bContext* C, struct Scene *scene,struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset);
+void draw_image_seq(const struct bContext* C, struct Scene *scene, struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset);
void seq_reset_imageofs(struct SpaceSeq *sseq);
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 6d810d9103c..13129616843 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -333,7 +333,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, yi -= buth, 200, buth,
&(tfp->ve_median[1]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:",0, yi -= buth, 200, buth,
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, yi -= buth, 200, buth,
&(tfp->ve_median[2]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index fd21bd1922f..6d72ca99678 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1189,12 +1189,12 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size)
size = -size;
case RIGHT:
glBegin(GL_LINES);
- glVertex2s( offset, 0);
- glVertex2s( offset + length, 0);
- glVertex2s( offset + length, 0);
- glVertex2s( offset + length - size, -size);
- glVertex2s( offset + length, 0);
- glVertex2s( offset + length - size, size);
+ glVertex2s(offset, 0);
+ glVertex2s(offset + length, 0);
+ glVertex2s(offset + length, 0);
+ glVertex2s(offset + length - size, -size);
+ glVertex2s(offset + length, 0);
+ glVertex2s(offset + length - size, size);
glEnd();
break;
case DOWN:
@@ -1203,12 +1203,12 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size)
size = -size;
case UP:
glBegin(GL_LINES);
- glVertex2s( 0, offset);
- glVertex2s( 0, offset + length);
- glVertex2s( 0, offset + length);
+ glVertex2s(0, offset);
+ glVertex2s(0, offset + length);
+ glVertex2s(0, offset + length);
glVertex2s(-size, offset + length - size);
- glVertex2s( 0, offset + length);
- glVertex2s( size, offset + length - size);
+ glVertex2s(0, offset + length);
+ glVertex2s(size, offset + length - size);
glEnd();
break;
}
@@ -1221,20 +1221,20 @@ static void drawArrowHead(ArrowDirection d, short size)
size = -size;
case RIGHT:
glBegin(GL_LINES);
- glVertex2s( 0, 0);
- glVertex2s( -size, -size);
- glVertex2s( 0, 0);
- glVertex2s( -size, size);
+ glVertex2s(0, 0);
+ glVertex2s(-size, -size);
+ glVertex2s(0, 0);
+ glVertex2s(-size, size);
glEnd();
break;
case DOWN:
size = -size;
case UP:
glBegin(GL_LINES);
- glVertex2s( 0, 0);
+ glVertex2s(0, 0);
glVertex2s(-size, -size);
- glVertex2s( 0, 0);
- glVertex2s( size, -size);
+ glVertex2s(0, 0);
+ glVertex2s(size, -size);
glEnd();
break;
}
@@ -1248,9 +1248,9 @@ static void drawArc(float size, float angle_start, float angle_end, int segments
glBegin(GL_LINE_STRIP);
for ( angle = angle_start; angle < angle_end; angle += delta) {
- glVertex2f( cosf(angle) * size, sinf(angle) * size);
+ glVertex2f(cosf(angle) * size, sinf(angle) * size);
}
- glVertex2f( cosf(angle_end) * size, sinf(angle_end) * size);
+ glVertex2f(cosf(angle_end) * size, sinf(angle_end) * size);
glEnd();
}
@@ -1943,8 +1943,8 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl
/* axis-angle get limited with euler... */
float eul[3], oldeul[3];
- axis_angle_to_eulO( eul, EULER_ORDER_DEFAULT,axis, *angle);
- axis_angle_to_eulO( oldeul, EULER_ORDER_DEFAULT,oldAxis, oldAngle);
+ axis_angle_to_eulO(eul, EULER_ORDER_DEFAULT, axis, *angle);
+ axis_angle_to_eulO(oldeul, EULER_ORDER_DEFAULT, oldAxis, oldAngle);
if (protectflag & OB_LOCK_ROTX)
eul[0]= oldeul[0];
@@ -1953,7 +1953,7 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl
if (protectflag & OB_LOCK_ROTZ)
eul[2]= oldeul[2];
- eulO_to_axis_angle( axis, angle,eul, EULER_ORDER_DEFAULT);
+ eulO_to_axis_angle(axis, angle, eul, EULER_ORDER_DEFAULT);
/* when converting to axis-angle, we need a special exception for the case when there is no axis */
if (IS_EQF(axis[0], axis[1]) && IS_EQF(axis[1], axis[2])) {
@@ -1999,7 +1999,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu
if (protectflag & OB_LOCK_ROTZ)
eul[2]= oldeul[2];
- eul_to_quat( quat,eul);
+ eul_to_quat(quat, eul);
/* restore original quat size */
mul_qt_fl(quat, qlen);
@@ -2175,15 +2175,15 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
/* copy results from cob->matrix */
if (td->ext->rotOrder == ROT_MODE_QUAT) {
/* quats */
- mat4_to_quat( td->ext->quat,cob.matrix);
+ mat4_to_quat(td->ext->quat, cob.matrix);
}
else if (td->ext->rotOrder == ROT_MODE_AXISANGLE) {
/* axis angle */
- mat4_to_axis_angle( &td->ext->quat[1], &td->ext->quat[0],cob.matrix);
+ mat4_to_axis_angle(&td->ext->quat[1], &td->ext->quat[0], cob.matrix);
}
else {
/* eulers */
- mat4_to_eulO( td->ext->rot, td->ext->rotOrder,cob.matrix);
+ mat4_to_eulO(td->ext->rot, td->ext->rotOrder, cob.matrix);
}
}
}
@@ -2209,7 +2209,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
if (td->flag & TD_SINGLESIZE)
return;
- size_to_mat4( cob.matrix,td->ext->size);
+ size_to_mat4(cob.matrix, td->ext->size);
}
/* Evaluate valid constraints */
@@ -2260,7 +2260,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
if (td->flag & TD_SINGLESIZE)
return;
- mat4_to_size( td->ext->size,cob.matrix);
+ mat4_to_size(td->ext->size, cob.matrix);
}
}
}
@@ -2628,7 +2628,7 @@ static void headerResize(TransInfo *t, float vec[3], char *str)
#define VECSIGNFLIP(a, b) ((SIGN(a[0]) & SIGN(b[0]))==0 || (SIGN(a[1]) & SIGN(b[1]))==0 || (SIGN(a[2]) & SIGN(b[2]))==0)
/* smat is reference matrix, only scaled */
-static void TransMat3ToSize( float mat[][3], float smat[][3], float *size)
+static void TransMat3ToSize(float mat[][3], float smat[][3], float *size)
{
float vec[3];
@@ -2688,7 +2688,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
//print_v3("fsize", fsize);
}
else {
- mat3_to_size( fsize,tmat);
+ mat3_to_size(fsize, tmat);
}
protectedSizeBits(td->protectflag, fsize);
@@ -2775,7 +2775,7 @@ int Resize(TransInfo *t, const int mval[2])
copy_v3_v3(t->values, size);
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize) {
t->con.applySize(t, NULL, mat);
@@ -2797,7 +2797,7 @@ int Resize(TransInfo *t, const int mval[2])
/* evil hack - redo resize if cliping needed */
if (t->flag & T_CLIP_UV && clipUVTransform(t, size, 1)) {
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize)
t->con.applySize(t, NULL, mat);
@@ -2966,14 +2966,14 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
add_v3_v3v3(td->loc, vec, center);
- sub_v3_v3v3(vec,td->loc,td->iloc);
+ sub_v3_v3v3(vec, td->loc, td->iloc);
protectedTransBits(td->protectflag, vec);
add_v3_v3v3(td->loc, td->iloc, vec);
if (td->flag & TD_USEQUAT) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
if (td->ext->quat) {
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
@@ -3040,7 +3040,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
if (td->ext->rotOrder == ROT_MODE_QUAT) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
/* this function works on end result */
@@ -3054,10 +3054,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
- quat_to_axis_angle( td->ext->rotAxis, td->ext->rotAngle,tquat);
+ quat_to_axis_angle(td->ext->rotAxis, td->ext->rotAngle, tquat);
/* this function works on end result */
protectedAxisAngleBits(td->protectflag, td->ext->rotAxis, td->ext->rotAngle, td->ext->irotAxis, td->ext->irotAngle);
@@ -3070,12 +3070,12 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* calculate the total rotatation in eulers */
copy_v3_v3(eul, td->ext->irot);
- eulO_to_mat3( eulmat,eul, td->ext->rotOrder);
+ eulO_to_mat3(eulmat, eul, td->ext->rotOrder);
/* mat = transform, obmat = bone rotation */
mul_m3_m3m3(fmat, smat, eulmat);
- mat3_to_compatible_eulO( eul, td->ext->rot, td->ext->rotOrder,fmat);
+ mat3_to_compatible_eulO(eul, td->ext->rot, td->ext->rotOrder, fmat);
/* and apply (to end result only) */
protectedRotateBits(td->protectflag, eul, td->ext->irot);
@@ -3108,7 +3108,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* euler or quaternion? */
if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
/* this function works on end result */
@@ -3121,10 +3121,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
- mat3_to_quat( quat,fmat); // Actual transform
+ mat3_to_quat(quat, fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
- quat_to_axis_angle( td->ext->rotAxis, td->ext->rotAngle,tquat);
+ quat_to_axis_angle(td->ext->rotAxis, td->ext->rotAngle, tquat);
/* this function works on end result */
protectedAxisAngleBits(td->protectflag, td->ext->rotAxis, td->ext->rotAngle, td->ext->irotAxis, td->ext->irotAngle);
@@ -3137,11 +3137,11 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* calculate the total rotatation in eulers */
add_v3_v3v3(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */
- eulO_to_mat3( obmat,eul, td->ext->rotOrder);
+ eulO_to_mat3(obmat, eul, td->ext->rotOrder);
/* mat = transform, obmat = object rotation */
mul_m3_m3m3(fmat, smat, obmat);
- mat3_to_compatible_eulO( eul, td->ext->rot, td->ext->rotOrder,fmat);
+ mat3_to_compatible_eulO(eul, td->ext->rot, td->ext->rotOrder, fmat);
/* correct back for delta rot */
sub_v3_v3v3(eul, eul, td->ext->drot);
@@ -3162,7 +3162,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
float mat[3][3];
int i;
- vec_rot_to_mat3( mat,axis, angle);
+ vec_rot_to_mat3(mat, axis, angle);
for (i = 0 ; i < t->total; i++, td++) {
@@ -3174,10 +3174,10 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
if (t->con.applyRot) {
t->con.applyRot(t, td, axis, NULL);
- vec_rot_to_mat3( mat,axis, angle * td->factor);
+ vec_rot_to_mat3(mat, axis, angle * td->factor);
}
else if (t->flag & T_PROP_EDIT) {
- vec_rot_to_mat3( mat,axis, angle * td->factor);
+ vec_rot_to_mat3(mat, axis, angle * td->factor);
}
ElementRotation(t, td, mat, t->around);
@@ -3263,8 +3263,8 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
float mat[3][3], smat[3][3], totmat[3][3];
int i;
- vec_rot_to_mat3( smat,axis1, angles[0]);
- vec_rot_to_mat3( totmat,axis2, angles[1]);
+ vec_rot_to_mat3(smat, axis1, angles[0]);
+ vec_rot_to_mat3(totmat, axis2, angles[1]);
mul_m3_m3m3(mat, smat, totmat);
@@ -3276,8 +3276,8 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
continue;
if (t->flag & T_PROP_EDIT) {
- vec_rot_to_mat3( smat,axis1, td->factor * angles[0]);
- vec_rot_to_mat3( totmat,axis2, td->factor * angles[1]);
+ vec_rot_to_mat3(smat, axis1, td->factor * angles[0]);
+ vec_rot_to_mat3(totmat, axis2, td->factor * angles[1]);
mul_m3_m3m3(mat, smat, totmat);
}
@@ -3324,8 +3324,8 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
}
(void)spos;
- vec_rot_to_mat3( smat,axis1, phi[0]);
- vec_rot_to_mat3( totmat,axis2, phi[1]);
+ vec_rot_to_mat3(smat, axis1, phi[0]);
+ vec_rot_to_mat3(totmat, axis2, phi[1]);
mul_m3_m3m3(mat, smat, totmat);
@@ -3483,7 +3483,7 @@ static void applyTranslation(TransInfo *t, float vec[3])
axis_angle_to_quat(quat, axis, angle);
- quat_to_mat3( mat,quat);
+ quat_to_mat3(mat, quat);
ElementRotation(t, td, mat, V3D_LOCAL);
}
@@ -3924,7 +3924,7 @@ int handleEventBevel(TransInfo *t, wmEvent *event)
int Bevel(TransInfo *t, const int UNUSED(mval[2]))
{
- float distance,d;
+ float distance, d;
int i;
char str[128];
const char *mode;
@@ -4177,9 +4177,9 @@ static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3])
/* we've tucked the scale in loc */
oldy= td->iloc[1];
- size_to_mat3( sizemat,td->iloc);
+ size_to_mat3(sizemat, td->iloc);
mul_m3_m3m3(tmat, tmat, sizemat);
- mat3_to_size( td->loc,tmat);
+ mat3_to_size(td->loc, tmat);
td->loc[1]= oldy;
}
@@ -4209,7 +4209,7 @@ int BoneSize(TransInfo *t, const int mval[2])
constraintNumInput(t, size);
}
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize) {
t->con.applySize(t, NULL, mat);
@@ -4861,7 +4861,7 @@ void freeSlideVerts(TransInfo *t)
LinkNode *look = sld->vertlist;
GHash *vertgh = sld->vhash;
while (look) {
- sv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
+ sv = BLI_ghash_lookup(vertgh, (EditVert*)look->link);
if (sv != NULL) {
sv->up->f &= !SELECT;
sv->down->f &= !SELECT;
@@ -5167,7 +5167,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
if (t->con.mode & CON_APPLY) {
size[0] = size[1] = size[2] = -1;
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
if (t->con.applySize) {
t->con.applySize(t, NULL, mat);
@@ -5192,7 +5192,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2]))
else {
size[0] = size[1] = size[2] = 1;
- size_to_mat3( mat,size);
+ size_to_mat3(mat, size);
for (i = 0, td=t->data; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
@@ -5460,7 +5460,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
/* do the snapping to nearest frame/second */
if (doTime) {
- val= (float)( floor((val/secf) + 0.5f) * secf );
+ val= (float)(floor((val/secf) + 0.5f) * secf);
}
else
#endif
@@ -5599,9 +5599,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
if (autosnap == SACTSNAP_STEP) {
if (doTime)
- deltax= (float)( floor((deltax/secf) + 0.5f) * secf );
+ deltax= (float)(floor((deltax/secf) + 0.5f) * secf);
else
- deltax= (float)( floor(deltax + 0.5f) );
+ deltax= (float)(floor(deltax + 0.5f));
}
val = BKE_nla_tweakedit_remap(adt, td->ival, NLATIME_CONVERT_MAP);
@@ -5613,9 +5613,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
if (autosnap == SACTSNAP_STEP) {
if (doTime)
- val= (float)( floor((deltax/secf) + 0.5f) * secf );
+ val= (float)(floor((deltax/secf) + 0.5f) * secf);
else
- val= (float)( floor(val + 0.5f) );
+ val= (float)(floor(val + 0.5f));
}
*(td->val) = td->ival + val;
@@ -5865,9 +5865,9 @@ static void applyTimeScale(TransInfo *t)
if (autosnap == SACTSNAP_STEP) {
if (doTime)
- fac= (float)( floor(fac/secf + 0.5f) * secf );
+ fac= (float)(floor(fac/secf + 0.5f) * secf);
else
- fac= (float)( floor(fac + 0.5f) );
+ fac= (float)(floor(fac + 0.5f));
}
/* check if any need to apply nla-mapping */
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 0bef33149d7..69af8cf2489 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -68,7 +68,7 @@ struct ReportList;
struct SmallHash;
typedef struct TransSnapPoint {
- struct TransSnapPoint *next,*prev;
+ struct TransSnapPoint *next, *prev;
float co[3];
} TransSnapPoint;
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index ebded7b0a6e..b18d132f8df 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -664,7 +664,7 @@ void drawConstraint(TransInfo *t)
else {
if (tc->mode & CON_SELECT) {
float vec[3];
- char col2[3] = {255,255,255};
+ char col2[3] = {255, 255, 255};
int depth_test_enabled;
convertViewVec(t, vec, (t->mval[0] - t->con.imval[0]), (t->mval[1] - t->con.imval[1]));
@@ -767,7 +767,7 @@ static void drawObjectConstraint(TransInfo *t)
td++;
- for (i=1;i<t->total;i++,td++) {
+ for (i=1; i < t->total; i++, td++) {
if (t->con.mode & CON_AXIS0) {
drawLine(t, td->ob->obmat[3], td->axismtx[0], 'X', 0);
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index c4edeefa598..d38d3917177 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -266,7 +266,7 @@ static void createTransTexspace(TransInfo *t)
}
id = ob->data;
- if (id == NULL || !ELEM3( GS(id->name), ID_ME, ID_CU, ID_MB )) {
+ if (id == NULL || !ELEM3(GS(id->name), ID_ME, ID_CU, ID_MB )) {
t->total = 0;
return;
}
@@ -418,7 +418,7 @@ static short apply_targetless_ik(Object *ob)
/* pose_mat(b) = pose_mat(b-1) * offs_bone * channel * constraint * IK */
/* we put in channel the entire result of rmat= (channel * constraint * IK) */
/* pose_mat(b) = pose_mat(b-1) * offs_bone * rmat */
- /* rmat = pose_mat(b) * inv( pose_mat(b-1) * offs_bone ) */
+ /* rmat = pose_mat(b) * inv(pose_mat(b-1) * offs_bone ) */
parchan= chanlist[segcount-1];
bone= parchan->bone;
@@ -439,25 +439,25 @@ static short apply_targetless_ik(Object *ob)
* and applied poses.
*/
if (parchan->rotmode > 0)
- mat3_to_eulO(parchan->eul, parchan->rotmode,rmat3);
+ mat3_to_eulO(parchan->eul, parchan->rotmode, rmat3);
else if (parchan->rotmode == ROT_MODE_AXISANGLE)
- mat3_to_axis_angle(parchan->rotAxis, &parchan->rotAngle,rmat3);
+ mat3_to_axis_angle(parchan->rotAxis, &parchan->rotAngle, rmat3);
else
- mat3_to_quat(parchan->quat,rmat3);
+ mat3_to_quat(parchan->quat, rmat3);
/* for size, remove rotation */
/* causes problems with some constraints (so apply only if needed) */
if (data->flag & CONSTRAINT_IK_STRETCH) {
if (parchan->rotmode > 0)
- eulO_to_mat3( qrmat,parchan->eul, parchan->rotmode);
+ eulO_to_mat3(qrmat, parchan->eul, parchan->rotmode);
else if (parchan->rotmode == ROT_MODE_AXISANGLE)
- axis_angle_to_mat3( qrmat,parchan->rotAxis, parchan->rotAngle);
+ axis_angle_to_mat3(qrmat, parchan->rotAxis, parchan->rotAngle);
else
- quat_to_mat3( qrmat,parchan->quat);
+ quat_to_mat3(qrmat, parchan->quat);
invert_m3_m3(imat3, qrmat);
mul_m3_m3m3(smat, rmat3, imat3);
- mat3_to_size( parchan->size,smat);
+ mat3_to_size(parchan->size, smat);
}
/* causes problems with some constraints (e.g. childof), so disable this */
@@ -548,10 +548,10 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
if (constraints_list_needinv(t, &pchan->constraints)) {
copy_m3_m4(tmat, pchan->constinv);
invert_m3_m3(cmat, tmat);
- mul_serie_m3(td->mtx, pmat, omat, cmat, NULL,NULL,NULL,NULL,NULL);
+ mul_serie_m3(td->mtx, pmat, omat, cmat, NULL, NULL, NULL, NULL, NULL);
}
else
- mul_serie_m3(td->mtx, pmat, omat, NULL, NULL,NULL,NULL,NULL,NULL);
+ mul_serie_m3(td->mtx, pmat, omat, NULL, NULL, NULL, NULL, NULL, NULL);
}
invert_m3_m3(td->smtx, td->mtx);
@@ -681,7 +681,7 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
total++;
if (mode == TFM_TRANSLATION) {
- if ( has_targetless_ik(pchan)==NULL ) {
+ if (has_targetless_ik(pchan) == NULL) {
if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
if (pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM)
hastranslation = 1;
@@ -1616,7 +1616,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
PTCacheEditPoint *point;
PTCacheEditKey *key;
float mat[4][4];
- int i,k, transformparticle;
+ int i, k, transformparticle;
int count = 0, hasselected = 0;
int propmode = t->flag & T_PROP_EDIT;
@@ -1625,7 +1625,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
psys = edit->psys;
if (psys)
- psmd = psys_get_modifier(ob,psys);
+ psmd = psys_get_modifier(ob, psys);
base->flag |= BA_HAS_RECALC_DATA;
@@ -1665,7 +1665,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
unit_m4(mat);
- invert_m4_m4(ob->imat,ob->obmat);
+ invert_m4_m4(ob->imat, ob->obmat);
for (i=0, point=edit->points; i<edit->totpoint; i++, point++) {
TransData *head, *tail;
@@ -1748,7 +1748,7 @@ void flushTransParticles(TransInfo *t)
if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat);
- invert_m4_m4(imat,mat);
+ invert_m4_m4(imat, mat);
for (k=0, key=point->keys; k<point->totkey; k++, key++) {
copy_v3_v3(co, key->world_co);
@@ -2055,7 +2055,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
* the modifiers that support deform matrices (defcos) */
if (totleft > 0) {
mappedcos= crazyspace_get_mapped_editverts(t->scene, t->obedit);
- quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats");
+ quats= MEM_mallocN((t->total)*sizeof(float)*4, "crazy quats");
crazyspace_set_quats_editmesh(em, (float*)defcos, mappedcos, quats); /* BMESH_TODO, abuses vertex index, should use an int array */
if (mappedcos)
MEM_freeN(mappedcos);
@@ -2133,7 +2133,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
}
/* Mirror? */
- if ( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) {
+ if ((mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) {
BMVert *vmir= EDBM_verts_mirror_get(em, eve); //t->obedit, em, eve, tob->iloc, a);
if (vmir && vmir != eve) {
tob->extra = vmir;
@@ -2147,7 +2147,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
if (mirror != 0)
{
tob = t->data;
- for ( a = 0; a < t->total; a++, tob++ )
+ for (a = 0; a < t->total; a++, tob++ )
{
if (ABS(tob->loc[0]) <= 0.00001f)
{
@@ -2294,7 +2294,7 @@ void flushTransSeq(TransInfo *t)
if (seq->depth==0) {
/* test overlap, displayes red outline */
seq->flag &= ~SEQ_OVERLAP;
- if ( seq_test_overlap(seqbasep, seq) ) {
+ if (seq_test_overlap(seqbasep, seq)) {
seq->flag |= SEQ_OVERLAP;
}
}
@@ -2994,7 +2994,7 @@ void flushTransGPactionData (TransInfo *t)
/* find the first one to start from */
if (t->mode == TFM_TIME_SLIDE)
- tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 );
+ tfd= (tGPFtransdata *)((float *)(t->customData) + 2);
else
tfd= (tGPFtransdata *)(t->customData);
@@ -3113,7 +3113,7 @@ static void createTransActionData(bContext *C, TransInfo *t)
if (ac.datatype == ANIMCONT_GPENCIL) {
if (t->mode == TFM_TIME_SLIDE) {
t->customData= MEM_callocN((sizeof(float)*2)+(sizeof(tGPFtransdata)*count), "TimeSlide + tGPFtransdata");
- tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 );
+ tfd= (tGPFtransdata *)((float *)(t->customData) + 2);
}
else {
t->customData= MEM_callocN(sizeof(tGPFtransdata)*count, "tGPFtransdata");
@@ -3468,9 +3468,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
* then check if we're using auto-handles.
* - If so, change them auto-handles to aligned handles so that handles get affected too
*/
- if ( ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) &&
- ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) &&
- ELEM(t->mode, TFM_ROTATION, TFM_RESIZE))
+ if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) &&
+ ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) &&
+ ELEM(t->mode, TFM_ROTATION, TFM_RESIZE))
{
if (hdata && (sel1) && (sel3)) {
bezt->h1= HD_ALIGN;
@@ -3559,8 +3559,8 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert, const short UNUSED(
* optimization: this only needs to be performed in the first loop
*/
if (bezm->swapHs == 0) {
- if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) &&
- (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) )
+ if ((bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) &&
+ (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) )
{
/* handles need to be swapped */
bezm->swapHs = 1;
@@ -3714,9 +3714,9 @@ void flushTransGraphData(TransInfo *t)
switch (sipo->autosnap) {
case SACTSNAP_FRAME: /* snap to nearest frame (or second if drawing seconds) */
if (sipo->flag & SIPO_DRAWTIME)
- td2d->loc[0]= (float)( floor((td2d->loc[0]/secf) + 0.5f) * secf );
+ td2d->loc[0]= (float)(floor((td2d->loc[0]/secf) + 0.5f) * secf);
else
- td2d->loc[0]= (float)( floor(td2d->loc[0]+0.5f) );
+ td2d->loc[0]= (float)(floor(td2d->loc[0]+0.5f));
break;
case SACTSNAP_MARKER: /* snap to nearest marker */
@@ -3879,7 +3879,7 @@ static int SeqTransCount(TransInfo *t, Sequence *parent, ListBase *seqbase, int
for (seq= seqbase->first; seq; seq= seq->next) {
seq->depth= depth;
- /* seq->tmp is used by seq_tx_get_final_{left,right} to check sequence's range and clamp to it if needed.
+ /* seq->tmp is used by seq_tx_get_final_{left, right} to check sequence's range and clamp to it if needed.
* it's first place where digging into sequences tree, so store link to parent here */
seq->tmp = parent;
@@ -4173,9 +4173,9 @@ static void createTransSeqData(bContext *C, TransInfo *t)
int i;
for (i=0; i<3; i++) {
seq_user= *((&seq->seq1) + i);
- if ( seq_user && (seq_user->flag & SELECT) &&
- !(seq_user->flag & SEQ_LOCK) &&
- !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)))
+ if (seq_user && (seq_user->flag & SELECT) &&
+ !(seq_user->flag & SEQ_LOCK) &&
+ !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)))
{
seq->flag |= SELECT;
}
@@ -4473,8 +4473,8 @@ static int count_proportional_objects(TransInfo *t)
/* mark all children */
for (base= scene->base.first; base; base= base->next) {
/* all base not already selected or marked that is editable */
- if ( (base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
- (BASE_EDITABLE_BGMODE(v3d, scene, base)))
+ if ((base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+ (BASE_EDITABLE_BGMODE(v3d, scene, base)))
{
mark_children(base->object);
}
@@ -4485,8 +4485,8 @@ static int count_proportional_objects(TransInfo *t)
Object *ob= base->object;
/* if base is not selected, not a parent of selection or not a child of selection and it is editable */
- if ( (ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
- (BASE_EDITABLE_BGMODE(v3d, scene, base)))
+ if ((ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+ (BASE_EDITABLE_BGMODE(v3d, scene, base)))
{
/* used for flush, depgraph will change recalcs if needed :) */
@@ -4877,8 +4877,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)) )
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
@@ -4908,8 +4908,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)))
{
posttrans_action_clean(&ac, (bAction *)ac.data);
}
@@ -4921,8 +4921,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)))
{
bGPdata *gpd;
@@ -4989,8 +4989,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
* 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
*/
- if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 &&
- ((canceled == 0) || (duplicate)) )
+ if ((sipo->flag & SIPO_NOTRANSKEYCULL)==0 &&
+ ((canceled == 0) || (duplicate)))
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0);
@@ -5101,10 +5101,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
- else if ( (t->scene->basact) &&
- (ob = t->scene->basact->object) &&
- (ob->mode & OB_MODE_PARTICLE_EDIT) &&
- PE_get_current(t->scene, ob))
+ else if ((t->scene->basact) &&
+ (ob = t->scene->basact->object) &&
+ (ob->mode & OB_MODE_PARTICLE_EDIT) &&
+ PE_get_current(t->scene, ob))
{
/* do nothing */
}
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index f8a982c6b71..f15397f1fd6 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -297,7 +297,7 @@ int calc_manipulator_stats(const bContext *C)
if (obedit->type==OB_MESH) {
BMEditMesh *em = BMEdit_FromObject(obedit);
BMEditSelection ese;
- float vec[3]= {0,0,0};
+ float vec[3]= {0, 0, 0};
/* USE LAST SELECTE WITH ACTIVE */
if ((v3d->around == V3D_ACTIVE) && BM_select_history_active_get(em->bm, &ese)) {
@@ -508,7 +508,7 @@ int calc_manipulator_stats(const bContext *C)
if (edit) {
point = edit->points;
- for (a=0; a<edit->totpoint; a++,point++) {
+ for (a=0; a<edit->totpoint; a++, point++) {
if (point->flag & PEP_HIDE) continue;
for (k=0, ek=point->keys; k<point->totkey; k++, ek++) {
@@ -1512,7 +1512,7 @@ void BIF_draw_manipulator(const bContext *C)
if (v3d->twflag & V3D_DRAW_MANIPULATOR) {
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
if (v3d->twtype & V3D_MANIP_ROTATE) {
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index b9ae3180591..83d4a5dfa6e 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -145,7 +145,7 @@ static int snap_type_exec(bContext *C, wmOperator *op)
{
ToolSettings *ts= CTX_data_tool_settings(C);
- ts->snap_mode = RNA_enum_get(op->ptr,"type");
+ ts->snap_mode = RNA_enum_get(op->ptr, "type");
WM_event_add_notifier(C, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index db974626b14..2b8c03a56ae 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -573,7 +573,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
BMEditMesh *em = me->edit_btmesh;
BMVert *eve;
BMEditSelection ese;
- float vec[3]= {0,0,0};
+ float vec[3]= {0, 0, 0};
/* USE LAST SELECTED WITH ACTIVE */
if (activeOnly && BM_select_history_active_get(em->bm, &ese)) {
@@ -769,7 +769,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
float mat[4][4];
/* Rotation of MetaElem is stored in quat */
- quat_to_mat4( mat,ml_sel->quat);
+ quat_to_mat4( mat, ml_sel->quat);
copy_v3_v3(normal, mat[2]);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 0a5613bca22..a24679878bc 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -216,7 +216,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
cpack(0xFFFFFF);
glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], 0.0f);
- //glRectf(0,0,1,1);
+ //glRectf(0, 0, 1, 1);
setlinestyle(0);
cpack(0x0);
@@ -700,7 +700,7 @@ static float RotationBetween(TransInfo *t, float p1[3], float p2[3])
mul_m3_v3(mtx, end);
mul_m3_v3(mtx, start);
- angle = atan2(start[1],start[0]) - atan2(end[1],end[0]);
+ angle = atan2(start[1], start[0]) - atan2(end[1], end[0]);
}
if (angle > (float)M_PI) {
@@ -1055,9 +1055,9 @@ static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], fl
copy_v3_v3(location, intersect);
if (v4co)
- normal_quad_v3( normal,v1co, v2co, v3co, v4co);
+ normal_quad_v3(normal, v1co, v2co, v3co, v4co);
else
- normal_tri_v3( normal,v1co, v2co, v3co);
+ normal_tri_v3(normal, v1co, v2co, v3co);
mul_m4_v3(obmat, location);
@@ -1738,9 +1738,9 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
copy_v3_v3(location, intersect);
if (f->v4)
- normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
+ normal_quad_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
else
- normal_tri_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
+ normal_tri_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
mul_m4_v3(obmat, location);
@@ -1767,13 +1767,13 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4],
copy_v3_v3(location, intersect);
if (f->v4)
- normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
+ normal_quad_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co);
else
- normal_tri_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
+ normal_tri_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co);
mul_m4_v3(obmat, location);
- new_depth = len_v3v3(location, ray_start);
+ new_depth = len_v3v3(location, ray_start);
mul_m3_v3(timat, normal);
normalize_v3(normal);
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 980aed64ed9..0b3ee03c8de 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -408,7 +408,7 @@ GPUDrawObject *GPU_drawobject_new( DerivedMesh *dm )
points_per_mat[mface[i].mat_nr] += mface[i].v4 ? 6 : 3;
/* create the GPUDrawObject */
- gdo = MEM_callocN(sizeof(GPUDrawObject),"GPUDrawObject");
+ gdo = MEM_callocN(sizeof(GPUDrawObject), "GPUDrawObject");
gdo->totvert = dm->getNumVerts(dm);
gdo->totedge = dm->getNumEdges(dm);
@@ -601,7 +601,7 @@ static void GPU_buffer_copy_vertex(DerivedMesh *dm, float *varray, int *index, i
j = dm->drawObject->tot_triangle_point*3;
for (i = 0; i < dm->drawObject->totvert; i++) {
if (dm->drawObject->vert_points[i].point_index >= dm->drawObject->tot_triangle_point) {
- copy_v3_v3(&varray[j],mvert[i].co);
+ copy_v3_v3(&varray[j], mvert[i].co);
j+=3;
}
}
@@ -685,16 +685,16 @@ static void GPU_buffer_copy_uv(DerivedMesh *dm, float *varray, int *index, int *
start = index[mat_orig_to_new[f->mat_nr]];
/* v1 v2 v3 */
- copy_v2_v2(&varray[start],mtface[i].uv[0]);
- copy_v2_v2(&varray[start+2],mtface[i].uv[1]);
- copy_v2_v2(&varray[start+4],mtface[i].uv[2]);
+ copy_v2_v2(&varray[start], mtface[i].uv[0]);
+ copy_v2_v2(&varray[start+2], mtface[i].uv[1]);
+ copy_v2_v2(&varray[start+4], mtface[i].uv[2]);
index[mat_orig_to_new[f->mat_nr]] += 6;
if (f->v4) {
/* v3 v4 v1 */
- copy_v2_v2(&varray[start+6],mtface[i].uv[2]);
- copy_v2_v2(&varray[start+8],mtface[i].uv[3]);
- copy_v2_v2(&varray[start+10],mtface[i].uv[0]);
+ copy_v2_v2(&varray[start+6], mtface[i].uv[2]);
+ copy_v2_v2(&varray[start+8], mtface[i].uv[3]);
+ copy_v2_v2(&varray[start+10], mtface[i].uv[0]);
index[mat_orig_to_new[f->mat_nr]] += 6;
}
}
@@ -788,25 +788,25 @@ static void GPU_buffer_copy_uvedge(DerivedMesh *dm, float *varray, int *UNUSED(i
for (i = 0; i < dm->numTessFaceData; i++, tf++) {
MFace mf;
- dm->getTessFace(dm,i,&mf);
+ dm->getTessFace(dm, i, &mf);
- copy_v2_v2(&varray[j],tf->uv[0]);
- copy_v2_v2(&varray[j+2],tf->uv[1]);
+ copy_v2_v2(&varray[j], tf->uv[0]);
+ copy_v2_v2(&varray[j+2], tf->uv[1]);
- copy_v2_v2(&varray[j+4],tf->uv[1]);
- copy_v2_v2(&varray[j+6],tf->uv[2]);
+ copy_v2_v2(&varray[j+4], tf->uv[1]);
+ copy_v2_v2(&varray[j+6], tf->uv[2]);
if (!mf.v4) {
- copy_v2_v2(&varray[j+8],tf->uv[2]);
- copy_v2_v2(&varray[j+10],tf->uv[0]);
+ copy_v2_v2(&varray[j+8], tf->uv[2]);
+ copy_v2_v2(&varray[j+10], tf->uv[0]);
j+=12;
}
else {
- copy_v2_v2(&varray[j+8],tf->uv[2]);
- copy_v2_v2(&varray[j+10],tf->uv[3]);
+ copy_v2_v2(&varray[j+8], tf->uv[2]);
+ copy_v2_v2(&varray[j+10], tf->uv[3]);
- copy_v2_v2(&varray[j+12],tf->uv[3]);
- copy_v2_v2(&varray[j+14],tf->uv[0]);
+ copy_v2_v2(&varray[j+12], tf->uv[3]);
+ copy_v2_v2(&varray[j+14], tf->uv[0]);
j+=16;
}
}
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index e14e4dce405..05eaad12ae2 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1567,7 +1567,7 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l
pixsize= (lamp->d)/temp;
wsize= pixsize*0.5f*lamp->size;
- perspective_m4( lamp->winmat,-wsize, wsize, -wsize, wsize, lamp->d, lamp->clipend);
+ perspective_m4( lamp->winmat, -wsize, wsize, -wsize, wsize, lamp->d, lamp->clipend);
}
static void gpu_lamp_shadow_free(GPULamp *lamp)
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c
index 8d4d01b7e97..08c5e24aca6 100644
--- a/source/blender/ikplugin/intern/iksolver_plugin.c
+++ b/source/blender/ikplugin/intern/iksolver_plugin.c
@@ -425,10 +425,10 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
goalpos[2]= fac*goalpos[2] + mfac*world_pose[3][2];
/* blend rotation */
- mat3_to_quat( q1,goalrot);
- mat4_to_quat( q2,world_pose);
+ mat3_to_quat(q1, goalrot);
+ mat4_to_quat(q2, world_pose);
interp_qt_qtqt(q, q1, q2, mfac);
- quat_to_mat3( goalrot,q);
+ quat_to_mat3(goalrot, q);
}
iktarget= iktree[target->tip];
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index a288f330224..2e437c627a2 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -424,16 +424,16 @@ static IK_Data* get_ikdata(bPose *pose)
}
static double EulerAngleFromMatrix(const KDL::Rotation& R, int axis)
{
- double t = KDL::sqrt(R(0,0)*R(0,0) + R(0,1)*R(0,1));
+ double t = KDL::sqrt(R(0, 0)*R(0, 0) + R(0, 1)*R(0, 1));
if (t > 16.0*KDL::epsilon) {
- if (axis == 0) return -KDL::atan2(R(1,2), R(2,2));
- else if (axis == 1) return KDL::atan2(-R(0,2), t);
- else return -KDL::atan2(R(0,1), R(0,0));
+ if (axis == 0) return -KDL::atan2(R(1, 2), R(2, 2));
+ else if (axis == 1) return KDL::atan2(-R(0, 2), t);
+ else return -KDL::atan2(R(0, 1), R(0, 0));
}
else {
- if (axis == 0) return -KDL::atan2(-R(2,1), R(1,1));
- else if (axis == 1) return KDL::atan2(-R(0,2), t);
+ if (axis == 0) return -KDL::atan2(-R(2, 1), R(1, 1));
+ else if (axis == 1) return KDL::atan2(-R(0, 2), t);
else return 0.0f;
}
}
@@ -441,8 +441,8 @@ static double EulerAngleFromMatrix(const KDL::Rotation& R, int axis)
static double ComputeTwist(const KDL::Rotation& R)
{
// qy and qw are the y and w components of the quaternion from R
- double qy = R(0,2) - R(2,0);
- double qw = R(0,0) + R(1,1) + R(2,2) + 1;
+ double qy = R(0, 2) - R(2, 0);
+ double qw = R(0, 0) + R(1, 1) + R(2, 2) + 1;
double tau = 2*KDL::atan2(qy, qw);
@@ -471,31 +471,31 @@ 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));
- Z = -KDL::sign(R(0,1)) * KDL::PI / 2;
+ if (fabs(R(0, 1)) > 1.0 - KDL::epsilon ) {
+ X = -KDL::sign(R(0, 1)) * KDL::atan2(R(1, 2), R(1, 0));
+ Z = -KDL::sign(R(0, 1)) * KDL::PI / 2;
Y = 0.0;
}
else {
- X = KDL::atan2(R(2,1), R(1,1));
- Z = KDL::atan2(-R(0,1), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,2))));
- Y = KDL::atan2(R(0,2), R(0,0));
+ X = KDL::atan2(R(2, 1), R(1, 1));
+ Z = KDL::atan2(-R(0, 1), KDL::sqrt( KDL::sqr(R(0, 0)) + KDL::sqr(R(0, 2))));
+ Y = KDL::atan2(R(0, 2), R(0, 0));
}
}
-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));
- Y = KDL::sign(R(0,2)) * KDL::PI / 2;
+ if (fabs(R(0, 2)) > 1.0 - KDL::epsilon ) {
+ X = KDL::sign(R(0, 2)) * KDL::atan2(-R(1, 0), R(1, 1));
+ Y = KDL::sign(R(0, 2)) * KDL::PI / 2;
Z = 0.0;
}
else {
- X = KDL::atan2(-R(1,2), R(2,2));
- Y = KDL::atan2(R(0,2), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,1))));
- Z = KDL::atan2(-R(0,1), R(0,0));
+ X = KDL::atan2(-R(1, 2), R(2, 2));
+ Y = KDL::atan2(R(0, 2), KDL::sqrt( KDL::sqr(R(0, 0)) + KDL::sqr(R(0, 1))));
+ Z = KDL::atan2(-R(0, 1), R(0, 0));
}
}
#endif
@@ -804,16 +804,16 @@ static bool joint_callback(const iTaSC::Timestamp& timestamp, iTaSC::ConstraintV
if (chan->rotmode > 0) {
/* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */
- eulO_to_mat3( rmat,chan->eul, chan->rotmode);
+ eulO_to_mat3( rmat, chan->eul, chan->rotmode);
}
else if (chan->rotmode == ROT_MODE_AXISANGLE) {
/* axis-angle - stored in quaternion data, but not really that great for 3D-changing orientations */
- axis_angle_to_mat3( rmat,&chan->quat[1], chan->quat[0]);
+ axis_angle_to_mat3( rmat, &chan->quat[1], chan->quat[0]);
}
else {
/* quats are normalised before use to eliminate scaling issues */
normalize_qt(chan->quat);
- quat_to_mat3( rmat,chan->quat);
+ quat_to_mat3(rmat, chan->quat);
}
KDL::Rotation jointRot(
rmat[0][0], rmat[1][0], rmat[2][0],
@@ -1388,7 +1388,7 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
e_matrix& Wq = arm->getWq();
assert(Wq.cols() == (int)weights.size());
for (int q=0; q<Wq.cols(); q++)
- Wq(q,q)=weights[q];
+ Wq(q, q)=weights[q];
// get the inverse rest pose frame of the base to compute relative rest pose of end effectors
// this is needed to handle the enforce parameter
// ikscene->pchan[0] is the root channel of the tree
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index d0d141a8ef8..cf1a4df1cf9 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -133,8 +133,8 @@ static void free_anim_movie(struct anim *UNUSED(anim)) { ; }
static int an_stringdec(const char *string, char* head, char *tail, unsigned short *numlen)
{
- unsigned short len,nume,nums=0;
- short i,found=FALSE;
+ unsigned short len, nume, nums=0;
+ short i, found=FALSE;
len=strlen(string);
nume = len;
@@ -156,7 +156,7 @@ static int an_stringdec(const char *string, char* head, char *tail, unsigned sho
}
}
if (found) {
- strcpy(tail ,&string[nume+1]);
+ strcpy(tail, &string[nume+1]);
strcpy(head, string);
head[nums]= '\0';
*numlen=nume-nums+1;
@@ -285,7 +285,7 @@ static int startavi (struct anim *anim)
streamcount = anim->streamindex;
#endif
- anim->avi = MEM_callocN (sizeof(AviMovie),"animavi");
+ anim->avi = MEM_callocN (sizeof(AviMovie), "animavi");
if (anim->avi == NULL) {
printf("Can't open avi: %s\n", anim->name);
@@ -676,7 +676,7 @@ static void ffmpeg_postprocess(struct anim * anim)
uint8_t** dst = anim->pFrameRGB->data;
int dstStride2[4] = { dstStride[0], 0, 0, 0 };
uint8_t* dst2[4] = { dst[0], 0, 0, 0 };
- int x,y,h,w;
+ int x, y, h, w;
unsigned char* bottom;
unsigned char* top;
@@ -933,7 +933,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: looking for PTS=%lld "
"(pts_timebase=%g, frame_rate=%g, st_time=%lld)\n",
- (long long int)pts_to_search,pts_time_base, frame_rate, st_time);
+ (long long int)pts_to_search, pts_time_base, frame_rate, st_time);
if (anim->last_frame &&
anim->last_pts <= pts_to_search && anim->next_pts > pts_to_search) {
@@ -1040,7 +1040,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
anim->next_packet.stream_index = -1;
}
- /* memset(anim->pFrame,...) ?? */
+ /* memset(anim->pFrame, ...) ?? */
if (ret >= 0) {
ffmpeg_decode_video_frame_scan(anim, pts_to_search);
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 06e1d75c5d0..bce3c70fd93 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -192,18 +192,18 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
}
/* Couple of helper functions for writing our data */
-static int putIntLSB(unsigned int ui,FILE *ofile)
+static int putIntLSB(unsigned int ui, FILE *ofile)
{
- putc((ui>>0)&0xFF,ofile);
- putc((ui>>8)&0xFF,ofile);
- putc((ui>>16)&0xFF,ofile);
- return putc((ui>>24)&0xFF,ofile);
+ putc((ui>>0)&0xFF, ofile);
+ putc((ui>>8)&0xFF, ofile);
+ putc((ui>>16)&0xFF, ofile);
+ return putc((ui>>24)&0xFF, ofile);
}
-static int putShortLSB(unsigned short us,FILE *ofile)
+static int putShortLSB(unsigned short us, FILE *ofile)
{
- putc((us>>0)&0xFF,ofile);
- return putc((us>>8)&0xFF,ofile);
+ putc((us>>0)&0xFF, ofile);
+ return putc((us>>8)&0xFF, ofile);
}
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
@@ -220,37 +220,37 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
bytesize = (ibuf->x * 3 + extrabytes) * ibuf->y;
data = (uchar *) ibuf->rect;
- ofile = BLI_fopen(name,"wb");
+ ofile = BLI_fopen(name, "wb");
if (!ofile) return 0;
- putShortLSB(19778,ofile); /* "BM" */
- putIntLSB(0,ofile); /* This can be 0 for BI_RGB bitmaps */
- putShortLSB(0,ofile); /* Res1 */
- putShortLSB(0,ofile); /* Res2 */
- putIntLSB(BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile);
-
- putIntLSB(sizeof(infoheader),ofile);
- putIntLSB(ibuf->x,ofile);
- putIntLSB(ibuf->y,ofile);
- putShortLSB(1,ofile);
- putShortLSB(24,ofile);
- putIntLSB(0,ofile);
- putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile);
- putIntLSB(0,ofile);
- putIntLSB(0,ofile);
- putIntLSB(0,ofile);
- putIntLSB(0,ofile);
+ putShortLSB(19778, ofile); /* "BM" */
+ putIntLSB(0, ofile); /* This can be 0 for BI_RGB bitmaps */
+ putShortLSB(0, ofile); /* Res1 */
+ putShortLSB(0, ofile); /* Res2 */
+ putIntLSB(BMP_FILEHEADER_SIZE + sizeof(infoheader), ofile);
+
+ putIntLSB(sizeof(infoheader), ofile);
+ putIntLSB(ibuf->x, ofile);
+ putIntLSB(ibuf->y, ofile);
+ putShortLSB(1, ofile);
+ putShortLSB(24, ofile);
+ putIntLSB(0, ofile);
+ putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader), ofile);
+ putIntLSB(0, ofile);
+ putIntLSB(0, ofile);
+ putIntLSB(0, ofile);
+ putIntLSB(0, ofile);
/* Need to write out padded image data in bgr format */
for (y=0;y<ibuf->y;y++) {
for (x=0;x<ibuf->x;x++) {
ptr=(x + y * ibuf->x) * 4;
- if (putc(data[ptr+2],ofile) == EOF) return 0;
- if (putc(data[ptr+1],ofile) == EOF) return 0;
- if (putc(data[ptr],ofile) == EOF) return 0;
+ if (putc(data[ptr+2], ofile) == EOF) return 0;
+ if (putc(data[ptr+1], ofile) == EOF) return 0;
+ if (putc(data[ptr], ofile) == EOF) return 0;
}
/* add padding here */
- for (t=0;t<extrabytes;t++) if (putc(0,ofile) == EOF) return 0;
+ for (t=0;t<extrabytes;t++) if (putc(0, ofile) == EOF) return 0;
}
if (ofile) {
fflush(ofile);
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 0e6567d2c6b..7b17334f3c9 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -52,7 +52,7 @@
static void filtrow(unsigned char *point, int x)
{
- unsigned int c1,c2,c3,error;
+ unsigned int c1, c2, c3, error;
if (x>1) {
c1 = c2 = *point;
@@ -72,7 +72,7 @@ static void filtrow(unsigned char *point, int x)
static void filtrowf(float *point, int x)
{
- float c1,c2,c3;
+ float c1, c2, c3;
if (x>1) {
c1 = c2 = *point;
@@ -92,7 +92,7 @@ static void filtrowf(float *point, int x)
static void filtcolum(unsigned char *point, int y, int skip)
{
- unsigned int c1,c2,c3,error;
+ unsigned int c1, c2, c3, error;
unsigned char *point2;
if (y>1) {
@@ -115,7 +115,7 @@ static void filtcolum(unsigned char *point, int y, int skip)
static void filtcolumf(float *point, int y, int skip)
{
- float c1,c2,c3, *point2;
+ float c1, c2, c3, *point2;
if (y>1) {
c1 = c2 = *point;
@@ -148,23 +148,23 @@ void IMB_filtery(struct ImBuf *ibuf)
for (;x>0;x--) {
if (point) {
- if (ibuf->planes > 24) filtcolum(point,y,skip);
+ if (ibuf->planes > 24) filtcolum(point, y, skip);
point++;
- filtcolum(point,y,skip);
+ filtcolum(point, y, skip);
point++;
- filtcolum(point,y,skip);
+ filtcolum(point, y, skip);
point++;
- filtcolum(point,y,skip);
+ filtcolum(point, y, skip);
point++;
}
if (pointf) {
- if (ibuf->planes > 24) filtcolumf(pointf,y,skip);
+ if (ibuf->planes > 24) filtcolumf(pointf, y, skip);
pointf++;
- filtcolumf(pointf,y,skip);
+ filtcolumf(pointf, y, skip);
pointf++;
- filtcolumf(pointf,y,skip);
+ filtcolumf(pointf, y, skip);
pointf++;
- filtcolumf(pointf,y,skip);
+ filtcolumf(pointf, y, skip);
pointf++;
}
}
@@ -186,23 +186,23 @@ void imb_filterx(struct ImBuf *ibuf)
for (;y>0;y--) {
if (point) {
- if (ibuf->planes > 24) filtrow(point,x);
+ if (ibuf->planes > 24) filtrow(point, x);
point++;
- filtrow(point,x);
+ filtrow(point, x);
point++;
- filtrow(point,x);
+ filtrow(point, x);
point++;
- filtrow(point,x);
+ filtrow(point, x);
point+=skip;
}
if (pointf) {
- if (ibuf->planes > 24) filtrowf(pointf,x);
+ if (ibuf->planes > 24) filtrowf(pointf, x);
pointf++;
- filtrowf(pointf,x);
+ filtrowf(pointf, x);
pointf++;
- filtrowf(pointf,x);
+ filtrowf(pointf, x);
pointf++;
- filtrowf(pointf,x);
+ filtrowf(pointf, x);
pointf+=skip;
}
}
@@ -304,7 +304,7 @@ void IMB_mask_filter_extend(char *mask, int width, int height)
void IMB_mask_clear(ImBuf *ibuf, char *mask, int val)
{
- int x,y;
+ int x, y;
if (ibuf->rect_float) {
for (x=0; x<ibuf->x; x++) {
for (y=0; y<ibuf->y; y++) {
@@ -399,7 +399,7 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
if (!check_pixel_assigned(srcbuf, srcmask, index, depth, is_float)) {
float tmp[4];
float wsum=0;
- float acc[4]={0,0,0,0};
+ float acc[4]={0, 0, 0, 0};
k = 0;
if (check_pixel_assigned(srcbuf, srcmask, filter_make_index(x-1, y, width, height), depth, is_float) ||
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index ba165d51e96..2109891a3ce 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -50,7 +50,7 @@
/* This define should be relocated to a global header some where Kent Mein
* I stole it from util.h in the plugins api */
-#define MAX2(x,y) ( (x)>(y) ? (x) : (y) )
+#define MAX2(x, y) ( (x)>(y) ? (x) : (y) )
/* Only this one is used liberally here, and in imbuf */
void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
@@ -113,10 +113,10 @@ static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **
static float P(float k)
{
float p1, p2, p3, p4;
- p1 = MAX2(k+2.0f,0);
- p2 = MAX2(k+1.0f,0);
- p3 = MAX2(k,0);
- p4 = MAX2(k-1.0f,0);
+ p1 = MAX2(k+2.0f, 0);
+ p2 = MAX2(k+1.0f, 0);
+ p3 = MAX2(k, 0);
+ p4 = MAX2(k-1.0f, 0);
return (float)(1.0f/6.0f)*( p1*p1*p1 - 4.0f * p2*p2*p2 + 6.0f * p3*p3*p3 - 4.0f * p4*p4*p4);
}
@@ -125,15 +125,15 @@ static float P(float k)
/* older, slower function, works the same as above */
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));
+ 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));
}
#endif
void bicubic_interpolation_color(struct ImBuf *in, unsigned char *outI, float *outF, float u, float v)
{
- int i,j,n,m,x1,y1;
+ int i, j, n, m, x1, y1;
unsigned char *dataI;
- float a,b,w,wx,wy[4], outR,outG,outB,outA,*dataF;
+ float a, b, w, wx, wy[4], outR, outG, outB, outA, *dataF;
/* sample area entirely outside image? */
if (ceil(u)<0 || floor(u)>in->x-1 || ceil(v)<0 || floor(v)>in->y-1)
diff --git a/source/blender/imbuf/intern/indexer_dv.c b/source/blender/imbuf/intern/indexer_dv.c
index f0c38f6db06..8dc03ae708d 100644
--- a/source/blender/imbuf/intern/indexer_dv.c
+++ b/source/blender/imbuf/intern/indexer_dv.c
@@ -171,7 +171,7 @@ static void parse_header_block(indexer_dv_context * This, unsigned char* target)
static void parse_subcode_blocks(
indexer_dv_context * This, unsigned char* target)
{
- int i,j;
+ int i, j;
for (j = 0; j < 2; j++) {
for (i = 3; i < 80; i += 5) {
@@ -185,7 +185,7 @@ static void parse_subcode_blocks(
static void parse_vaux_blocks(
indexer_dv_context * This, unsigned char* target)
{
- int i,j;
+ int i, j;
for (j = 0; j < 3; j++) {
for (i = 3; i < 80; i += 5) {
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index e775d0f7bbd..430361dbb53 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -74,7 +74,7 @@ typedef struct {
#define GINTLUM (156)
#define BINTLUM (21)
-#define ILUM(r,g,b) ((int)(RINTLUM*(r)+GINTLUM*(g)+BINTLUM*(b))>>8)
+#define ILUM(r, g, b) ((int)(RINTLUM * (r) + GINTLUM * (g) + BINTLUM * (b)) >> 8)
#define OFFSET_R 0 /* this is byte order dependent */
#define OFFSET_G 1
@@ -149,7 +149,7 @@ static void putshort(FILE *outf, unsigned short val)
buf[0] = (val>>8);
buf[1] = (val>>0);
- fwrite(buf,2,1,outf);
+ fwrite(buf, 2, 1, outf);
}
static int putlong(FILE *outf, unsigned int val)
@@ -160,7 +160,7 @@ static int putlong(FILE *outf, unsigned int val)
buf[1] = (val>>16);
buf[2] = (val>>8);
buf[3] = (val>>0);
- return fwrite(buf,4,1,outf);
+ return fwrite(buf, 4, 1, outf);
}
static void readheader(FILE *inf, IMAGE *image)
@@ -178,18 +178,18 @@ static int writeheader(FILE *outf, IMAGE *image)
{
IMAGE t= {0};
- fwrite(&t,sizeof(IMAGE),1,outf);
- fseek(outf,0,SEEK_SET);
- putshort(outf,image->imagic);
- putshort(outf,image->type);
- putshort(outf,image->dim);
- putshort(outf,image->xsize);
- putshort(outf,image->ysize);
- putshort(outf,image->zsize);
- putlong(outf,image->min);
- putlong(outf,image->max);
- putlong(outf,0);
- return fwrite("no name",8,1,outf);
+ fwrite(&t, sizeof(IMAGE), 1, outf);
+ fseek(outf, 0, SEEK_SET);
+ putshort(outf, image->imagic);
+ putshort(outf, image->type);
+ putshort(outf, image->dim);
+ putshort(outf, image->xsize);
+ putshort(outf, image->ysize);
+ putshort(outf, image->zsize);
+ putlong(outf, image->min);
+ putlong(outf, image->max);
+ putlong(outf, 0);
+ return fwrite("no name", 8, 1, outf);
}
static int writetab(FILE *outf, unsigned int *tab, int len)
@@ -197,7 +197,7 @@ static int writetab(FILE *outf, unsigned int *tab, int len)
int r = 0;
while (len) {
- r = putlong(outf,*tab++);
+ r = putlong(outf, *tab++);
len -= 4;
}
return r;
@@ -271,14 +271,14 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
readheader(inf, &image);
if (image.imagic != IMAGIC) {
- fprintf(stderr,"longimagedata: bad magic number in image file\n");
+ fprintf(stderr, "longimagedata: bad magic number in image file\n");
return(NULL);
}
rle = ISRLE(image.type);
bpp = BPP(image.type);
if (bpp != 1 && bpp != 2) {
- fprintf(stderr,"longimagedata: image must have 1 or 2 byte per pix chan\n");
+ fprintf(stderr, "longimagedata: image must have 1 or 2 byte per pix chan\n");
return(NULL);
}
@@ -299,8 +299,8 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags)
lengthtab = (unsigned int *)MEM_mallocN(tablen, "iris endtab");
file_offset = 512;
- readtab(inf,starttab,tablen);
- readtab(inf,lengthtab,tablen);
+ readtab(inf, starttab, tablen);
+ readtab(inf, lengthtab, tablen);
/* check data order */
cur = 0;
@@ -710,27 +710,27 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
image->zsize = zsize;
image->min = 0;
image->max = 255;
- goodwrite *= writeheader(outf,image);
- fseek(outf,512+2*tablen,SEEK_SET);
+ goodwrite *= writeheader(outf, image);
+ fseek(outf, 512+2*tablen, SEEK_SET);
pos = 512+2*tablen;
for (y = 0; y < ysize; y++) {
for (z = 0; z < zsize; z++) {
if (zsize == 1) {
- lumrow((uchar *)lptr,(uchar *)lumbuf,xsize);
- len = compressrow((uchar *)lumbuf,rlebuf,CHANOFFSET(z),xsize);
+ lumrow((uchar *)lptr, (uchar *)lumbuf, xsize);
+ len = compressrow((uchar *)lumbuf, rlebuf, CHANOFFSET(z), xsize);
}
else {
if (z<4) {
- len = compressrow((uchar *)lptr, rlebuf,CHANOFFSET(z),xsize);
+ len = compressrow((uchar *)lptr, rlebuf, CHANOFFSET(z), xsize);
}
else if (z<8 && zptr) {
- len = compressrow((uchar *)zptr, rlebuf,CHANOFFSET(z-4),xsize);
+ len = compressrow((uchar *)zptr, rlebuf, CHANOFFSET(z-4), xsize);
}
}
if (len>rlebuflen) {
- fprintf(stderr,"output_iris: rlebuf is too small - bad poop\n");
+ fprintf(stderr, "output_iris: rlebuf is too small - bad poop\n");
exit(1);
}
goodwrite *= fwrite(rlebuf, len, 1, outf);
@@ -742,9 +742,9 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
if (zptr) zptr += xsize;
}
- fseek(outf,512,SEEK_SET);
- goodwrite *= writetab(outf,starttab,tablen);
- goodwrite *= writetab(outf,lengthtab,tablen);
+ fseek(outf, 512, SEEK_SET);
+ goodwrite *= writetab(outf, starttab, tablen);
+ goodwrite *= writetab(outf, lengthtab, tablen);
MEM_freeN(image);
MEM_freeN(starttab);
MEM_freeN(lengthtab);
@@ -754,7 +754,7 @@ static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, cons
if (goodwrite)
return 1;
else {
- fprintf(stderr,"output_iris: not enough space for image!!\n");
+ fprintf(stderr, "output_iris: not enough space for image!!\n");
return 0;
}
}
@@ -765,7 +765,7 @@ static void lumrow(unsigned char *rgbptr, unsigned char *lumptr, int n)
{
lumptr += CHANOFFSET(0);
while (n--) {
- *lumptr = ILUM(rgbptr[OFFSET_R],rgbptr[OFFSET_G],rgbptr[OFFSET_B]);
+ *lumptr = ILUM(rgbptr[OFFSET_R], rgbptr[OFFSET_G], rgbptr[OFFSET_B]);
lumptr += 4;
rgbptr += 4;
}
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 6abfbdb4aa1..c71763b245d 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -158,7 +158,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
if ((image->numcomps * image->x1 * image->y1) == 0) {
- fprintf(stderr,"\nError: invalid raw image parameters\n");
+ fprintf(stderr, "\nError: invalid raw image parameters\n");
return NULL;
}
@@ -339,7 +339,7 @@ static void cinema_parameters(opj_cparameters_t *parameters)
parameters->tp_flag = 'C';
parameters->tp_on = 1;
- /*Tile and Image shall be at (0,0)*/
+ /*Tile and Image shall be at (0, 0)*/
parameters->cp_tx0 = 0;
parameters->cp_ty0 = 0;
parameters->image_offset_x0 = 0;
@@ -363,7 +363,7 @@ static void cinema_parameters(opj_cparameters_t *parameters)
}
-static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_fol_t *img_fol)
+static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *image, img_fol_t *img_fol)
{
int i;
float temp_rate;
@@ -375,9 +375,9 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
parameters->numresolution = 6;
}
if (!((image->comps[0].w == 2048) || (image->comps[0].h == 1080))) {
- fprintf(stdout,"Image coordinates %d x %d is not 2K compliant.\nJPEG Digital Cinema Profile-3 "
+ fprintf(stdout, "Image coordinates %d x %d is not 2K compliant.\nJPEG Digital Cinema Profile-3 "
"(2K profile) compliance requires that at least one of coordinates match 2048 x 1080\n",
- image->comps[0].w,image->comps[0].h);
+ image->comps[0].w, image->comps[0].h);
parameters->cp_rsiz = STD_RSIZ;
}
break;
@@ -390,12 +390,12 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
parameters->numresolution = 7;
}
if (!((image->comps[0].w == 4096) || (image->comps[0].h == 2160))) {
- fprintf(stdout,"Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4"
+ fprintf(stdout, "Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4"
"(4K profile) compliance requires that at least one of coordinates match 4096 x 2160\n",
- image->comps[0].w,image->comps[0].h);
+ image->comps[0].w, image->comps[0].h);
parameters->cp_rsiz = STD_RSIZ;
}
- parameters->numpocs = initialise_4K_poc(parameters->POC,parameters->numresolution);
+ parameters->numpocs = initialise_4K_poc(parameters->POC, parameters->numresolution);
break;
case OFF:
/* do nothing */
@@ -465,13 +465,13 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
int i, numcomps, w, h, prec;
- int x,y, y_row;
+ int x, y, y_row;
OPJ_COLOR_SPACE color_space;
opj_image_cmptparm_t cmptparm[4]; /* maximum of 4 components */
opj_image_t * image = NULL;
img_fol_t img_fol; /* only needed for cinema presets */
- memset(&img_fol,0,sizeof(img_fol_t));
+ memset(&img_fol, 0, sizeof(img_fol_t));
if (ibuf->ftype & JP2_CINE) {
@@ -552,7 +552,7 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
float rgb[3];
switch (prec) {
- case 8: /* Convert blenders float color channels to 8,12 or 16bit ints */
+ case 8: /* Convert blenders float color channels to 8, 12 or 16bit ints */
for (y=h-1; y>=0; y--) {
y_row = y*w;
for (x=0; x<w; x++, rect_float+=4) {
@@ -665,7 +665,7 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
parameters->tcp_mct = image->numcomps == 3 ? 1 : 0;
if (parameters->cp_cinema) {
- cinema_setup_encoder(parameters,image,&img_fol);
+ cinema_setup_encoder(parameters, image, &img_fol);
}
if (img_fol.rates)
@@ -748,7 +748,7 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
}
fwrite(cio->buffer, 1, codestream_length, f);
fclose(f);
- fprintf(stderr,"Generated outfile %s\n",name);
+ fprintf(stderr, "Generated outfile %s\n", name);
/* close and free the byte stream */
opj_cio_close(cio);
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 44b7472b910..50bc55da412 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1024,7 +1024,7 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags)
addzbuffloatImBuf(ibuf);
firstz= ibuf->zbuf_float - (dw.min.x - dw.min.y*width);
firstz+= (height-1)*width;
- frameBuffer.insert ("Z", Slice (Imf::FLOAT, (char *)firstz , sizeof(float), -width*sizeof(float)));
+ frameBuffer.insert("Z", Slice (Imf::FLOAT, (char *)firstz, sizeof(float), -width * sizeof(float)));
}
file->setFrameBuffer (frameBuffer);
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index 61f90f7a97a..e9d549be8b9 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -152,7 +152,7 @@ ImBuf *IMB_testiffname(const char *filepath, int flags)
imb_cache_filename(filepath_tx, filepath, flags);
- file = BLI_open(filepath_tx,O_BINARY|O_RDONLY,0);
+ file = BLI_open(filepath_tx, O_BINARY|O_RDONLY, 0);
if (file < 0) return NULL;
ibuf=IMB_loadifffile(file, flags|IB_test|IB_multilayer, filepath_tx);
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 6ea84fd6717..9f025803c2e 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -359,13 +359,13 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx,
/* copy */
for (;height > 0; height--) {
if (do_char) {
- memcpy(drect,srect, width * sizeof(int));
+ memcpy(drect, srect, width * sizeof(int));
drect += destskip;
srect += srcskip;
}
if (do_float) {
- memcpy(drectf,srectf, width * sizeof(float) * 4);
+ memcpy(drectf, srectf, width * sizeof(float) * 4);
drectf += destskip*4;
srectf += srcskip*4;
}
@@ -496,8 +496,8 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
CLAMP(y1, 0, height);
CLAMP(y2, 0, height);
- if (x1>x2) SWAP(int,x1,x2);
- if (y1>y2) SWAP(int,y1,y2);
+ if (x1>x2) SWAP(int, x1, x2);
+ if (y1>y2) SWAP(int, y1, y2);
if (x1==x2 || y1==y2) return;
a = col[3];
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index a7b994beef9..7f5430dad8a 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -53,10 +53,10 @@
struct ImBuf *IMB_half_x(struct ImBuf *ibuf1)
{
struct ImBuf *ibuf2;
- uchar *p1,*_p1,*dest;
- short a,r,g,b;
- int x,y;
- float af,rf,gf,bf, *p1f, *_p1f, *destf;
+ uchar *p1, *_p1, *dest;
+ short a, r, g, b;
+ int x, y;
+ float af, rf, gf, bf, *p1f, *_p1f, *destf;
int do_rect, do_float;
if (ibuf1==NULL) return (NULL);
@@ -119,7 +119,7 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1)
struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1)
{
struct ImBuf *ibuf2;
- int *p1,*dest, i, col, do_rect, do_float;
+ int *p1, *dest, i, col, do_rect, do_float;
float *p1f, *destf;
if (ibuf1==NULL) return (NULL);
@@ -128,7 +128,7 @@ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1)
do_rect= (ibuf1->rect != NULL);
do_float= (ibuf1->rect_float != NULL);
- ibuf2 = IMB_allocImBuf(2 * ibuf1->x , ibuf1->y , ibuf1->planes, ibuf1->flags);
+ ibuf2 = IMB_allocImBuf(2 * ibuf1->x, ibuf1->y, ibuf1->planes, ibuf1->flags);
if (ibuf2==NULL) return (NULL);
p1 = (int *) ibuf1->rect;
@@ -172,11 +172,11 @@ struct ImBuf *IMB_double_x(struct ImBuf *ibuf1)
struct ImBuf *IMB_half_y(struct ImBuf *ibuf1)
{
struct ImBuf *ibuf2;
- uchar *p1,*p2,*_p1,*dest;
- short a,r,g,b;
- int x,y;
+ uchar *p1, *p2, *_p1, *dest;
+ short a, r, g, b;
+ int x, y;
int do_rect, do_float;
- float af,rf,gf,bf,*p1f,*p2f,*_p1f,*destf;
+ float af, rf, gf, bf, *p1f, *p2f, *_p1f, *destf;
p1= p2= NULL;
p1f= p2f= NULL;
@@ -187,7 +187,7 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1)
do_rect= (ibuf1->rect != NULL);
do_float= (ibuf1->rect_float != NULL);
- ibuf2 = IMB_allocImBuf(ibuf1->x , (ibuf1->y) / 2 , ibuf1->planes, ibuf1->flags);
+ ibuf2 = IMB_allocImBuf(ibuf1->x, (ibuf1->y) / 2, ibuf1->planes, ibuf1->flags);
if (ibuf2==NULL) return (NULL);
_p1 = (uchar *) ibuf1->rect;
@@ -246,7 +246,7 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1)
struct ImBuf *ibuf2;
int *p1, *dest1, *dest2;
float *p1f, *dest1f, *dest2f;
- int x,y;
+ int x, y;
int do_rect, do_float;
if (ibuf1==NULL) return (NULL);
@@ -255,7 +255,7 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1)
do_rect= (ibuf1->rect != NULL);
do_float= (ibuf1->rect_float != NULL);
- ibuf2 = IMB_allocImBuf(ibuf1->x , 2 * ibuf1->y , ibuf1->planes, ibuf1->flags);
+ ibuf2 = IMB_allocImBuf(ibuf1->x, 2 * ibuf1->y, ibuf1->planes, ibuf1->flags);
if (ibuf2==NULL) return (NULL);
p1 = (int *) ibuf1->rect;
@@ -297,7 +297,7 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1)
{
uchar *p1, *p2 = NULL, *dest;
float *p1f, *destf, *p2f = NULL;
- int x,y;
+ int x, y;
const short do_rect= (ibuf1->rect != NULL);
const short do_float= (ibuf1->rect_float != NULL) && (ibuf2->rect_float != NULL);
@@ -1093,18 +1093,18 @@ static struct ImBuf *scaledowny(struct ImBuf *ibuf, int newy)
static struct ImBuf *scaleupx(struct ImBuf *ibuf, int newx)
{
- uchar *rect,*_newrect=NULL,*newrect;
- float *rectf,*_newrectf=NULL,*newrectf;
- float sample,add;
- float val_a,nval_a,diff_a;
- float val_b,nval_b,diff_b;
- float val_g,nval_g,diff_g;
- float val_r,nval_r,diff_r;
- float val_af,nval_af,diff_af;
- float val_bf,nval_bf,diff_bf;
- float val_gf,nval_gf,diff_gf;
- float val_rf,nval_rf,diff_rf;
- int x,y, do_rect = 0, do_float = 0;
+ uchar *rect, *_newrect=NULL, *newrect;
+ float *rectf, *_newrectf=NULL, *newrectf;
+ float sample, add;
+ float val_a, nval_a, diff_a;
+ float val_b, nval_b, diff_b;
+ float val_g, nval_g, diff_g;
+ float val_r, nval_r, diff_r;
+ float val_af, nval_af, diff_af;
+ float val_bf, nval_bf, diff_bf;
+ float val_gf, nval_gf, diff_gf;
+ float val_rf, nval_rf, diff_rf;
+ int x, y, do_rect = 0, do_float = 0;
val_a = nval_a = diff_a = val_b = nval_b = diff_b = 0;
val_g = nval_g = diff_g = val_r = nval_r = diff_r = 0;
@@ -1260,18 +1260,18 @@ static struct ImBuf *scaleupx(struct ImBuf *ibuf, int newx)
static struct ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
{
- uchar *rect,*_newrect=NULL,*newrect;
- float *rectf,*_newrectf=NULL,*newrectf;
- float sample,add;
- float val_a,nval_a,diff_a;
- float val_b,nval_b,diff_b;
- float val_g,nval_g,diff_g;
- float val_r,nval_r,diff_r;
- float val_af,nval_af,diff_af;
- float val_bf,nval_bf,diff_bf;
- float val_gf,nval_gf,diff_gf;
- float val_rf,nval_rf,diff_rf;
- int x,y, do_rect = 0, do_float = 0, skipx;
+ uchar *rect, *_newrect=NULL, *newrect;
+ float *rectf, *_newrectf=NULL, *newrectf;
+ float sample, add;
+ float val_a, nval_a, diff_a;
+ float val_b, nval_b, diff_b;
+ float val_g, nval_g, diff_g;
+ float val_r, nval_r, diff_r;
+ float val_af, nval_af, diff_af;
+ float val_bf, nval_bf, diff_bf;
+ float val_gf, nval_gf, diff_gf;
+ float val_rf, nval_rf, diff_rf;
+ int x, y, do_rect = 0, do_float = 0, skipx;
val_a = nval_a = diff_a = val_b = nval_b = diff_b = 0;
val_g = nval_g = diff_g = val_r = nval_r = diff_r = 0;
@@ -1484,10 +1484,10 @@ struct ImBuf *IMB_scaleImBuf(struct ImBuf * ibuf, unsigned int newx, unsigned in
return ibuf;
}
- if (newx < ibuf->x) if (newx) scaledownx(ibuf,newx);
- if (newy < ibuf->y) if (newy) scaledowny(ibuf,newy);
- if (newx > ibuf->x) if (newx) scaleupx(ibuf,newx);
- if (newy > ibuf->y) if (newy) scaleupy(ibuf,newy);
+ if (newx < ibuf->x) if (newx) scaledownx(ibuf, newx);
+ if (newy < ibuf->y) if (newy) scaledowny(ibuf, newy);
+ if (newx > ibuf->x) if (newx) scaleupx(ibuf, newx);
+ if (newy > ibuf->y) if (newy) scaleupy(ibuf, newy);
return(ibuf);
}
@@ -1498,10 +1498,10 @@ struct imbufRGBA {
struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy)
{
- unsigned int *rect,*_newrect,*newrect;
+ unsigned int *rect, *_newrect, *newrect;
struct imbufRGBA *rectf, *_newrectf, *newrectf;
- int x,y, do_float=0, do_rect=0;
- int ofsx,ofsy,stepx,stepy;
+ int x, y, do_float=0, do_rect=0;
+ int ofsx, ofsy, stepx, stepy;
rect = NULL; _newrect = NULL; newrect = NULL;
rectf = NULL; _newrectf = NULL; newrectf = NULL;
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index 0ed9b99d0ee..1a05dd93229 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -73,7 +73,7 @@ static int tga_out1(unsigned int data, FILE *file)
uchar *p;
p = (uchar *) & data;
- if (putc(p[0],file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
return (~EOF);
}
@@ -82,8 +82,8 @@ static int tga_out2(unsigned int data, FILE * file)
uchar *p;
p = (uchar *) & data;
- if (putc(p[0],file) == EOF) return(EOF);
- if (putc(p[1],file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
+ if (putc(p[1], file) == EOF) return(EOF);
return (~EOF);
}
@@ -93,9 +93,9 @@ static int tga_out3(unsigned int data, FILE * file)
uchar *p;
p = (uchar *) & data;
- if (putc(p[2],file) == EOF) return(EOF);
- if (putc(p[1],file) == EOF) return(EOF);
- if (putc(p[0],file) == EOF) return(EOF);
+ if (putc(p[2], file) == EOF) return(EOF);
+ if (putc(p[1], file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
return (~EOF);
}
@@ -106,16 +106,16 @@ static int tga_out4(unsigned int data, FILE * file)
p = (uchar *) & data;
/* order = bgra */
- if (putc(p[2],file) == EOF) return(EOF);
- if (putc(p[1],file) == EOF) return(EOF);
- if (putc(p[0],file) == EOF) return(EOF);
- if (putc(p[3],file) == EOF) return(EOF);
+ if (putc(p[2], file) == EOF) return(EOF);
+ if (putc(p[1], file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
+ if (putc(p[3], file) == EOF) return(EOF);
return (~EOF);
}
static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FILE*))
{
- register int last,this;
+ register int last, this;
register int copy, bytes;
register unsigned int *rect, *rectstart, *temp;
int y;
@@ -150,9 +150,9 @@ static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FI
last = copy;
if (copy>=128) last = 128;
copy -= last;
- if (fputc(last-1,file) == EOF) return(0);
+ if (fputc(last-1, file) == EOF) return(0);
do {
- if (out(*rect++,file) == EOF) return(0);
+ if (out(*rect++, file) == EOF) return(0);
} while (--last != 0);
}
rectstart = rect;
@@ -173,17 +173,17 @@ static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FI
while (copy) {
if (copy>128) {
- if (fputc(255,file) == EOF) return(0);
+ if (fputc(255, file) == EOF) return(0);
copy -= 128;
}
else {
if (copy == 1) {
- if (fputc(0,file) == EOF) return(0);
+ if (fputc(0, file) == EOF) return(0);
}
- else if (fputc(127 + copy,file) == EOF) return(0);
+ else if (fputc(127 + copy, file) == EOF) return(0);
copy = 0;
}
- if (out(last,file) == EOF) return(0);
+ if (out(last, file) == EOF) return(0);
}
copy=TRUE;
}
@@ -276,10 +276,10 @@ int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags)
if (ibuf->planes==32) {
buf[17] |= 0x08;
}
- fildes = BLI_fopen(name,"wb");
+ fildes = BLI_fopen(name, "wb");
if (!fildes) return 0;
- if (fwrite(buf, 1, 18,fildes) != 18) {
+ if (fwrite(buf, 1, 18, fildes) != 18) {
fclose(fildes);
return (0);
}
@@ -485,10 +485,10 @@ partial_load:
complete_partial_load(ibuf, rect);
}
-static void ldtarga(struct ImBuf * ibuf,unsigned char * mem, size_t mem_size, int psize)
+static void ldtarga(struct ImBuf * ibuf, unsigned char * mem, size_t mem_size, int psize)
{
unsigned char *mem_end = mem+mem_size;
- int col,size;
+ int col, size;
unsigned int *rect;
uchar * cp = (uchar *) &col;
@@ -553,10 +553,10 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
unsigned int *rect, *cmap= NULL /*, mincol= 0*/, maxcol= 0;
uchar * cp = (uchar *) &col;
- if (checktarga(&tga,mem) == 0) return(NULL);
+ if (checktarga(&tga, mem) == 0) return(NULL);
- if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,tga.pixsize, 0);
- else ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,(tga.pixsize + 0x7) & ~0x7, IB_rect);
+ if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize, tga.ysize, tga.pixsize, 0);
+ else ibuf = IMB_allocImBuf(tga.xsize, tga.ysize, (tga.pixsize + 0x7) & ~0x7, IB_rect);
if (ibuf == NULL) return(NULL);
ibuf->ftype = TGA;
@@ -621,18 +621,18 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
case 1:
case 2:
case 3:
- if (tga.pixsize <= 8) ldtarga(ibuf,mem,mem_size,0);
- else if (tga.pixsize <= 16) ldtarga(ibuf,mem,mem_size,1);
- else if (tga.pixsize <= 24) ldtarga(ibuf,mem,mem_size,2);
- else if (tga.pixsize <= 32) ldtarga(ibuf,mem,mem_size,3);
+ if (tga.pixsize <= 8) ldtarga(ibuf, mem, mem_size, 0);
+ else if (tga.pixsize <= 16) ldtarga(ibuf, mem, mem_size, 1);
+ else if (tga.pixsize <= 24) ldtarga(ibuf, mem, mem_size, 2);
+ else if (tga.pixsize <= 32) ldtarga(ibuf, mem, mem_size, 3);
break;
case 9:
case 10:
case 11:
- if (tga.pixsize <= 8) decodetarga(ibuf,mem,mem_size,0);
- else if (tga.pixsize <= 16) decodetarga(ibuf,mem,mem_size,1);
- else if (tga.pixsize <= 24) decodetarga(ibuf,mem,mem_size,2);
- else if (tga.pixsize <= 32) decodetarga(ibuf,mem,mem_size,3);
+ if (tga.pixsize <= 8) decodetarga(ibuf, mem, mem_size, 0);
+ else if (tga.pixsize <= 16) decodetarga(ibuf, mem, mem_size, 1);
+ else if (tga.pixsize <= 24) decodetarga(ibuf, mem, mem_size, 2);
+ else if (tga.pixsize <= 32) decodetarga(ibuf, mem, mem_size, 3);
break;
}
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 9aeed8002e1..23080aee7ab 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -69,13 +69,13 @@
#define URI_MAX FILE_MAX*3 + 8
-static int get_thumb_dir( char* dir , ThumbSize size)
+static int get_thumb_dir(char *dir, ThumbSize size)
{
#ifdef WIN32
wchar_t dir_16 [MAX_PATH];
/* yes, applications shouldn't store data there, but so does GIMP :)*/
SHGetSpecialFolderPathW(0, dir_16, CSIDL_PROFILE, 0);
- conv_utf_16_to_8(dir_16,dir,FILE_MAX);
+ conv_utf_16_to_8(dir_16, dir, FILE_MAX);
#else
@@ -132,7 +132,7 @@ static const char hex[17] = "0123456789abcdef";
/* Note: This escape function works on file: URIs, but if you want to
* escape something else, please read RFC-2396 */
-static void escape_uri_string (const char *string, char* escaped_string, int len,UnsafeCharacterSet mask)
+static void escape_uri_string (const char *string, char* escaped_string, int len, UnsafeCharacterSet mask)
{
#define ACCEPTABLE(a) ((a)>=32 && (a)<128 && (acceptable[(a)-32] & use_mask))
@@ -302,7 +302,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
return NULL;
}
if (size == THB_FAIL) {
- img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata);
+ img = IMB_allocImBuf(1, 1, 32, IB_rect | IB_metadata);
if (!img) return NULL;
}
else {
@@ -398,7 +398,7 @@ ImBuf* IMB_thumb_read(const char* path, ThumbSize size)
char uri[FILE_MAX*3+8];
ImBuf *img = NULL;
- if (!uri_from_filename(path,uri)) {
+ if (!uri_from_filename(path, uri)) {
return NULL;
}
if (thumbpath_from_uri(uri, thumb, sizeof(thumb), size)) {
@@ -414,7 +414,7 @@ void IMB_thumb_delete(const char* path, ThumbSize size)
char thumb[FILE_MAX];
char uri[FILE_MAX*3+8];
- if (!uri_from_filename(path ,uri)) {
+ if (!uri_from_filename(path, uri)) {
return;
}
if (thumbpath_from_uri(uri, thumb, sizeof(thumb), size)) {
@@ -439,7 +439,7 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
if (stat(path, &st)) {
return NULL;
}
- if (!uri_from_filename(path,uri)) {
+ if (!uri_from_filename(path, uri)) {
return NULL;
}
if (thumbpath_from_uri(uri, thumb, sizeof(thumb), THB_FAIL)) {
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 9e819e56da5..62cf206dfec 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -154,12 +154,12 @@ static int IMB_ispic_name(const char *name)
if (UTIL_DEBUG) printf("IMB_ispic_name: loading %s\n", name);
- if (stat(name,&st) == -1)
+ if (stat(name, &st) == -1)
return FALSE;
if (((st.st_mode) & S_IFMT) != S_IFREG)
return FALSE;
- if ((fp = BLI_open(name,O_BINARY|O_RDONLY, 0)) < 0)
+ if ((fp = BLI_open(name, O_BINARY|O_RDONLY, 0)) < 0)
return FALSE;
if (read(fp, buf, 32) != 32) {
@@ -342,14 +342,14 @@ int imb_get_anim_type(const char * name)
/* stat test below fails on large files > 4GB */
if (isffmpeg(name)) return (ANIM_FFMPEG);
# endif
- if (stat(name,&st) == -1) return(0);
+ if (stat(name, &st) == -1) return(0);
if (((st.st_mode) & S_IFMT) != S_IFREG) return(0);
if (isavi(name)) return (ANIM_AVI);
if (ismovie(name)) return (ANIM_MOVIE);
#else
- if (stat(name,&st) == -1) return(0);
+ if (stat(name, &st) == -1) return(0);
if (((st.st_mode) & S_IFMT) != S_IFREG) return(0);
if (ismovie(name)) return (ANIM_MOVIE);
diff --git a/source/blender/makesdna/DNA_listBase.h b/source/blender/makesdna/DNA_listBase.h
index d0e7a2f4433..35549aee3d2 100644
--- a/source/blender/makesdna/DNA_listBase.h
+++ b/source/blender/makesdna/DNA_listBase.h
@@ -43,7 +43,7 @@ extern "C" {
/* generic - all structs which are used in linked-lists used this */
typedef struct Link
{
- struct Link *next,*prev;
+ struct Link *next, *prev;
} Link;
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index 89ed3ba055f..a0806481aea 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -95,7 +95,7 @@ typedef struct MLoop {
typedef struct MTexPoly {
struct Image *tpage;
char flag, transp;
- short mode,tile,unwrap;
+ short mode, tile, unwrap;
} MTexPoly;
/* can copy from/to MTexPoly/MTFace */
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 1abce525be2..01096b6459e 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -375,8 +375,8 @@ typedef struct NodeImageMultiFileSocket {
} NodeImageMultiFileSocket;
typedef struct NodeChroma {
- float t1,t2,t3;
- float fsize,fstrength,falpha;
+ float t1, t2, t3;
+ float fsize, fstrength, falpha;
float key[4];
short algorithm, channel;
} NodeChroma;
diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h
index a55b7b17a22..24bd023af88 100644
--- a/source/blender/makesdna/DNA_object_fluidsim.h
+++ b/source/blender/makesdna/DNA_object_fluidsim.h
@@ -50,16 +50,16 @@ typedef struct FluidVertexVelocity {
typedef struct FluidsimSettings {
struct FluidsimModifierData *fmd; /* for fast RNA access */
- /* domain,fluid or obstacle */
+ /* domain, fluid or obstacle */
short type;
- /* display advanced options in fluid sim tab (on=1,off=0)*/
+ /* display advanced options in fluid sim tab (on=1, off=0)*/
short show_advancedoptions;
/* domain object settings */
/* resolutions */
short resolutionxyz;
short previewresxyz;
- /* size of the domain in real units (meters along largest resolution x,y,z extent) */
+ /* size of the domain in real units (meters along largest resolution x, y, z extent) */
float realsize;
/* show original meshes, preview or final sim */
short guiDisplayMode;
@@ -85,7 +85,7 @@ typedef struct FluidsimSettings {
/* fluid object type settings */
/* gravity strength */
- float iniVelx,iniVely,iniVelz;
+ float iniVelx, iniVely, iniVelz;
/* store pointer to original mesh (for replacing the current one) */
struct Mesh *orgMesh;
@@ -106,8 +106,8 @@ typedef struct FluidsimSettings {
/* additional flags depending on the type, lower short contains flags
* to check validity, higher short additional flags */
short typeFlags;
- /* switch off velocity genration, volume init type for fluid/obstacles (volume=1,shell=2,both=3) */
- char domainNovecgen,volumeInitType;
+ /* switch off velocity genration, volume init type for fluid/obstacles (volume=1, shell=2, both=3) */
+ char domainNovecgen, volumeInitType;
/* boundary "stickiness" for part slip values */
float partSlipValue;
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 6fefd2d672f..25c9ad70ea1 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -327,7 +327,7 @@ typedef struct SoftBody {
maxloops,
choke,
solver_ID,
- plastic,springpreload
+ plastic, springpreload
;
struct SBScratch *scratch; /* scratch pad/cache on live time not saved in file */
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 0a516c90aa1..cd73b692011 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -208,7 +208,7 @@ typedef struct Editing {
/* ************* Effect Variable Structs ********* */
typedef struct WipeVars {
- float edgeWidth,angle;
+ float edgeWidth, angle;
short forward, wipetype;
} WipeVars;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 40c4a7fab9d..94c4d141a57 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -205,7 +205,7 @@ typedef struct ThemeSpace {
char grid[4];
char wire[4], select[4];
- char lamp[4], speaker[4], empty[4],camera[4], pad[8];
+ char lamp[4], speaker[4], empty[4], camera[4], pad[8];
char active[4], group[4], group_active[4], transform[4];
char vertex[4], vertex_select[4];
char edge[4], edge_select[4];
@@ -376,13 +376,13 @@ typedef struct UserDef {
short tb_leftmouse, tb_rightmouse;
struct SolidLight light[3];
short tw_hotspot, tw_flag, tw_handlesize, tw_size;
- short textimeout,texcollectrate;
+ short textimeout, texcollectrate;
short wmdrawmethod; /* removed wmpad */
short dragthreshold;
int memcachelimit;
int prefetchframes;
short frameserverport;
- short pad_rot_angle; /*control the rotation step of the view when PAD2,PAD4,PAD6&PAD8 is use*/
+ short pad_rot_angle; /*control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use*/
short obcenter_dia;
short rvisize; /* rotating view icon size */
short rvibright; /* rotating view icon brightness */
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index f9572e1313a..adcdf5df106 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -360,8 +360,8 @@ static int add_name(const char *str)
* */
buf[i] = 0;
if (debugSDNA > 3) printf("Name before chomping: %s\n", buf);
- if ((strncmp(buf,"(*headdraw", 10) == 0) ||
- (strncmp(buf,"(*windraw", 9) == 0) )
+ if ((strncmp(buf, "(*headdraw", 10) == 0) ||
+ (strncmp(buf, "(*windraw", 9) == 0) )
{
buf[i] = ')';
buf[i+1] = '(';
@@ -766,7 +766,7 @@ static int calculate_structlens(int firststruct)
}
if (alphalen % 8) {
- printf("Align pointer error in struct (alphalen8): %s %s\n", types[structtype],cp);
+ printf("Align pointer error in struct (alphalen8): %s %s\n", types[structtype], cp);
dna_error = 1;
}
@@ -792,7 +792,7 @@ static int calculate_structlens(int firststruct)
/* struct alignment */
if (type >= firststruct) {
if (sizeof(void *)==8 && (len % 8) ) {
- printf("Align struct error: %s %s\n", types[structtype],cp);
+ printf("Align struct error: %s %s\n", types[structtype], cp);
dna_error = 1;
}
}
@@ -890,7 +890,7 @@ void dna_write(FILE *file, void *pntr, int size)
data = (char *) pntr;
for (i = 0 ; i < size ; i++) {
- fprintf(file, "%d,", data[i]);
+ fprintf(file, "%d, ", data[i]);
linelength++;
if (linelength >= MAX_DNA_LINE_LENGTH) {
fprintf(file, "\n");
@@ -989,7 +989,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
/* FOR DEBUG */
if (debugSDNA > 1) {
- int a,b;
+ int a, b;
/* short *elem; */
short num_types;
@@ -1007,7 +1007,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
for (a=0; a<nr_structs; a++) {
sp= structs[a];
- printf(" struct %s elems: %d size: %d\n", types[sp[0]], sp[1],typelens[sp[0]]);
+ printf(" struct %s elems: %d size: %d\n", types[sp[0]], sp[1], typelens[sp[0]]);
num_types = sp[1];
sp+= 2;
/* ? num_types was elem? */
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index ca29dcd341d..62957ac5de8 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -281,7 +281,7 @@ static void rna_sortlist(ListBase *listbase, int(*cmp)(const void*, const void*)
static void rna_print_c_string(FILE *f, const char *str)
{
- static const char *escape[] = {"\''", "\"\"", "\??", "\\\\","\aa", "\bb", "\ff", "\nn", "\rr", "\tt", "\vv", NULL};
+ static const char *escape[] = {"\''", "\"\"", "\??", "\\\\", "\aa", "\bb", "\ff", "\nn", "\rr", "\tt", "\vv", NULL};
int i, j;
if (!str) {
@@ -3126,7 +3126,7 @@ int main(int argc, char **argv)
totblock = MEM_get_memory_blocks_in_use();
if (totblock != 0) {
- fprintf(stderr, "Error Totblock: %d\n",totblock);
+ fprintf(stderr, "Error Totblock: %d\n", totblock);
MEM_set_error_callback(mem_error_cb);
MEM_printmemlist();
}
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 1159a1ba20e..20265f467d5 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -191,7 +191,7 @@ static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min,
-static void rna_Action_frame_range_get(PointerRNA *ptr,float *values)
+static void rna_Action_frame_range_get(PointerRNA *ptr, float *values)
{ /* don't include modifiers because they too easily can have very large
* ranges: MINAFRAMEF to MAXFRAMEF. */
calc_action_range(ptr->id.data, values, values+1, FALSE);
@@ -617,9 +617,9 @@ static void rna_def_action(BlenderRNA *brna)
rna_def_action_pose_markers(brna, prop);
/* properties */
- prop = RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" ,
- "The final frame range of all F-Curves within this action" , 0 , 0);
- RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get" , NULL, NULL);
+ prop = RNA_def_float_vector(srna, "frame_range", 2, NULL, 0, 0, "Frame Range",
+ "The final frame range of all F-Curves within this action", 0, 0);
+ RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get", NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* special "type" limiter - should not really be edited in general,
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index e8eed526a7c..3b89899702d 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -141,7 +141,7 @@ static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value)
switch (ca->type) {
case ACT_CONST_TYPE_ORI:
/* negative axis not supported in the orientation mode */
- if (ELEM3(ca->mode, ACT_CONST_DIRNX,ACT_CONST_DIRNY, ACT_CONST_DIRNZ))
+ if (ELEM3(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ))
ca->mode = ACT_CONST_NONE;
break;
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index ce9edc17999..2f27c7a1e84 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -407,7 +407,7 @@ static void rna_def_boidrule(BlenderRNA *brna)
/* data */
srna = RNA_def_struct(brna, "BoidRule", NULL);
- RNA_def_struct_ui_text(srna , "Boid Rule", "");
+ RNA_def_struct_ui_text(srna, "Boid Rule", "");
RNA_def_struct_refine_func(srna, "rna_BoidRule_refine");
RNA_def_struct_path_func(srna, "rna_BoidRule_path");
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 5093c1a6eee..4444f7aa3cc 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -52,7 +52,7 @@ EnumPropertyItem brush_sculpt_tool_items[] = {
{SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""},
{SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""},
{SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""},
- {SCULPT_TOOL_CREASE, "CREASE",ICON_BRUSH_CREASE, "Crease", ""},
+ {SCULPT_TOOL_CREASE, "CREASE", ICON_BRUSH_CREASE, "Crease", ""},
{SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
{SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
{SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
@@ -572,7 +572,7 @@ static void rna_def_brush(BlenderRNA *brna)
prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rate");
- RNA_def_property_range(prop, 0.0001f , 10000.0f);
+ RNA_def_property_range(prop, 0.0001f, 10000.0f);
RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
RNA_def_property_update(prop, 0, "rna_Brush_update");
@@ -867,7 +867,7 @@ static void rna_def_brush(BlenderRNA *brna)
prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "clone.offset");
RNA_def_property_ui_text(prop, "Clone Offset", "");
- RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3);
+ RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update");
/* brush capabilities (mode-dependent) */
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 6d67f0c00dd..e321e83dd61 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -68,7 +68,7 @@ EnumPropertyItem constraint_type_items[] = {
{CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", ICON_CONSTRAINT_DATA, "Locked Track",
"Tracking along a single axis"},
{CONSTRAINT_TYPE_SPLINEIK, "SPLINE_IK", ICON_CONSTRAINT_DATA, "Spline IK", ""},
- {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO",ICON_CONSTRAINT_DATA, "Stretch To", ""},
+ {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", ICON_CONSTRAINT_DATA, "Stretch To", ""},
{CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To",
"Legacy tracking constraint prone to twisting artifacts"},
{0, "", 0, N_("Relationship"), ""},
@@ -1020,7 +1020,7 @@ static void rna_def_constraint_minmax(BlenderRNA *brna)
srna = RNA_def_struct(brna, "FloorConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Floor Constraint", "Use the target object for location limitation");
- RNA_def_struct_sdna_from(srna, "bMinMaxConstraint","data");
+ RNA_def_struct_sdna_from(srna, "bMinMaxConstraint", "data");
prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tar");
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index a4aac6f345c..003b4ae4fbc 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -141,7 +141,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
psys->flag |= PSYS_ENABLED;
BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name));
- BLI_addtail(&ob->particlesystem,psys);
+ BLI_addtail(&ob->particlesystem, psys);
/* add modifier */
psmd = (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem);
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index e5939296f5a..f7e7435598b 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -212,13 +212,13 @@ static int rna_Image_has_data_get(PointerRNA *ptr)
return 0;
}
-static void rna_Image_size_get(PointerRNA *ptr,int *values)
+static void rna_Image_size_get(PointerRNA *ptr, int *values)
{
Image *im = (Image*)ptr->data;
ImBuf *ibuf;
void *lock;
- ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
+ ibuf = BKE_image_acquire_ibuf(im, NULL, &lock);
if (ibuf) {
values[0] = ibuf->x;
values[1] = ibuf->y;
@@ -237,7 +237,7 @@ static void rna_Image_resolution_get(PointerRNA *ptr, float *values)
ImBuf *ibuf;
void *lock;
- ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
+ ibuf = BKE_image_acquire_ibuf(im, NULL, &lock);
if (ibuf) {
values[0] = ibuf->ppm[0];
values[1] = ibuf->ppm[1];
@@ -256,7 +256,7 @@ static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
ImBuf *ibuf;
void *lock;
- ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
+ ibuf = BKE_image_acquire_ibuf(im, NULL, &lock);
if (ibuf) {
ibuf->ppm[0] = values[0];
ibuf->ppm[1] = values[1];
@@ -616,13 +616,13 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Depth", "Image bit depth");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop = RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" ,
- "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
- RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL);
+ prop = RNA_def_int_vector(srna, "size", 2, NULL, 0, 0, "Size",
+ "Width and height in pixels, zero when image data cant be loaded", 0, 0);
+ RNA_def_property_int_funcs(prop, "rna_Image_size_get", NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- prop = RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0);
- RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL);
+ prop = RNA_def_float_vector(srna, "resolution", 2, NULL, 0, 0, "Resolution", "X/Y pixels per meter", 0, 0);
+ RNA_def_property_float_funcs(prop, "rna_Image_resolution_get", "rna_Image_resolution_set", NULL);
prop = RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC);
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 671bee80523..dda287a164c 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -600,7 +600,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_shadbuftype_items[] = {
- {LA_SHADBUF_REGULAR , "REGULAR", 0, "Classical", "Classic shadow buffer"},
+ {LA_SHADBUF_REGULAR, "REGULAR", 0, "Classical", "Classic shadow buffer"},
{LA_SHADBUF_HALFWAY, "HALFWAY", 0, "Classic-Halfway",
"Regular buffer, averaging the closest and 2nd closest Z value to reducing "
"bias artifacts"},
@@ -612,7 +612,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_shadbuffiltertype_items[] = {
- {LA_SHADBUF_BOX , "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"},
+ {LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"},
{LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"},
{LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"},
{0, NULL, 0, NULL, NULL}};
@@ -677,7 +677,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotblend");
- RNA_def_property_range(prop, 0.0f ,1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index cb4eea5c25b..1a039295924 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -301,7 +301,7 @@ void RNA_def_main(BlenderRNA *brna)
RNA_def_main_window_managers},
{"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks", RNA_def_main_images},
{"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks", RNA_def_main_lattices},
- {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves} ,
+ {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves},
{"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks", RNA_def_main_metaballs},
{"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font datablocks", RNA_def_main_fonts},
{"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks", RNA_def_main_textures},
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 7802241a25b..8aabc515dcb 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -766,7 +766,7 @@ static void rna_def_material_gamesettings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_face_orientation_items[] = {
- {GEMAT_NORMAL,"NORMAL",0,"Normal","No tranformation"},
+ {GEMAT_NORMAL, "NORMAL", 0, "Normal", "No tranformation"},
{GEMAT_HALO, "HALO", 0, "Halo", "Screen aligned billboard"},
{GEMAT_BILLBOARD, "BILLBOARD", 0, "Billboard", "Billboard with Z-axis constraint"},
{GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"},
@@ -1244,7 +1244,7 @@ static void rna_def_material_volume(BlenderRNA *brna)
prop = RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scattering");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Scattering",
"Amount of light that gets scattered out by the volume - "
"the more out-scattering, the shallower the light will penetrate");
@@ -1267,7 +1267,7 @@ static void rna_def_material_volume(BlenderRNA *brna)
prop = RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "reflection");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1 ,3);
+ RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
RNA_def_property_ui_text(prop, "Reflection",
"Multiplier to make out-scattered light brighter or darker (non-physically correct)");
RNA_def_property_update(prop, 0, "rna_Material_update");
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index ca1b3a86087..8c000e522ba 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1444,7 +1444,7 @@ static void rna_def_modifier_array(BlenderRNA *brna)
/* Offset parameters */
prop = RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST);
- RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset");;
+ RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
@@ -3162,7 +3162,7 @@ void RNA_def_modifier(BlenderRNA *brna)
/* data */
srna = RNA_def_struct(brna, "Modifier", NULL);
- RNA_def_struct_ui_text(srna , "Modifier", "Modifier affecting the geometry data of an object");
+ RNA_def_struct_ui_text(srna, "Modifier", "Modifier affecting the geometry data of an object");
RNA_def_struct_refine_func(srna, "rna_Modifier_refine");
RNA_def_struct_path_func(srna, "rna_Modifier_path");
RNA_def_struct_sdna(srna, "ModifierData");
diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c
index ca06793cd49..96da24b3392 100644
--- a/source/blender/makesrna/intern/rna_movieclip.c
+++ b/source/blender/makesrna/intern/rna_movieclip.c
@@ -248,9 +248,9 @@ static void rna_def_movieclip(BlenderRNA *brna)
"Use a preview proxy and/or timecode index for this clip");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
- prop = RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size",
- "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
- RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get" , NULL, NULL);
+ prop = RNA_def_int_vector(srna, "size", 2, NULL, 0, 0, "Size",
+ "Width and height in pixels, zero when image data cant be loaded", 0, 0);
+ RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get", NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 140e874eb78..6a4809e54e5 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1888,9 +1888,9 @@ static void rna_def_object(BlenderRNA *brna)
"Axis Angle (W+XYZ), defines a rotation around some axis defined by 3D-Vector"},
{0, NULL, 0, NULL, NULL}};
- static float default_quat[4] = {1,0,0,0}; /* default quaternion values */
- static float default_axisAngle[4] = {0,0,1,0}; /* default axis-angle rotation values */
- static float default_scale[3] = {1,1,1}; /* default scale values */
+ static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */
+ static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */
+ static float default_scale[3] = {1, 1, 1}; /* default scale values */
static int boundbox_dimsize[] = {8, 3};
srna = RNA_def_struct(brna, "Object", "ID");
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index c52b6251223..2e8e597ad35 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -187,7 +187,7 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache)
pid2 = pid;
- else if (cache->name[0] != '\0' && strcmp(cache->name,pid->cache->name) == 0) {
+ else if (cache->name[0] != '\0' && strcmp(cache->name, pid->cache->name) == 0) {
/*TODO: report "name exists" to user */
BLI_strncpy(cache->name, cache->prev_name, sizeof(cache->name));
new_name = 0;
@@ -513,7 +513,7 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA
/* add/remove modifier as needed */
if (!md) {
- if (pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield,PFIELD_GUIDE,PFIELD_TEXTURE) == 0)
+ if (pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield, PFIELD_GUIDE, PFIELD_TEXTURE) == 0)
if (ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
ED_object_modifier_add(NULL, bmain, scene, ob, NULL, eModifierType_Surface);
}
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index dd591ea7343..52c41c869bb 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -1516,7 +1516,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
{PART_AVE_GLOBAL_X, "GLOBAL_X", 0, "Global X", ""},
{PART_AVE_GLOBAL_Y, "GLOBAL_Y", 0, "Global Y", ""},
{PART_AVE_GLOBAL_Z, "GLOBAL_Z", 0, "Global Z", ""},
- {PART_AVE_RAND, "RAND", 0, "Random", ""} ,
+ {PART_AVE_RAND, "RAND", 0, "Random", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index b65924057cd..ceace424f35 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -736,9 +736,9 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
static void rna_def_pose_channel(BlenderRNA *brna)
{
- static float default_quat[4] = {1,0,0,0}; /* default quaternion values */
- static float default_axisAngle[4] = {0,0,1,0}; /* default axis-angle rotation values */
- static float default_scale[3] = {1,1,1}; /* default scale values */
+ static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */
+ static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */
+ static float default_scale[3] = {1, 1, 1}; /* default scale values */
const int matrix_dimsize[] = {4, 4};
@@ -1002,21 +1002,21 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop = RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikstretch");
- RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_rotation_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikrotweight");
- RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "IK Rot Weight", "Weight of rotation constraint for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "ik_linear_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "iklinweight");
- RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
@@ -1133,13 +1133,13 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop = RNA_def_property(srna, "precision", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "precision");
- RNA_def_property_range(prop, 0.0f,0.1f);
+ RNA_def_property_range(prop, 0.0f, 0.1f);
RNA_def_property_ui_text(prop, "Precision", "Precision of convergence in case of reiteration");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numiter");
- RNA_def_property_range(prop, 1.f,1000.f);
+ RNA_def_property_range(prop, 1.f, 1000.f);
RNA_def_property_ui_text(prop, "Iterations",
"Maximum number of iterations for convergence in case of reiteration");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
@@ -1173,19 +1173,19 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop = RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minstep");
- RNA_def_property_range(prop, 0.0f,0.1f);
+ RNA_def_property_range(prop, 0.0f, 0.1f);
RNA_def_property_ui_text(prop, "Min step", "Lower bound for timestep in second in case of automatic substeps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "step_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxstep");
- RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Max step", "Higher bound for timestep in second in case of automatic substeps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "feedback");
- RNA_def_property_range(prop, 0.0f,100.0f);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Feedback",
"Feedback coefficient for error correction, average response time is 1/feedback "
"(default=20)");
@@ -1193,7 +1193,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxvel");
- RNA_def_property_range(prop, 0.0f,100.0f);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s (default=50)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
@@ -1205,7 +1205,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop = RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampmax");
- RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Damp",
"Maximum damping coefficient when singular value is nearly 0 "
"(higher values=more stability, less reactivity - default=0.5)");
@@ -1213,7 +1213,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop = RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampeps");
- RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Epsilon",
"Singular value under which damping is progressively applied "
"(higher values=more stability, less reactivity - default=0.1)");
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c
index 3eac129a195..637e21cf6c5 100644
--- a/source/blender/makesrna/intern/rna_property.c
+++ b/source/blender/makesrna/intern/rna_property.c
@@ -109,7 +109,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
/* Base Struct for GameProperty */
srna = RNA_def_struct(brna, "GameProperty", NULL);
- RNA_def_struct_ui_text(srna , "Game Property", "Game engine user defined object property");
+ RNA_def_struct_ui_text(srna, "Game Property", "Game engine user defined object property");
RNA_def_struct_sdna(srna, "bProperty");
RNA_def_struct_refine_func(srna, "rna_GameProperty_refine");
@@ -132,7 +132,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
/* GameBooleanProperty */
srna = RNA_def_struct(brna, "GameBooleanProperty", "GameProperty");
- RNA_def_struct_ui_text(srna , "Game Boolean Property", "Game engine user defined Boolean property");
+ RNA_def_struct_ui_text(srna, "Game Boolean Property", "Game engine user defined Boolean property");
RNA_def_struct_sdna(srna, "bProperty");
RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -143,7 +143,7 @@ void RNA_def_gameproperty(BlenderRNA *brna)
/* GameIntProperty */
srna = RNA_def_struct(brna, "GameIntProperty", "GameProperty");
- RNA_def_struct_ui_text(srna , "Game Integer Property", "Game engine user defined integer number property");
+ RNA_def_struct_ui_text(srna, "Game Integer Property", "Game engine user defined integer number property");
RNA_def_struct_sdna(srna, "bProperty");
prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 359b1e4ee00..6a3fd47ba04 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -151,7 +151,7 @@ EnumPropertyItem snap_element_items[] = {
#ifdef WITH_CINEON
# define R_IMF_ENUM_CINEON {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", \
"Output image in Cineon format"},
-# define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX",ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
+# define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX", ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
#else
# define R_IMF_ENUM_CINEON
# define R_IMF_ENUM_DPX
@@ -2901,7 +2901,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
{CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
{CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
{CODEC_ID_QTRLE, "QTRLE", 0, "QTRLE", ""},
- /* {CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},*/ /* disabled for after release */
+ /* {CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""}, */ /* disabled for after release */
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem ffmpeg_audio_codec_items[] = {
@@ -3804,14 +3804,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
RNA_def_property_array(prop, 4);
- RNA_def_property_range(prop,0.0,1.0);
+ RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
RNA_def_property_array(prop, 4);
- RNA_def_property_range(prop,0.0,1.0);
+ RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Background", "Color to use behind stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index ff336ba6693..8bed95f88b2 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -369,7 +369,7 @@ static void rna_def_near_sensor(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "NearSensor", "Sensor");
- RNA_def_struct_ui_text(srna , "Near Sensor", "Sensor to detect nearby objects");
+ RNA_def_struct_ui_text(srna, "Near Sensor", "Sensor to detect nearby objects");
RNA_def_struct_sdna_from(srna, "bNearSensor", "data");
prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 7fecbb83fa5..775e943b9a2 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -1046,7 +1046,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied");
- RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set",NULL);
+ RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set", NULL);
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1061,7 +1061,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "");
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); /* overlap tests and calc_seq_disp */
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set", NULL); /* overlap tests and calc_seq_disp */
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -1116,7 +1116,7 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "machine");
RNA_def_property_range(prop, 0, MAXSEQ-1);
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip");
- RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set",NULL); /* overlap test */
+ RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set", NULL); /* overlap test */
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
/* blending */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 15f296b504b..a418de2c92d 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2612,7 +2612,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sort");
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index c314e9be0ba..e8253f4b51c 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -92,7 +92,7 @@ EnumPropertyItem blend_type_items[] = {
{MTEX_BLEND_VAL, "VALUE", 0, "Value", ""},
{MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""},
{MTEX_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
- {MTEX_LIN_LIGHT , "LINEAR_LIGHT", 0, "Linear Light", ""},
+ {MTEX_LIN_LIGHT, "LINEAR_LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -1558,19 +1558,19 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
static EnumPropertyItem point_source_items[] = {
{TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"},
{TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"},
- /*{TEX_PD_FILE, "FILE", 0 , "File", ""}, */
+ /*{TEX_PD_FILE, "FILE", 0, "File", ""}, */
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem particle_cache_items[] = {
{TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""},
{TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""},
- {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""},
+ {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0, "Global Space", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem vertice_cache_items[] = {
{TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""},
{TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""},
- {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""},
+ {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0, "Global Space", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem falloff_items[] = {
diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c
index 034696b43c5..b801dbb4fed 100644
--- a/source/blender/makesrna/intern/rna_texture_api.c
+++ b/source/blender/makesrna/intern/rna_texture_api.c
@@ -103,18 +103,18 @@ void RNA_api_environment_map(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- static const float default_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 };
+ static const float default_layout[] = {0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 2, 1};
func = RNA_def_function(srna, "clear", "clear_envmap");
RNA_def_function_ui_description(func, "Discard the environment map and free it from memory");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func = RNA_def_function(srna,"save", "save_envmap");
+ func = RNA_def_function(srna, "save", "save_envmap");
RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm = RNA_def_string_file_name(func,"filepath","",FILE_MAX,"File path","Location of the output file");
+ parm = RNA_def_string_file_name(func, "filepath", "", FILE_MAX, "File path", "Location of the output file");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken");
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 2e56d1a2a4d..813feb986dc 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -155,7 +155,7 @@ static void rna_userdef_gl_use_16bit_textures(Main *bmain, Scene *scene, Pointer
rna_userdef_update(bmain, scene, ptr);
}
-static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
+static void rna_userdef_select_mouse_set(PointerRNA *ptr, int value)
{
UserDef *userdef = (UserDef*)ptr->data;
@@ -178,7 +178,7 @@ static int rna_userdef_autokeymode_get(PointerRNA *ptr)
return retval;
}
-static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
+static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
{
UserDef *userdef = (UserDef*)ptr->data;
@@ -2872,20 +2872,20 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{10, "CATALAN", 0, "Catalan (Català)", "ca_AD"},
{16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"},
{11, "CZECH", 0, "Czech (Český)", "cs_CZ"},
-/* { 3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"},*/ /* XXX No po's yet. */
+/* { 3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"}, */ /* XXX No po's yet. */
{ 6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"},
{ 5, "GERMAN", 0, "German (Deutsch)", "de_DE"},
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
{ 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
{29, "KYRGYZ", 0, "Kyrgyz (Кыргыз тили)", "ky_KG"},
-/* {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"},*/ /* XXX No po's yet. */
+/* {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"}, */ /* XXX No po's yet. */
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
/* using the utf8 flipped form of Persian (فارسی) */
{26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_IR"},
{19, "POLISH", 0, "Polish (Polski)", "pl_PL"},
{12, "BRAZILIAN_PORTUGUESE", 0, "Portuguese (Português)", "pt"},
-/* {20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"},*/ /* XXX No po's yet. */
+/* {20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"}, */ /* XXX No po's yet. */
{17, "SERBIAN", 0, "Serbian (Српски)", "sr_RS"},
{28, "SERBIAN_LATIN", 0, "Serbian latin (Srpski latinica)", "sr_RS@latin"},
{ 7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c
index 8341bc67107..711c7e6e4ff 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.c
+++ b/source/blender/modifiers/intern/MOD_boolean_util.c
@@ -129,7 +129,7 @@ static void VertexIt_Construct(CSG_VertexIteratorDescriptor *output, DerivedMesh
if (output == 0) return;
// allocate some memory for blender iterator
- it = (VertexIt *)(MEM_mallocN(sizeof(VertexIt),"Boolean_VIt"));
+ it = (VertexIt *)(MEM_mallocN(sizeof(VertexIt), "Boolean_VIt"));
if (it == 0) {
return;
}
@@ -223,7 +223,7 @@ static void FaceIt_Construct(
if (output == 0) return;
// allocate some memory for blender iterator
- it = (FaceIt *)(MEM_mallocN(sizeof(FaceIt),"Boolean_FIt"));
+ it = (FaceIt *)(MEM_mallocN(sizeof(FaceIt), "Boolean_FIt"));
if (it == 0) {
return;
}
@@ -333,7 +333,7 @@ static void InterpCSGFace(
else
copy_v3_v3(obco, co[j]);
- interp_weights_face_v3( w[j],orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco);
+ interp_weights_face_v3(w[j], orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco);
}
CustomData_interp(&orig_dm->faceData, &dm->faceData, &orig_index, NULL, (float*)w, 1, index);
@@ -496,8 +496,8 @@ static void BuildMeshDescriptors(
struct CSG_FaceIteratorDescriptor * face_it,
struct CSG_VertexIteratorDescriptor * vertex_it)
{
- VertexIt_Construct(vertex_it,dm, ob);
- FaceIt_Construct(face_it,dm,face_offset,ob);
+ VertexIt_Construct(vertex_it, dm, ob);
+ FaceIt_Construct(face_it, dm, face_offset, ob);
}
static void FreeMeshDescriptors(
@@ -551,7 +551,7 @@ static DerivedMesh *NewBooleanDerivedMesh_intern(
}
BuildMeshDescriptors(dm_select, ob_select, 0, &fd_1, &vd_1);
- BuildMeshDescriptors(dm, ob, dm_select->getNumTessFaces(dm_select) , &fd_2, &vd_2);
+ BuildMeshDescriptors(dm, ob, dm_select->getNumTessFaces(dm_select), &fd_2, &vd_2);
bool_op = CSG_NewBooleanFunction();
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index 11542dc4c1a..af1969061fe 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -104,8 +104,8 @@ static void createFacepa(ExplodeModifierData *emd,
ParticleData *pa;
KDTree *tree;
float center[3], co[3];
- int *facepa=NULL,*vertpa=NULL,totvert=0,totface=0,totpart=0;
- int i,p,v1,v2,v3,v4=0;
+ int *facepa=NULL, *vertpa=NULL, totvert=0, totface=0, totpart=0;
+ int i, p, v1, v2, v3, v4=0;
mvert = dm->getVertArray(dm);
mface = dm->getTessFaceArray(dm);
@@ -145,24 +145,24 @@ static void createFacepa(ExplodeModifierData *emd,
/* make tree of emitter locations */
tree=BLI_kdtree_new(totpart);
- for (p=0,pa=psys->particles; p<totpart; p++,pa++) {
- psys_particle_on_emitter(psmd,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,NULL,NULL,NULL,NULL,NULL);
+ for (p=0, pa=psys->particles; p<totpart; p++, pa++) {
+ psys_particle_on_emitter(psmd, psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, NULL, NULL, NULL, NULL, NULL);
BLI_kdtree_insert(tree, p, co, NULL);
}
BLI_kdtree_balance(tree);
/* set face-particle-indexes to nearest particle to face center */
- for (i=0,fa=mface; i<totface; i++,fa++) {
- add_v3_v3v3(center,mvert[fa->v1].co,mvert[fa->v2].co);
+ for (i=0, fa=mface; i<totface; i++, fa++) {
+ add_v3_v3v3(center, mvert[fa->v1].co, mvert[fa->v2].co);
add_v3_v3(center, mvert[fa->v3].co);
if (fa->v4) {
add_v3_v3(center, mvert[fa->v4].co);
- mul_v3_fl(center,0.25);
+ mul_v3_fl(center, 0.25);
}
else
- mul_v3_fl(center,0.3333f);
+ mul_v3_fl(center, 0.3333f);
- p= BLI_kdtree_find_nearest(tree,center,NULL,NULL);
+ p= BLI_kdtree_find_nearest(tree, center, NULL, NULL);
v1=vertpa[fa->v1];
v2=vertpa[fa->v2];
@@ -545,7 +545,7 @@ static void remap_uvs_23(DerivedMesh *dm, DerivedMesh *split, int numlayer, int
static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
{
DerivedMesh *splitdm;
- MFace *mf=NULL,*df1=NULL;
+ MFace *mf=NULL, *df1=NULL;
MFace *mface=dm->getTessFaceArray(dm);
MVert *dupve, *mv;
EdgeHash *edgehash;
@@ -553,10 +553,10 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
int totvert=dm->getNumVerts(dm);
int totface=dm->getNumTessFaces(dm);
- int *facesplit = MEM_callocN(sizeof(int)*totface,"explode_facesplit");
- int *vertpa = MEM_callocN(sizeof(int)*totvert,"explode_vertpa2");
+ int *facesplit = MEM_callocN(sizeof(int)*totface, "explode_facesplit");
+ int *vertpa = MEM_callocN(sizeof(int)*totvert, "explode_vertpa2");
int *facepa = emd->facepa;
- int *fs, totesplit=0,totfsplit=0,curdupface=0;
+ int *fs, totesplit=0, totfsplit=0, curdupface=0;
int i, v1, v2, v3, v4, esplit,
v[4] = {0, 0, 0, 0}, /* To quite gcc barking... */
uv[4] = {0, 0, 0, 0}; /* To quite gcc barking... */
@@ -566,7 +566,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
edgehash= BLI_edgehash_new();
/* recreate vertpa from facepa calculation */
- for (i=0,mf=mface; i<totface; i++,mf++) {
+ for (i=0, mf=mface; i<totface; i++, mf++) {
vertpa[mf->v1]=facepa[i];
vertpa[mf->v2]=facepa[i];
vertpa[mf->v3]=facepa[i];
@@ -575,7 +575,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
}
/* mark edges for splitting and how to split faces */
- for (i=0,mf=mface,fs=facesplit; i<totface; i++,mf++,fs++) {
+ for (i=0, mf=mface, fs=facesplit; i<totface; i++, mf++, fs++) {
v1=vertpa[mf->v1];
v2=vertpa[mf->v2];
v3=vertpa[mf->v3];
@@ -627,7 +627,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
BLI_edgehashIterator_free(ehi);
/* count new faces due to splitting */
- for (i=0,fs=facesplit; i<totface; i++,fs++)
+ for (i=0, fs=facesplit; i<totface; i++, fs++)
totfsplit += add_faces[*fs];
splitdm= CDDM_from_template(dm, totesplit, 0, totface+totfsplit, 0, 0);
@@ -650,8 +650,8 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
* later interpreted as tri's, for this to work right I think we probably
* have to stop using tessface - campbell */
- facepa= MEM_callocN(sizeof(int)*(totface+(totfsplit * 2)),"explode_facepa");
- //memcpy(facepa,emd->facepa,totface*sizeof(int));
+ facepa= MEM_callocN(sizeof(int)*(totface+(totfsplit * 2)), "explode_facepa");
+ //memcpy(facepa, emd->facepa, totface*sizeof(int));
emd->facepa=facepa;
/* create new verts */
@@ -660,9 +660,9 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
BLI_edgehashIterator_getKey(ehi, &ed_v1, &ed_v2);
esplit= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
mv=CDDM_get_vert(splitdm, ed_v2);
- dupve=CDDM_get_vert(splitdm,esplit);
+ dupve=CDDM_get_vert(splitdm, esplit);
- DM_copy_vert_data(splitdm,splitdm, ed_v2, esplit,1);
+ DM_copy_vert_data(splitdm, splitdm, ed_v2, esplit, 1);
*dupve=*mv;
@@ -676,7 +676,7 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
/* create new faces */
curdupface=0;//=totface;
//curdupin=totesplit;
- for (i=0,fs=facesplit; i<totface; i++,fs++) {
+ for (i=0, fs=facesplit; i<totface; i++, fs++) {
mf = dm->getTessFaceData(dm, i, CD_MFACE);
switch (*fs) {
@@ -797,7 +797,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
float cfra;
/* float timestep; */
int *facepa=emd->facepa;
- int totdup=0,totvert=0,totface=0,totpart=0,delface=0;
+ int totdup=0, totvert=0, totface=0, totpart=0, delface=0;
int i, v, u;
unsigned int ed_v1, ed_v2, mindex=0;
MTFace *mtface = NULL, *mtf;
@@ -858,12 +858,12 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
BLI_edgehashIterator_free(ehi);
/* the final duplicated vertices */
- explode= CDDM_from_template(dm, totdup, 0,totface-delface, 0, 0);
+ explode= CDDM_from_template(dm, totdup, 0, totface-delface, 0, 0);
mtface = CustomData_get_layer_named(&explode->faceData, CD_MTFACE, emd->uvname);
/*dupvert= CDDM_get_verts(explode);*/
/* getting back to object space */
- invert_m4_m4(imat,ob->obmat);
+ invert_m4_m4(imat, ob->obmat);
psmd->psys->lattice = psys_get_lattice(&sim);
@@ -879,7 +879,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
v= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
dm->getVert(dm, ed_v1, &source);
- dest = CDDM_get_vert(explode,v);
+ dest = CDDM_get_vert(explode, v);
DM_copy_vert_data(dm, explode, ed_v1, v, 1);
*dest = source;
@@ -893,8 +893,8 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
state.time=cfra;
psys_get_particle_state(&sim, ed_v2, &state, 1);
- vertco=CDDM_get_vert(explode,v)->co;
- mul_m4_v3(ob->obmat,vertco);
+ vertco=CDDM_get_vert(explode, v)->co;
+ mul_m4_v3(ob->obmat, vertco);
sub_v3_v3(vertco, birth.co);
@@ -903,7 +903,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
mul_qt_v3(rot, vertco);
if (emd->flag & eExplodeFlag_PaSize)
- mul_v3_fl(vertco,pa->size);
+ mul_v3_fl(vertco, pa->size);
add_v3_v3(vertco, state.co);
@@ -913,7 +913,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
BLI_edgehashIterator_free(ehi);
/*map new vertices to faces*/
- for (i=0,u=0; i<totface; i++) {
+ for (i=0, u=0; i<totface; i++) {
MFace source;
int orig_v4;
@@ -925,8 +925,8 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
if (pa->alive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0) continue;
}
- dm->getTessFace(dm,i,&source);
- mf=CDDM_get_tessface(explode,u);
+ dm->getTessFace(dm, i, &source);
+ mf=CDDM_get_tessface(explode, u);
orig_v4 = source.v4;
@@ -941,7 +941,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
if (source.v4)
source.v4 = edgecut_get(vertpahash, source.v4, mindex);
- DM_copy_tessface_data(dm,explode,i,u,1);
+ DM_copy_tessface_data(dm, explode, i, u, 1);
*mf = source;
@@ -995,7 +995,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
{
DerivedMesh *dm = derivedData;
ExplodeModifierData *emd= (ExplodeModifierData*) md;
- ParticleSystemModifierData *psmd=findPrecedingParticlesystem(ob,md);
+ ParticleSystemModifierData *psmd=findPrecedingParticlesystem(ob, md);
DM_ensure_tessface(dm); /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */
@@ -1018,13 +1018,13 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
if (emd->flag & eExplodeFlag_CalcFaces)
emd->flag &= ~eExplodeFlag_CalcFaces;
- createFacepa(emd,psmd,derivedData);
+ createFacepa(emd, psmd, derivedData);
}
/* 2. create new mesh */
if (emd->flag & eExplodeFlag_EdgeCut) {
int *facepa = emd->facepa;
- DerivedMesh *splitdm=cutEdges(emd,dm);
- DerivedMesh *explode=explodeMesh(emd, psmd, md->scene, ob, splitdm);
+ DerivedMesh *splitdm = cutEdges(emd, dm);
+ DerivedMesh *explode = explodeMesh(emd, psmd, md->scene, ob, splitdm);
MEM_freeN(emd->facepa);
emd->facepa=facepa;
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c
index 8d3b1871c51..ac3341f8e8d 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -165,7 +165,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd)
/* read .bobj.gz file into a fluidsimDerivedMesh struct */
static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_example)
{
- int wri = 0,i;
+ int wri = 0, i;
int gotBytes;
gzFile gzf;
int numverts = 0, numfaces = 0;
@@ -361,7 +361,7 @@ void fluid_estimate_memory(Object *ob, FluidsimSettings *fss, char *value)
mesh= ob->data;
fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize);
- elbeemEstimateMemreq(fss->resolutionxyz, fss->bbSize[0],fss->bbSize[1],fss->bbSize[2], fss->maxRefine, value);
+ elbeemEstimateMemreq(fss->resolutionxyz, fss->bbSize[0], fss->bbSize[1], fss->bbSize[2], fss->maxRefine, value);
}
}
@@ -393,7 +393,7 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *
velarray = fss->meshVelocities;
- // .bobj.gz , correct filename
+ // .bobj.gz, correct filename
// 87654321
filename[len-6] = 'v';
filename[len-5] = 'e';
@@ -478,7 +478,7 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
if (getenv(strEnvName2)) {
int elevel = atoi(getenv(strEnvName2));
if (elevel>0) {
- printf("Env. var %s set, fluid sim mesh '%s' not found, aborting render...\n",strEnvName2, targetFile);
+ printf("Env. var %s set, fluid sim mesh '%s' not found, aborting render...\n", strEnvName2, targetFile);
exit(1);
}
}
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c
index 628104295f7..3af1351cbdb 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.c
+++ b/source/blender/modifiers/intern/MOD_particleinstance.c
@@ -117,7 +117,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
ParticleData *pa= NULL, *pars= NULL;
MFace *mface, *orig_mface;
MVert *mvert, *orig_mvert;
- int i,totvert, totpart=0, totface, maxvert, maxface, first_particle=0;
+ int i, totvert, totpart=0, totface, maxvert, maxface, first_particle=0;
short track=ob->trackflag%3, trackneg, axis = pimd->axis;
float max_co=0.0, min_co=0.0, temp_co[3], cross[3];
float *size=NULL;
@@ -132,7 +132,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
}
if (pimd->ob) {
- psys = BLI_findlink(&pimd->ob->particlesystem,pimd->psys-1);
+ psys = BLI_findlink(&pimd->ob->particlesystem, pimd->psys-1);
if (psys==NULL || psys->totpart==0)
return derivedData;
}
@@ -192,7 +192,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
max_co=max_r[track];
}
- result = CDDM_from_template(dm, maxvert,dm->getNumEdges(dm)*totpart,maxface, 0, 0);
+ result = CDDM_from_template(dm, maxvert, dm->getNumEdges(dm)*totpart, maxface, 0, 0);
mvert=result->getVertArray(result);
orig_mvert=dm->getVertArray(dm);
@@ -231,7 +231,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
mv->co[axis] = 0.0;
}
- psys_get_particle_on_path(&sim, first_particle + i/totvert, &state,1);
+ psys_get_particle_on_path(&sim, first_particle + i/totvert, &state, 1);
normalize_v3(state.vel);
@@ -241,22 +241,22 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
state.rot[1] = state.rot[2] = state.rot[3] = 0.0f;
}
else {
- float temp[3] = {0.0f,0.0f,0.0f};
+ float temp[3] = {0.0f, 0.0f, 0.0f};
temp[axis] = 1.0f;
cross_v3_v3v3(cross, temp, state.vel);
/* state.vel[axis] is the only component surviving from a dot product with the axis */
- axis_angle_to_quat(state.rot,cross,saacos(state.vel[axis]));
+ axis_angle_to_quat(state.rot, cross, saacos(state.vel[axis]));
}
}
else {
state.time=-1.0;
- psys_get_particle_state(&sim, first_particle + i/totvert, &state,1);
+ psys_get_particle_state(&sim, first_particle + i/totvert, &state, 1);
}
- mul_qt_v3(state.rot,mv->co);
+ mul_qt_v3(state.rot, mv->co);
if (pimd->flag & eParticleInstanceFlag_UseSize)
mul_v3_fl(mv->co, size[i/totvert]);
add_v3_v3(mv->co, state.co);
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index c0a4b319a18..4e143bcb008 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -209,7 +209,7 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm, float (*
if (orco)
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob));
}
- else if (ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) {
+ else if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
dm= CDDM_from_curve(ob);
}
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 1b96c586cbf..2b289efa437 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -224,12 +224,12 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
if (cam->type == CAM_PERSP) {
float perspmat[4][4];
- perspective_m4( perspmat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
+ perspective_m4( perspmat, xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
mult_m4_m4m4(tmpmat, perspmat, projectors[i].projmat);
}
else { /* if (cam->type == CAM_ORTHO) */
float orthomat[4][4];
- orthographic_m4( orthomat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
+ orthographic_m4( orthomat, xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
mult_m4_m4m4(tmpmat, orthomat, projectors[i].projmat);
}
}
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c
index 8012057b393..f26b5f44f99 100644
--- a/source/blender/nodes/composite/node_composite_util.c
+++ b/source/blender/nodes/composite/node_composite_util.c
@@ -643,37 +643,37 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf)
void do_rgba_to_yuva(bNode *UNUSED(node), float *out, float *in)
{
- rgb_to_yuv(in[0],in[1],in[2], &out[0], &out[1], &out[2]);
+ rgb_to_yuv(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
out[3]=in[3];
}
void do_rgba_to_hsva(bNode *UNUSED(node), float *out, float *in)
{
- rgb_to_hsv(in[0],in[1],in[2], &out[0], &out[1], &out[2]);
+ rgb_to_hsv(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
out[3]=in[3];
}
void do_rgba_to_ycca(bNode *UNUSED(node), float *out, float *in)
{
- rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
+ rgb_to_ycc(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
out[3]=in[3];
}
void do_yuva_to_rgba(bNode *UNUSED(node), float *out, float *in)
{
- yuv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]);
+ yuv_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
out[3]=in[3];
}
void do_hsva_to_rgba(bNode *UNUSED(node), float *out, float *in)
{
- hsv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]);
+ hsv_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2]);
out[3]=in[3];
}
void do_ycca_to_rgba(bNode *UNUSED(node), float *out, float *in)
{
- ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
+ ycc_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
out[3]=in[3];
}
@@ -1200,7 +1200,7 @@ void qd_getPixelLerp(CompBuf* src, float u, float v, float* col)
const int x1 = (int)ufl, y1 = (int)vfl;
const int x2 = (int)ceil(u), y2 = (int)ceil(v);
if ((x2 >= 0) && (y2 >= 0) && (x1 < src->x) && (y1 < src->y)) {
- const float B[4] = {0,0,0,0};
+ const float B[4] = {0, 0, 0, 0};
const int ox1 = (x1 < 0), oy1 = (y1 < 0), ox2 = (x2 >= src->x), oy2 = (y2 >= src->y);
const float* c00 = (ox1 || oy1) ? B : &src->rect[(x1 + y1*src->x)*src->type];
const float* c10 = (ox2 || oy1) ? B : &src->rect[(x2 + y1*src->x)*src->type];
@@ -1226,7 +1226,7 @@ void qd_getPixelLerpChan(CompBuf* src, float u, float v, int chan, float* out)
const int x2 = (int)ceil(u), y2 = (int)ceil(v);
if (chan >= src->type) chan = 0;
if ((x2 >= 0) && (y2 >= 0) && (x1 < src->x) && (y1 < src->y)) {
- const float B[4] = {0,0,0,0};
+ const float B[4] = {0, 0, 0, 0};
const int ox1 = (x1 < 0), oy1 = (y1 < 0), ox2 = (x2 >= src->x), oy2 = (y2 >= src->y);
const float* c00 = (ox1 || oy1) ? B : &src->rect[(x1 + y1*src->x)*src->type + chan];
const float* c10 = (ox2 || oy1) ? B : &src->rect[(x2 + y1*src->x)*src->type + chan];
diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
index f42fd83c13d..5b26927b694 100644
--- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
@@ -96,7 +96,7 @@ The main change is an optional image input */
static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
NodeBilateralBlurData *nbbd= node->storage;
- CompBuf *new, *source, *img= in[0]->data , *refimg= in[1]->data;
+ CompBuf *new, *source, *img= in[0]->data, *refimg= in[1]->data;
double mean0, w, i2sigma_color, i2sigma_space;
double mean1[4];
double weight_tab[8];
diff --git a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
index b3690b5d20f..9e3aa9ee13f 100644
--- a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c
@@ -35,20 +35,20 @@
/* ******************* Channel Matte Node ********************************* */
static bNodeSocketTemplate cmp_node_channel_matte_in[]={
- {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
- {-1,0,""}
+ {SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_channel_matte_out[]={
- {SOCK_RGBA,0,"Image"},
- {SOCK_FLOAT,0,"Matte"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {SOCK_FLOAT, 0, "Matte"},
+ {-1, 0, ""}
};
static void do_normalized_rgba_to_ycca2(bNode *UNUSED(node), float *out, float *in)
{
/*normalize to the range 0.0 to 1.0) */
- rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
+ rgb_to_ycc(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
out[0]=(out[0])/255.0f;
out[1]=(out[1])/255.0f;
out[2]=(out[2])/255.0f;
@@ -61,7 +61,7 @@ static void do_normalized_ycca_to_rgba2(bNode *UNUSED(node), float *out, float *
in[0]=in[0]*255.0f;
in[1]=in[1]*255.0f;
in[2]=in[2]*255.0f;
- ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
+ ycc_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
out[3]=in[3];
}
@@ -81,15 +81,15 @@ static void do_channel_matte(bNode *node, float *out, float *in)
case 1: { /* Alpha=G-MAX(R, B) */
switch (node->custom2) {
case 1: {
- alpha=in[0]-MAX2(in[1],in[2]);
+ alpha=in[0]-MAX2(in[1], in[2]);
break;
}
case 2: {
- alpha=in[1]-MAX2(in[0],in[2]);
+ alpha=in[1]-MAX2(in[0], in[2]);
break;
}
case 3: {
- alpha=in[2]-MAX2(in[0],in[1]);
+ alpha=in[2]-MAX2(in[0], in[1]);
break;
}
default:
diff --git a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
index 2df8e1b6139..8684f67a54e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
@@ -34,20 +34,20 @@
/* ******************* Chroma Key ********************************************************** */
static bNodeSocketTemplate cmp_node_chroma_in[]={
- {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
- {SOCK_RGBA,1,"Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
- {-1,0,""}
+ {SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
+ {SOCK_RGBA, 1, "Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_chroma_out[]={
- {SOCK_RGBA,0,"Image"},
- {SOCK_FLOAT,0,"Matte"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {SOCK_FLOAT, 0, "Matte"},
+ {-1, 0, ""}
};
static void do_rgba_to_ycca_normalized(bNode *UNUSED(node), float *out, float *in)
{
- rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
+ rgb_to_ycc(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
//normalize to 0..1.0
out[0]=out[0]/255.0f;
@@ -79,7 +79,7 @@ static void do_ycca_to_rgba_normalized(bNode *UNUSED(node), float *out, float *i
// in[0]=(in[0]*255.0)+16;
// in[1]=(in[1]*255.0)+128;
// in[2]=(in[2]*255.0)+128;
- ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
+ ycc_to_rgb(in[0], in[1], in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
out[3]=in[3];
}
@@ -114,7 +114,7 @@ static void do_chroma_key(bNode *node, float *out, float *in)
if (kfg>0.0f) { /* found a pixel that is within key color */
alpha=(1.0f-kfg)*(c->fstrength);
- beta=atan2(z,x);
+ beta=atan2(z, x);
angle2=c->t2; /* t2 is radians. */
/* if beta is within the cutoff angle */
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
index 12b6e802555..aa74e5c71a0 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c
@@ -34,15 +34,15 @@
/* ******************* Color Key ********************************************************** */
static bNodeSocketTemplate cmp_node_color_in[]={
- {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
- {SOCK_RGBA,1,"Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
- {-1,0,""}
+ {SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
+ {SOCK_RGBA, 1, "Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_color_out[]={
- {SOCK_RGBA,0,"Image"},
- {SOCK_FLOAT,0,"Matte"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {SOCK_FLOAT, 0, "Matte"},
+ {-1, 0, ""}
};
static void do_color_key(bNode *node, float *out, float *in)
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
index 0153a2bce34..15c10d0242e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
@@ -37,14 +37,14 @@
/* ******************* Color Spill Supression ********************************* */
static bNodeSocketTemplate cmp_node_color_spill_in[]={
- {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
+ {SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
{SOCK_FLOAT, 1, "Fac", 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
- {-1,0,""}
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_color_spill_out[]={
- {SOCK_RGBA,0,"Image"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {-1, 0, ""}
};
static void do_simple_spillmap_red(bNode *node, float* out, float *in)
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
index f77e4cd9c4e..8dead1babdd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
@@ -37,13 +37,13 @@
/* ******************* Color Balance ********************************* */
static bNodeSocketTemplate cmp_node_colorbalance_in[]={
{SOCK_FLOAT, 1, "Fac", 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
- {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
- {-1,0,""}
+ {SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_colorbalance_out[]={
- {SOCK_RGBA,0,"Image"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {-1, 0, ""}
};
/* this function implements ASC-CDL according to the spec at http://www.asctech.org/
diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
index 027786d8b22..a827f094477 100644
--- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
@@ -34,15 +34,15 @@
/* ******************* channel Difference Matte ********************************* */
static bNodeSocketTemplate cmp_node_diff_matte_in[]={
- {SOCK_RGBA,1,"Image 1", 1.0f, 1.0f, 1.0f, 1.0f},
- {SOCK_RGBA,1,"Image 2", 1.0f, 1.0f, 1.0f, 1.0f},
- {-1,0,""}
+ {SOCK_RGBA, 1, "Image 1", 1.0f, 1.0f, 1.0f, 1.0f},
+ {SOCK_RGBA, 1, "Image 2", 1.0f, 1.0f, 1.0f, 1.0f},
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_diff_matte_out[]={
- {SOCK_RGBA,0,"Image"},
- {SOCK_FLOAT,0,"Matte"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {SOCK_FLOAT, 0, "Matte"},
+ {-1, 0, ""}
};
static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *inColor2)
diff --git a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
index f65b3312bea..49690499569 100644
--- a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
+++ b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c
@@ -72,7 +72,7 @@ static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap,
const float cs= cosf(rot), ss= sinf(rot);
const float isc= 1.f / (1.f + sc);
unsigned int x, y;
- float col[4]= {0,0,0,0};
+ float col[4]= {0, 0, 0, 0};
for (y= 0; y < img->y; ++y) {
const float v= isc * (y - center_y_pix) + ty;
diff --git a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
index 7aaaa7ed9b4..8ea8b64a26e 100644
--- a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
@@ -34,15 +34,15 @@
/* ******************* channel Distance Matte ********************************* */
static bNodeSocketTemplate cmp_node_distance_matte_in[]={
- {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
- {SOCK_RGBA,1,"Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
- {-1,0,""}
+ {SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
+ {SOCK_RGBA, 1, "Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_distance_matte_out[]={
- {SOCK_RGBA,0,"Image"},
- {SOCK_FLOAT,0,"Matte"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {SOCK_FLOAT, 0, "Matte"},
+ {-1, 0, ""}
};
/* note, keyvals is passed on from caller as stack array */
diff --git a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
index 966d8f8a21a..6eb70636efa 100644
--- a/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
@@ -786,7 +786,7 @@ static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *l
int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop
int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop
/* Test all rows between the FIRST and LAST rows, excluding left and right edges */
- for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
+ for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw, dx-=rw) {
a=x-2;
pix_prevRow=a+rw;
pix_nextRow=a-rw;
@@ -848,7 +848,7 @@ static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned i
int pix_prevCol; // pix_prevCol = pixel one column behind the one we are testing in a loop
int pix_nextCol; // pix_nextCol = pixel one column in front of the one we are testing in a loop
/* Test all rows between the FIRST and LAST rows, excluding left and right edges */
- for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw,dx-=rw) {
+ for (x= (t-rw)+1, dx=x-(rw-2); dx>rw; x-=rw, dx-=rw) {
a=x-2;
pix_prevRow=a+rw;
pix_nextRow=a-rw;
@@ -917,13 +917,13 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne
unsigned int outerAccum=0; // for looping outer edge pixel indexes, represents current position from offset
unsigned int gradientAccum=0; // for looping gradient pixel indexes, represents current position from offset
/*
- * Here we compute the size of buffer needed to hold (row,col) coordinates
+ * Here we compute the size of buffer needed to hold (row, col) coordinates
* for each pixel previously determined to be either gradient, inner edge,
* or outer edge.
*
* Allocation is done by requesting 4 bytes "sizeof(int)" per pixel, even
* though gbuf[] is declared as unsigned short* (2 bytes) because we don't
- * store the pixel indexes, we only store x,y location of pixel in buffer.
+ * store the pixel indexes, we only store x, y location of pixel in buffer.
*
* This does make the assumption that x and y can fit in 16 unsigned bits
* so if Blender starts doing renders greater than 65536 in either direction
@@ -961,7 +961,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne
* gradientFillOffset (0 pixels) innerEdgeOffset (18 pixels) outerEdgeOffset (22 pixels)
* / / /
* / / /
- * |X Y X Y X Y X Y > <X Y X Y > <X Y X Y X Y > <X Y X Y | <- (x,y)
+ * |X Y X Y X Y X Y > <X Y X Y > <X Y X Y X Y > <X Y X Y | <- (x, y)
* +--------------------------------> <----------------> <------------------------> <----------------+
* |0 2 4 6 8 10 12 14 > ... <68 70 72 74 > ... <80 82 84 86 88 90 > ... <152 154 156 158 | <- bytes
* +--------------------------------> <----------------> <------------------------> <----------------+
@@ -975,7 +975,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne
* Ultimately we do need the pixel's memory buffer index to set the output
* pixel color, but it's faster to reconstruct the memory buffer location
* each iteration of the final gradient calculation than it is to deconstruct
- * a memory location into x,y pairs each round.
+ * a memory location into x, y pairs each round.
*/
@@ -987,7 +987,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne
innerAccum = *innerEdgeOffset; // section's offset so when we start filling, each
outerAccum = *outerEdgeOffset; // section fills up it's allocated space in gbuf
//uses dmin=row, rsl=col
- for (x=0,dmin=0; x<t; x+=rw,dmin++) {
+ for (x=0, dmin=0; x<t; x+=rw, dmin++) {
for (rsl=0; rsl<rw; rsl++) {
a=x+rsl;
if (lres[a]==2) { // it is a gradient pixel flagged by 2
@@ -1222,29 +1222,29 @@ static void node_composit_exec_doubleedgemask(void *UNUSED(data), bNode *node, b
*/
if (node->custom2) { // if "adjacent only" inner edge mode is turned on
if (node->custom1) { // if "keep inside" buffer edge mode is turned on
- do_adjacentKeepBorders(t,rw,limask,lomask,lres,res,rsize);
+ do_adjacentKeepBorders(t, rw, limask, lomask, lres, res, rsize);
}
else { // "bleed out" buffer edge mode is turned on
- do_adjacentBleedBorders(t,rw,limask,lomask,lres,res,rsize);
+ do_adjacentBleedBorders(t, rw, limask, lomask, lres, res, rsize);
}
isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass
osz=rsize[1];
gsz=rsize[2];
// detect edges in all non-border pixels in the buffer
- do_adjacentEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz);
+ do_adjacentEdgeDetection(t, rw, limask, lomask, lres, res, rsize, isz, osz, gsz);
}
else { // "all" inner edge mode is turned on
if (node->custom1) { // if "keep inside" buffer edge mode is turned on
- do_allKeepBorders(t,rw,limask,lomask,lres,res,rsize);
+ do_allKeepBorders(t, rw, limask, lomask, lres, res, rsize);
}
else { // "bleed out" buffer edge mode is turned on
- do_allBleedBorders(t,rw,limask,lomask,lres,res,rsize);
+ do_allBleedBorders(t, rw, limask, lomask, lres, res, rsize);
}
isz=rsize[0]; // set up inner edge, outer edge, and gradient buffer sizes after border pass
osz=rsize[1];
gsz=rsize[2];
// detect edges in all non-border pixels in the buffer
- do_allEdgeDetection(t,rw,limask,lomask,lres,res,rsize,isz,osz,gsz);
+ do_allEdgeDetection(t, rw, limask, lomask, lres, res, rsize, isz, osz, gsz);
}
isz=rsize[0]; // set edge and gradient buffer sizes once again...
@@ -1263,8 +1263,8 @@ static void node_composit_exec_doubleedgemask(void *UNUSED(data), bNode *node, b
fsz=gsz+isz+osz; // calculate size of pixel index buffer needed
gbuf= MEM_mallocN(fsz*sizeof(int), "grd buf"); // allocate edge/gradient pixel index buffer
- do_createEdgeLocationBuffer(t,rw,lres,res,gbuf,&innerEdgeOffset,&outerEdgeOffset,isz,gsz);
- do_fillGradientBuffer(rw,res,gbuf,isz,osz,gsz,innerEdgeOffset,outerEdgeOffset);
+ do_createEdgeLocationBuffer(t, rw, lres, res, gbuf, &innerEdgeOffset, &outerEdgeOffset, isz, gsz);
+ do_fillGradientBuffer(rw, res, gbuf, isz, osz, gsz, innerEdgeOffset, outerEdgeOffset);
MEM_freeN(gbuf); // free the gradient index buffer
out[0]->data= stackbuf; // point the node output buffer to our filled buffer
diff --git a/source/blender/nodes/composite/nodes/node_composite_filter.c b/source/blender/nodes/composite/nodes/node_composite_filter.c
index d6cb54eb944..5adabecba08 100644
--- a/source/blender/nodes/composite/nodes/node_composite_filter.c
+++ b/source/blender/nodes/composite/nodes/node_composite_filter.c
@@ -168,12 +168,12 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
static float soft[9]= {1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f};
- float sharp[9]= {-1,-1,-1,-1,9,-1,-1,-1,-1};
+ float sharp[9]= {-1, -1, -1, -1, 9, -1, -1, -1, -1};
float laplace[9]= {-1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f, 1.0f, -1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f};
- float sobel[9]= {1,2,1,0,0,0,-1,-2,-1};
- float prewitt[9]= {1,1,1,0,0,0,-1,-1,-1};
- float kirsch[9]= {5,5,5,-3,-3,-3,-2,-2,-2};
- float shadow[9]= {1,2,1,0,1,0,-1,-2,-1};
+ float sobel[9]= {1, 2, 1, 0, 0, 0, -1, -2, -1};
+ float prewitt[9]= {1, 1, 1, 0, 0, 0, -1, -1, -1};
+ float kirsch[9]= {5, 5, 5, -3, -3, -3, -2, -2, -2};
+ float shadow[9]= {1, 2, 1, 0, 1, 0, -1, -2, -1};
if (out[0]->hasoutput==0) return;
diff --git a/source/blender/nodes/composite/nodes/node_composite_gamma.c b/source/blender/nodes/composite/nodes/node_composite_gamma.c
index ae793b44f2c..2ee94224e4b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_gamma.c
+++ b/source/blender/nodes/composite/nodes/node_composite_gamma.c
@@ -50,7 +50,7 @@ static void do_gamma(bNode *UNUSED(node), float *out, float *in, float *fac)
int i=0;
for (i=0; i<3; i++) {
/* check for negative to avoid nan's */
- out[i] = (in[i] > 0.0f)? powf(in[i],fac[0]): in[i];
+ out[i] = (in[i] > 0.0f)? powf(in[i], fac[0]): in[i];
}
out[3] = in[3];
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.c b/source/blender/nodes/composite/nodes/node_composite_glare.c
index 42760ddfc4e..7484ae266fc 100644
--- a/source/blender/nodes/composite/nodes/node_composite_glare.c
+++ b/source/blender/nodes/composite/nodes/node_composite_glare.c
@@ -124,7 +124,7 @@ static CompBuf* BTP(CompBuf* src, float threshold, int scaledown)
static void star4(NodeGlare* ndg, CompBuf* dst, CompBuf* src)
{
int x, y, i, xm, xp, ym, yp;
- float c[4] = {0,0,0,0}, tc[4] = {0,0,0,0};
+ float c[4] = {0, 0, 0, 0}, tc[4] = {0, 0, 0, 0};
CompBuf *tbuf1, *tbuf2, *tsrc;
const float f1 = 1.f - ndg->fade, f2 = (1.f - f1)*0.5f;
//const float t3 = ndg->threshold*3.f;
diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
index 7349d1dd4bf..7089983fdbc 100644
--- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
+++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
@@ -81,7 +81,7 @@ static void node_composit_exec_hue_sat(void *UNUSED(data), bNode *node, bNodeSta
else {
/* make output size of input image */
CompBuf *cbuf= dupalloc_compbuf(in[1]->data);
- CompBuf *stackbuf=typecheck_compbuf(cbuf,CB_RGBA);
+ CompBuf *stackbuf=typecheck_compbuf(cbuf, CB_RGBA);
composit2_pixel_processor(node, stackbuf, stackbuf, in[1]->vec, in[0]->data, in[0]->vec, do_hue_sat_fac, CB_RGBA, CB_VAL);
diff --git a/source/blender/nodes/composite/nodes/node_composite_levels.c b/source/blender/nodes/composite/nodes/node_composite_levels.c
index 32b07582140..9888966c46a 100644
--- a/source/blender/nodes/composite/nodes/node_composite_levels.c
+++ b/source/blender/nodes/composite/nodes/node_composite_levels.c
@@ -40,9 +40,9 @@ static bNodeSocketTemplate cmp_node_view_levels_in[]= {
};
static bNodeSocketTemplate cmp_node_view_levels_out[]={
- {SOCK_FLOAT, 0,"Mean"},
- {SOCK_FLOAT, 0,"Std Dev"},
- {-1,0,""}
+ {SOCK_FLOAT, 0, "Mean"},
+ {SOCK_FLOAT, 0, "Std Dev"},
+ {-1, 0, ""}
};
static void rgb_tobw(float r, float g, float b, float* out)
@@ -54,7 +54,7 @@ static void fill_bins(bNode* node, CompBuf* in, int* bins)
{
float value[4];
int ivalue=0;
- int x,y;
+ int x, y;
/*fill bins */
for (y=0; y<in->y; y++) {
@@ -66,7 +66,7 @@ static void fill_bins(bNode* node, CompBuf* in, int* bins)
if (value[3] > 0.0f) { /* don't count transparent pixels */
switch (node->custom1) {
case 1: { /* all colors */
- rgb_tobw(value[0],value[1],value[2], &value[0]);
+ rgb_tobw(value[0], value[1], value[2], &value[0]);
value[0]=value[0]*255; /* scale to 0-255 range */
ivalue=(int)value[0];
break;
@@ -89,7 +89,7 @@ static void fill_bins(bNode* node, CompBuf* in, int* bins)
}
case 5: /* luminence */
{
- rgb_to_yuv(value[0],value[1],value[2], &value[0], &value[1], &value[2]);
+ rgb_to_yuv(value[0], value[1], value[2], &value[0], &value[1], &value[2]);
value[0]=value[0]*255; /* scale to 0-255 range */
ivalue=(int)value[0];
break;
@@ -111,7 +111,7 @@ static float brightness_mean(bNode* node, CompBuf* in)
{
float sum=0.0;
int numPixels=0.0;
- int x,y;
+ int x, y;
float value[4];
for (x=0; x< in->x; x++) {
@@ -125,7 +125,7 @@ static float brightness_mean(bNode* node, CompBuf* in)
switch (node->custom1) {
case 1:
{
- rgb_tobw(value[0],value[1],value[2], &value[0]);
+ rgb_tobw(value[0], value[1], value[2], &value[0]);
sum+=value[0];
break;
}
@@ -146,7 +146,7 @@ static float brightness_mean(bNode* node, CompBuf* in)
}
case 5:
{
- rgb_to_yuv(value[0],value[1],value[2], &value[0], &value[1], &value[2]);
+ rgb_to_yuv(value[0], value[1], value[2], &value[0], &value[1], &value[2]);
sum+=value[0];
break;
}
@@ -162,7 +162,7 @@ static float brightness_standard_deviation(bNode* node, CompBuf* in, float mean)
{
float sum=0.0;
int numPixels=0.0;
- int x,y;
+ int x, y;
float value[4];
for (x=0; x< in->x; x++) {
@@ -176,7 +176,7 @@ static float brightness_standard_deviation(bNode* node, CompBuf* in, float mean)
switch (node->custom1) {
case 1:
{
- rgb_tobw(value[0],value[1],value[2], &value[0]);
+ rgb_tobw(value[0], value[1], value[2], &value[0]);
sum+=(value[0]-mean)*(value[0]-mean);
break;
}
@@ -200,7 +200,7 @@ static float brightness_standard_deviation(bNode* node, CompBuf* in, float mean)
}
case 5:
{
- rgb_to_yuv(value[0],value[1],value[2], &value[0], &value[1], &value[2]);
+ rgb_to_yuv(value[0], value[1], value[2], &value[0], &value[1], &value[2]);
sum+=(value[0]-mean)*(value[0]-mean);
break;
}
@@ -215,7 +215,7 @@ static float brightness_standard_deviation(bNode* node, CompBuf* in, float mean)
static void draw_histogram(bNode *node, CompBuf *out, int* bins)
{
- int x,y;
+ int x, y;
float color[4];
float value;
int max;
diff --git a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
index 85c291fd9ec..1518284e015 100644
--- a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
@@ -35,14 +35,14 @@
/* ******************* Luma Matte Node ********************************* */
static bNodeSocketTemplate cmp_node_luma_matte_in[]={
- {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
- {-1,0,""}
+ {SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f},
+ {-1, 0, ""}
};
static bNodeSocketTemplate cmp_node_luma_matte_out[]={
- {SOCK_RGBA,0,"Image"},
- {SOCK_FLOAT,0,"Matte"},
- {-1,0,""}
+ {SOCK_RGBA, 0, "Image"},
+ {SOCK_FLOAT, 0, "Matte"},
+ {-1, 0, ""}
};
static void do_luma_matte(bNode *node, float *out, float *in)
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
index 6dac2d16401..c0e11fe54e3 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
@@ -127,7 +127,7 @@ static bNodeSocketTemplate cmp_node_combhsva_out[]= {
static void do_comb_hsva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
{
- float r,g,b;
+ float r, g, b;
hsv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b);
out[0] = r;
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
index 6eff3dcd95b..7f3b8a31a4b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
@@ -175,7 +175,7 @@ static bNodeSocketTemplate cmp_node_combycca_out[]= {
static void do_comb_ycca_601(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
{
- float r,g,b;
+ float r, g, b;
float y, cb, cr;
/*need to un-normalize the data*/
@@ -183,7 +183,7 @@ static void do_comb_ycca_601(bNode *UNUSED(node), float *out, float *in1, float
cb=in2[0]*255;
cr=in3[0]*255;
- ycc_to_rgb(y,cb,cr, &r, &g, &b, BLI_YCC_ITU_BT601);
+ ycc_to_rgb(y, cb, cr, &r, &g, &b, BLI_YCC_ITU_BT601);
out[0] = r;
out[1] = g;
@@ -193,7 +193,7 @@ static void do_comb_ycca_601(bNode *UNUSED(node), float *out, float *in1, float
static void do_comb_ycca_709(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
{
- float r,g,b;
+ float r, g, b;
float y, cb, cr;
/*need to un-normalize the data*/
@@ -201,7 +201,7 @@ static void do_comb_ycca_709(bNode *UNUSED(node), float *out, float *in1, float
cb=in2[0]*255;
cr=in3[0]*255;
- ycc_to_rgb(y,cb,cr, &r, &g, &b, BLI_YCC_ITU_BT709);
+ ycc_to_rgb(y, cb, cr, &r, &g, &b, BLI_YCC_ITU_BT709);
out[0] = r;
out[1] = g;
@@ -211,7 +211,7 @@ static void do_comb_ycca_709(bNode *UNUSED(node), float *out, float *in1, float
static void do_comb_ycca_jfif(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
{
- float r,g,b;
+ float r, g, b;
float y, cb, cr;
/*need to un-normalize the data*/
@@ -219,7 +219,7 @@ static void do_comb_ycca_jfif(bNode *UNUSED(node), float *out, float *in1, float
cb=in2[0]*255;
cr=in3[0]*255;
- ycc_to_rgb(y,cb,cr, &r, &g, &b, BLI_YCC_JFIF_0_255);
+ ycc_to_rgb(y, cb, cr, &r, &g, &b, BLI_YCC_JFIF_0_255);
out[0] = r;
out[1] = g;
diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
index 8dd551643f5..57fcf3af046 100644
--- a/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
+++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
@@ -128,7 +128,7 @@ static bNodeSocketTemplate cmp_node_combyuva_out[]= {
static void do_comb_yuva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4)
{
- float r,g,b;
+ float r, g, b;
yuv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b);
out[0] = r;
diff --git a/source/blender/nodes/composite/nodes/node_composite_texture.c b/source/blender/nodes/composite/nodes/node_composite_texture.c
index 562e2b2737e..0b521fac3e1 100644
--- a/source/blender/nodes/composite/nodes/node_composite_texture.c
+++ b/source/blender/nodes/composite/nodes/node_composite_texture.c
@@ -40,7 +40,7 @@ static bNodeSocketTemplate cmp_node_texture_in[]= {
};
static bNodeSocketTemplate cmp_node_texture_out[]= {
{ SOCK_FLOAT, 0, "Value"},
- { SOCK_RGBA , 0, "Color"},
+ { SOCK_RGBA, 0, "Color"},
{ -1, 0, "" }
};
diff --git a/source/blender/nodes/composite/nodes/node_composite_tonemap.c b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
index 0696c2ba848..eae81a4bbd2 100644
--- a/source/blender/nodes/composite/nodes/node_composite_tonemap.c
+++ b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
@@ -94,7 +94,7 @@ static void tonemap(NodeTonemap* ntm, CompBuf* dst, CompBuf* src)
I_l = sp[x][1] + ic*(L - sp[x][1]);
I_g = Cav[1] + ic*(Lav - Cav[1]);
I_a = I_l + ia*(I_g - I_l);
- dp[x][1] /= (dp[x][1] + pow((double)f*I_a,(double)m));
+ dp[x][1] /= (dp[x][1] + pow((double)f*I_a, (double)m));
I_l = sp[x][2] + ic*(L - sp[x][2]);
I_g = Cav[2] + ic*(Lav - Cav[2]);
I_a = I_l + ia*(I_g - I_l);
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c
index 94b9d364418..b5400244efe 100644
--- a/source/blender/nodes/intern/node_socket.c
+++ b/source/blender/nodes/intern/node_socket.c
@@ -59,7 +59,7 @@ static bNodeSocketType node_socket_type_float = {
/* ui_name */ "Float",
/* ui_description */ "Floating Point",
/* ui_icon */ 0,
- /* ui_color */ {160,160,160,255},
+ /* ui_color */ {160, 160, 160, 255},
/* value_structname */ "bNodeSocketValueFloat",
/* value_structsize */ sizeof(bNodeSocketValueFloat),
@@ -74,7 +74,7 @@ static bNodeSocketType node_socket_type_vector = {
/* ui_name */ "Vector",
/* ui_description */ "3-dimensional floating point vector",
/* ui_icon */ 0,
- /* ui_color */ {100,100,200,255},
+ /* ui_color */ {100, 100, 200, 255},
/* value_structname */ "bNodeSocketValueVector",
/* value_structsize */ sizeof(bNodeSocketValueVector),
@@ -89,7 +89,7 @@ static bNodeSocketType node_socket_type_rgba = {
/* ui_name */ "RGBA",
/* ui_description */ "RGBA color",
/* ui_icon */ 0,
- /* ui_color */ {200,200,40,255},
+ /* ui_color */ {200, 200, 40, 255},
/* value_structname */ "bNodeSocketValueRGBA",
/* value_structsize */ sizeof(bNodeSocketValueRGBA),
@@ -104,7 +104,7 @@ static bNodeSocketType node_socket_type_int = {
/* ui_name */ "Int",
/* ui_description */ "Integer",
/* ui_icon */ 0,
- /* ui_color */ {17,133,37,255},
+ /* ui_color */ {17, 133, 37, 255},
/* value_structname */ "bNodeSocketValueInt",
/* value_structsize */ sizeof(bNodeSocketValueInt),
@@ -119,7 +119,7 @@ static bNodeSocketType node_socket_type_boolean = {
/* ui_name */ "Boolean",
/* ui_description */ "Boolean",
/* ui_icon */ 0,
- /* ui_color */ {158,139,63,255},
+ /* ui_color */ {158, 139, 63, 255},
/* value_structname */ "bNodeSocketValueBoolean",
/* value_structsize */ sizeof(bNodeSocketValueBoolean),
@@ -134,7 +134,7 @@ static bNodeSocketType node_socket_type_shader = {
/* ui_name */ "Shader",
/* ui_description */ "Shader",
/* ui_icon */ 0,
- /* ui_color */ {100,200,100,255},
+ /* ui_color */ {100, 200, 100, 255},
/* value_structname */ NULL,
/* value_structsize */ 0,
@@ -149,7 +149,7 @@ static bNodeSocketType node_socket_type_mesh = {
/* ui_name */ "Mesh",
/* ui_description */ "Mesh geometry data",
/* ui_icon */ 0,
- /* ui_color */ {255,133,7,255},
+ /* ui_color */ {255, 133, 7, 255},
/* value_structname */ NULL,
/* value_structsize */ 0,
diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c
index 8b6386fe2f6..7d3e532be0b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_texture.c
+++ b/source/blender/nodes/shader/nodes/node_shader_texture.c
@@ -41,7 +41,7 @@ static bNodeSocketTemplate sh_node_texture_in[]= {
};
static bNodeSocketTemplate sh_node_texture_out[]= {
{ SOCK_FLOAT, 0, "Value"},
- { SOCK_RGBA , 0, "Color"},
+ { SOCK_RGBA, 0, "Color"},
{ SOCK_VECTOR, 0, "Normal"},
{ -1, 0, "" }
};
diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c
index ac8799762bd..8ef531c6316 100644
--- a/source/blender/nodes/texture/nodes/node_texture_bricks.c
+++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c
@@ -102,7 +102,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
ins_y = y - row_height*rownum;
tint = noise((rownum << 16) + (bricknum & 0xFFFF)) + bias;
- CLAMP(tint,0.0f,1.0f);
+ CLAMP(tint, 0.0f, 1.0f);
if ( ins_x < mortar_thickness || ins_y < mortar_thickness ||
ins_x > (brick_width - mortar_thickness) ||
diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c
index 41115076ec1..c170d03a495 100644
--- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c
+++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c
@@ -37,7 +37,7 @@
static bNodeSocketTemplate inputs[]= {
{ SOCK_FLOAT, 1, "Factor", 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR },
{ SOCK_RGBA, 1, "Color1", 0.5f, 0.5f, 0.5f, 1.0f },
- { SOCK_RGBA , 1, "Color2", 0.5f, 0.5f, 0.5f, 1.0f },
+ { SOCK_RGBA, 1, "Color2", 0.5f, 0.5f, 0.5f, 1.0f },
{ -1, 0, "" }
};
static bNodeSocketTemplate outputs[]= {
diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c
index bf93231c306..201d75c0cad 100644
--- a/source/blender/nodes/texture/nodes/node_texture_texture.c
+++ b/source/blender/nodes/texture/nodes/node_texture_texture.c
@@ -49,8 +49,8 @@ static bNodeSocketTemplate outputs[]= {
static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
Tex *nodetex = (Tex *)node->id;
- static float red[] = {1,0,0,1};
- static float white[] = {1,1,1,1};
+ static float red[] = {1, 0, 0, 1};
+ static float white[] = {1, 1, 1, 1};
float co[3], dxt[3], dyt[3];
copy_v3_v3(co, p->co);
@@ -70,7 +70,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
else if (nodetex) {
TexResult texres;
int textype;
- float nor[] = {0,0,0};
+ float nor[] = {0, 0, 0};
float col1[4], col2[4];
tex_input_rgba(col1, in[0], p, thread);
diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c
index 599268b225a..d436b90502e 100644
--- a/source/blender/quicktime/apple/quicktime_export.c
+++ b/source/blender/quicktime/apple/quicktime_export.c
@@ -144,7 +144,7 @@ static QuicktimeCodecTypeDesc qtVideoCodecList[] = {
{kMPEG4VisualCodecType, 10, "MPEG4"},
{kH263CodecType, 11, "H.263"},
{kH264CodecType, 12, "H.264"},
- {0,0,NULL}};
+ {0, 0, NULL}};
static int qtVideoCodecCount = 12;
@@ -346,22 +346,22 @@ static void QT_CreateMyVideoTrack(int rectx, int recty, ReportList *reports)
trackFrame.bottom = recty;
trackFrame.right = rectx;
- qtexport->theTrack = NewMovieTrack (qtexport->theMovie,
- FixRatio(trackFrame.right,1),
- FixRatio(trackFrame.bottom,1),
- 0);
+ qtexport->theTrack = NewMovieTrack (qtexport->theMovie,
+ FixRatio(trackFrame.right, 1),
+ FixRatio(trackFrame.bottom, 1),
+ 0);
CheckError( GetMoviesError(), "NewMovieTrack error", reports );
-// SetIdentityMatrix(&myMatrix);
-// ScaleMatrix(&myMatrix, fixed1, Long2Fix(-1), 0, 0);
-// TranslateMatrix(&myMatrix, 0, Long2Fix(trackFrame.bottom));
-// SetMovieMatrix(qtexport->theMovie, &myMatrix);
+ // SetIdentityMatrix(&myMatrix);
+ // ScaleMatrix(&myMatrix, fixed1, Long2Fix(-1), 0, 0);
+ // TranslateMatrix(&myMatrix, 0, Long2Fix(trackFrame.bottom));
+ // SetMovieMatrix(qtexport->theMovie, &myMatrix);
qtexport->theMedia = NewTrackMedia (qtexport->theTrack,
- VideoMediaType,
- qtdata->kVideoTimeScale,
- nil,
- 0);
+ VideoMediaType,
+ qtdata->kVideoTimeScale,
+ nil,
+ 0);
CheckError( GetMoviesError(), "NewTrackMedia error", reports );
err = BeginMediaEdits (qtexport->theMedia);
@@ -381,10 +381,10 @@ static void QT_EndCreateMyVideoTrack(ReportList *reports)
CheckError( err, "EndMediaEdits error", reports );
err = InsertMediaIntoTrack (qtexport->theTrack,
- kTrackStart,/* track start time */
- kMediaStart,/* media start time */
- GetMediaDuration (qtexport->theMedia),
- fixed1);
+ kTrackStart, /* track start time */
+ kMediaStart, /* media start time */
+ GetMediaDuration (qtexport->theMedia),
+ fixed1);
CheckError( err, "InsertMediaIntoTrack error", reports );
}
@@ -515,7 +515,7 @@ void filepath_qt(char *string, RenderData *rd)
BLI_make_existing_file(string);
if (BLI_strcasecmp(string + strlen(string) - 4, ".mov")) {
- sprintf(txt, "%04d-%04d.mov", (rd->sfra) , (rd->efra) );
+ sprintf(txt, "%04d-%04d.mov", (rd->sfra), (rd->efra) );
strcat(string, txt);
}
}
diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c
index 197c8cebca3..f5601fb5b8c 100644
--- a/source/blender/quicktime/apple/quicktime_import.c
+++ b/source/blender/quicktime/apple/quicktime_import.c
@@ -417,7 +417,7 @@ static int GetFirstVideoMedia(struct anim *anim)
anim->qtime->theMedia = GetTrackMedia(anim->qtime->theTrack);
if (anim->qtime->theMedia)
- GetMediaHandlerDescription(anim->qtime->theMedia,&mediaType, nil, nil);
+ GetMediaHandlerDescription(anim->qtime->theMedia, &mediaType, nil, nil);
if (mediaType == VideoMediaType) return 1;
}
@@ -454,7 +454,7 @@ int startquicktime (struct anim *anim)
#endif
short depth = 0;
- anim->qtime = MEM_callocN (sizeof(QuicktimeMovie),"animqt");
+ anim->qtime = MEM_callocN (sizeof(QuicktimeMovie), "animqt");
anim->qtime->have_gw = FALSE;
if (anim->qtime == NULL) {
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 74255560025..f84b00451a6 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -525,13 +525,13 @@ typedef struct LampRen {
float shdwr, shdwg, shdwb;
float energy, haint;
int lay;
- float spotsi,spotbl;
+ float spotsi, spotbl;
float vec[3];
float xsp, ysp, distkw, inpr;
float halokw, halo;
short falloff_type;
- float ld1,ld2;
+ float ld1, ld2;
struct CurveMapping *curfalloff;
/* copied from Lamp, to decouple more rendering stuff */
diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h
index 6a41517b113..0afd9246150 100644
--- a/source/blender/render/intern/include/sunsky.h
+++ b/source/blender/render/intern/include/sunsky.h
@@ -73,7 +73,7 @@ typedef struct SunSky
} SunSky;
void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_brightness,
- float spread,float sun_brightness, float sun_size, float back_scatter,
+ float spread, float sun_brightness, float sun_size, float back_scatter,
float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace);
void GetSkyXYZRadiance(struct SunSky *sunsky, float theta, float phi, float color_out[3]);
diff --git a/source/blender/render/intern/raytrace/bvh.h b/source/blender/render/intern/raytrace/bvh.h
index 946b64e98e5..d99debd6cb5 100644
--- a/source/blender/render/intern/raytrace/bvh.h
+++ b/source/blender/render/intern/raytrace/bvh.h
@@ -153,7 +153,7 @@ static inline void bvh_node_merge_bb(Node *node, float *min, float *max)
RE_rayobject_merge_bb( (RayObject*)node, min, max);
}
else {
- DO_MIN(node->bb , min);
+ DO_MIN(node->bb, min);
DO_MAX(node->bb+3, max);
}
}
@@ -165,7 +165,7 @@ static inline void bvh_node_merge_bb(Node *node, float *min, float *max)
*/
template<class Node> static inline void bvh_node_push_childs(Node *node, Isect *isec, Node **stack, int &stack_pos);
-template<class Node,int MAX_STACK_SIZE,bool TEST_ROOT,bool SHADOW>
+template<class Node, int MAX_STACK_SIZE, bool TEST_ROOT, bool SHADOW>
static int bvh_node_stack_raycast(Node *root, Isect *isec)
{
Node *stack[MAX_STACK_SIZE];
@@ -179,7 +179,7 @@ static int bvh_node_stack_raycast(Node *root, Isect *isec)
while (stack_pos) {
Node *node = stack[--stack_pos];
if (!is_leaf(node)) {
- if (bvh_node_hit_test(node,isec)) {
+ if (bvh_node_hit_test(node, isec)) {
bvh_node_push_childs(node, isec, stack, stack_pos);
assert(stack_pos <= MAX_STACK_SIZE);
}
@@ -199,7 +199,7 @@ static int bvh_node_stack_raycast(Node *root, Isect *isec)
* this was created to be able to use any simd (with the cost of some memmoves)
* it can take advantage of any SIMD width and doens't needs any special tree care
*/
-template<class Node,int MAX_STACK_SIZE,bool TEST_ROOT>
+template<class Node, int MAX_STACK_SIZE, bool TEST_ROOT>
static int bvh_node_stack_raycast_simd(Node *root, Isect *isec)
{
Node *stack[MAX_STACK_SIZE];
@@ -242,20 +242,20 @@ static int bvh_node_stack_raycast_simd(Node *root, Isect *isec)
const float *bb2 = stack[stack_pos+2]->bb;
const float *bb3 = stack[stack_pos+3]->bb;
- const __m128 x0y0x1y1 = _mm_shuffle_ps( _mm_load_ps(bb0), _mm_load_ps(bb1), _MM_SHUFFLE(1,0,1,0) );
- const __m128 x2y2x3y3 = _mm_shuffle_ps( _mm_load_ps(bb2), _mm_load_ps(bb3), _MM_SHUFFLE(1,0,1,0) );
- t_bb[0] = _mm_shuffle_ps( x0y0x1y1, x2y2x3y3, _MM_SHUFFLE(2,0,2,0) );
- t_bb[1] = _mm_shuffle_ps( x0y0x1y1, x2y2x3y3, _MM_SHUFFLE(3,1,3,1) );
-
- const __m128 z0X0z1X1 = _mm_shuffle_ps( _mm_load_ps(bb0), _mm_load_ps(bb1), _MM_SHUFFLE(3,2,3,2) );
- const __m128 z2X2z3X3 = _mm_shuffle_ps( _mm_load_ps(bb2), _mm_load_ps(bb3), _MM_SHUFFLE(3,2,3,2) );
- t_bb[2] = _mm_shuffle_ps( z0X0z1X1, z2X2z3X3, _MM_SHUFFLE(2,0,2,0) );
- t_bb[3] = _mm_shuffle_ps( z0X0z1X1, z2X2z3X3, _MM_SHUFFLE(3,1,3,1) );
-
- const __m128 Y0Z0Y1Z1 = _mm_shuffle_ps( _mm_load_ps(bb0+4), _mm_load_ps(bb1+4), _MM_SHUFFLE(1,0,1,0) );
- const __m128 Y2Z2Y3Z3 = _mm_shuffle_ps( _mm_load_ps(bb2+4), _mm_load_ps(bb3+4), _MM_SHUFFLE(1,0,1,0) );
- t_bb[4] = _mm_shuffle_ps( Y0Z0Y1Z1, Y2Z2Y3Z3, _MM_SHUFFLE(2,0,2,0) );
- t_bb[5] = _mm_shuffle_ps( Y0Z0Y1Z1, Y2Z2Y3Z3, _MM_SHUFFLE(3,1,3,1) );
+ const __m128 x0y0x1y1 = _mm_shuffle_ps( _mm_load_ps(bb0), _mm_load_ps(bb1), _MM_SHUFFLE(1, 0, 1, 0) );
+ const __m128 x2y2x3y3 = _mm_shuffle_ps( _mm_load_ps(bb2), _mm_load_ps(bb3), _MM_SHUFFLE(1, 0, 1, 0) );
+ t_bb[0] = _mm_shuffle_ps( x0y0x1y1, x2y2x3y3, _MM_SHUFFLE(2, 0, 2, 0) );
+ t_bb[1] = _mm_shuffle_ps( x0y0x1y1, x2y2x3y3, _MM_SHUFFLE(3, 1, 3, 1) );
+
+ const __m128 z0X0z1X1 = _mm_shuffle_ps( _mm_load_ps(bb0), _mm_load_ps(bb1), _MM_SHUFFLE(3, 2, 3, 2) );
+ const __m128 z2X2z3X3 = _mm_shuffle_ps( _mm_load_ps(bb2), _mm_load_ps(bb3), _MM_SHUFFLE(3, 2, 3, 2) );
+ t_bb[2] = _mm_shuffle_ps( z0X0z1X1, z2X2z3X3, _MM_SHUFFLE(2, 0, 2, 0) );
+ t_bb[3] = _mm_shuffle_ps( z0X0z1X1, z2X2z3X3, _MM_SHUFFLE(3, 1, 3, 1) );
+
+ const __m128 Y0Z0Y1Z1 = _mm_shuffle_ps( _mm_load_ps(bb0+4), _mm_load_ps(bb1+4), _MM_SHUFFLE(1, 0, 1, 0) );
+ const __m128 Y2Z2Y3Z3 = _mm_shuffle_ps( _mm_load_ps(bb2+4), _mm_load_ps(bb3+4), _MM_SHUFFLE(1, 0, 1, 0) );
+ t_bb[4] = _mm_shuffle_ps( Y0Z0Y1Z1, Y2Z2Y3Z3, _MM_SHUFFLE(2, 0, 2, 0) );
+ t_bb[5] = _mm_shuffle_ps( Y0Z0Y1Z1, Y2Z2Y3Z3, _MM_SHUFFLE(3, 1, 3, 1) );
#if 0
for(int i=0; i<4; i++)
{
@@ -294,7 +294,7 @@ static int bvh_node_stack_raycast_simd(Node *root, Isect *isec)
Node *node = stack[--stack_pos];
assert(!is_leaf(node));
- if (bvh_node_hit_test(node,isec)) {
+ if (bvh_node_hit_test(node, isec)) {
if (!is_leaf(node->child)) {
bvh_node_push_childs(node, isec, stack, stack_pos);
assert(stack_pos <= MAX_STACK_SIZE);
@@ -361,7 +361,7 @@ static int bvh_node_raycast(Node *node, Isect *isec)
}
#endif
-template<class Node,class HintObject>
+template<class Node, class HintObject>
void bvh_dfs_make_hint(Node *node, LCTSHint *hint, int reserve_space, HintObject *hintObject)
{
assert( hint->size + reserve_space + 1 <= RE_RAY_LCTS_MAX_SIZE );
diff --git a/source/blender/render/intern/raytrace/rayobject_blibvh.cpp b/source/blender/render/intern/raytrace/rayobject_blibvh.cpp
index d0036fd8556..8f1b730bf10 100644
--- a/source/blender/render/intern/raytrace/rayobject_blibvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_blibvh.cpp
@@ -136,8 +136,8 @@ static void RE_rayobject_blibvh_add(RayObject *o, RayObject *ob)
INIT_MINMAX(min_max, min_max+3);
RE_rayobject_merge_bb(ob, min_max, min_max+3);
- DO_MIN(min_max , obj->bb[0]);
- DO_MAX(min_max+3, obj->bb[1]);
+ DO_MIN(min_max, obj->bb[0]);
+ DO_MAX(min_max + 3, obj->bb[1]);
BLI_bvhtree_insert(obj->bvh, obj->next_leaf - obj->leafs, min_max, 2);
*(obj->next_leaf++) = ob;
diff --git a/source/blender/render/intern/raytrace/rayobject_octree.cpp b/source/blender/render/intern/raytrace/rayobject_octree.cpp
index eef2fcc51c9..dc7b6dd6e8d 100644
--- a/source/blender/render/intern/raytrace/rayobject_octree.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_octree.cpp
@@ -74,7 +74,7 @@ typedef struct Octree {
struct Branch **adrbranch;
struct Node **adrnode;
float ocsize; /* ocsize: mult factor, max size octree */
- float ocfacx,ocfacy,ocfacz;
+ float ocfacx, ocfacy, ocfacz;
float min[3], max[3];
int ocres;
int branchcount, nodecount;
@@ -216,7 +216,7 @@ static Node *addnode(Octree *oc)
index= oc->nodecount>>12;
if (oc->adrnode[index]==NULL)
- oc->adrnode[index]= (Node*)MEM_callocN(4096*sizeof(Node),"addnode");
+ oc->adrnode[index]= (Node*)MEM_callocN(4096*sizeof(Node), "addnode");
if (oc->nodecount> NODE_ARRAY*NODE_ARRAY) {
printf("error; octree nodes full\n");
@@ -233,7 +233,7 @@ static int face_in_node(RayFace *face, short x, short y, short z, float rtf[][3]
// init static vars
if (face) {
- normal_tri_v3( nor,rtf[0], rtf[1], rtf[2]);
+ normal_tri_v3(nor, rtf[0], rtf[1], rtf[2]);
d= -nor[0]*rtf[0][0] - nor[1]*rtf[0][1] - nor[2]*rtf[0][2];
return 0;
}
@@ -297,11 +297,11 @@ static void ocwrite(Octree *oc, RayFace *face, int quad, short x, short y, short
oc4= ((x & 8)+(y & 4)+(z & 2))>>1;
oc5= ((x & 4)+(y & 2)+(z & 1));
- br= addbranch(oc, br,oc0);
- br= addbranch(oc, br,oc1);
- br= addbranch(oc, br,oc2);
- br= addbranch(oc, br,oc3);
- br= addbranch(oc, br,oc4);
+ br= addbranch(oc, br, oc0);
+ br= addbranch(oc, br, oc1);
+ br= addbranch(oc, br, oc2);
+ br= addbranch(oc, br, oc3);
+ br= addbranch(oc, br, oc4);
no= (Node *)br->b[oc5];
if (no==NULL) br->b[oc5]= (Branch *)(no= addnode(oc));
@@ -326,10 +326,10 @@ static void ocwrite(Octree *oc, RayFace *face, int quad, short x, short y, short
static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocface, short rts[][3], float rtf[][3])
{
- int ocx1,ocx2,ocy1,ocy2;
- int x,y,dx=0,dy=0;
- float ox1,ox2,oy1,oy2;
- float labda,labdao,labdax,labday,ldx,ldy;
+ int ocx1, ocx2, ocy1, ocy2;
+ int x, y, dx=0, dy=0;
+ float ox1, ox2, oy1, oy2;
+ float labda, labdao, labdax, labday, ldx, ldy;
ocx1= rts[b1][c1];
ocy1= rts[b1][c2];
@@ -405,7 +405,7 @@ static void d2dda(Octree *oc, short b1, short b2, short c1, short c2, char *ocfa
y+=dy;
}
}
- labda=MIN2(labdax,labday);
+ labda=MIN2(labdax, labday);
if (labda==labdao) break;
if (labda>=1.0f) break;
}
@@ -541,13 +541,13 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
oc2= rts[1][c];
oc3= rts[2][c];
if (!RE_rayface_isQuad(face)) {
- ocmin[c]= MIN3(oc1,oc2,oc3);
- ocmax[c]= MAX3(oc1,oc2,oc3);
+ ocmin[c]= MIN3(oc1, oc2, oc3);
+ ocmax[c]= MAX3(oc1, oc2, oc3);
}
else {
oc4= rts[3][c];
- ocmin[c]= MIN4(oc1,oc2,oc3,oc4);
- ocmax[c]= MAX4(oc1,oc2,oc3,oc4);
+ ocmin[c]= MIN4(oc1, oc2, oc3, oc4);
+ ocmax[c]= MAX4(oc1, oc2, oc3, oc4);
}
if (ocmax[c]>oc->ocres-1) ocmax[c]=oc->ocres-1;
if (ocmin[c]<0) ocmin[c]=0;
@@ -558,32 +558,32 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
}
else {
- d2dda(oc, 0,1,0,1,ocface+ocres2,rts,rtf);
- d2dda(oc, 0,1,0,2,ocface,rts,rtf);
- d2dda(oc, 0,1,1,2,ocface+2*ocres2,rts,rtf);
- d2dda(oc, 1,2,0,1,ocface+ocres2,rts,rtf);
- d2dda(oc, 1,2,0,2,ocface,rts,rtf);
- d2dda(oc, 1,2,1,2,ocface+2*ocres2,rts,rtf);
+ d2dda(oc, 0, 1, 0, 1, ocface+ocres2, rts, rtf);
+ d2dda(oc, 0, 1, 0, 2, ocface, rts, rtf);
+ d2dda(oc, 0, 1, 1, 2, ocface+2*ocres2, rts, rtf);
+ d2dda(oc, 1, 2, 0, 1, ocface+ocres2, rts, rtf);
+ d2dda(oc, 1, 2, 0, 2, ocface, rts, rtf);
+ d2dda(oc, 1, 2, 1, 2, ocface+2*ocres2, rts, rtf);
if (!RE_rayface_isQuad(face)) {
- d2dda(oc, 2,0,0,1,ocface+ocres2,rts,rtf);
- d2dda(oc, 2,0,0,2,ocface,rts,rtf);
- d2dda(oc, 2,0,1,2,ocface+2*ocres2,rts,rtf);
+ d2dda(oc, 2, 0, 0, 1, ocface+ocres2, rts, rtf);
+ d2dda(oc, 2, 0, 0, 2, ocface, rts, rtf);
+ d2dda(oc, 2, 0, 1, 2, ocface+2*ocres2, rts, rtf);
}
else {
- d2dda(oc, 2,3,0,1,ocface+ocres2,rts,rtf);
- d2dda(oc, 2,3,0,2,ocface,rts,rtf);
- d2dda(oc, 2,3,1,2,ocface+2*ocres2,rts,rtf);
- d2dda(oc, 3,0,0,1,ocface+ocres2,rts,rtf);
- d2dda(oc, 3,0,0,2,ocface,rts,rtf);
- d2dda(oc, 3,0,1,2,ocface+2*ocres2,rts,rtf);
+ d2dda(oc, 2, 3, 0, 1, ocface+ocres2, rts, rtf);
+ d2dda(oc, 2, 3, 0, 2, ocface, rts, rtf);
+ d2dda(oc, 2, 3, 1, 2, ocface+2*ocres2, rts, rtf);
+ d2dda(oc, 3, 0, 0, 1, ocface+ocres2, rts, rtf);
+ d2dda(oc, 3, 0, 0, 2, ocface, rts, rtf);
+ d2dda(oc, 3, 0, 1, 2, ocface+2*ocres2, rts, rtf);
}
/* nothing todo with triangle..., just fills :) */
- filltriangle(oc, 0,1,ocface+ocres2,ocmin,ocmax);
- filltriangle(oc, 0,2,ocface,ocmin,ocmax);
- filltriangle(oc, 1,2,ocface+2*ocres2,ocmin,ocmax);
+ filltriangle(oc, 0, 1, ocface+ocres2, ocmin, ocmax);
+ filltriangle(oc, 0, 2, ocface, ocmin, ocmax);
+ filltriangle(oc, 1, 2, ocface+2*ocres2, ocmin, ocmax);
/* init static vars here */
- face_in_node(face, 0,0,0, rtf);
+ face_in_node(face, 0, 0, 0, rtf);
for (x=ocmin[0];x<=ocmax[0];x++) {
a= oc->ocres*x;
@@ -593,7 +593,7 @@ static void octree_fill_rayface(Octree *oc, RayFace *face)
for (z=ocmin[2];z<=ocmax[2];z++) {
if (ocface[b+z] && ocface[a+z]) {
if (face_in_node(NULL, x, y, z, rtf))
- ocwrite(oc, face, RE_rayface_isQuad(face), x,y,z, rtf);
+ ocwrite(oc, face, RE_rayface_isQuad(face), x, y, z, rtf);
}
}
}
@@ -695,7 +695,7 @@ static int testnode(Octree *UNUSED(oc), Isect *is, Node *no, OcVal ocval)
if (!face) break;
if ( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) ) {
- if ( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face),is) )
+ if ( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face), is) )
return 1;
}
}
@@ -713,7 +713,7 @@ static int testnode(Octree *UNUSED(oc), Isect *is, Node *no, OcVal ocval)
if (!face) break;
if ( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) ) {
- if ( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face),is) ) {
+ if ( RE_rayobject_intersect( RE_rayobject_unalignRayFace(face), is) ) {
found = 1;
}
}
@@ -849,12 +849,12 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
Node *no;
OcVal ocval;
float vec1[3], vec2[3], start[3], end[3];
- float u1,u2,ox1,ox2,oy1,oy2,oz1,oz2;
- float labdao,labdax,ldx,labday,ldy,labdaz,ldz, ddalabda;
+ float u1, u2, ox1, ox2, oy1, oy2, oz1, oz2;
+ float labdao, labdax, ldx, labday, ldy, labdaz, ldz, ddalabda;
float olabda = 0;
- int dx,dy,dz;
- int xo,yo,zo,c1=0;
- int ocx1,ocx2,ocy1, ocy2,ocz1,ocz2;
+ int dx, dy, dz;
+ int xo, yo, zo, c1=0;
+ int ocx1, ocx2, ocy1, ocy2, ocz1, ocz2;
/* clip with octree */
if (oc->branchcount==0) return 0;
@@ -875,14 +875,14 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
u2= 1.0f;
/* clip with octree cube */
- if (cliptest(-ldx, start[0]-oc->min[0], &u1,&u2)) {
- if (cliptest(ldx, oc->max[0]-start[0], &u1,&u2)) {
+ if (cliptest(-ldx, start[0]-oc->min[0], &u1, &u2)) {
+ if (cliptest(ldx, oc->max[0]-start[0], &u1, &u2)) {
ldy= is->dir[1]*is->dist;
- if (cliptest(-ldy, start[1]-oc->min[1], &u1,&u2)) {
- if (cliptest(ldy, oc->max[1]-start[1], &u1,&u2)) {
+ if (cliptest(-ldy, start[1]-oc->min[1], &u1, &u2)) {
+ if (cliptest(ldy, oc->max[1]-start[1], &u1, &u2)) {
ldz = is->dir[2]*is->dist;
- if (cliptest(-ldz, start[2]-oc->min[2], &u1,&u2)) {
- if (cliptest(ldz, oc->max[2]-start[2], &u1,&u2)) {
+ if (cliptest(-ldz, start[2]-oc->min[2], &u1, &u2)) {
+ if (cliptest(ldz, oc->max[2]-start[2], &u1, &u2)) {
c1=1;
if (u2<1.0f) {
end[0] = start[0]+u2*ldx;
@@ -934,7 +934,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
}
else {
int found = 0;
- //static int coh_ocx1,coh_ocx2,coh_ocy1, coh_ocy2,coh_ocz1,coh_ocz2;
+ //static int coh_ocx1, coh_ocx2, coh_ocy1, coh_ocy2, coh_ocz1, coh_ocz2;
float dox, doy, doz;
int eqval;
@@ -992,7 +992,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
}
xo=ocx1; yo=ocy1; zo=ocz1;
- ddalabda= MIN3(labdax,labday,labdaz);
+ ddalabda= MIN3(labdax, labday, labdaz);
vec2[0]= ox1;
vec2[1]= oy1;
@@ -1008,7 +1008,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
/* calculate ray intersection with octree node */
copy_v3_v3(vec1, vec2);
- // dox,y,z is negative
+ // dox, y, z is negative
vec2[0]= ox1-ddalabda*dox;
vec2[1]= oy1-ddalabda*doy;
vec2[2]= oz1-ddalabda*doz;
@@ -1082,7 +1082,7 @@ static int RE_rayobject_octree_intersect(RayObject *tree, Isect *is)
}
- ddalabda=MIN3(labdax,labday,labdaz);
+ ddalabda=MIN3(labdax, labday, labdaz);
if (ddalabda==labdao) break;
/* to make sure the last node is always checked */
if (labdao>=1.0f) break;
diff --git a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
index 2d0abba9a75..bfcfbee536f 100644
--- a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
@@ -78,7 +78,7 @@ void bvh_done<QBVHTree>(QBVHTree *obj)
}
if (root) {
- pushup_simd<VBVHNode,4>(root);
+ pushup_simd<VBVHNode, 4>(root);
obj->root = Reorganize_SVBVH<VBVHNode>(arena2).transform(root);
}
else
@@ -100,9 +100,9 @@ int intersect(QBVHTree *obj, Isect* isec)
//TODO renable hint support
if (RE_rayobject_isAligned(obj->root)) {
if (isec->mode == RE_RAY_SHADOW)
- return svbvh_node_stack_raycast<StackSize,true>(obj->root, isec);
+ return svbvh_node_stack_raycast<StackSize, true>(obj->root, isec);
else
- return svbvh_node_stack_raycast<StackSize,false>(obj->root, isec);
+ return svbvh_node_stack_raycast<StackSize, false>(obj->root, isec);
}
else
return RE_rayobject_intersect((RayObject*)obj->root, isec);
@@ -123,13 +123,13 @@ RayObjectAPI make_api()
{
static RayObjectAPI api =
{
- (RE_rayobject_raycast_callback) ((int(*)(Tree*,Isect*)) &intersect<STACK_SIZE>),
- (RE_rayobject_add_callback) ((void(*)(Tree*,RayObject*)) &bvh_add<Tree>),
+ (RE_rayobject_raycast_callback) ((int(*)(Tree*, Isect*)) &intersect<STACK_SIZE>),
+ (RE_rayobject_add_callback) ((void(*)(Tree*, RayObject*)) &bvh_add<Tree>),
(RE_rayobject_done_callback) ((void(*)(Tree*)) &bvh_done<Tree>),
(RE_rayobject_free_callback) ((void(*)(Tree*)) &bvh_free<Tree>),
- (RE_rayobject_merge_bb_callback)((void(*)(Tree*,float*,float*)) &bvh_bb<Tree>),
+ (RE_rayobject_merge_bb_callback)((void(*)(Tree*, float*, float*)) &bvh_bb<Tree>),
(RE_rayobject_cost_callback) ((float(*)(Tree*)) &bvh_cost<Tree>),
- (RE_rayobject_hint_bb_callback) ((void(*)(Tree*,LCTSHint*,float*,float*)) &bvh_hint_bb<Tree>)
+ (RE_rayobject_hint_bb_callback) ((void(*)(Tree*, LCTSHint*, float*, float*)) &bvh_hint_bb<Tree>)
};
return api;
@@ -138,7 +138,7 @@ RayObjectAPI make_api()
template<class Tree>
RayObjectAPI* bvh_get_api(int maxstacksize)
{
- static RayObjectAPI bvh_api256 = make_api<Tree,1024>();
+ static RayObjectAPI bvh_api256 = make_api<Tree, 1024>();
if (maxstacksize <= 1024) return &bvh_api256;
assert(maxstacksize <= 256);
@@ -147,7 +147,7 @@ RayObjectAPI* bvh_get_api(int maxstacksize)
RayObject *RE_rayobject_qbvh_create(int size)
{
- return bvh_create_tree<QBVHTree,DFS_STACK_SIZE>(size);
+ return bvh_create_tree<QBVHTree, DFS_STACK_SIZE>(size);
}
#else
diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
index ad74159fd3b..eb3bdb37f9d 100644
--- a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
@@ -66,7 +66,7 @@ static void rtbuild_init(RTBuilder *b)
RTBuilder* rtbuild_create(int size)
{
RTBuilder *builder = (RTBuilder*) MEM_mallocN( sizeof(RTBuilder), "RTBuilder" );
- RTBuilder::Object *memblock= (RTBuilder::Object*)MEM_mallocN( sizeof(RTBuilder::Object)*size,"RTBuilder.objects");
+ RTBuilder::Object *memblock= (RTBuilder::Object*)MEM_mallocN( sizeof(RTBuilder::Object)*size, "RTBuilder.objects");
rtbuild_init(builder);
@@ -75,7 +75,7 @@ RTBuilder* rtbuild_create(int size)
builder->primitives.maxsize = size;
for (int i=0; i<3; i++) {
- builder->sorted_begin[i] = (RTBuilder::Object**)MEM_mallocN( sizeof(RTBuilder::Object*)*size,"RTBuilder.sorted_objects");
+ builder->sorted_begin[i] = (RTBuilder::Object**)MEM_mallocN( sizeof(RTBuilder::Object*)*size, "RTBuilder.sorted_objects");
builder->sorted_end[i] = builder->sorted_begin[i];
}
@@ -136,7 +136,7 @@ int rtbuild_size(RTBuilder *b)
}
-template<class Obj,int Axis>
+template<class Obj, int Axis>
static bool obj_bb_compare(const Obj &a, const Obj &b)
{
if (a->bb[Axis] != b->bb[Axis])
@@ -147,9 +147,9 @@ static bool obj_bb_compare(const Obj &a, const Obj &b)
template<class Item>
static void object_sort(Item *begin, Item *end, int axis)
{
- if (axis == 0) return std::sort(begin, end, obj_bb_compare<Item,0> );
- if (axis == 1) return std::sort(begin, end, obj_bb_compare<Item,1> );
- if (axis == 2) return std::sort(begin, end, obj_bb_compare<Item,2> );
+ if (axis == 0) return std::sort(begin, end, obj_bb_compare<Item, 0> );
+ if (axis == 1) return std::sort(begin, end, obj_bb_compare<Item, 1> );
+ if (axis == 2) return std::sort(begin, end, obj_bb_compare<Item, 2> );
assert(false);
}
@@ -188,7 +188,7 @@ void rtbuild_calc_bb(RTBuilder *b)
{
if (b->bb[0] == 1.0e30f) {
for (RTBuilder::Object **index = b->sorted_begin[0]; index != b->sorted_end[0]; index++)
- RE_rayobject_merge_bb( (*index)->obj , b->bb, b->bb+3);
+ RE_rayobject_merge_bb( (*index)->obj, b->bb, b->bb+3);
}
}
@@ -306,7 +306,7 @@ int rtbuild_median_split_largest_axis(RTBuilder *b, int nchilds)
rtbuild_calc_bb(b);
- la = bb_largest_axis(b->bb,b->bb+3);
+ la = bb_largest_axis(b->bb, b->bb+3);
for (i=1; i<nchilds; i++)
separators[i-1] = (b->bb[la+3]-b->bb[la])*i / nchilds;
@@ -449,9 +449,9 @@ static void split_leafs(RTBuilder *b, int *nth, int partitions, int split_axis)
{
assert(nth[i] < nth[i+1] && nth[i+1] < nth[partitions]);
- if (split_axis == 0) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,0>);
- if (split_axis == 1) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,1>);
- if (split_axis == 2) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object,2>);
+ if (split_axis == 0) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object, 0>);
+ if (split_axis == 1) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object, 1>);
+ if (split_axis == 2) std::nth_element(b, nth[i], nth[i+1], nth[partitions], obj_bb_compare<RTBuilder::Object, 2>);
}
}
#endif
diff --git a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
index cbec02ab798..3cf2b4b5d5f 100644
--- a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
@@ -94,14 +94,14 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj)
pushup(root);
pushdown(root);
- pushup_simd<VBVHNode,4>(root);
+ pushup_simd<VBVHNode, 4>(root);
obj->root = Reorganize_SVBVH<VBVHNode>(arena2).transform(root);
}
else {
//Finds the optimal packing of this tree using a given cost model
//TODO this uses quite a lot of memory, find ways to reduce memory usage during building
- OVBVHNode *root = BuildBinaryVBVH<OVBVHNode>(arena1,&obj->rayobj.control).transform(obj->builder);
+ OVBVHNode *root = BuildBinaryVBVH<OVBVHNode>(arena1, &obj->rayobj.control).transform(obj->builder);
if (RE_rayobjectcontrol_test_break(&obj->rayobj.control)) {
BLI_memarena_free(arena1);
@@ -110,7 +110,7 @@ void bvh_done<SVBVHTree>(SVBVHTree *obj)
}
if (root) {
- VBVH_optimalPackSIMD<OVBVHNode,PackCost>(PackCost()).transform(root);
+ VBVH_optimalPackSIMD<OVBVHNode, PackCost>(PackCost()).transform(root);
obj->root = Reorganize_SVBVH<OVBVHNode>(arena2).transform(root);
}
else
@@ -133,9 +133,9 @@ int intersect(SVBVHTree *obj, Isect* isec)
//TODO renable hint support
if (RE_rayobject_isAligned(obj->root)) {
if (isec->mode == RE_RAY_SHADOW)
- return svbvh_node_stack_raycast<StackSize,true>(obj->root, isec);
+ return svbvh_node_stack_raycast<StackSize, true>(obj->root, isec);
else
- return svbvh_node_stack_raycast<StackSize,false>(obj->root, isec);
+ return svbvh_node_stack_raycast<StackSize, false>(obj->root, isec);
}
else
return RE_rayobject_intersect( (RayObject*) obj->root, isec );
@@ -156,13 +156,13 @@ RayObjectAPI make_api()
{
static RayObjectAPI api =
{
- (RE_rayobject_raycast_callback) ((int(*)(Tree*,Isect*)) &intersect<STACK_SIZE>),
- (RE_rayobject_add_callback) ((void(*)(Tree*,RayObject*)) &bvh_add<Tree>),
+ (RE_rayobject_raycast_callback) ((int(*)(Tree*, Isect*)) &intersect<STACK_SIZE>),
+ (RE_rayobject_add_callback) ((void(*)(Tree*, RayObject*)) &bvh_add<Tree>),
(RE_rayobject_done_callback) ((void(*)(Tree*)) &bvh_done<Tree>),
(RE_rayobject_free_callback) ((void(*)(Tree*)) &bvh_free<Tree>),
- (RE_rayobject_merge_bb_callback)((void(*)(Tree*,float*,float*)) &bvh_bb<Tree>),
+ (RE_rayobject_merge_bb_callback)((void(*)(Tree*, float*, float*)) &bvh_bb<Tree>),
(RE_rayobject_cost_callback) ((float(*)(Tree*)) &bvh_cost<Tree>),
- (RE_rayobject_hint_bb_callback) ((void(*)(Tree*,LCTSHint*,float*,float*)) &bvh_hint_bb<Tree>)
+ (RE_rayobject_hint_bb_callback) ((void(*)(Tree*, LCTSHint*, float*, float*)) &bvh_hint_bb<Tree>)
};
return api;
@@ -171,7 +171,7 @@ RayObjectAPI make_api()
template<class Tree>
RayObjectAPI* bvh_get_api(int maxstacksize)
{
- static RayObjectAPI bvh_api256 = make_api<Tree,1024>();
+ static RayObjectAPI bvh_api256 = make_api<Tree, 1024>();
if (maxstacksize <= 1024) return &bvh_api256;
assert(maxstacksize <= 256);
@@ -180,7 +180,7 @@ RayObjectAPI* bvh_get_api(int maxstacksize)
RayObject *RE_rayobject_svbvh_create(int size)
{
- return bvh_create_tree<SVBVHTree,DFS_STACK_SIZE>(size);
+ return bvh_create_tree<SVBVHTree, DFS_STACK_SIZE>(size);
}
#else
diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
index 26a99794362..47e78b8912e 100644
--- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
@@ -88,7 +88,7 @@ void bvh_done<VBVHTree>(VBVHTree *obj)
//Build and optimize the tree
if (1) {
- VBVHNode *root = BuildBinaryVBVH<VBVHNode>(arena1,&obj->rayobj.control).transform(obj->builder);
+ VBVHNode *root = BuildBinaryVBVH<VBVHNode>(arena1, &obj->rayobj.control).transform(obj->builder);
if (RE_rayobjectcontrol_test_break(&obj->rayobj.control)) {
BLI_memarena_free(arena1);
return;
@@ -115,7 +115,7 @@ void bvh_done<VBVHTree>(VBVHTree *obj)
//Finds the optimal packing of this tree using a given cost model
//TODO this uses quite a lot of memory, find ways to reduce memory usage during building
OVBVHNode *root = BuildBinaryVBVH<OVBVHNode>(arena2).transform(obj->builder);
- VBVH_optimalPackSIMD<OVBVHNode,PackCost>(PackCost()).transform(root);
+ VBVH_optimalPackSIMD<OVBVHNode, PackCost>(PackCost()).transform(root);
obj->root = Reorganize_VBVH<OVBVHNode>(arena1).transform(root);
BLI_memarena_free(arena2);
@@ -136,9 +136,9 @@ int intersect(VBVHTree *obj, Isect* isec)
//TODO renable hint support
if (RE_rayobject_isAligned(obj->root)) {
if (isec->mode == RE_RAY_SHADOW)
- return bvh_node_stack_raycast<VBVHNode,StackSize,false,true>( obj->root, isec);
+ return bvh_node_stack_raycast<VBVHNode, StackSize, false, true>( obj->root, isec);
else
- return bvh_node_stack_raycast<VBVHNode,StackSize,false,false>( obj->root, isec);
+ return bvh_node_stack_raycast<VBVHNode, StackSize, false, false>( obj->root, isec);
}
else
return RE_rayobject_intersect( (RayObject*) obj->root, isec );
@@ -178,13 +178,13 @@ RayObjectAPI make_api()
{
static RayObjectAPI api =
{
- (RE_rayobject_raycast_callback) ((int(*)(Tree*,Isect*)) &intersect<STACK_SIZE>),
- (RE_rayobject_add_callback) ((void(*)(Tree*,RayObject*)) &bvh_add<Tree>),
+ (RE_rayobject_raycast_callback) ((int(*)(Tree*, Isect*)) &intersect<STACK_SIZE>),
+ (RE_rayobject_add_callback) ((void(*)(Tree*, RayObject*)) &bvh_add<Tree>),
(RE_rayobject_done_callback) ((void(*)(Tree*)) &bvh_done<Tree>),
(RE_rayobject_free_callback) ((void(*)(Tree*)) &bvh_free<Tree>),
- (RE_rayobject_merge_bb_callback)((void(*)(Tree*,float*,float*)) &bvh_bb<Tree>),
+ (RE_rayobject_merge_bb_callback)((void(*)(Tree*, float*, float*)) &bvh_bb<Tree>),
(RE_rayobject_cost_callback) ((float(*)(Tree*)) &bvh_cost<Tree>),
- (RE_rayobject_hint_bb_callback) ((void(*)(Tree*,LCTSHint*,float*,float*)) &bvh_hint_bb<Tree>)
+ (RE_rayobject_hint_bb_callback) ((void(*)(Tree*, LCTSHint*, float*, float*)) &bvh_hint_bb<Tree>)
};
return api;
@@ -193,7 +193,7 @@ RayObjectAPI make_api()
template<class Tree>
RayObjectAPI* bvh_get_api(int maxstacksize)
{
- static RayObjectAPI bvh_api256 = make_api<Tree,1024>();
+ static RayObjectAPI bvh_api256 = make_api<Tree, 1024>();
if (maxstacksize <= 1024) return &bvh_api256;
assert(maxstacksize <= 256);
@@ -202,5 +202,5 @@ RayObjectAPI* bvh_get_api(int maxstacksize)
RayObject *RE_rayobject_vbvh_create(int size)
{
- return bvh_create_tree<VBVHTree,DFS_STACK_SIZE>(size);
+ return bvh_create_tree<VBVHTree, DFS_STACK_SIZE>(size);
}
diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h
index 1930e5bb32b..cb557ae32c8 100644
--- a/source/blender/render/intern/raytrace/reorganize.h
+++ b/source/blender/render/intern/raytrace/reorganize.h
@@ -61,7 +61,7 @@ bool node_fits_inside(Node *a, Node *b)
}
template<class Node>
-void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float,Node*> &cost)
+void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float, Node*> &cost)
{
std::queue<Node*> q;
q.push(tree);
@@ -73,7 +73,7 @@ void reorganize_find_fittest_parent(Node *tree, Node *node, std::pair<float,Node
if (parent == node) continue;
if (node_fits_inside(node, parent) && RE_rayobject_isAligned(parent->child) ) {
float pcost = bb_area(parent->bb, parent->bb+3);
- cost = std::min( cost, std::make_pair(pcost,parent) );
+ cost = std::min( cost, std::make_pair(pcost, parent) );
for (Node *child = parent->child; child; child = child->sibling)
q.push(child);
}
@@ -96,7 +96,7 @@ void reorganize(Node *root)
assert( RE_rayobject_isAligned(*prev) );
q.push(*prev);
- std::pair<float,Node*> best(FLT_MAX, root);
+ std::pair<float, Node*> best(FLT_MAX, root);
reorganize_find_fittest_parent( root, *prev, best );
if (best.second == node) {
@@ -215,7 +215,7 @@ void pushup_simd(Node *parent)
}
for (Node *child = parent->child; RE_rayobject_isAligned(child) && child; child = child->sibling)
- pushup_simd<Node,SSize>(child);
+ pushup_simd<Node, SSize>(child);
}
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 7fe1fab1681..8cd31eb289f 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -469,11 +469,11 @@ static void calc_tangent_vector(ObjectRen *obr, VertexTangent **vtangents, MemAr
}
else if (v1->orco) {
uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
- map_to_sphere( &uv[0][0], &uv[0][1],v1->orco[0], v1->orco[1], v1->orco[2]);
- map_to_sphere( &uv[1][0], &uv[1][1],v2->orco[0], v2->orco[1], v2->orco[2]);
- map_to_sphere( &uv[2][0], &uv[2][1],v3->orco[0], v3->orco[1], v3->orco[2]);
+ map_to_sphere( &uv[0][0], &uv[0][1], v1->orco[0], v1->orco[1], v1->orco[2]);
+ map_to_sphere( &uv[1][0], &uv[1][1], v2->orco[0], v2->orco[1], v2->orco[2]);
+ map_to_sphere( &uv[2][0], &uv[2][1], v3->orco[0], v3->orco[1], v3->orco[2]);
if (v4)
- map_to_sphere( &uv[3][0], &uv[3][1],v4->orco[0], v4->orco[1], v4->orco[2]);
+ map_to_sphere( &uv[3][0], &uv[3][1], v4->orco[0], v4->orco[1], v4->orco[2]);
}
else return;
@@ -886,9 +886,9 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[][4], int d
/* skip wire faces */
if (vlr->v2 != vlr->v3) {
if (vlr->v4)
- normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_quad_v3(vlr->n, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
else
- normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
}
}
}
@@ -1061,7 +1061,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
width= w;
/*cross is the radius of the strand so we want it to be half of full width */
- mul_v3_fl(cross,0.5f/crosslen);
+ mul_v3_fl(cross, 0.5f/crosslen);
}
else
width/=w;
@@ -1111,7 +1111,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
vlr->v3->orco= sd->orco;
vlr->v3->accum= vlr->v4->accum;
- normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_quad_v3(vlr->n, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
vlr->mat= ma;
vlr->ec= ME_V2V3;
@@ -1124,7 +1124,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
if (sd->uvco) {
for (i=0; i<sd->totuv; i++) {
MTFace *mtf;
- mtf=RE_vlakren_get_tface(obr,vlr,i,NULL,1);
+ mtf=RE_vlakren_get_tface(obr, vlr, i, NULL, 1);
mtf->uv[0][0]=mtf->uv[1][0]=
mtf->uv[2][0]=mtf->uv[3][0]=(sd->uvco+2*i)[0];
mtf->uv[0][1]=mtf->uv[1][1]=
@@ -1132,7 +1132,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
}
if (sd->override_uv>=0) {
MTFace *mtf;
- mtf=RE_vlakren_get_tface(obr,vlr,sd->override_uv,NULL,0);
+ mtf=RE_vlakren_get_tface(obr, vlr, sd->override_uv, NULL, 0);
mtf->uv[0][0]=mtf->uv[3][0]=0.0f;
mtf->uv[1][0]=mtf->uv[2][0]=1.0f;
@@ -1144,7 +1144,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
if (sd->mcol) {
for (i=0; i<sd->totcol; i++) {
MCol *mc;
- mc=RE_vlakren_get_mcol(obr,vlr,i,NULL,1);
+ mc=RE_vlakren_get_mcol(obr, vlr, i, NULL, 1);
mc[0]=mc[1]=mc[2]=mc[3]=sd->mcol[i];
mc[0]=mc[1]=mc[2]=mc[3]=sd->mcol[i];
}
@@ -1189,22 +1189,22 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
if (sd->adapt) {
second=0;
- copy_v3_v3(anor,nor);
- copy_v3_v3(avec,vec);
+ copy_v3_v3(anor, nor);
+ copy_v3_v3(avec, vec);
}
}
else if (sd->adapt) {
- float dvec[3],pvec[3];
- sub_v3_v3v3(dvec,avec,vec);
- project_v3_v3v3(pvec,dvec,vec);
- sub_v3_v3v3(dvec,dvec,pvec);
+ float dvec[3], pvec[3];
+ sub_v3_v3v3(dvec, avec, vec);
+ project_v3_v3v3(pvec, dvec, vec);
+ sub_v3_v3v3(dvec, dvec, pvec);
w= vec[2]*re->winmat[2][3] + re->winmat[3][3];
dx= re->winx*dvec[0]*re->winmat[0][0]/w;
dy= re->winy*dvec[1]*re->winmat[1][1]/w;
w= sqrt(dx*dx + dy*dy);
- if (dot_v3v3(anor,nor)<sd->adapt_angle && w>sd->adapt_pix) {
+ if (dot_v3v3(anor, nor)<sd->adapt_angle && w>sd->adapt_pix) {
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->flag= flag;
vlr->v1= v1;
@@ -1215,8 +1215,8 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
v1= vlr->v4; // cycle
v2= vlr->v3; // cycle
- copy_v3_v3(anor,nor);
- copy_v3_v3(avec,vec);
+ copy_v3_v3(anor, nor);
+ copy_v3_v3(avec, vec);
}
else {
vlr= RE_findOrAddVlak(obr, obr->totvlak-1);
@@ -1235,7 +1235,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
vlr->v3->orco= sd->orco;
vlr->v3->accum= vlr->v4->accum;
- normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_quad_v3(vlr->n, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
vlr->mat= ma;
vlr->ec= ME_V2V3;
@@ -1248,7 +1248,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
if (sd->uvco) {
for (i=0; i<sd->totuv; i++) {
MTFace *mtf;
- mtf=RE_vlakren_get_tface(obr,vlr,i,NULL,1);
+ mtf=RE_vlakren_get_tface(obr, vlr, i, NULL, 1);
mtf->uv[0][0]=mtf->uv[1][0]=
mtf->uv[2][0]=mtf->uv[3][0]=(sd->uvco+2*i)[0];
mtf->uv[0][1]=mtf->uv[1][1]=
@@ -1256,7 +1256,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
}
if (sd->override_uv>=0) {
MTFace *mtf;
- mtf=RE_vlakren_get_tface(obr,vlr,sd->override_uv,NULL,0);
+ mtf=RE_vlakren_get_tface(obr, vlr, sd->override_uv, NULL, 0);
mtf->uv[0][0]=mtf->uv[3][0]=0.0f;
mtf->uv[1][0]=mtf->uv[2][0]=1.0f;
@@ -1268,7 +1268,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
if (sd->mcol) {
for (i=0; i<sd->totcol; i++) {
MCol *mc;
- mc=RE_vlakren_get_mcol(obr,vlr,i,NULL,1);
+ mc=RE_vlakren_get_mcol(obr, vlr, i, NULL, 1);
mc[0]=mc[1]=mc[2]=mc[3]=sd->mcol[i];
mc[0]=mc[1]=mc[2]=mc[3]=sd->mcol[i];
}
@@ -1372,11 +1372,11 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl
sub_v3_v3(vlr->v4->co, yvec);
mul_m4_v3(re->viewmat, vlr->v4->co);
- normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
- copy_v3_v3(vlr->v1->n,vlr->n);
- copy_v3_v3(vlr->v2->n,vlr->n);
- copy_v3_v3(vlr->v3->n,vlr->n);
- copy_v3_v3(vlr->v4->n,vlr->n);
+ normal_quad_v3(vlr->n, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ copy_v3_v3(vlr->v1->n, vlr->n);
+ copy_v3_v3(vlr->v2->n, vlr->n);
+ copy_v3_v3(vlr->v3->n, vlr->n);
+ copy_v3_v3(vlr->v4->n, vlr->n);
vlr->mat= ma;
vlr->ec= ME_V2V3;
@@ -1395,8 +1395,8 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl
time = (float)fmod((bb->tilt + 1.0f) / 2.0f, 1.0);
}
else {
- float axis1[3] = {0.0f,0.0f,0.0f};
- float axis2[3] = {0.0f,0.0f,0.0f};
+ float axis1[3] = {0.0f, 0.0f, 0.0f};
+ float axis2[3] = {0.0f, 0.0f, 0.0f};
axis1[(bb->align + 1) % 3] = 1.0f;
axis2[(bb->align + 2) % 3] = 1.0f;
@@ -1518,7 +1518,7 @@ static void get_particle_uvco_mcol(short from, DerivedMesh *dm, float *fuv, int
int i;
/* get uvco */
- if (sd->uvco && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ if (sd->uvco && ELEM(from, PART_FROM_FACE, PART_FROM_VOLUME)) {
for (i=0; i<sd->totuv; i++) {
if (num != DMCACHE_NOTFOUND) {
MFace *mface = dm->getTessFaceData(dm, num, CD_MFACE);
@@ -1535,7 +1535,7 @@ static void get_particle_uvco_mcol(short from, DerivedMesh *dm, float *fuv, int
}
/* get mcol */
- if (sd->mcol && ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
+ if (sd->mcol && ELEM(from, PART_FROM_FACE, PART_FROM_VOLUME)) {
for (i=0; i<sd->totcol; i++) {
if (num != DMCACHE_NOTFOUND) {
MFace *mface = dm->getTessFaceData(dm, num, CD_MFACE);
@@ -1557,7 +1557,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
ParticleSystemModifierData *psmd;
ParticleSystem *tpsys=0;
ParticleSettings *part, *tpart=0;
- ParticleData *pars, *pa=0,*tpa=0;
+ ParticleData *pars, *pa=0, *tpa=0;
ParticleKey *states=0;
ParticleKey state;
ParticleCacheKey *cache=0;
@@ -1569,7 +1569,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
StrandBound *sbound= 0;
StrandRen *strand=0;
RNG *rng= 0;
- float loc[3],loc1[3],loc0[3],mat[4][4],nmat[3][3],co[3],nor[3],duplimat[4][4];
+ float loc[3], loc1[3], loc0[3], mat[4][4], nmat[3][3], co[3], nor[3], duplimat[4][4];
float strandlen=0.0f, curlen=0.0f;
float hasize, pa_size, r_tilt, r_length;
float pa_time, pa_birthtime, pa_dietime;
@@ -1597,7 +1597,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* 2. start initializing things */
/* last possibility to bail out! */
- psmd = psys_get_modifier(ob,psys);
+ psmd = psys_get_modifier(ob, psys);
if (!(psmd->modifier.mode & eModifierMode_Render))
return 0;
@@ -1702,7 +1702,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* 2.6 setup strand rendering */
if (part->ren_as == PART_DRAW_PATH && psys->pathcache) {
- path_nbr=(int)pow(2.0,(double) part->ren_step);
+ path_nbr=(int)pow(2.0, (double) part->ren_step);
if (path_nbr) {
if (!ELEM(ma->material_type, MA_TYPE_HALO, MA_TYPE_WIRE)) {
@@ -1770,7 +1770,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
psys->lattice = psys_get_lattice(&sim);
/* 3. start creating renderable things */
- for (a=0,pa=pars; a<totpart+totchild; a++, pa++, seed++) {
+ for (a=0, pa=pars; a<totpart+totchild; a++, pa++, seed++) {
random = rng_getFloat(rng);
/* setup per particle individual stuff */
if (a<totpart) {
@@ -1786,10 +1786,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* get orco */
if (tpsys && part->phystype == PART_PHYS_NO) {
tpa = tpsys->particles + pa->num;
- psys_particle_on_emitter(psmd,tpart->from,tpa->num,pa->num_dmcache,tpa->fuv,tpa->foffset,co,nor,0,0,sd.orco,0);
+ psys_particle_on_emitter(psmd, tpart->from, tpa->num, pa->num_dmcache, tpa->fuv, tpa->foffset, co, nor, 0, 0, sd.orco, 0);
}
else
- psys_particle_on_emitter(psmd,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,nor,0,0,sd.orco,0);
+ psys_particle_on_emitter(psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, sd.orco, 0);
/* get uvco & mcol */
num= pa->num_dmcache;
@@ -1835,14 +1835,14 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* get orco */
if (part->childtype == PART_CHILD_FACES) {
psys_particle_on_emitter(psmd,
- PART_FROM_FACE, cpa->num,DMCACHE_ISCHILD,
- cpa->fuv,cpa->foffset,co,nor,0,0,sd.orco,0);
+ PART_FROM_FACE, cpa->num, DMCACHE_ISCHILD,
+ cpa->fuv, cpa->foffset, co, nor, 0, 0, sd.orco, 0);
}
else {
ParticleData *par = psys->particles + cpa->parent;
psys_particle_on_emitter(psmd, part->from,
- par->num,DMCACHE_ISCHILD,par->fuv,
- par->foffset,co,nor,0,0,sd.orco,0);
+ par->num, DMCACHE_ISCHILD, par->fuv,
+ par->foffset, co, nor, 0, 0, sd.orco, 0);
}
/* get uvco & mcol */
@@ -1943,8 +1943,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
float time;
if (k<=max_k) {
- copy_v3_v3(state.co,(cache+k)->co);
- copy_v3_v3(state.vel,(cache+k)->vel);
+ copy_v3_v3(state.co, (cache+k)->co);
+ copy_v3_v3(state.vel, (cache+k)->vel);
}
else
continue;
@@ -1953,8 +1953,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
curlen += len_v3v3((cache+k-1)->co, (cache+k)->co);
time= curlen/strandlen;
- copy_v3_v3(loc,state.co);
- mul_m4_v3(re->viewmat,loc);
+ copy_v3_v3(loc, state.co);
+ mul_m4_v3(re->viewmat, loc);
if (strandbuf) {
copy_v3_v3(svert->co, loc);
@@ -1968,8 +1968,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
if (k==1) {
sd.first = 1;
sd.time = 0.0f;
- sub_v3_v3v3(loc0,loc1,loc);
- add_v3_v3v3(loc0,loc1,loc0);
+ sub_v3_v3v3(loc0, loc1, loc);
+ add_v3_v3v3(loc0, loc1, loc0);
particle_curve(re, obr, psmd->dm, ma, &sd, loc1, loc0, seed, pa_co);
}
@@ -1980,7 +1980,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
if (k)
particle_curve(re, obr, psmd->dm, ma, &sd, loc, loc1, seed, pa_co);
- copy_v3_v3(loc1,loc);
+ copy_v3_v3(loc1, loc);
}
}
@@ -2005,7 +2005,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
continue;
state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : ct;
- psys_get_particle_on_path(&sim,a,&state,1);
+ psys_get_particle_on_path(&sim, a, &state, 1);
if (psys->parent)
mul_m4_v3(psys->parent->obmat, state.co);
@@ -2042,7 +2042,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
}
else {
state.time=cfra;
- if (psys_get_particle_state(&sim,a,&state,0)==0)
+ if (psys_get_particle_state(&sim, a, &state, 0)==0)
continue;
if (psys->parent)
@@ -2363,7 +2363,7 @@ static void displace_render_face(Render *re, ObjectRen *obr, VlakRen *vlr, float
/* Displace the verts, flag is set when done */
if (!vlr->v1->flag)
- displace_render_vert(re, obr, &shi, vlr->v1,0, scale, mat, imat);
+ displace_render_vert(re, obr, &shi, vlr->v1, 0, scale, mat, imat);
if (!vlr->v2->flag)
displace_render_vert(re, obr, &shi, vlr->v2, 1, scale, mat, imat);
@@ -2383,10 +2383,10 @@ static void displace_render_face(Render *re, ObjectRen *obr, VlakRen *vlr, float
/* Recalculate the face normal - if flipped before, flip now */
if (vlr->v4) {
- normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_quad_v3(vlr->n, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
}
else {
- normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
}
}
@@ -2502,9 +2502,9 @@ static void init_render_mball(Render *re, ObjectRen *obr)
vlr->v4= 0;
if (negative_scale)
- normal_tri_v3( vlr->n,vlr->v1->co, vlr->v2->co, vlr->v3->co);
+ normal_tri_v3(vlr->n, vlr->v1->co, vlr->v2->co, vlr->v3->co);
else
- normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
vlr->mat= ma;
vlr->flag= ME_SMOOTH;
@@ -2519,9 +2519,9 @@ static void init_render_mball(Render *re, ObjectRen *obr)
vlr1->v2= vlr1->v3;
vlr1->v3= RE_findOrAddVert(obr, index[3]);
if (negative_scale)
- normal_tri_v3( vlr1->n,vlr1->v1->co, vlr1->v2->co, vlr1->v3->co);
+ normal_tri_v3(vlr1->n, vlr1->v1->co, vlr1->v2->co, vlr1->v3->co);
else
- normal_tri_v3( vlr1->n,vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
+ normal_tri_v3(vlr1->n, vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
}
}
@@ -2610,7 +2610,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->v1= v1; vlr->v2= v2; vlr->v3= v3; vlr->v4= v4;
- normal_quad_v3( n1,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_quad_v3(n1, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
copy_v3_v3(vlr->n, n1);
@@ -2671,12 +2671,12 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar,
*/
if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U)) {
- vlr= RE_findOrAddVlak(obr, UVTOINDEX(sizeu - 1, sizev - 1)); /* (m,n) */
- vlr1= RE_findOrAddVlak(obr, UVTOINDEX(0,0)); /* (0,0) */
+ vlr= RE_findOrAddVlak(obr, UVTOINDEX(sizeu - 1, sizev - 1)); /* (m, n) */
+ vlr1= RE_findOrAddVlak(obr, UVTOINDEX(0, 0)); /* (0, 0) */
add_v3_v3v3(n1, vlr->n, vlr1->n);
- vlr2= RE_findOrAddVlak(obr, UVTOINDEX(0, sizev-1)); /* (0,n) */
+ vlr2= RE_findOrAddVlak(obr, UVTOINDEX(0, sizev-1)); /* (0, n) */
add_v3_v3(n1, vlr2->n);
- vlr3= RE_findOrAddVlak(obr, UVTOINDEX(sizeu-1, 0)); /* (m,0) */
+ vlr3= RE_findOrAddVlak(obr, UVTOINDEX(sizeu-1, 0)); /* (m, 0) */
add_v3_v3(n1, vlr3->n);
copy_v3_v3(vlr->v3->n, n1);
copy_v3_v3(vlr1->v1->n, n1);
@@ -2754,9 +2754,9 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
/* render normals are inverted in render */
if (vlr->v4)
- len= normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ len= normal_quad_v3(vlr->n, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
else
- len= normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ len= normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
vlr->mat= ma;
vlr->flag= flag;
@@ -2981,7 +2981,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
orco+= 3*dl_surf_to_renderdata(obr, dl, matar, orco, mat);
}
else {
- int p1,p2,p3,p4;
+ int p1, p2, p3, p4;
fp= dl->verts;
startvert= obr->totvert;
@@ -3437,15 +3437,15 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
MVert *mv= me->mvert;
if (vlr->v4)
- len= normal_quad_v3( vlr->n, mv[mf->v4].co, mv[mf->v3].co, mv[mf->v2].co, mv[mf->v1].co);
+ len= normal_quad_v3(vlr->n, mv[mf->v4].co, mv[mf->v3].co, mv[mf->v2].co, mv[mf->v1].co);
else
- len= normal_tri_v3( vlr->n,mv[mf->v3].co, mv[mf->v2].co, mv[mf->v1].co);
+ len= normal_tri_v3(vlr->n, mv[mf->v3].co, mv[mf->v2].co, mv[mf->v1].co);
}
else {
if (vlr->v4)
- len= normal_quad_v3( vlr->n,vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ len= normal_quad_v3(vlr->n, vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co);
else
- len= normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ len= normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
}
vlr->mat= ma;
@@ -3584,7 +3584,7 @@ static void initshadowbuf(Render *re, LampRen *lar, float mat[][4])
/* if (la->spsi<16) return; */
/* memory alloc */
- shb= (struct ShadBuf *)MEM_callocN( sizeof(struct ShadBuf),"initshadbuf");
+ shb= (struct ShadBuf *)MEM_callocN( sizeof(struct ShadBuf), "initshadbuf");
lar->shb= shb;
if (shb==NULL) return;
@@ -3683,7 +3683,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
BLI_addtail(&re->lights, go);
go->ob= ob;
/* lamprens are in own list, for freeing */
- lar= (LampRen *)MEM_callocN(sizeof(LampRen),"lampren");
+ lar= (LampRen *)MEM_callocN(sizeof(LampRen), "lampren");
BLI_addtail(&re->lampren, lar);
go->lampren= lar;
@@ -3794,7 +3794,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->sunsky = (struct SunSky*)MEM_callocN(sizeof(struct SunSky), "sunskyren");
lar->sunsky->effect_type = la->sun_effect_type;
- copy_v3_v3(vec,ob->obmat[2]);
+ copy_v3_v3(vec, ob->obmat[2]);
normalize_v3(vec);
InitSunSky(lar->sunsky, la->atm_turbidity, vec, la->horizon_brightness,
@@ -3844,7 +3844,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
if (la->haint>0.0f) {
re->flag |= R_LAMPHALO;
- /* camera position (0,0,0) rotate around lamp */
+ /* camera position (0, 0, 0) rotate around lamp */
lar->sh_invcampos[0]= -lar->co[0];
lar->sh_invcampos[1]= -lar->co[1];
lar->sh_invcampos[2]= -lar->co[2];
@@ -4133,7 +4133,7 @@ static void set_fullsample_trace_flag(Render *re, ObjectRen *obr)
}
/* split quads for predictable baking
- * dir 1 == (0,1,2) (0,2,3), 2 == (1,3,0) (1,2,3)
+ * dir 1 == (0, 1, 2) (0, 2, 3), 2 == (1, 3, 0) (1, 2, 3)
*/
static void split_quads(ObjectRen *obr, int dir)
{
@@ -4174,8 +4174,8 @@ static void split_quads(ObjectRen *obr, int dir)
vlr->v4 = vlr1->v4 = NULL;
/* new normals */
- normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
- normal_tri_v3( vlr1->n,vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
+ normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_tri_v3(vlr1->n, vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
}
/* clear the flag when not divided */
else vlr->flag &= ~R_DIVIDE_24;
@@ -4239,8 +4239,8 @@ static void check_non_flat_quads(ObjectRen *obr)
/* 1---2 1---2 0 = orig face, 1 = new face */
/* render normals are inverted in render! we calculate normal of single tria here */
- flen= normal_tri_v3( nor,vlr->v4->co, vlr->v3->co, vlr->v1->co);
- if (flen==0.0f) normal_tri_v3( nor,vlr->v4->co, vlr->v2->co, vlr->v1->co);
+ flen= normal_tri_v3(nor, vlr->v4->co, vlr->v3->co, vlr->v1->co);
+ if (flen==0.0f) normal_tri_v3(nor, vlr->v4->co, vlr->v2->co, vlr->v1->co);
xn = dot_v3v3(nor, vlr->n);
@@ -4252,10 +4252,10 @@ static void check_non_flat_quads(ObjectRen *obr)
vlr1->flag |= R_FACE_SPLIT;
/* split direction based on vnorms */
- normal_tri_v3( nor,vlr->v1->co, vlr->v2->co, vlr->v3->co);
+ normal_tri_v3(nor, vlr->v1->co, vlr->v2->co, vlr->v3->co);
d1 = dot_v3v3(nor, vlr->v1->n);
- normal_tri_v3( nor,vlr->v2->co, vlr->v3->co, vlr->v4->co);
+ normal_tri_v3(nor, vlr->v2->co, vlr->v3->co, vlr->v4->co);
d2 = dot_v3v3(nor, vlr->v2->n);
if ( fabs(d1) < fabs(d2) ) vlr->flag |= R_DIVIDE_24;
@@ -4281,8 +4281,8 @@ static void check_non_flat_quads(ObjectRen *obr)
vlr->v4 = vlr1->v4 = NULL;
/* new normals */
- normal_tri_v3( vlr->n,vlr->v3->co, vlr->v2->co, vlr->v1->co);
- normal_tri_v3( vlr1->n,vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
+ normal_tri_v3(vlr->n, vlr->v3->co, vlr->v2->co, vlr->v1->co);
+ normal_tri_v3(vlr1->n, vlr1->v3->co, vlr1->v2->co, vlr1->v1->co);
}
/* clear the flag when not divided */
else vlr->flag &= ~R_DIVIDE_24;
@@ -5260,7 +5260,7 @@ static void speedvector_project(Render *re, float zco[2], const float co[3], con
/* use cylinder projection */
if (pano) {
float vec[3], ang;
- /* angle between (0,0,-1) and (co) */
+ /* angle between (0, 0, -1) and (co) */
copy_v3_v3(vec, co);
ang= saacos(-vec[2]/sqrtf(vec[0]*vec[0] + vec[2]*vec[2]));
@@ -5398,7 +5398,7 @@ static void calculate_speedvectors(Render *re, ObjectInstanceRen *obi, float *ve
co3= mesh->co[face[2]];
co4= (face[3])? mesh->co[face[3]]: NULL;
- interp_weights_face_v3( w,co1, co2, co3, co4, strand->vert->co);
+ interp_weights_face_v3(w, co1, co2, co3, co4, strand->vert->co);
zero_v4(speed);
madd_v4_v4fl(speed, winspeed[face[0]], w[0]);
@@ -5649,7 +5649,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned
// NT check for fluidsim special treatment
fluidmd = (FluidsimModifierData *)modifiers_findByType(obi->ob, eModifierType_Fluidsim);
if (fluidmd && fluidmd->fss && (fluidmd->fss->type & OB_FLUIDSIM_DOMAIN)) {
- // use preloaded per vertex simulation data , only does calculation for step=1
+ // use preloaded per vertex simulation data, only does calculation for step=1
// NOTE/FIXME - velocities and meshes loaded unnecessarily often during the database_fromscene_vectors calls...
load_fluidsimspeedvectors(re, obi, oldobi->vectors, step);
}
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index fa7b9cb7ea1..f8ada97e493 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -239,10 +239,10 @@ static void envmap_transmatrix(float mat[][4], int part)
}
copy_m4_m4(tmat, mat);
- eul_to_mat4( rotmat,eul);
+ eul_to_mat4(rotmat, eul);
mul_serie_m4(mat, tmat, rotmat,
- NULL, NULL, NULL,
- NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
}
/* ------------------------------------------------------------------------- */
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 260a2de4858..2bcc71d1d48 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -1482,10 +1482,10 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
/* pixel coordinates */
- minx= MIN3(dxt[0],dyt[0],dxt[0]+dyt[0] );
- maxx= MAX3(dxt[0],dyt[0],dxt[0]+dyt[0] );
- miny= MIN3(dxt[1],dyt[1],dxt[1]+dyt[1] );
- maxy= MAX3(dxt[1],dyt[1],dxt[1]+dyt[1] );
+ minx = MIN3(dxt[0], dyt[0], dxt[0] + dyt[0]);
+ maxx = MAX3(dxt[0], dyt[0], dxt[0] + dyt[0]);
+ miny = MIN3(dxt[1], dyt[1], dxt[1] + dyt[1]);
+ maxy = MAX3(dxt[1], dyt[1], dxt[1] + dyt[1]);
/* tex_sharper has been removed */
minx= (maxx-minx)/2.0f;
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index 436eaefd155..f5c2b70a290 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -1627,11 +1627,11 @@ static void *exec_strandsurface_sample(void *data)
co4= mesh->co[face[3]];
mid_v3_v3v3(co, co1, co3);
- normal_quad_v3( n,co1, co2, co3, co4);
+ normal_quad_v3(n, co1, co2, co3, co4);
}
else {
cent_tri_v3(co, co1, co2, co3);
- normal_tri_v3( n,co1, co2, co3);
+ normal_tri_v3(n, co1, co2, co3);
}
negate_v3(n);
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index a4a244daf43..cf233f1b6cd 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -541,7 +541,7 @@ void RE_SetWindow(Render *re, rctf *viewplane, float clipsta, float clipend)
re->clipend= clipend;
re->r.mode &= ~R_ORTHO;
- perspective_m4( re->winmat,re->viewplane.xmin, re->viewplane.xmax, re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend);
+ perspective_m4( re->winmat, re->viewplane.xmin, re->viewplane.xmax, re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend);
}
@@ -554,7 +554,7 @@ void RE_SetOrtho(Render *re, rctf *viewplane, float clipsta, float clipend)
re->clipend= clipend;
re->r.mode |= R_ORTHO;
- orthographic_m4( re->winmat,re->viewplane.xmin, re->viewplane.xmax, re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend);
+ orthographic_m4( re->winmat, re->viewplane.xmin, re->viewplane.xmax, re->viewplane.ymin, re->viewplane.ymax, re->clipsta, re->clipend);
}
void RE_SetView(Render *re, float mat[][4])
@@ -2375,7 +2375,7 @@ void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, const char
ibuf_clip = IMB_allocImBuf(layer->rectx, layer->recty, 32, IB_rectfloat);
if (ibuf_clip) {
- IMB_rectcpy(ibuf_clip, ibuf, 0,0, x,y, layer->rectx, layer->recty);
+ IMB_rectcpy(ibuf_clip, ibuf, 0, 0, x, y, layer->rectx, layer->recty);
memcpy(layer->rectf, ibuf_clip->rect_float, sizeof(float)*4*layer->rectx*layer->recty);
IMB_freeImBuf(ibuf_clip);
@@ -2404,7 +2404,7 @@ void RE_result_load_from_file(RenderResult *result, ReportList *reports, const c
}
}
-const float default_envmap_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 };
+const float default_envmap_layout[] = { 0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 2, 1 };
int RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env, const char *relpath, const char imtype, float layout[12])
{
@@ -2412,7 +2412,7 @@ int RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env,
ImBuf *ibuf=NULL;
int ok;
int dx;
- int maxX=0,maxY=0,i=0;
+ int maxX=0, maxY=0, i=0;
char filepath[FILE_MAX];
if (env->cube[1]==NULL) {
@@ -2427,8 +2427,8 @@ int RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env,
if (env->type == ENV_CUBE) {
for (i=0; i < 12; i+=2) {
- maxX = MAX2(maxX,layout[i] + 1);
- maxY = MAX2(maxY,layout[i+1] + 1);
+ maxX = MAX2(maxX, layout[i] + 1);
+ maxY = MAX2(maxY, layout[i+1] + 1);
}
ibuf = IMB_allocImBuf(maxX*dx, maxY*dx, 24, IB_rectfloat);
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 54474891810..8bbb16739f7 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -121,7 +121,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
/* Just to create a valid rendering context for particles */
psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy, 0);
- dm = mesh_create_derived_render(re->scene, ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
+ dm = mesh_create_derived_render(re->scene, ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
if ( !psys_check_enabled(ob, psys)) {
psys_render_restore(ob, psys);
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index bb08911a1eb..33523ab346f 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -1314,7 +1314,7 @@ static void trace_refract(float col[4], ShadeInput *shi, ShadeResult *shr)
/* get a quasi-random vector from a phong-weighted disc */
QMC_samplePhong(samp3d, qsa, shi->thread, samples, blur);
- ortho_basis_v3v3_v3( orthx, orthy,v_refract);
+ ortho_basis_v3v3_v3(orthx, orthy, v_refract);
mul_v3_fl(orthx, samp3d[0]);
mul_v3_fl(orthy, samp3d[1]);
@@ -1410,7 +1410,7 @@ static void trace_reflect(float col[3], ShadeInput *shi, ShadeResult *shr, float
mul_v3_fl(orthy, samp3d[1]*aniso);
}
else {
- ortho_basis_v3v3_v3( orthx, orthy,shi->vn);
+ ortho_basis_v3v3_v3(orthx, orthy, shi->vn);
mul_v3_fl(orthx, samp3d[0]);
mul_v3_fl(orthy, samp3d[1]);
}
@@ -1913,7 +1913,7 @@ static void ray_ao_qmc(ShadeInput *shi, float ao[3], float env[3])
copy_v3_v3(nrm, shi->facenor);
}
- ortho_basis_v3v3_v3( up, side,nrm);
+ ortho_basis_v3v3_v3(up, side, nrm);
/* sampling init */
if (R.wrld.ao_samp_method==WO_AOSAMP_HALTON) {
@@ -2262,10 +2262,10 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
/* calc tangent plane vectors */
sub_v3_v3v3(v, co, lampco);
normalize_v3(v);
- ortho_basis_v3v3_v3( ru, rv,v);
+ ortho_basis_v3v3_v3(ru, rv, v);
/* sampling, returns quasi-random vector in area_size disc */
- QMC_sampleDisc(samp3d, qsa, shi->thread, samples,lar->area_size);
+ QMC_sampleDisc(samp3d, qsa, shi->thread, samples, lar->area_size);
/* distribute disc samples across the tangent plane */
s[0] = samp3d[0]*ru[0] + samp3d[1]*rv[0];
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 4c49d2cc7fe..fce22c388e5 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -227,7 +227,7 @@ static int blend(Tex *tex, float *texvec, TexResult *texres)
texres->tin= (2.0f+x+y)/4.0f;
}
else if (tex->stype==TEX_RAD) { /* radial */
- texres->tin= (atan2(y,x) / (2*M_PI) + 0.5);
+ texres->tin= (atan2(y, x) / (2*M_PI) + 0.5);
}
else { /* sphere TEX_SPHERE */
texres->tin= 1.0-sqrt(x*x+ y*y+texvec[2]*texvec[2]);
@@ -870,7 +870,7 @@ static int cubemap(MTex *mtex, VlakRen *vlr, float *n, float x, float y, float z
/* test for v1, vlr can be faked for baking */
if (vlr->v1 && vlr->v1->orco) {
float nor[3];
- normal_tri_v3( nor,vlr->v1->orco, vlr->v2->orco, vlr->v3->orco);
+ normal_tri_v3(nor, vlr->v1->orco, vlr->v2->orco, vlr->v3->orco);
if ( fabs(nor[0])<fabs(nor[2]) && fabs(nor[1])<fabs(nor[2]) ) vlr->puno |= ME_PROJXY;
else if ( fabs(nor[0])<fabs(nor[1]) && fabs(nor[2])<fabs(nor[1]) ) vlr->puno |= ME_PROJXZ;
@@ -969,8 +969,8 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
fx = (t[0] + 1.0f) / 2.0f;
fy = (t[1] + 1.0f) / 2.0f;
}
- else if (wrap==MTEX_TUBE) map_to_tube( &fx, &fy,t[0], t[1], t[2]);
- else if (wrap==MTEX_SPHERE) map_to_sphere( &fx, &fy,t[0], t[1], t[2]);
+ else if (wrap==MTEX_TUBE) map_to_tube( &fx, &fy, t[0], t[1], t[2]);
+ else if (wrap==MTEX_SPHERE) map_to_sphere( &fx, &fy, t[0], t[1], t[2]);
else {
if (texco==TEXCO_OBJECT) cubemap_ob(ob, n, t[0], t[1], t[2], &fx, &fy);
else if (texco==TEXCO_GLOB) cubemap_glob(n, t[0], t[1], t[2], &fx, &fy);
@@ -1041,20 +1041,20 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, float *n, float *d
}
if (ok) {
if (wrap==MTEX_TUBE) {
- map_to_tube( area, area+1,t[0], t[1], t[2]);
- map_to_tube( area+2, area+3,t[0]+dxt[0], t[1]+dxt[1], t[2]+dxt[2]);
- map_to_tube( area+4, area+5,t[0]+dyt[0], t[1]+dyt[1], t[2]+dyt[2]);
+ map_to_tube( area, area+1, t[0], t[1], t[2]);
+ map_to_tube( area+2, area+3, t[0]+dxt[0], t[1]+dxt[1], t[2]+dxt[2]);
+ map_to_tube( area+4, area+5, t[0]+dyt[0], t[1]+dyt[1], t[2]+dyt[2]);
}
else {
- map_to_sphere(area,area+1,t[0], t[1], t[2]);
- map_to_sphere( area+2, area+3,t[0]+dxt[0], t[1]+dxt[1], t[2]+dxt[2]);
- map_to_sphere( area+4, area+5,t[0]+dyt[0], t[1]+dyt[1], t[2]+dyt[2]);
+ map_to_sphere(area, area+1, t[0], t[1], t[2]);
+ map_to_sphere( area+2, area+3, t[0]+dxt[0], t[1]+dxt[1], t[2]+dxt[2]);
+ map_to_sphere( area+4, area+5, t[0]+dyt[0], t[1]+dyt[1], t[2]+dyt[2]);
}
areaflag= 1;
}
else {
- if (wrap==MTEX_TUBE) map_to_tube( &fx, &fy,t[0], t[1], t[2]);
- else map_to_sphere( &fx, &fy,t[0], t[1], t[2]);
+ if (wrap==MTEX_TUBE) map_to_tube( &fx, &fy, t[0], t[1], t[2]);
+ else map_to_sphere( &fx, &fy, t[0], t[1], t[2]);
dxt[0]/= 2.0f;
dxt[1]/= 2.0f;
dyt[0]/= 2.0f;
@@ -3077,8 +3077,8 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
case TEXCO_H_SPHEREMAP:
case TEXCO_H_TUBEMAP:
if (skyflag & WO_ZENUP) {
- if (mtex->texco==TEXCO_H_TUBEMAP) map_to_tube( tempvec, tempvec+1,lo[0], lo[2], lo[1]);
- else map_to_sphere( tempvec, tempvec+1,lo[0], lo[2], lo[1]);
+ if (mtex->texco==TEXCO_H_TUBEMAP) map_to_tube( tempvec, tempvec+1, lo[0], lo[2], lo[1]);
+ else map_to_sphere( tempvec, tempvec+1, lo[0], lo[2], lo[1]);
/* tube/spheremap maps for outside view, not inside */
tempvec[0]= 1.0f-tempvec[0];
/* only top half */
@@ -3683,7 +3683,7 @@ void RE_sample_material_color(Material *mat, float color[3], float *alpha, const
if (!mvert || !mface || !mat) return;
v1=mface[face_index].v1, v2=mface[face_index].v2, v3=mface[face_index].v3;
if (hit_quad) {v2=mface[face_index].v3; v3=mface[face_index].v4;}
- normal_tri_v3( normal, mvert[v1].co, mvert[v2].co, mvert[v3].co);
+ normal_tri_v3(normal, mvert[v1].co, mvert[v2].co, mvert[v3].co);
/* generate shadeinput with data required */
shi.mat = mat;
@@ -3737,7 +3737,7 @@ void RE_sample_material_color(Material *mat, float color[3], float *alpha, const
}
}
/* active uv map */
- shi.actuv = CustomData_get_active_layer_index(&orcoDm->faceData,CD_MTFACE) - layer_index;
+ shi.actuv = CustomData_get_active_layer_index(&orcoDm->faceData, CD_MTFACE) - layer_index;
shi.totuv = layers;
}
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index c0267a3b44d..04e1bee4376 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -889,10 +889,10 @@ static PixStrMain *addpsmain(ListBase *lb)
{
PixStrMain *psm;
- psm= (PixStrMain *)MEM_mallocN(sizeof(PixStrMain),"pixstrMain");
+ psm= (PixStrMain *)MEM_mallocN(sizeof(PixStrMain), "pixstrMain");
BLI_addtail(lb, psm);
- psm->ps= (PixStr *)MEM_mallocN(4096*sizeof(PixStr),"pixstr");
+ psm->ps= (PixStr *)MEM_mallocN(4096*sizeof(PixStr), "pixstr");
psm->counter= 0;
return psm;
diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c
index f3b6bfb80ea..4a9e4be7f86 100644
--- a/source/blender/render/intern/source/renderdatabase.c
+++ b/source/blender/render/intern/source/renderdatabase.c
@@ -254,7 +254,7 @@ VertRen *RE_findOrAddVert(ObjectRen *obr, int nr)
int a;
if (nr<0) {
- printf("error in findOrAddVert: %d\n",nr);
+ printf("error in findOrAddVert: %d\n", nr);
return NULL;
}
a= nr>>8;
@@ -262,7 +262,7 @@ VertRen *RE_findOrAddVert(ObjectRen *obr, int nr)
if (a>=obr->vertnodeslen-1) { /* Need to allocate more columns..., and keep last element NULL for free loop */
temp= obr->vertnodes;
- obr->vertnodes= MEM_mallocN(sizeof(VertTableNode)*(obr->vertnodeslen+TABLEINITSIZE) , "vertnodes");
+ obr->vertnodes= MEM_mallocN(sizeof(VertTableNode)*(obr->vertnodeslen+TABLEINITSIZE), "vertnodes");
if (temp) memcpy(obr->vertnodes, temp, obr->vertnodeslen*sizeof(VertTableNode));
memset(obr->vertnodes+obr->vertnodeslen, 0, TABLEINITSIZE*sizeof(VertTableNode));
@@ -274,7 +274,7 @@ VertRen *RE_findOrAddVert(ObjectRen *obr, int nr)
if (v==NULL) {
int i;
- v= (VertRen *)MEM_callocN(256*sizeof(VertRen),"findOrAddVert");
+ v= (VertRen *)MEM_callocN(256*sizeof(VertRen), "findOrAddVert");
obr->vertnodes[a].vert= v;
for (i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++) {
@@ -497,7 +497,7 @@ VlakRen *RE_findOrAddVlak(ObjectRen *obr, int nr)
int a;
if (nr<0) {
- printf("error in findOrAddVlak: %d\n",nr);
+ printf("error in findOrAddVlak: %d\n", nr);
return obr->vlaknodes[0].vlak;
}
a= nr>>8;
@@ -505,7 +505,7 @@ VlakRen *RE_findOrAddVlak(ObjectRen *obr, int nr)
if (a>=obr->vlaknodeslen-1) { /* Need to allocate more columns..., and keep last element NULL for free loop */
temp= obr->vlaknodes;
- obr->vlaknodes= MEM_mallocN(sizeof(VlakTableNode)*(obr->vlaknodeslen+TABLEINITSIZE) , "vlaknodes");
+ obr->vlaknodes= MEM_mallocN(sizeof(VlakTableNode)*(obr->vlaknodeslen+TABLEINITSIZE), "vlaknodes");
if (temp) memcpy(obr->vlaknodes, temp, obr->vlaknodeslen*sizeof(VlakTableNode));
memset(obr->vlaknodes+obr->vlaknodeslen, 0, TABLEINITSIZE*sizeof(VlakTableNode));
@@ -518,7 +518,7 @@ VlakRen *RE_findOrAddVlak(ObjectRen *obr, int nr)
if (v==NULL) {
int i;
- v= (VlakRen *)MEM_callocN(256*sizeof(VlakRen),"findOrAddVlak");
+ v= (VlakRen *)MEM_callocN(256*sizeof(VlakRen), "findOrAddVlak");
obr->vlaknodes[a].vlak= v;
for (i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++)
@@ -668,7 +668,7 @@ StrandRen *RE_findOrAddStrand(ObjectRen *obr, int nr)
int a;
if (nr<0) {
- printf("error in findOrAddStrand: %d\n",nr);
+ printf("error in findOrAddStrand: %d\n", nr);
return obr->strandnodes[0].strand;
}
a= nr>>8;
@@ -676,7 +676,7 @@ StrandRen *RE_findOrAddStrand(ObjectRen *obr, int nr)
if (a>=obr->strandnodeslen-1) { /* Need to allocate more columns..., and keep last element NULL for free loop */
temp= obr->strandnodes;
- obr->strandnodes= MEM_mallocN(sizeof(StrandTableNode)*(obr->strandnodeslen+TABLEINITSIZE) , "strandnodes");
+ obr->strandnodes= MEM_mallocN(sizeof(StrandTableNode)*(obr->strandnodeslen+TABLEINITSIZE), "strandnodes");
if (temp) memcpy(obr->strandnodes, temp, obr->strandnodeslen*sizeof(StrandTableNode));
memset(obr->strandnodes+obr->strandnodeslen, 0, TABLEINITSIZE*sizeof(StrandTableNode));
@@ -689,7 +689,7 @@ StrandRen *RE_findOrAddStrand(ObjectRen *obr, int nr)
if (v==NULL) {
int i;
- v= (StrandRen *)MEM_callocN(256*sizeof(StrandRen),"findOrAddStrand");
+ v= (StrandRen *)MEM_callocN(256*sizeof(StrandRen), "findOrAddStrand");
obr->strandnodes[a].strand= v;
for (i= (nr & 0xFFFFFF00), a=0; a<256; a++, i++)
@@ -903,7 +903,7 @@ HaloRen *RE_findOrAddHalo(ObjectRen *obr, int nr)
int a;
if (nr<0) {
- printf("error in findOrAddHalo: %d\n",nr);
+ printf("error in findOrAddHalo: %d\n", nr);
return NULL;
}
a= nr>>8;
@@ -913,7 +913,7 @@ HaloRen *RE_findOrAddHalo(ObjectRen *obr, int nr)
// TABLEINITSIZE, obr->blohalen+TABLEINITSIZE );
temp=obr->bloha;
- obr->bloha=(HaloRen**)MEM_callocN(sizeof(void*)*(obr->blohalen+TABLEINITSIZE) , "Bloha");
+ obr->bloha=(HaloRen**)MEM_callocN(sizeof(void*)*(obr->blohalen+TABLEINITSIZE), "Bloha");
if (temp) memcpy(obr->bloha, temp, obr->blohalen*sizeof(void*));
memset(&(obr->bloha[obr->blohalen]), 0, TABLEINITSIZE*sizeof(void*));
obr->blohalen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/
@@ -922,7 +922,7 @@ HaloRen *RE_findOrAddHalo(ObjectRen *obr, int nr)
h= obr->bloha[a];
if (h==NULL) {
- h= (HaloRen *)MEM_callocN(256*sizeof(HaloRen),"findOrAdHalo");
+ h= (HaloRen *)MEM_callocN(256*sizeof(HaloRen), "findOrAdHalo");
obr->bloha[a]= h;
}
h+= (nr & 255);
@@ -1050,7 +1050,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
HaloRen *har;
MTex *mtex;
float tin, tr, tg, tb, ta;
- float xn, yn, zn, texvec[3], hoco[4], hoco1[4], in[3],tex[3],out[3];
+ float xn, yn, zn, texvec[3], hoco[4], hoco1[4], in[3], tex[3], out[3];
int i, hasrgb;
if (hasize==0.0f) return NULL;
@@ -1124,24 +1124,24 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
}
else if (mtex->texco & TEXCO_OBJECT) {
if (mtex->object)
- mul_m4_v3(mtex->object->imat_ren,texvec);
+ mul_m4_v3(mtex->object->imat_ren, texvec);
}
else if (mtex->texco & TEXCO_GLOB) {
- copy_v3_v3(texvec,vec);
+ copy_v3_v3(texvec, vec);
}
else if (mtex->texco & TEXCO_UV && uvco) {
- int uv_index=CustomData_get_named_layer_index(&dm->faceData,CD_MTFACE,mtex->uvname);
+ int uv_index=CustomData_get_named_layer_index(&dm->faceData, CD_MTFACE, mtex->uvname);
if (uv_index<0)
- uv_index=CustomData_get_active_layer_index(&dm->faceData,CD_MTFACE);
+ uv_index=CustomData_get_active_layer_index(&dm->faceData, CD_MTFACE);
- uv_index-=CustomData_get_layer_index(&dm->faceData,CD_MTFACE);
+ uv_index-=CustomData_get_layer_index(&dm->faceData, CD_MTFACE);
texvec[0]=2.0f*uvco[2*uv_index]-1.0f;
texvec[1]=2.0f*uvco[2*uv_index+1]-1.0f;
texvec[2]=0.0f;
}
else if (mtex->texco & TEXCO_PARTICLE) {
- /* particle coordinates in range [0,1] */
+ /* particle coordinates in range [0, 1] */
texvec[0] = 2.f * pa_co[0] - 1.f;
texvec[1] = 2.f * pa_co[1] - 1.f;
texvec[2] = pa_co[2];
@@ -1162,7 +1162,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
out[1]=har->g;
out[2]=har->b;
- texture_rgb_blend(in,tex,out,tin,mtex->colfac,mtex->blendtype);
+ texture_rgb_blend(in, tex, out, tin, mtex->colfac, mtex->blendtype);
// zn= 1.0-yn;
//har->r= (yn*tr+ zn*ma->r);
//har->g= (yn*tg+ zn*ma->g);
@@ -1177,13 +1177,13 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater
tin = ta;
if (mtex->mapto & MAP_ALPHA)
- har->alfa = texture_value_blend(mtex->def_var,har->alfa,tin,mtex->alphafac,mtex->blendtype);
+ har->alfa = texture_value_blend(mtex->def_var, har->alfa, tin, mtex->alphafac, mtex->blendtype);
if (mtex->mapto & MAP_HAR)
- har->hard = 1.0f+126.0f*texture_value_blend(mtex->def_var,((float)har->hard)/127.0f,tin,mtex->hardfac,mtex->blendtype);
+ har->hard = 1.0f+126.0f*texture_value_blend(mtex->def_var, ((float)har->hard)/127.0f, tin, mtex->hardfac, mtex->blendtype);
if (mtex->mapto & MAP_RAYMIRR)
- har->hasize = 100.0f*texture_value_blend(mtex->def_var,har->hasize/100.0f,tin,mtex->raymirrfac,mtex->blendtype);
+ har->hasize = 100.0f*texture_value_blend(mtex->def_var, har->hasize/100.0f, tin, mtex->raymirrfac, mtex->blendtype);
if (mtex->mapto & MAP_TRANSLU) {
- float add = texture_value_blend(mtex->def_var,(float)har->add/255.0f,tin,mtex->translfac,mtex->blendtype);
+ float add = texture_value_blend(mtex->def_var, (float)har->add/255.0f, tin, mtex->translfac, mtex->blendtype);
CLAMP(add, 0.f, 1.f);
har->add = 255.0f*add;
}
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 7b17c782590..4956eedbb87 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -108,7 +108,7 @@ static void copy_to_ztile(int *rectz, int size, int x1, int y1, int tile, char *
#if 0
static int sizeoflampbuf(ShadBuf *shb)
{
- int num,count=0;
+ int num, count=0;
char *cp;
cp= shb->cbuf;
@@ -193,7 +193,7 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
#if 0
if (print) {
for (a=0, ds=dsample; a<tot; a++, ds++)
- printf("%lf,%f ", ds->z/(double)0x7FFFFFFF, ds->v);
+ printf("%lf, %f ", ds->z/(double)0x7FFFFFFF, ds->v);
printf("\n");
}
#endif
@@ -278,7 +278,7 @@ static int compress_deepsamples(DeepSample *dsample, int tot, float epsilon)
#if 0
if (print) {
for (a=0, ds=dsample; a<newtot; a++, ds++)
- printf("%lf,%f ", ds->z/(double)0x7FFFFFFF, ds->v);
+ printf("%lf, %f ", ds->z/(double)0x7FFFFFFF, ds->v);
printf("\n");
}
#endif
@@ -546,7 +546,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
verg= (*rz1 & 0xFFFFFF00);
- for (a=0;a<256;a++,rz1++) {
+ for (a=0;a<256;a++, rz1++) {
if ( (*rz1 & 0xFFFFFF00) !=verg) break;
}
}
@@ -564,7 +564,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
verg1= rc[BCOMP];
rc+= 4;
byt1= 1; byt2= 1;
- for (a=1;a<256;a++,rc+=4) {
+ for (a=1;a<256;a++, rc+=4) {
byt1 &= (verg==rc[ACOMP]);
byt2 &= (verg1==rc[BCOMP]);
@@ -582,7 +582,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
}
else if (byt1) { /* only store short */
*ctile= 2;
- *ztile= (uintptr_t)MEM_mallocN(2*256+4,"Tile2");
+ *ztile= (uintptr_t)MEM_mallocN(2*256+4, "Tile2");
rz= (int *)*ztile;
*rz= *rz1;
@@ -595,7 +595,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
}
else { /* store triple */
*ctile= 3;
- *ztile= (uintptr_t)MEM_mallocN(3*256,"Tile3");
+ *ztile= (uintptr_t)MEM_mallocN(3*256, "Tile3");
zt= (char *)*ztile;
rc= rcline;
@@ -779,7 +779,7 @@ void makeshadowbuf(Render *re, LampRen *lar)
shb->pixsize= (shb->d)/temp;
wsize= shb->pixsize*(shb->size/2.0f);
- perspective_m4( shb->winmat,-wsize, wsize, -wsize, wsize, shb->d, shb->clipend);
+ perspective_m4( shb->winmat, -wsize, wsize, -wsize, wsize, shb->d, shb->clipend);
mult_m4_m4m4(shb->persmat, shb->winmat, shb->viewmat);
if (ELEM3(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP)) {
@@ -1192,7 +1192,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, const float co[3], const float dxc
if (firstreadshadbuf(shb, shsample, &rz, (int)(xs1+xres), (int)ys1, 1)) {
if (firstreadshadbuf(shb, shsample, &rz, (int)xs1, (int)(ys1+yres), 1)) {
if (firstreadshadbuf(shb, shsample, &rz, (int)(xs1+xres), (int)(ys1+yres), 1)) {
- return readshadowbuf(shb, shsample, bias,(int)xs1, (int)ys1, zs);
+ return readshadowbuf(shb, shsample, bias, (int)xs1, (int)ys1, zs);
}
}
}
@@ -2074,7 +2074,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
dface = dot_v3v3(v1, nor);
hoco[3]= 1.0f;
- /* ortho viewplane cannot intersect using view vector originating in (0,0,0) */
+ /* ortho viewplane cannot intersect using view vector originating in (0, 0, 0) */
if (R.r.mode & R_ORTHO) {
/* x and y 3d coordinate can be derived from pixel coord and winmat */
float fx= 2.0f/(R.winx*R.winmat[0][0]);
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index b6eccc3e10f..1dcac84271a 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -176,7 +176,7 @@ static float compute_reduced_albedo(ScatterSettings *ss)
{
const float tolerance= 1e-8;
const int max_iteration_count= 20;
- float d, fsub, xn_1= 0.0f , xn= 1.0f, fxn, fxn_1;
+ float d, fsub, xn_1= 0.0f, xn= 1.0f, fxn, fxn_1;
int i;
/* use secant method to compute reduced albedo using Rd function inverse
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index ea6b099996d..b68525c7150 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -485,7 +485,7 @@ static APixstrand *addpsmainAstrand(ListBase *lb)
psm= MEM_mallocN(sizeof(APixstrMain), "addpsmainA");
BLI_addtail(lb, psm);
- psm->ps= MEM_callocN(4096*sizeof(APixstrand),"pixstr");
+ psm->ps = MEM_callocN(4096 * sizeof(APixstrand), "pixstr");
return psm->ps;
}
diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c
index 8aabfbfed09..5f274e379ad 100644
--- a/source/blender/render/intern/source/sunsky.c
+++ b/source/blender/render/intern/source/sunsky.c
@@ -71,7 +71,7 @@
/**
* ClipColor:
- * clip a color to range [0,1];
+ * clip a color to range [0, 1];
* */
void ClipColor(float c[3])
{
@@ -146,7 +146,7 @@ static float PerezFunction(struct SunSky *sunsky, const float *lam, float theta,
* back_scatter, controls back scatter light
* */
void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_brightness,
- float spread,float sun_brightness, float sun_size, float back_scatter,
+ float spread, float sun_brightness, float sun_size, float back_scatter,
float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace)
{
float theta2;
@@ -251,7 +251,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b
void GetSkyXYZRadiance(struct SunSky* sunsky, float theta, float phi, float color_out[3])
{
float gamma;
- float x,y,Y,X,Z;
+ float x, y, Y, X, Z;
float hfade=1, nfade=1;
@@ -336,7 +336,7 @@ static void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3])
fAlpha = 1.3f;
fBeta = 0.04608365822050f * turbidity - 0.04586025928522f;
- m = 1.0f/(cosf(theta) + 0.15f*powf(93.885f-theta/(float)M_PI*180.0f,-1.253f));
+ m = 1.0f/(cosf(theta) + 0.15f*powf(93.885f-theta/(float)M_PI*180.0f, -1.253f));
for (i = 0; i < 3; i++) {
// Rayleigh Scattering
@@ -374,7 +374,7 @@ void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float r
float K[3] = {0.685f, 0.679f, 0.670f};
float vBetaMieTemp[3];
- float fLambda[3],fLambda2[3], fLambda4[3];
+ float fLambda[3], fLambda2[3], fLambda4[3];
float vLambda2[3];
float vLambda4[3];
@@ -411,7 +411,7 @@ void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float r
VEC3OPF(sunSky->atm_BetaRay, vLambda4, *, fBeta);
fBetaDash = fTemp/2;
- VEC3OPF(sunSky->atm_BetaDashRay, vLambda4,*, fBetaDash);
+ VEC3OPF(sunSky->atm_BetaDashRay, vLambda4, *, fBetaDash);
// Mie scattering constants.
@@ -421,7 +421,7 @@ void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float r
fTemp3 = 0.434f*c*pi*(2*pi)*(2*pi);
VEC3OPV(vBetaMieTemp, K, *, fLambda);
- VEC3OPF(sunSky->atm_BetaMie, vBetaMieTemp,*, fTemp3);
+ VEC3OPF(sunSky->atm_BetaMie, vBetaMieTemp, *, fTemp3);
}
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 1f5ada9b113..69aa6082950 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -95,7 +95,7 @@ static int intersect_outside_volume(RayObject *tree, Isect *isect, float *offset
static int point_inside_obi(RayObject *tree, ObjectInstanceRen *UNUSED(obi), float *co)
{
Isect isect= {{0}};
- float dir[3] = {0.0f,0.0f,1.0f};
+ float dir[3] = {0.0f, 0.0f, 1.0f};
int final_depth=0, depth=0, limit=20;
/* set up the isect */
@@ -313,7 +313,7 @@ static float total_ms_energy(Render *re, int do_test_break, float *sr, float *sg
for (z=1;z<=res[2];z++) {
for (y=1;y<=res[1];y++) {
for (x=1;x<=res[0];x++) {
- const int i = ms_I(x,y,z,res);
+ const int i = ms_I(x, y, z, res);
if (sr[i] > 0.f) energy += sr[i];
if (sg[i] > 0.f) energy += sg[i];
@@ -338,8 +338,8 @@ static void ms_diffuse(Render *re, int do_test_break, float *x0, float *x, float
for (k=1; k<=n[2]; k++) {
for (j=1; j<=n[1]; j++) {
for (i=1; i<=n[0]; i++) {
- x[v_I_pad(i,j,k,n)] = (x0[v_I_pad(i,j,k,n)]) + a*( x0[v_I_pad(i-1,j,k,n)]+ x0[v_I_pad(i+1,j,k,n)]+ x0[v_I_pad(i,j-1,k,n)]+
- x0[v_I_pad(i,j+1,k,n)]+ x0[v_I_pad(i,j,k-1,n)]+x0[v_I_pad(i,j,k+1,n)]
+ x[v_I_pad(i, j, k, n)] = (x0[v_I_pad(i, j, k, n)]) + a*( x0[v_I_pad(i-1, j, k, n)]+ x0[v_I_pad(i+1, j, k, n)]+ x0[v_I_pad(i, j-1, k, n)]+
+ x0[v_I_pad(i, j+1, k, n)]+ x0[v_I_pad(i, j, k-1, n)]+x0[v_I_pad(i, j, k+1, n)]
) / (1+6*a);
}
}
@@ -385,7 +385,7 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi
for (z=1; z<=n[2]; z++) {
for (y=1; y<=n[1]; y++) {
for (x=1; x<=n[0]; x++) {
- const int i = lc_to_ms_I(x, y ,z, n); //lc index
+ const int i = lc_to_ms_I(x, y, z, n); //lc index
const int j = ms_I(x, y, z, n); //ms index
time= PIL_check_seconds_timer();
@@ -414,9 +414,9 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi
if (re->test_break(re->tbh)) break;
- SWAP(float *,sr,sr0);
- SWAP(float *,sg,sg0);
- SWAP(float *,sb,sb0);
+ SWAP(float *, sr, sr0);
+ SWAP(float *, sg, sg0);
+ SWAP(float *, sb, sb0);
/* main diffusion simulation */
ms_diffuse(re, do_test_break, sr0, sr, diff, n);
@@ -443,7 +443,7 @@ static void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Materi
for (z=1;z<=n[2];z++) {
for (y=1;y<=n[1];y++) {
for (x=1;x<=n[0];x++) {
- const int i = lc_to_ms_I(x, y ,z, n); //lc index
+ const int i = lc_to_ms_I(x, y, z, n); //lc index
const int j = ms_I(x, y, z, n); //ms index
vp->data_r[i] = origf * vp->data_r[i] + fac * sr[j];
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index 0f72a4bd40f..e63c9b7b4dd 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -113,7 +113,7 @@ static float vol_get_shadow(ShadeInput *shi, LampRen *lar, const float co[3])
is.orig.face = NULL;
is.last_hit = lar->last_hit[shi->thread];
- if (RE_rayobject_raycast(R.raytree,&is)) {
+ if (RE_rayobject_raycast(R.raytree, &is)) {
visibility = 0.f;
}
@@ -258,7 +258,7 @@ static float metadensity(Object* ob, const float co[3])
/* element rotation transform */
float tp[3] = {ml->x - tco[0], ml->y - tco[1], ml->z - tco[2]};
- quat_to_mat3( bmat,ml->quat);
+ quat_to_mat3(bmat, ml->quat);
transpose_m3(bmat); // rot.only, so inverse == transpose
mul_m3_v3(bmat, tp);
@@ -471,7 +471,7 @@ static void vol_get_transmittance(ShadeInput *shi, float tr[3], const float co[3
static void vol_shade_one_lamp(struct ShadeInput *shi, const float co[3], const float view[3], LampRen *lar, float lacol[3])
{
float visifac, lv[3], lampdist;
- float tr[3]={1.0,1.0,1.0};
+ float tr[3]={1.0, 1.0, 1.0};
float hitco[3], *atten_co;
float p, ref_col[3];
@@ -653,7 +653,7 @@ static void volumeintegrate(struct ShadeInput *shi, float col[4], const float co
/* the main entry point for volume shading */
static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume)
{
- float hitco[3], col[4] = {0.f,0.f,0.f,0.f};
+ float hitco[3], col[4] = {0.f, 0.f, 0.f, 0.f};
float *startco, *endco;
int trace_behind = 1;
const int ztransp= ((shi->depth==0) && (shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_ZTRANSP));
@@ -748,7 +748,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is)
{
float hitco[3];
- float tr[3] = {1.0,1.0,1.0};
+ float tr[3] = {1.0, 1.0, 1.0};
Isect is= {{0}};
float *startco, *endco;
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index 817e51f2020..940f718d4ad 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -117,7 +117,7 @@ static int load_frame_raw8(VoxelData *vd, FILE *fp, int frame)
return 0;
}
- if (fseek(fp,(frame-1)*size*sizeof(char),0) == -1) {
+ if (fseek(fp, (frame-1)*size*sizeof(char), 0) == -1) {
MEM_freeN(data_c);
MEM_freeN(vd->dataset);
vd->dataset= NULL;
@@ -201,7 +201,7 @@ static int read_voxeldata_header(FILE *fp, struct VoxelData *vd)
VoxelDataHeader *h=(VoxelDataHeader *)MEM_mallocN(sizeof(VoxelDataHeader), "voxel data header");
rewind(fp);
- if (fread(h,sizeof(VoxelDataHeader),1,fp) != 1) {
+ if (fread(h, sizeof(VoxelDataHeader), 1, fp) != 1) {
MEM_freeN(h);
return 0;
}
@@ -338,7 +338,7 @@ void cache_voxeldata(Tex *tex, int scene_frame)
case TEX_VD_BLENDERVOXEL:
BLI_path_abs(path, G.main->name);
if (!BLI_exists(path)) return;
- fp = BLI_fopen(path,"rb");
+ fp = BLI_fopen(path, "rb");
if (!fp) return;
if (read_voxeldata_header(fp, vd))
@@ -349,7 +349,7 @@ void cache_voxeldata(Tex *tex, int scene_frame)
case TEX_VD_RAW_8BIT:
BLI_path_abs(path, G.main->name);
if (!BLI_exists(path)) return;
- fp = BLI_fopen(path,"rb");
+ fp = BLI_fopen(path, "rb");
if (!fp) return;
load_frame_raw8(vd, fp, curframe);
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 06fc323e8d7..50fb9211995 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -149,7 +149,7 @@ static void zbuf_add_to_span(ZSpan *zspan, float *v1, float *v2)
}
else {
dx0= 0.0f;
- xs0= MIN2(minv[0],maxv[0]);
+ xs0= MIN2(minv[0], maxv[0]);
}
/* empty span */
@@ -270,7 +270,7 @@ static APixstr *addpsmainA(ListBase *lb)
psm= MEM_mallocN(sizeof(APixstrMain), "addpsmainA");
BLI_addtail(lb, psm);
- psm->ps= MEM_callocN(4096*sizeof(APixstr),"pixstr");
+ psm->ps= MEM_callocN(4096*sizeof(APixstr), "pixstr");
return psm->ps;
}
@@ -305,8 +305,8 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
{
APixstr *ap, *apofs, *apn;
double zxd, zyd, zy0, zverg;
- float x0,y0,z0;
- float x1,y1,z1,x2,y2,z2,xx1;
+ float x0, y0, z0;
+ float x1, y1, z1, x2, y2, z2, xx1;
float *span1, *span2;
int *rz, *rm, x, y;
int sn1, sn2, rectx, *rectzofs, *rectmaskofs, my0, my2, mask;
@@ -844,7 +844,7 @@ static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), flo
static int clipline(float v1[4], float v2[4]) /* return 0: do not draw */
{
- float dz,dw, u1=0.0, u2=1.0;
+ float dz, dw, u1=0.0, u2=1.0;
float dx, dy, v13;
dz= v2[2]-v1[2];
@@ -854,20 +854,20 @@ static int clipline(float v1[4], float v2[4]) /* return 0: do not draw */
* filled in with zbufwire correctly when rendering in parts. otherwise
* you see line endings at edges... */
- if (cliptestf(-dz, -dw, v1[3], v1[2], &u1,&u2)) {
- if (cliptestf(dz, -dw, v1[3], -v1[2], &u1,&u2)) {
+ if (cliptestf(-dz, -dw, v1[3], v1[2], &u1, &u2)) {
+ if (cliptestf(dz, -dw, v1[3], -v1[2], &u1, &u2)) {
dx= v2[0]-v1[0];
dz= 1.01f*(v2[3]-v1[3]);
v13= 1.01f*v1[3];
- if (cliptestf(-dx, -dz, v1[0], v13, &u1,&u2)) {
- if (cliptestf(dx, -dz, v13, -v1[0], &u1,&u2)) {
+ if (cliptestf(-dx, -dz, v1[0], v13, &u1, &u2)) {
+ if (cliptestf(dx, -dz, v13, -v1[0], &u1, &u2)) {
dy= v2[1]-v1[1];
- if (cliptestf(-dy, -dz, v1[1], v13, &u1,&u2)) {
- if (cliptestf(dy, -dz, v13, -v1[1], &u1,&u2)) {
+ if (cliptestf(-dy, -dz, v1[1], v13, &u1, &u2)) {
+ if (cliptestf(dy, -dz, v13, -v1[1], &u1, &u2)) {
if (u2<1.0f) {
v2[0]= v1[0]+u2*dx;
@@ -1042,8 +1042,8 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const
static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
{
double zxd, zyd, zy0, zverg;
- float x0,y0,z0;
- float x1,y1,z1,x2,y2,z2,xx1;
+ float x0, y0, z0;
+ float x1, y1, z1, x2, y2, z2, xx1;
float *span1, *span2;
int *rectoofs, *ro;
int *rectpofs, *rp;
@@ -1164,8 +1164,8 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
{
double zxd, zyd, zy0, zverg;
- float x0,y0,z0;
- float x1,y1,z1,x2,y2,z2,xx1;
+ float x0, y0, z0;
+ float x1, y1, z1, x2, y2, z2, xx1;
float *span1, *span2;
int *rectoofs, *ro;
int *rectpofs, *rp;
@@ -1294,8 +1294,8 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), float *v1, float *v2, float *v3, float *v4)
{
double zxd, zyd, zy0, zverg;
- float x0,y0,z0;
- float x1,y1,z1,x2,y2,z2,xx1;
+ float x0, y0, z0;
+ float x1, y1, z1, x2, y2, z2, xx1;
float *span1, *span2;
int *rz, *rz1, x, y;
int sn1, sn2, rectx, *rectzofs, *rectzofs1= NULL, my0, my2;
@@ -1399,7 +1399,7 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), f
}
}
-/* 2d scanconvert for tria, calls func for each x,y coordinate and gives UV barycentrics */
+/* 2d scanconvert for tria, calls func for each x, y coordinate and gives UV barycentrics */
void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2, float *v3, void (*func)(void *, int, int, float, float, float) )
{
float x0, y0, x1, y1, x2, y2, z0, z1, z2, z;
@@ -1498,7 +1498,7 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2,
}
}
-/* scanconvert for strand triangles, calls func for each x,y coordinate and gives UV barycentrics and z */
+/* scanconvert for strand triangles, calls func for each x, y coordinate and gives UV barycentrics and z */
void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *v3, void (*func)(void *, int, int, float, float) )
{
@@ -1603,7 +1603,7 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a, float clipcrop)
{
- float da,dw,u1=0.0,u2=1.0;
+ float da, dw, u1=0.0, u2=1.0;
float v13;
labda[0]= -1.0;
@@ -1627,8 +1627,8 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a
* who would have thought that of L&B!
*/
- if (cliptestf(-da, -dw, v13, v1[a], &u1,&u2)) {
- if (cliptestf(da, -dw, v13, -v1[a], &u1,&u2)) {
+ if (cliptestf(-da, -dw, v13, v1[a], &u1, &u2)) {
+ if (cliptestf(da, -dw, v13, -v1[a], &u1, &u2)) {
*b3=1;
if (u2<1.0f) {
labda[1]= u2;
@@ -1701,7 +1701,7 @@ static void makevertpyra(float *vez, float *labda, float **trias, float *v1, flo
void projectverto(const float v1[3], float winmat[][4], float adr[4])
{
/* calcs homogenic coord of vertex v1 */
- float x,y,z;
+ float x, y, z;
x= v1[0];
y= v1[1];
@@ -1719,7 +1719,7 @@ void projectverto(const float v1[3], float winmat[][4], float adr[4])
void projectvert(const float v1[3], float winmat[][4], float adr[4])
{
/* calcs homogenic coord of vertex v1 */
- float x,y,z;
+ float x, y, z;
x= v1[0];
y= v1[1];
@@ -1877,9 +1877,9 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
else if (b==1) arg= 0;
else arg= 1;
- clippyra(labda[0], vlzp[v][0],vlzp[v][1], &b2,&b3, arg, zspan->clipcrop);
- clippyra(labda[1], vlzp[v][1],vlzp[v][2], &b2,&b3, arg, zspan->clipcrop);
- clippyra(labda[2], vlzp[v][2],vlzp[v][0], &b2,&b3, arg, zspan->clipcrop);
+ clippyra(labda[0], vlzp[v][0], vlzp[v][1], &b2, &b3, arg, zspan->clipcrop);
+ clippyra(labda[1], vlzp[v][1], vlzp[v][2], &b2, &b3, arg, zspan->clipcrop);
+ clippyra(labda[2], vlzp[v][2], vlzp[v][0], &b2, &b3, arg, zspan->clipcrop);
if (b2==0 && b3==1) {
/* completely 'in', but we copy because of last for () loop in this section */;
@@ -1895,9 +1895,9 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
else {
b1=0;
- makevertpyra(vez, labda[0], trias, vlzp[v][0],vlzp[v][1], &b1,&clve);
- makevertpyra(vez, labda[1], trias, vlzp[v][1],vlzp[v][2], &b1,&clve);
- makevertpyra(vez, labda[2], trias, vlzp[v][2],vlzp[v][0], &b1,&clve);
+ makevertpyra(vez, labda[0], trias, vlzp[v][0], vlzp[v][1], &b1, &clve);
+ makevertpyra(vez, labda[1], trias, vlzp[v][1], vlzp[v][2], &b1, &clve);
+ makevertpyra(vez, labda[2], trias, vlzp[v][2], vlzp[v][0], &b1, &clve);
/* after front clip done: now set clip flags */
if (b==0) {
@@ -1927,7 +1927,7 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
/* warning, this should never happen! */
- if (clve>38 || clvl>31) printf("clip overflow: clve clvl %d %d\n",clve,clvl);
+ if (clve>38 || clvl>31) printf("clip overflow: clve clvl %d %d\n", clve, clvl);
/* perspective division */
f1=vez;
@@ -1937,7 +1937,7 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
for (b=1;b<clvl;b++) {
if (vlzp[b][0]) {
- zspan->zbuffunc(zspan, obi, zvlnr, vlzp[b][0],vlzp[b][1],vlzp[b][2], NULL);
+ zspan->zbuffunc(zspan, obi, zvlnr, vlzp[b][0], vlzp[b][1], vlzp[b][2], NULL);
}
}
return;
@@ -1948,7 +1948,7 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
hoco_to_zco(zspan, vez, f1);
hoco_to_zco(zspan, vez+4, f2);
hoco_to_zco(zspan, vez+8, f3);
- zspan->zbuffunc(zspan, obi, zvlnr, vez,vez+4,vez+8, NULL);
+ zspan->zbuffunc(zspan, obi, zvlnr, vez, vez+4, vez+8, NULL);
}
void zbufclip4(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3, float *f4, int c1, int c2, int c3, int c4)
@@ -2648,8 +2648,8 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
{
DrawBufPixel *rectpofs, *rp;
double zxd, zyd, zy0, zverg;
- float x0,y0,z0;
- float x1,y1,z1,x2,y2,z2,xx1;
+ float x0, y0, z0;
+ float x1, y1, z1, x2, y2, z2, xx1;
float *span1, *span2;
float *rectzofs, *rz;
int x, y;
@@ -2839,7 +2839,7 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
}
/* in: two vectors, first vector points from origin back in time, 2nd vector points to future */
-/* we make this into 3 points, center point is (0,0) */
+/* we make this into 3 points, center point is (0, 0) */
/* and offset the center point just enough to make curve go through midpoint */
static void quad_bezier_2d(float *result, float *v1, float *v2, float *ipodata)
@@ -3772,7 +3772,7 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int
for (samp=0; samp<R.osa; samp++) {
if (curmask & (1<<samp)) {
- xs= (float)x + R.jit[samp][0] + 0.5f; /* zbuffer has this inverse corrected, ensures xs,ys are inside pixel */
+ xs= (float)x + R.jit[samp][0] + 0.5f; /* zbuffer has this inverse corrected, ensures (xs, ys) are inside pixel */
ys= (float)y + R.jit[samp][1] + 0.5f;
if (shi_inc) {
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 382165065af..ad232818c33 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1000,9 +1000,9 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
float fno[3];
if (mface->v4)
- normal_quad_v3( fno,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
+ normal_quad_v3(fno,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
else
- normal_tri_v3( fno,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
+ normal_tri_v3(fno,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
no0 = no1 = no2 = no3 = MT_Vector3(fno);
}
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index 9f7d42dcf56..98a3dc8f96a 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -608,10 +608,10 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj
{
v4 = polygon->GetVertex(3);
mirrorVerts.push_back(v4);
- area = normal_quad_v3( normal,(float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ(), (float*)v4->getXYZ());
+ area = normal_quad_v3(normal,(float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ(), (float*)v4->getXYZ());
} else
{
- area = normal_tri_v3( normal,(float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ());
+ area = normal_tri_v3(normal,(float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ());
}
area = fabs(area);
mirrorArea += area;