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
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-03-26 00:40:08 +0300
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-03-26 00:40:08 +0300
commit048f357f416d8044a3acfb16f7cd27db194cd3e8 (patch)
tree65c5da02a9e39518550d89e72a4b5c69fa9089e8
parent29adfa7d649df33a3d756b02058b4c1b09740058 (diff)
parentaa3428e6abbf3ef453757b4909ad10bb52b9a418 (diff)
Merged changes in the trunk up to revision 27752.
-rw-r--r--projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj4
-rw-r--r--projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj8
-rw-r--r--release/scripts/keyingsets/keyingsets_builtins.py33
-rw-r--r--release/scripts/keyingsets/keyingsets_utils.py23
-rw-r--r--release/scripts/ui/properties_data_modifier.py22
-rw-r--r--release/scripts/ui/properties_material.py56
-rw-r--r--release/scripts/ui/properties_physics_common.py4
-rw-r--r--release/scripts/ui/properties_physics_fluid.py39
-rw-r--r--release/scripts/ui/properties_scene.py1
-rw-r--r--release/scripts/ui/space_dopesheet.py12
-rw-r--r--release/scripts/ui/space_graph.py11
-rw-r--r--release/scripts/ui/space_image.py19
-rw-r--r--release/scripts/ui/space_info.py6
-rw-r--r--release/scripts/ui/space_nla.py2
-rw-r--r--release/scripts/ui/space_time.py2
-rw-r--r--release/scripts/ui/space_view3d.py8
-rw-r--r--release/scripts/ui/space_view3d_toolbar.py32
-rw-r--r--source/blender/avi/AVI_avi.h2
-rw-r--r--source/blender/avi/intern/avi.c66
-rw-r--r--source/blender/avi/intern/codecs.c90
-rw-r--r--source/blender/avi/intern/mjpeg.c8
-rw-r--r--source/blender/avi/intern/options.c14
-rw-r--r--source/blender/blenfont/intern/blf_lang.c1
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h114
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/BKE_bmesh.h6
-rw-r--r--source/blender/blenkernel/BKE_booleanops.h2
-rw-r--r--source/blender/blenkernel/BKE_cdderivedmesh.h2
-rw-r--r--source/blender/blenkernel/BKE_context.h2
-rw-r--r--source/blender/blenkernel/BKE_customdata.h42
-rw-r--r--source/blender/blenkernel/BKE_displist.h8
-rw-r--r--source/blender/blenkernel/BKE_idprop.h2
-rw-r--r--source/blender/blenkernel/BKE_lattice.h8
-rw-r--r--source/blender/blenkernel/BKE_modifier.h54
-rw-r--r--source/blender/blenkernel/BKE_object.h2
-rw-r--r--source/blender/blenkernel/BKE_paint.h9
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h6
-rw-r--r--source/blender/blenkernel/BKE_softbody.h4
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h28
-rw-r--r--source/blender/blenkernel/intern/BME_Customdata.c4
-rw-r--r--source/blender/blenkernel/intern/BME_eulers.c2
-rw-r--r--source/blender/blenkernel/intern/BME_mesh.c2
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c2
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c116
-rw-r--r--source/blender/blenkernel/intern/action.c24
-rw-r--r--source/blender/blenkernel/intern/anim.c2
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c19
-rw-r--r--source/blender/blenkernel/intern/armature.c46
-rw-r--r--source/blender/blenkernel/intern/bmfont.c2
-rw-r--r--source/blender/blenkernel/intern/booleanops.c10
-rw-r--r--source/blender/blenkernel/intern/brush.c4
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c2
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c86
-rw-r--r--source/blender/blenkernel/intern/cloth.c57
-rw-r--r--source/blender/blenkernel/intern/colortools.c8
-rw-r--r--source/blender/blenkernel/intern/constraint.c2
-rw-r--r--source/blender/blenkernel/intern/curve.c40
-rw-r--r--source/blender/blenkernel/intern/customdata.c150
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c4
-rw-r--r--source/blender/blenkernel/intern/displist.c10
-rw-r--r--source/blender/blenkernel/intern/effect.c10
-rw-r--r--source/blender/blenkernel/intern/exotic.c108
-rw-r--r--source/blender/blenkernel/intern/fluidsim.c8
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c8
-rw-r--r--source/blender/blenkernel/intern/font.c18
-rw-r--r--source/blender/blenkernel/intern/idprop.c12
-rw-r--r--source/blender/blenkernel/intern/image.c20
-rw-r--r--source/blender/blenkernel/intern/image_gen.c82
-rw-r--r--source/blender/blenkernel/intern/ipo.c2
-rw-r--r--source/blender/blenkernel/intern/key.c10
-rw-r--r--source/blender/blenkernel/intern/lattice.c10
-rw-r--r--source/blender/blenkernel/intern/library.c14
-rw-r--r--source/blender/blenkernel/intern/material.c90
-rw-r--r--source/blender/blenkernel/intern/mball.c14
-rw-r--r--source/blender/blenkernel/intern/mesh.c8
-rw-r--r--source/blender/blenkernel/intern/modifier.c1227
-rw-r--r--source/blender/blenkernel/intern/multires.c26
-rw-r--r--source/blender/blenkernel/intern/nla.c1
-rw-r--r--source/blender/blenkernel/intern/node.c53
-rw-r--r--source/blender/blenkernel/intern/object.c80
-rw-r--r--source/blender/blenkernel/intern/particle.c25
-rw-r--r--source/blender/blenkernel/intern/particle_system.c809
-rw-r--r--source/blender/blenkernel/intern/pointcache.c25
-rw-r--r--source/blender/blenkernel/intern/sca.c20
-rw-r--r--source/blender/blenkernel/intern/scene.c23
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c240
-rw-r--r--source/blender/blenkernel/intern/sequencer.c144
-rw-r--r--source/blender/blenkernel/intern/smoke.c172
-rw-r--r--source/blender/blenkernel/intern/softbody.c170
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c115
-rw-r--r--source/blender/blenkernel/intern/text.c2
-rw-r--r--source/blender/blenkernel/intern/texture.c6
-rw-r--r--source/blender/blenkernel/intern/world.c6
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c10
-rw-r--r--source/blender/blenkernel/intern/writeframeserver.c4
-rw-r--r--source/blender/blenlib/BLI_math_vector.h31
-rw-r--r--source/blender/blenlib/BLI_pbvh.h10
-rw-r--r--source/blender/blenlib/BLI_uvproject.h40
-rw-r--r--source/blender/blenlib/BLI_vfontdata.h2
-rw-r--r--source/blender/blenlib/intern/BLI_bfile.c8
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c4
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c4
-rw-r--r--source/blender/blenlib/intern/BLI_linklist.c14
-rw-r--r--source/blender/blenlib/intern/boxpack2d.c24
-rw-r--r--source/blender/blenlib/intern/bpath.c2
-rw-r--r--source/blender/blenlib/intern/dynamiclist.c2
-rw-r--r--source/blender/blenlib/intern/edgehash.c4
-rw-r--r--source/blender/blenlib/intern/fnmatch.c146
-rw-r--r--source/blender/blenlib/intern/freetypefont.c62
-rw-r--r--source/blender/blenlib/intern/math_base.c12
-rw-r--r--source/blender/blenlib/intern/math_color.c22
-rw-r--r--source/blender/blenlib/intern/math_geom.c88
-rw-r--r--source/blender/blenlib/intern/math_matrix.c125
-rw-r--r--source/blender/blenlib/intern/math_rotation.c20
-rw-r--r--source/blender/blenlib/intern/math_vector.c10
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c32
-rw-r--r--source/blender/blenlib/intern/noise.c12
-rw-r--r--source/blender/blenlib/intern/path_util.c2
-rw-r--r--source/blender/blenlib/intern/pbvh.c49
-rw-r--r--source/blender/blenlib/intern/scanfill.c6
-rw-r--r--source/blender/blenlib/intern/storage.c2
-rw-r--r--source/blender/blenlib/intern/string.c10
-rw-r--r--source/blender/blenlib/intern/uvproject.c184
-rw-r--r--source/blender/blenlib/intern/voxel.c52
-rw-r--r--source/blender/blenlib/intern/winstuff.c30
-rw-r--r--source/blender/blenloader/intern/readblenentry.c6
-rw-r--r--source/blender/blenloader/intern/readfile.c133
-rw-r--r--source/blender/editors/animation/anim_filter.c12
-rw-r--r--source/blender/editors/animation/anim_intern.h3
-rw-r--r--source/blender/editors/animation/anim_markers.c2
-rw-r--r--source/blender/editors/animation/anim_ops.c2
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c71
-rw-r--r--source/blender/editors/animation/keyframes_draw.c11
-rw-r--r--source/blender/editors/animation/keyframes_edit.c36
-rw-r--r--source/blender/editors/animation/keyframes_general.c9
-rw-r--r--source/blender/editors/animation/keyframing.c53
-rw-r--r--source/blender/editors/animation/keyingsets.c183
-rw-r--r--source/blender/editors/armature/armature_ops.c10
-rw-r--r--source/blender/editors/armature/editarmature.c162
-rw-r--r--source/blender/editors/armature/editarmature_generate.c1
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c7
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c7
-rw-r--r--source/blender/editors/armature/meshlaplacian.c8
-rw-r--r--source/blender/editors/armature/poseSlide.c11
-rw-r--r--source/blender/editors/armature/poseUtils.c13
-rw-r--r--source/blender/editors/armature/poselib.c6
-rw-r--r--source/blender/editors/armature/poseobject.c15
-rw-r--r--source/blender/editors/armature/reeb.c8
-rw-r--r--source/blender/editors/curve/curve_intern.h2
-rw-r--r--source/blender/editors/curve/curve_ops.c9
-rw-r--r--source/blender/editors/curve/editcurve.c355
-rw-r--r--source/blender/editors/curve/editfont.c41
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c9
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c16
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c41
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c10
-rw-r--r--source/blender/editors/gpencil/gpencil_ops.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c9
-rw-r--r--source/blender/editors/include/ED_anim_api.h2
-rw-r--r--source/blender/editors/include/ED_fluidsim.h2
-rw-r--r--source/blender/editors/include/ED_keyframing.h10
-rw-r--r--source/blender/editors/include/ED_numinput.h14
-rw-r--r--source/blender/editors/include/ED_sculpt.h2
-rw-r--r--source/blender/editors/include/UI_icons.h2
-rw-r--r--source/blender/editors/include/UI_interface.h20
-rw-r--r--source/blender/editors/include/UI_resources.h12
-rw-r--r--source/blender/editors/interface/interface.c29
-rw-r--r--source/blender/editors/interface/interface_anim.c2
-rw-r--r--source/blender/editors/interface/interface_draw.c10
-rw-r--r--source/blender/editors/interface/interface_handlers.c17
-rw-r--r--source/blender/editors/interface/interface_icons.c3
-rw-r--r--source/blender/editors/interface/interface_layout.c52
-rw-r--r--source/blender/editors/interface/interface_ops.c7
-rw-r--r--source/blender/editors/interface/interface_panel.c5
-rw-r--r--source/blender/editors/interface/interface_regions.c5
-rw-r--r--source/blender/editors/interface/interface_style.c7
-rw-r--r--source/blender/editors/interface/interface_templates.c102
-rw-r--r--source/blender/editors/interface/interface_utils.c4
-rw-r--r--source/blender/editors/interface/interface_widgets.c24
-rw-r--r--source/blender/editors/interface/resources.c4
-rw-r--r--source/blender/editors/interface/view2d.c4
-rw-r--r--source/blender/editors/interface/view2d_ops.c6
-rw-r--r--source/blender/editors/mesh/editface.c9
-rw-r--r--source/blender/editors/mesh/editmesh.c15
-rw-r--r--source/blender/editors/mesh/editmesh_add.c9
-rw-r--r--source/blender/editors/mesh/editmesh_lib.c12
-rw-r--r--source/blender/editors/mesh/editmesh_loop.c15
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c17
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c47
-rw-r--r--source/blender/editors/mesh/loopcut.c1
-rw-r--r--source/blender/editors/mesh/mesh_data.c9
-rw-r--r--source/blender/editors/mesh/mesh_ops.c13
-rw-r--r--source/blender/editors/mesh/meshtools.c8
-rw-r--r--source/blender/editors/metaball/mball_edit.c17
-rw-r--r--source/blender/editors/metaball/mball_ops.c2
-rw-r--r--source/blender/editors/object/object_add.c8
-rw-r--r--source/blender/editors/object/object_bake.c1
-rw-r--r--source/blender/editors/object/object_constraint.c9
-rw-r--r--source/blender/editors/object/object_edit.c56
-rw-r--r--source/blender/editors/object/object_hook.c8
-rw-r--r--source/blender/editors/object/object_lattice.c9
-rw-r--r--source/blender/editors/object/object_modifier.c9
-rw-r--r--source/blender/editors/object/object_ops.c6
-rw-r--r--source/blender/editors/object/object_relations.c43
-rw-r--r--source/blender/editors/object/object_select.c3
-rw-r--r--source/blender/editors/object/object_shapekey.c8
-rw-r--r--source/blender/editors/object/object_transform.c7
-rw-r--r--source/blender/editors/object/object_vgroup.c6
-rw-r--r--source/blender/editors/physics/particle_boids.c2
-rw-r--r--source/blender/editors/physics/particle_edit.c29
-rw-r--r--source/blender/editors/physics/particle_object.c3
-rw-r--r--source/blender/editors/physics/physics_fluid.c1574
-rw-r--r--source/blender/editors/physics/physics_ops.c1
-rw-r--r--source/blender/editors/physics/physics_pointcache.c6
-rw-r--r--source/blender/editors/render/render_internal.c13
-rw-r--r--source/blender/editors/render/render_opengl.c10
-rw-r--r--source/blender/editors/render/render_ops.c2
-rw-r--r--source/blender/editors/render/render_preview.c4
-rw-r--r--source/blender/editors/render/render_shading.c14
-rw-r--r--source/blender/editors/screen/area.c6
-rw-r--r--source/blender/editors/screen/glutil.c3
-rw-r--r--source/blender/editors/screen/screen_context.c1
-rw-r--r--source/blender/editors/screen/screen_edit.c5
-rw-r--r--source/blender/editors/screen/screen_ops.c3
-rw-r--r--source/blender/editors/screen/screendump.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c28
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h4
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c5
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c11
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c10
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c17
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c208
-rw-r--r--source/blender/editors/sound/sound_ops.c21
-rw-r--r--source/blender/editors/space_action/action_draw.c22
-rw-r--r--source/blender/editors/space_action/action_edit.c15
-rw-r--r--source/blender/editors/space_action/action_ops.c9
-rw-r--r--source/blender/editors/space_action/action_select.c16
-rw-r--r--source/blender/editors/space_action/space_action.c11
-rw-r--r--source/blender/editors/space_api/space.c1
-rw-r--r--source/blender/editors/space_api/spacetypes.c1
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c7
-rw-r--r--source/blender/editors/space_buttons/buttons_header.c8
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c4
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c10
-rw-r--r--source/blender/editors/space_console/console_draw.c2
-rw-r--r--source/blender/editors/space_console/console_ops.c26
-rw-r--r--source/blender/editors/space_console/console_report.c19
-rw-r--r--source/blender/editors/space_console/space_console.c6
-rw-r--r--source/blender/editors/space_file/file_draw.c35
-rw-r--r--source/blender/editors/space_file/file_ops.c4
-rw-r--r--source/blender/editors/space_file/file_panels.c5
-rw-r--r--source/blender/editors/space_file/filelist.c11
-rw-r--r--source/blender/editors/space_file/filesel.c7
-rw-r--r--source/blender/editors/space_file/fsmenu.h2
-rw-r--r--source/blender/editors/space_file/space_file.c10
-rw-r--r--source/blender/editors/space_file/writeimage.c2
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c54
-rw-r--r--source/blender/editors/space_graph/graph_draw.c15
-rw-r--r--source/blender/editors/space_graph/graph_edit.c17
-rw-r--r--source/blender/editors/space_graph/graph_ops.c6
-rw-r--r--source/blender/editors/space_graph/graph_select.c15
-rw-r--r--source/blender/editors/space_graph/graph_utils.c14
-rw-r--r--source/blender/editors/space_graph/space_graph.c5
-rw-r--r--source/blender/editors/space_image/image_buttons.c43
-rw-r--r--source/blender/editors/space_image/image_draw.c15
-rw-r--r--source/blender/editors/space_image/image_header.c24
-rw-r--r--source/blender/editors/space_image/image_intern.h2
-rw-r--r--source/blender/editors/space_image/image_ops.c188
-rw-r--r--source/blender/editors/space_image/image_render.c3
-rw-r--r--source/blender/editors/space_image/space_image.c11
-rw-r--r--source/blender/editors/space_info/info_ops.c8
-rw-r--r--source/blender/editors/space_info/info_stats.c4
-rw-r--r--source/blender/editors/space_info/space_info.c9
-rw-r--r--source/blender/editors/space_logic/logic_buttons.c8
-rw-r--r--source/blender/editors/space_logic/logic_header.c6
-rw-r--r--source/blender/editors/space_logic/logic_window.c203
-rw-r--r--source/blender/editors/space_logic/space_logic.c10
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c61
-rw-r--r--source/blender/editors/space_nla/nla_channels.c20
-rw-r--r--source/blender/editors/space_nla/nla_draw.c20
-rw-r--r--source/blender/editors/space_nla/nla_edit.c22
-rw-r--r--source/blender/editors/space_nla/nla_ops.c11
-rw-r--r--source/blender/editors/space_nla/nla_select.c10
-rw-r--r--source/blender/editors/space_nla/space_nla.c10
-rw-r--r--source/blender/editors/space_node/drawnode.c394
-rw-r--r--source/blender/editors/space_node/node_buttons.c11
-rw-r--r--source/blender/editors/space_node/node_draw.c16
-rw-r--r--source/blender/editors/space_node/node_edit.c14
-rw-r--r--source/blender/editors/space_node/node_header.c8
-rw-r--r--source/blender/editors/space_node/node_ops.c5
-rw-r--r--source/blender/editors/space_node/node_select.c7
-rw-r--r--source/blender/editors/space_node/node_state.c6
-rw-r--r--source/blender/editors/space_node/space_node.c8
-rw-r--r--source/blender/editors/space_outliner/outliner.c21
-rw-r--r--source/blender/editors/space_outliner/outliner_ops.c3
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c14
-rw-r--r--source/blender/editors/space_script/script_edit.c6
-rw-r--r--source/blender/editors/space_script/script_header.c6
-rw-r--r--source/blender/editors/space_script/script_ops.c5
-rw-r--r--source/blender/editors/space_script/space_script.c7
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c20
-rw-r--r--source/blender/editors/space_sequencer/sequencer_buttons.c12
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c8
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c47
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h12
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c7
-rw-r--r--source/blender/editors/space_sequencer/sequencer_scopes.c22
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c14
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c20
-rw-r--r--source/blender/editors/space_sound/sound_header.c6
-rw-r--r--source/blender/editors/space_sound/space_sound.c6
-rw-r--r--source/blender/editors/space_text/space_text.c6
-rw-r--r--source/blender/editors/space_text/text_draw.c16
-rw-r--r--source/blender/editors/space_text/text_header.c21
-rw-r--r--source/blender/editors/space_text/text_intern.h2
-rw-r--r--source/blender/editors/space_text/text_ops.c36
-rw-r--r--source/blender/editors/space_text/text_python.c1
-rw-r--r--source/blender/editors/space_time/space_time.c6
-rw-r--r--source/blender/editors/space_time/time_ops.c7
-rw-r--r--source/blender/editors/space_userpref/space_userpref.c3
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c9
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c10
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c8
-rw-r--r--source/blender/editors/space_view3d/drawobject.c90
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c40
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c11
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c90
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c33
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c254
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c50
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c42
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c23
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c46
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c30
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c58
-rw-r--r--source/blender/editors/transform/transform.c33
-rw-r--r--source/blender/editors/transform/transform.h108
-rw-r--r--source/blender/editors/transform/transform_constraints.c16
-rw-r--r--source/blender/editors/transform/transform_conversions.c57
-rw-r--r--source/blender/editors/transform/transform_generics.c14
-rw-r--r--source/blender/editors/transform/transform_input.c1
-rw-r--r--source/blender/editors/transform/transform_manipulator.c8
-rw-r--r--source/blender/editors/transform/transform_ndofinput.c10
-rw-r--r--source/blender/editors/transform/transform_ops.c10
-rw-r--r--source/blender/editors/transform/transform_orientations.c12
-rw-r--r--source/blender/editors/transform/transform_snap.c4
-rw-r--r--source/blender/editors/util/ed_util.c3
-rw-r--r--source/blender/editors/util/editmode_undo.c5
-rw-r--r--source/blender/editors/util/numinput.c5
-rw-r--r--source/blender/editors/util/undo.c12
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c9
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c7
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c80
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.h18
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c177
-rw-r--r--source/blender/gpu/GPU_extensions.h12
-rw-r--r--source/blender/gpu/gpu_buffers.h2
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c25
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c4
-rw-r--r--source/blender/gpu/intern/gpu_codegen.h2
-rw-r--r--source/blender/gpu/intern/gpu_draw.c4
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c28
-rw-r--r--source/blender/gpu/intern/gpu_material.c62
-rw-r--r--source/blender/imbuf/intern/IMB_anim.h2
-rw-r--r--source/blender/imbuf/intern/IMB_imginfo.h4
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c2
-rw-r--r--source/blender/imbuf/intern/anim.c54
-rw-r--r--source/blender/imbuf/intern/anim5.c2
-rw-r--r--source/blender/imbuf/intern/bmp.c2
-rw-r--r--source/blender/imbuf/intern/data.c6
-rw-r--r--source/blender/imbuf/intern/dds/DirectDrawSurface.h10
-rw-r--r--source/blender/imbuf/intern/divers.c2
-rw-r--r--source/blender/imbuf/intern/jp2.c4
-rw-r--r--source/blender/imbuf/intern/jpeg.c4
-rw-r--r--source/blender/imbuf/intern/md5.c270
-rw-r--r--source/blender/imbuf/intern/md5.h10
-rw-r--r--source/blender/imbuf/intern/png.c4
-rw-r--r--source/blender/imbuf/intern/radiance_hdr.c2
-rw-r--r--source/blender/imbuf/intern/readimage.c2
-rw-r--r--source/blender/imbuf/intern/scaling.c42
-rw-r--r--source/blender/imbuf/intern/targa.c8
-rw-r--r--source/blender/imbuf/intern/tiff.c2
-rw-r--r--source/blender/imbuf/intern/util.c4
-rw-r--r--source/blender/makesdna/DNA_ID.h4
-rw-r--r--source/blender/makesdna/DNA_action_types.h4
-rw-r--r--source/blender/makesdna/DNA_camera_types.h2
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h2
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h2
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h18
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h39
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim.h10
-rw-r--r--source/blender/makesdna/DNA_object_force.h8
-rw-r--r--source/blender/makesdna/DNA_object_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h13
-rw-r--r--source/blender/makesdna/DNA_screen_types.h4
-rw-r--r--source/blender/makesdna/DNA_sdna_types.h2
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h14
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h2
-rw-r--r--source/blender/makesdna/DNA_space_types.h3
-rw-r--r--source/blender/makesdna/DNA_texture_types.h2
-rw-r--r--source/blender/makesdna/DNA_vec_types.h8
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h12
-rw-r--r--source/blender/makesdna/intern/makesdna.c6
-rw-r--r--source/blender/makesrna/RNA_access.h7
-rw-r--r--source/blender/makesrna/RNA_enum_types.h2
-rw-r--r--source/blender/makesrna/RNA_types.h7
-rw-r--r--source/blender/makesrna/intern/makesrna.c10
-rw-r--r--source/blender/makesrna/intern/rna_ID.c1
-rw-r--r--source/blender/makesrna/intern/rna_access.c34
-rw-r--r--source/blender/makesrna/intern/rna_action.c1
-rw-r--r--source/blender/makesrna/intern/rna_action_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c1
-rw-r--r--source/blender/makesrna/intern/rna_animation.c55
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c42
-rw-r--r--source/blender/makesrna/intern/rna_animviz.c3
-rw-r--r--source/blender/makesrna/intern/rna_armature.c1
-rw-r--r--source/blender/makesrna/intern/rna_armature_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_boid.c1
-rw-r--r--source/blender/makesrna/intern/rna_brush.c3
-rw-r--r--source/blender/makesrna/intern/rna_camera.c1
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c1
-rw-r--r--source/blender/makesrna/intern/rna_color.c17
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c2
-rw-r--r--source/blender/makesrna/intern/rna_context.c1
-rw-r--r--source/blender/makesrna/intern/rna_controller.c3
-rw-r--r--source/blender/makesrna/intern/rna_curve.c7
-rw-r--r--source/blender/makesrna/intern/rna_define.c2
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c1
-rw-r--r--source/blender/makesrna/intern/rna_fcurve_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c80
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c2
-rw-r--r--source/blender/makesrna/intern/rna_group.c1
-rw-r--r--source/blender/makesrna/intern/rna_image.c3
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_key.c5
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c3
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c1
-rw-r--r--source/blender/makesrna/intern/rna_main.c83
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c40
-rw-r--r--source/blender/makesrna/intern/rna_material.c5
-rw-r--r--source/blender/makesrna/intern/rna_material_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c29
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_meta.c1
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c91
-rw-r--r--source/blender/makesrna/intern/rna_nla.c1
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c5
-rw-r--r--source/blender/makesrna/intern/rna_object.c52
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c21
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c1
-rw-r--r--source/blender/makesrna/intern/rna_packedfile.c1
-rw-r--r--source/blender/makesrna/intern/rna_particle.c2
-rw-r--r--source/blender/makesrna/intern/rna_pose.c1
-rw-r--r--source/blender/makesrna/intern/rna_pose_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_property.c1
-rw-r--r--source/blender/makesrna/intern/rna_render.c3
-rw-r--r--source/blender/makesrna/intern/rna_rna.c1
-rw-r--r--source/blender/makesrna/intern/rna_scene.c79
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c5
-rw-r--r--source/blender/makesrna/intern/rna_screen.c1
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c30
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c1
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c1
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c4
-rw-r--r--source/blender/makesrna/intern/rna_sound.c1
-rw-r--r--source/blender/makesrna/intern/rna_space.c6
-rw-r--r--source/blender/makesrna/intern/rna_test.c1
-rw-r--r--source/blender/makesrna/intern/rna_text.c1
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_texture.c5
-rw-r--r--source/blender/makesrna/intern/rna_timeline.c1
-rw-r--r--source/blender/makesrna/intern/rna_ui.c1
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c33
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c5
-rw-r--r--source/blender/makesrna/intern/rna_vfont.c1
-rw-r--r--source/blender/makesrna/intern/rna_wm.c3
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c11
-rw-r--r--source/blender/makesrna/intern/rna_world.c1
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c52
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c6
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c4
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c4
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_crop.c2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c26
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c26
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_gamma.c12
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_image.c122
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_math.c2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_rotate.c44
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c34
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c2
-rw-r--r--source/blender/nodes/intern/CMP_util.c28
-rw-r--r--source/blender/nodes/intern/CMP_util.h4
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c2
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_proc.c32
-rw-r--r--source/blender/nodes/intern/TEX_util.c6
-rw-r--r--source/blender/python/BPY_extern.h8
-rw-r--r--source/blender/python/generic/Geometry.c2
-rw-r--r--source/blender/python/generic/Mathutils.c2
-rw-r--r--source/blender/python/generic/bgl.c26
-rw-r--r--source/blender/python/generic/bpy_internal_import.c2
-rw-r--r--source/blender/python/generic/euler.c2
-rw-r--r--source/blender/python/generic/matrix.c24
-rw-r--r--source/blender/python/generic/quat.c4
-rw-r--r--source/blender/python/generic/vector.c18
-rw-r--r--source/blender/python/intern/bpy.c20
-rw-r--r--source/blender/python/intern/bpy_array.c6
-rw-r--r--source/blender/python/intern/bpy_driver.c14
-rw-r--r--source/blender/python/intern/bpy_props.c22
-rw-r--r--source/blender/python/intern/bpy_rna.c40
-rw-r--r--source/blender/python/intern/bpy_util.h6
-rw-r--r--source/blender/quicktime/apple/quicktime_export.c16
-rw-r--r--source/blender/quicktime/apple/quicktime_import.c38
-rw-r--r--source/blender/readblenfile/test/test.c12
-rw-r--r--source/blender/render/intern/include/rayobject.h2
-rw-r--r--source/blender/render/intern/include/render_types.h20
-rw-r--r--source/blender/render/intern/include/sunsky.h56
-rw-r--r--source/blender/render/intern/include/zbuf.h16
-rw-r--r--source/blender/render/intern/source/convertblender.c12
-rw-r--r--source/blender/render/intern/source/gammaCorrectionTables.c4
-rw-r--r--source/blender/render/intern/source/imagetexture.c6
-rw-r--r--source/blender/render/intern/source/initrender.c24
-rw-r--r--source/blender/render/intern/source/occlusion.c6
-rw-r--r--source/blender/render/intern/source/pipeline.c2
-rw-r--r--source/blender/render/intern/source/pixelblending.c44
-rw-r--r--source/blender/render/intern/source/pixelshading.c16
-rw-r--r--source/blender/render/intern/source/pointdensity.c8
-rw-r--r--source/blender/render/intern/source/rendercore.c14
-rw-r--r--source/blender/render/intern/source/shadbuf.c14
-rw-r--r--source/blender/render/intern/source/sss.c8
-rw-r--r--source/blender/render/intern/source/strand.c4
-rw-r--r--source/blender/render/intern/source/sunsky.c112
-rw-r--r--source/blender/render/intern/source/texture.c44
-rw-r--r--source/blender/render/intern/source/volumetric.c2
-rw-r--r--source/blender/render/intern/source/voxeldata.c4
-rw-r--r--source/blender/render/intern/source/zbuf.c6
-rw-r--r--source/blender/verify/intern/BLO_verify.c2
-rw-r--r--source/blender/windowmanager/intern/wm.c4
-rw-r--r--source/blender/windowmanager/intern/wm_apple.c6
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c80
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c1
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c13
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c6
-rw-r--r--source/blender/windowmanager/intern/wm_files.c1
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c8
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c6
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c1
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c17
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c5
-rw-r--r--source/blender/windowmanager/wm_draw.h2
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c46
-rw-r--r--source/creator/creator.c1
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp61
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h10
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp51
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h4
557 files changed, 8043 insertions, 8048 deletions
diff --git a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
index c537f4f6f84..470f84f9c60 100644
--- a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
+++ b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
@@ -647,6 +647,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\image_gen.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\intern\implicit.c"
>
</File>
diff --git a/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj b/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
index f7fa4121e21..03cdcf9875b 100644
--- a/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
+++ b/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
@@ -644,6 +644,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenlib\intern\uvproject.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenlib\intern\voxel.c"
>
</File>
@@ -797,6 +801,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenlib\BLI_uvproject.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenlib\BLI_voxel.h"
>
</File>
diff --git a/release/scripts/keyingsets/keyingsets_builtins.py b/release/scripts/keyingsets/keyingsets_builtins.py
index c5417ba3d66..bf5c66ad01d 100644
--- a/release/scripts/keyingsets/keyingsets_builtins.py
+++ b/release/scripts/keyingsets/keyingsets_builtins.py
@@ -11,8 +11,7 @@ from keyingsets_utils import *
# Location
class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo):
- bl_idname = "Location"
- bl_builtin = True
+ bl_label = "Location"
# poll - use predefined callback for selected bones/objects
poll = RKS_POLL_selected_items
@@ -25,8 +24,7 @@ class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo):
# Rotation
class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo):
- bl_idname = "Rotation"
- bl_builtin = True
+ bl_label = "Rotation"
# poll - use predefined callback for selected bones/objects
poll = RKS_POLL_selected_items
@@ -39,8 +37,7 @@ class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo):
# Scale
class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo):
- bl_idname = "Scaling"
- bl_builtin = True
+ bl_label = "Scaling"
# poll - use predefined callback for selected bones/objects
poll = RKS_POLL_selected_items
@@ -55,8 +52,7 @@ class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo):
# LocRot
class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo):
- bl_idname = "LocRot"
- bl_builtin = True
+ bl_label = "LocRot"
# poll - use predefined callback for selected bones/objects
poll = RKS_POLL_selected_items
@@ -73,8 +69,7 @@ class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo):
# LocScale
class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo):
- bl_idname = "LocScale"
- bl_builtin = True
+ bl_label = "LocScale"
# poll - use predefined callback for selected bones/objects
poll = RKS_POLL_selected_items
@@ -91,8 +86,7 @@ class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo):
# LocRotScale
class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo):
- bl_idname = "LocRotScale"
- bl_builtin = True
+ bl_label = "LocRotScale"
# poll - use predefined callback for selected bones/objects
poll = RKS_POLL_selected_items
@@ -111,8 +105,7 @@ class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo):
# RotScale
class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo):
- bl_idname = "RotScale"
- bl_builtin = True
+ bl_label = "RotScale"
# poll - use predefined callback for selected bones/objects
poll = RKS_POLL_selected_items
@@ -131,8 +124,7 @@ class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo):
# Location
class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo):
- bl_idname = "Visual Location"
- bl_builtin = True
+ bl_label = "Visual Location"
insertkey_visual = True
@@ -147,8 +139,7 @@ class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo):
# Rotation
class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo):
- bl_idname = "Visual Rotation"
- bl_builtin = True
+ bl_label = "Visual Rotation"
insertkey_visual = True
@@ -163,8 +154,7 @@ class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo):
# VisualLocRot
class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo):
- bl_idname = "Visual LocRot"
- bl_builtin = True
+ bl_label = "Visual LocRot"
insertkey_visual = True
@@ -185,8 +175,7 @@ class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo):
# Available
class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo):
- bl_idname = "Available"
- bl_builtin = True
+ bl_label = "Available"
# poll - use predefined callback for selected objects
# TODO: this should really check whether the selected object (or datablock)
diff --git a/release/scripts/keyingsets/keyingsets_utils.py b/release/scripts/keyingsets/keyingsets_utils.py
index 78e170c88f9..3d57130b6e5 100644
--- a/release/scripts/keyingsets/keyingsets_utils.py
+++ b/release/scripts/keyingsets/keyingsets_utils.py
@@ -57,20 +57,16 @@ def RKS_GEN_available(ksi, context, ks, data):
# try to get the animation data associated with the closest
# ID-block to the data (neither of which may exist/be easy to find)
id_block = data.id_data
- try:
- adt = id_block.animation_data
- except:
- # there isn't any animation data available
- return;
-
+ adt = getattr(id_block, "animation_data", None)
+
# there must also be an active action...
- if adt.action is None:
+ if adt is None or adt.action is None:
return;
# for each F-Curve, include an path to key it
# NOTE: we don't need to set the group settings here
for fcu in adt.action.fcurves:
- ks.add_path(id_block, fcu.rna_path, array_index=fcu.array_index, entire_array=False)
+ ks.add_path(id_block, fcu.data_path, index=fcu.array_index)
# ------
@@ -89,13 +85,10 @@ def get_transform_generators_base_info(data):
else:
# get the path to the ID-block
path = data.path_to_id()
-
- try:
- # try to use the name of the data element to group the F-Curve
- grouping = data.name
- except:
- # fallback on the KeyingSet name
- grouping = None;
+
+ # try to use the name of the data element to group the F-Curve
+ # else fallback on the KeyingSet name
+ grouping = getattr(data, "name", None)
# return the ID-block and the path
return id_block, path, grouping
diff --git a/release/scripts/ui/properties_data_modifier.py b/release/scripts/ui/properties_data_modifier.py
index 8364d070d1a..b91c7d4372c 100644
--- a/release/scripts/ui/properties_data_modifier.py
+++ b/release/scripts/ui/properties_data_modifier.py
@@ -497,6 +497,28 @@ class DATA_PT_modifiers(DataButtonsPanel):
def PARTICLE_SYSTEM(self, layout, ob, md, wide_ui):
layout.label(text="See Particle panel.")
+ def SCREW(self, layout, ob, md, wide_ui):
+ split = layout.split()
+
+ col = split.column()
+ col.prop(md, "axis")
+ col.prop(md, "object", text="AxisOb")
+ col.prop(md, "angle")
+ col.prop(md, "steps")
+ col.prop(md, "render_steps")
+
+ col = split.column()
+ row = col.row()
+ row.active = (md.object is None or md.use_object_screw_offset == False)
+ row.prop(md, "screw_offset")
+ row = col.row()
+ row.active = (md.object is not None)
+ row.prop(md, "use_object_screw_offset")
+ col.prop(md, "use_normal_calculate")
+ col.prop(md, "use_normal_flip")
+ col.prop(md, "iterations")
+
+
def SHRINKWRAP(self, layout, ob, md, wide_ui):
split = layout.split()
col = split.column()
diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py
index d178df7d79e..13bfd7a7f5d 100644
--- a/release/scripts/ui/properties_material.py
+++ b/release/scripts/ui/properties_material.py
@@ -23,6 +23,18 @@ from rna_prop_ui import PropertyPanel
narrowui = 180
+def active_node_mat(mat):
+ # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
+ # which settings from node-materials are used
+ if mat:
+ mat_node = mat.active_node_material
+ if mat_node:
+ return mat_node
+ else:
+ return mat
+
+ return None
+
class MATERIAL_MT_sss_presets(bpy.types.Menu):
bl_label = "SSS Presets"
@@ -136,14 +148,14 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
if mat.type in ('SURFACE', 'WIRE'):
@@ -247,14 +259,14 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
split = layout.split()
@@ -293,14 +305,14 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
split = layout.split()
@@ -330,14 +342,14 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
split = layout.split()
@@ -401,14 +413,14 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
layout.active = (not mat.shadeless)
@@ -471,12 +483,12 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
self.layout.active = (not mat.shadeless)
@@ -485,7 +497,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
wide_ui = context.region.width > narrowui
@@ -523,19 +535,19 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
- raym = context.material.raytrace_mirror
+ raym = active_node_mat(context.material).raytrace_mirror
self.layout.prop(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
raym = mat.raytrace_mirror
wide_ui = context.region.width > narrowui
@@ -582,19 +594,19 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_RENDER'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
self.layout.prop(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
wide_ui = context.region.width > narrowui
@@ -649,19 +661,19 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel):
COMPAT_ENGINES = {'BLENDER_GAME'}
def poll(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
- mat = context.material
+ mat = active_node_mat(context.material)
self.layout.prop(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
- mat = context.material
+ mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
wide_ui = context.region.width > narrowui
diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py
index b81fa25b1a1..9b24115d492 100644
--- a/release/scripts/ui/properties_physics_common.py
+++ b/release/scripts/ui/properties_physics_common.py
@@ -65,7 +65,7 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
sub = row.row()
sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
- sub.operator("ptcache.bake", "bake", False, text="Calculate to Current Frame")
+ sub.operator("ptcache.bake", text="Calculate to Current Frame").bake = False
row = layout.row()
row.enabled = enabled
@@ -87,7 +87,7 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
row = layout.row()
row.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
row.operator("ptcache.free_bake_all", text="Free All Bakes")
- layout.operator("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
+ layout.operator("ptcache.bake_all", text="Update All Dynamics to current frame").bake = False
def effector_weights_ui(self, context, weights):
diff --git a/release/scripts/ui/properties_physics_fluid.py b/release/scripts/ui/properties_physics_fluid.py
index 9b36b98bc24..c6fd7e930d9 100644
--- a/release/scripts/ui/properties_physics_fluid.py
+++ b/release/scripts/ui/properties_physics_fluid.py
@@ -42,7 +42,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
md = context.fluid
wide_ui = context.region.width > narrowui
- split = layout.split()
+ split = layout.split(percentage=0.5)
split.operator_context = 'EXEC_DEFAULT'
if md:
@@ -53,7 +53,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
row = split.row(align=True)
row.prop(md, "render", text="")
row.prop(md, "realtime", text="")
-
+
fluid = md.settings
else:
@@ -67,10 +67,19 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
if fluid:
if wide_ui:
- layout.prop(fluid, "type")
+ row = layout.row()
+ row.prop(fluid, "type")
+ if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
+ row.prop(fluid, "active", text="")
else:
layout.prop(fluid, "type", text="")
-
+ if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
+ layout.prop(fluid, "active", text="")
+
+ layout = layout.column()
+ if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
+ layout.active = fluid.active
+
if fluid.type == 'DOMAIN':
layout.operator("fluid.bake", text="Bake Fluid Simulation", icon='MOD_FLUIDSIM')
split = layout.split()
@@ -220,15 +229,29 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
layout = self.layout
fluid = context.fluid.settings
+ scene = context.scene
wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.label(text="Gravity:")
- col.prop(fluid, "gravity", text="")
- col.label(text="Real World Size:")
- col.prop(fluid, "real_world_size", text="Metres")
+ if scene.use_gravity:
+ col.label(text="Using Scene Gravity", icon="SCENE_DATA")
+ sub = col.column()
+ sub.enabled = False
+ sub.prop(fluid, "gravity", text="")
+ else:
+ col.label(text="Gravity:")
+ col.prop(fluid, "gravity", text="")
+
+ if scene.unit_settings.system != 'NONE':
+ col.label(text="Using Scene Size Units", icon="SCENE_DATA")
+ sub = col.column()
+ sub.enabled = False
+ sub.prop(fluid, "real_world_size", text="Metres")
+ else:
+ col.label(text="Real World Size:")
+ col.prop(fluid, "real_world_size", text="Metres")
if wide_ui:
col = split.column()
diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py
index 7cdb42b832b..714f22f5ca6 100644
--- a/release/scripts/ui/properties_scene.py
+++ b/release/scripts/ui/properties_scene.py
@@ -101,7 +101,6 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
col = row.column()
col.prop(ks, "name")
- col.prop(ks, "absolute")
subcol = col.column()
subcol.operator_context = 'INVOKE_DEFAULT'
diff --git a/release/scripts/ui/space_dopesheet.py b/release/scripts/ui/space_dopesheet.py
index a98f142cc3a..e8e2466f049 100644
--- a/release/scripts/ui/space_dopesheet.py
+++ b/release/scripts/ui/space_dopesheet.py
@@ -155,8 +155,8 @@ class DOPESHEET_MT_key(bpy.types.Menu):
layout.column()
layout.menu("DOPESHEET_MT_key_transform", text="Transform")
- layout.operator_menu_enum("action.snap", property="type", text="Snap")
- layout.operator_menu_enum("action.mirror", property="type", text="Mirror")
+ layout.operator_menu_enum("action.snap", "type", text="Snap")
+ layout.operator_menu_enum("action.mirror", "type", text="Mirror")
layout.separator()
layout.operator("action.keyframe_insert")
@@ -166,10 +166,10 @@ class DOPESHEET_MT_key(bpy.types.Menu):
layout.operator("action.delete")
layout.separator()
- layout.operator_menu_enum("action.keyframe_type", property="type", text="Keyframe Type")
- layout.operator_menu_enum("action.handle_type", property="type", text="Handle Type")
- layout.operator_menu_enum("action.interpolation_type", property="type", text="Interpolation Mode")
- layout.operator_menu_enum("action.extrapolation_type", property="type", text="Extrapolation Mode")
+ layout.operator_menu_enum("action.keyframe_type", "type", text="Keyframe Type")
+ layout.operator_menu_enum("action.handle_type", "type", text="Handle Type")
+ layout.operator_menu_enum("action.interpolation_type", "type", text="Interpolation Mode")
+ layout.operator_menu_enum("action.extrapolation_type", "type", text="Extrapolation Mode")
layout.separator()
layout.operator("action.clean")
diff --git a/release/scripts/ui/space_graph.py b/release/scripts/ui/space_graph.py
index 64f6337177e..cdf7f653eb6 100644
--- a/release/scripts/ui/space_graph.py
+++ b/release/scripts/ui/space_graph.py
@@ -142,6 +142,7 @@ class GRAPH_MT_channel(bpy.types.Menu):
layout.separator()
layout.operator("anim.channels_editable_toggle")
+ layout.operator("anim.channels_visibility_set")
layout.separator()
layout.operator("anim.channels_expand")
@@ -160,8 +161,8 @@ class GRAPH_MT_key(bpy.types.Menu):
layout.column()
layout.menu("GRAPH_MT_key_transform", text="Transform")
- layout.operator_menu_enum("graph.snap", property="type", text="Snap")
- layout.operator_menu_enum("graph.mirror", property="type", text="Mirror")
+ layout.operator_menu_enum("graph.snap", "type", text="Snap")
+ layout.operator_menu_enum("graph.mirror", "type", text="Mirror")
layout.separator()
layout.operator("graph.keyframe_insert")
@@ -172,9 +173,9 @@ class GRAPH_MT_key(bpy.types.Menu):
layout.operator("graph.delete")
layout.separator()
- layout.operator_menu_enum("graph.handle_type", property="type", text="Handle Type")
- layout.operator_menu_enum("graph.interpolation_type", property="type", text="Interpolation Mode")
- layout.operator_menu_enum("graph.extrapolation_type", property="type", text="Extrapolation Mode")
+ layout.operator_menu_enum("graph.handle_type", "type", text="Handle Type")
+ layout.operator_menu_enum("graph.interpolation_type", "type", text="Interpolation Mode")
+ layout.operator_menu_enum("graph.extrapolation_type", "type", text="Extrapolation Mode")
layout.separator()
layout.operator("graph.clean")
diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py
index 1e37cb16f81..4b4ff15014d 100644
--- a/release/scripts/ui/space_image.py
+++ b/release/scripts/ui/space_image.py
@@ -406,6 +406,20 @@ class IMAGE_PT_view_histogram(bpy.types.Panel):
layout.template_histogram(sima, "histogram")
+class IMAGE_PT_sample_line(bpy.types.Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'PREVIEW'
+ bl_label = "Sample Line"
+
+ def poll(self, context):
+ sima = context.space_data
+ return (sima and sima.image)
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("image.sample_line")
+ sima = context.space_data
+ layout.template_histogram(sima, "sample_histogram")
class IMAGE_PT_view_properties(bpy.types.Panel):
bl_space_type = 'IMAGE_EDITOR'
@@ -572,7 +586,7 @@ class IMAGE_PT_paint_curve(bpy.types.Panel):
brush = toolsettings.brush
layout.template_curve_mapping(brush, "curve")
- layout.operator_menu_enum("brush.curve_preset", property="shape")
+ layout.operator_menu_enum("brush.curve_preset", "shape")
classes = [
@@ -592,7 +606,8 @@ classes = [
IMAGE_PT_paint_curve,
IMAGE_PT_game_properties,
IMAGE_PT_view_properties,
- IMAGE_PT_view_histogram]
+ IMAGE_PT_view_histogram,
+ IMAGE_PT_sample_line]
def register():
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py
index d8b18b57cf9..f8f8f5cefe3 100644
--- a/release/scripts/ui/space_info.py
+++ b/release/scripts/ui/space_info.py
@@ -221,7 +221,7 @@ class INFO_MT_add(bpy.types.Menu):
layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
- layout.operator_menu_enum("object.metaball_add", "type", 'META', text="Metaball", icon='OUTLINER_OB_META')
+ layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
layout.separator()
@@ -233,10 +233,10 @@ class INFO_MT_add(bpy.types.Menu):
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
layout.operator_context = 'EXEC_SCREEN'
- layout.operator_menu_enum("object.lamp_add", "type", 'LAMP', text="Lamp", icon='OUTLINER_OB_LAMP')
+ layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
layout.separator()
- layout.operator_menu_enum("object.effector_add", "type", 'EMPTY', text="Force Field", icon='OUTLINER_OB_EMPTY')
+ layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY')
layout.separator()
if(len(bpy.data.groups) > 10):
diff --git a/release/scripts/ui/space_nla.py b/release/scripts/ui/space_nla.py
index 12ed8aa7740..0eb342d4b15 100644
--- a/release/scripts/ui/space_nla.py
+++ b/release/scripts/ui/space_nla.py
@@ -102,7 +102,7 @@ class NLA_MT_edit(bpy.types.Menu):
layout.column()
layout.menu("NLA_MT_edit_transform", text="Transform")
- layout.operator_menu_enum("nla.snap", property="type", text="Snap")
+ layout.operator_menu_enum("nla.snap", "type", text="Snap")
layout.separator()
layout.operator("nla.duplicate")
diff --git a/release/scripts/ui/space_time.py b/release/scripts/ui/space_time.py
index 2f2fad59e9f..cfd5fdfce0b 100644
--- a/release/scripts/ui/space_time.py
+++ b/release/scripts/ui/space_time.py
@@ -77,7 +77,7 @@ class TIME_HT_header(bpy.types.Header):
layout.separator()
row = layout.row(align=True)
- row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="")
+ row.prop_object(scene, "active_keying_set", scene, "all_keying_sets", text="")
row.operator("anim.keyframe_insert", text="", icon='KEY_HLT')
row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py
index 2e10470c5f7..3cc588ecbaa 100644
--- a/release/scripts/ui/space_view3d.py
+++ b/release/scripts/ui/space_view3d.py
@@ -384,7 +384,7 @@ class VIEW3D_MT_select_object(bpy.types.Menu):
layout.operator("object.select_random", text="Random")
layout.operator("object.select_mirror", text="Mirror")
layout.operator("object.select_by_layer", text="Select All by Layer")
- layout.operator_menu_enum("object.select_by_type", "type", "", text="Select All by Type...")
+ layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
layout.operator("object.select_camera", text="Select Camera")
layout.separator()
@@ -654,6 +654,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
+ layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
layout.separator()
@@ -834,7 +835,7 @@ class VIEW3D_MT_make_links(bpy.types.Menu):
layout.operator_menu_enum("object.make_links_scene", "type", text="Objects to Scene...")
layout.operator_menu_enum("marker.make_links_scene", "type", text="Markers to Scene...")
- layout.operator_enums("object.make_links_data", property="type") # inline
+ layout.operator_enums("object.make_links_data", "type") # inline
# ********** Vertex paint menu **********
@@ -930,7 +931,7 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
layout.prop(sculpt, "lock_y")
layout.prop(sculpt, "lock_z")
layout.separator()
- layout.operator_menu_enum("brush.curve_preset", property="shape")
+ layout.operator_menu_enum("brush.curve_preset", "shape")
layout.separator()
sculpt_tool = brush.sculpt_tool
@@ -1020,6 +1021,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
+ layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
layout.separator()
diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py
index 10718883c3c..603ed93efed 100644
--- a/release/scripts/ui/space_view3d_toolbar.py
+++ b/release/scripts/ui/space_view3d_toolbar.py
@@ -523,9 +523,11 @@ class VIEW3D_PT_tools_brush(PaintPanel):
if settings.tool != 'NONE':
col = layout.column()
col.prop(brush, "size", slider=True)
- col.prop(brush, "strength", slider=True)
+ if settings.tool != 'ADD':
+ col.prop(brush, "strength", slider=True)
if settings.tool == 'ADD':
+ col.prop(brush, "count")
col = layout.column()
col.prop(settings, "add_interpolate")
sub = col.column(align=True)
@@ -568,8 +570,17 @@ class VIEW3D_PT_tools_brush(PaintPanel):
col.prop(brush, "use_accumulate")
if brush.sculpt_tool == 'LAYER':
- col.prop(brush, "use_persistent")
- col.operator("sculpt.set_persistent_base")
+ ob = context.sculpt_object
+ do_persistent = True
+
+ # not supported yet for this case
+ for md in ob.modifiers:
+ if md.type == 'MULTIRES':
+ do_persistent = False
+
+ if do_persistent:
+ col.prop(brush, "use_persistent")
+ col.operator("sculpt.set_persistent_base")
# Texture Paint Mode #
@@ -1007,12 +1018,15 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
col.active = pe.editable
col.label(text="Draw:")
col.prop(pe, "draw_step", text="Path Steps")
- if pe.type == 'PARTICLES':
- col.prop(pe, "draw_particles", text="Particles")
- col.prop(pe, "fade_time")
- sub = col.row()
- sub.active = pe.fade_time
- sub.prop(pe, "fade_frames", slider=True)
+ if pe.hair:
+ col.prop(pe, "draw_particles", text="Children")
+ else:
+ if pe.type == 'PARTICLES':
+ col.prop(pe, "draw_particles", text="Particles")
+ col.prop(pe, "fade_time")
+ sub = col.row()
+ sub.active = pe.fade_time
+ sub.prop(pe, "fade_frames", slider=True)
classes = [
diff --git a/source/blender/avi/AVI_avi.h b/source/blender/avi/AVI_avi.h
index 42493685ede..a3115e0543b 100644
--- a/source/blender/avi/AVI_avi.h
+++ b/source/blender/avi/AVI_avi.h
@@ -175,7 +175,7 @@ typedef struct _AviStreamRec {
} AviStreamRec;
typedef struct _AviMovie {
- FILE *fp;
+ FILE *fp;
int type;
#define AVI_MOVIE_READ 0
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 5be39557577..a73dec57a55 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -197,8 +197,8 @@ int AVI_is_avi (char *name) {
return 0;
if (GET_FCC (fp) != FCC("RIFF") ||
- !GET_FCC (fp) ||
- GET_FCC (fp) != FCC("AVI ")) {
+ !GET_FCC (fp) ||
+ GET_FCC (fp) != FCC("AVI ")) {
ret = 0;
} else {
ret = 1;
@@ -228,19 +228,19 @@ int AVI_is_avi (char *name) {
return 0;
if (GET_FCC (movie.fp) != FCC("RIFF") ||
- !(movie.size = GET_FCC (movie.fp))) {
- fclose(movie.fp);
+ !(movie.size = GET_FCC (movie.fp))) {
+ fclose(movie.fp);
return 0;
}
movie.header = &header;
if (GET_FCC (movie.fp) != FCC("AVI ") ||
- GET_FCC (movie.fp) != FCC("LIST") ||
- !GET_FCC (movie.fp) ||
- GET_FCC (movie.fp) != FCC("hdrl") ||
- (movie.header->fcc = GET_FCC (movie.fp)) != FCC("avih") ||
- !(movie.header->size = GET_FCC (movie.fp))) {
+ GET_FCC (movie.fp) != FCC("LIST") ||
+ !GET_FCC (movie.fp) ||
+ GET_FCC (movie.fp) != FCC("hdrl") ||
+ (movie.header->fcc = GET_FCC (movie.fp)) != FCC("avih") ||
+ !(movie.header->size = GET_FCC (movie.fp))) {
DEBUG("bad initial header info\n");
fclose(movie.fp);
return 0;
@@ -274,10 +274,10 @@ int AVI_is_avi (char *name) {
for (temp=0; temp < movie.header->Streams; temp++) {
if (GET_FCC(movie.fp) != FCC("LIST") ||
- !GET_FCC (movie.fp) ||
- GET_FCC (movie.fp) != FCC ("strl") ||
- (movie.streams[temp].sh.fcc = GET_FCC (movie.fp)) != FCC ("strh") ||
- !(movie.streams[temp].sh.size = GET_FCC (movie.fp))) {
+ !GET_FCC (movie.fp) ||
+ GET_FCC (movie.fp) != FCC ("strl") ||
+ (movie.streams[temp].sh.fcc = GET_FCC (movie.fp)) != FCC ("strh") ||
+ !(movie.streams[temp].sh.size = GET_FCC (movie.fp))) {
DEBUG("bad stream header information\n");
MEM_freeN(movie.streams);
@@ -357,7 +357,7 @@ int AVI_is_avi (char *name) {
fcca = bi->Compression;
- if ( movie.streams[temp].format ==
+ if ( movie.streams[temp].format ==
AVI_FORMAT_AVI_RGB) {
if (fcca == FCC ("DIB ") ||
fcca == FCC ("RGB ") ||
@@ -386,7 +386,7 @@ int AVI_is_avi (char *name) {
MEM_freeN(movie.streams);
fclose(movie.fp);
- return 0;
+ return 0;
}
fseek(movie.fp, temp, SEEK_CUR);
}
@@ -417,17 +417,17 @@ AviError AVI_open_movie (char *name, AviMovie *movie) {
return AVI_ERROR_OPEN;
if (GET_FCC (movie->fp) != FCC("RIFF") ||
- !(movie->size = GET_FCC (movie->fp)))
+ !(movie->size = GET_FCC (movie->fp)))
return AVI_ERROR_FORMAT;
movie->header = (AviMainHeader *) MEM_mallocN (sizeof (AviMainHeader), "movieheader");
if (GET_FCC (movie->fp) != FCC("AVI ") ||
- GET_FCC (movie->fp) != FCC("LIST") ||
- !GET_FCC (movie->fp) ||
- GET_FCC (movie->fp) != FCC("hdrl") ||
- (movie->header->fcc = GET_FCC (movie->fp)) != FCC("avih") ||
- !(movie->header->size = GET_FCC (movie->fp))) {
+ GET_FCC (movie->fp) != FCC("LIST") ||
+ !GET_FCC (movie->fp) ||
+ GET_FCC (movie->fp) != FCC("hdrl") ||
+ (movie->header->fcc = GET_FCC (movie->fp)) != FCC("avih") ||
+ !(movie->header->size = GET_FCC (movie->fp))) {
DEBUG("bad initial header info\n");
return AVI_ERROR_FORMAT;
}
@@ -459,10 +459,10 @@ AviError AVI_open_movie (char *name, AviMovie *movie) {
for (temp=0; temp < movie->header->Streams; temp++) {
if (GET_FCC(movie->fp) != FCC("LIST") ||
- !GET_FCC (movie->fp) ||
- GET_FCC (movie->fp) != FCC ("strl") ||
- (movie->streams[temp].sh.fcc = GET_FCC (movie->fp)) != FCC ("strh") ||
- !(movie->streams[temp].sh.size = GET_FCC (movie->fp))) {
+ !GET_FCC (movie->fp) ||
+ GET_FCC (movie->fp) != FCC ("strl") ||
+ (movie->streams[temp].sh.fcc = GET_FCC (movie->fp)) != FCC ("strh") ||
+ !(movie->streams[temp].sh.size = GET_FCC (movie->fp))) {
DEBUG("bad stream header information\n");
return AVI_ERROR_FORMAT;
}
@@ -535,7 +535,7 @@ AviError AVI_open_movie (char *name, AviMovie *movie) {
fcca = bi->Compression;
- if ( movie->streams[temp].format ==
+ if ( movie->streams[temp].format ==
AVI_FORMAT_AVI_RGB) {
if (fcca == FCC ("DIB ") ||
fcca == FCC ("RGB ") ||
@@ -559,7 +559,7 @@ AviError AVI_open_movie (char *name, AviMovie *movie) {
temp= GET_FCC (movie->fp);
if (temp<0 || ftell(movie->fp) > movie->size) {
DEBUG("incorrect size in header or error in AVI\n");
- return AVI_ERROR_FORMAT;
+ return AVI_ERROR_FORMAT;
}
fseek(movie->fp, temp, SEEK_CUR);
}
@@ -584,7 +584,7 @@ AviError AVI_open_movie (char *name, AviMovie *movie) {
}
if (ftell(movie->fp) > movie->size) {
DEBUG("incorrect size in header or error in AVI\n");
- return AVI_ERROR_FORMAT;
+ return AVI_ERROR_FORMAT;
}
}
@@ -727,9 +727,9 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...) {
movie->header->fcc = FCC("avih");
movie->header->size = 56;
movie->header->MicroSecPerFrame = 66667;
- movie->header->MaxBytesPerSec = 0;
- movie->header->PaddingGranularity = 0;
- movie->header->Flags = AVIF_HASINDEX | AVIF_MUSTUSEINDEX;
+ movie->header->MaxBytesPerSec = 0;
+ movie->header->PaddingGranularity = 0;
+ movie->header->Flags = AVIF_HASINDEX | AVIF_MUSTUSEINDEX;
movie->header->TotalFrames = 0;
movie->header->InitialFrames = 0;
movie->header->Streams = streams;
@@ -906,10 +906,10 @@ 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));
+ * sizeof(AviIndexEntry));
MEM_freeN (movie->entries);
}
diff --git a/source/blender/avi/intern/codecs.c b/source/blender/avi/intern/codecs.c
index 9691c903027..4ebcb216012 100644
--- a/source/blender/avi/intern/codecs.c
+++ b/source/blender/avi/intern/codecs.c
@@ -44,41 +44,41 @@
void *avi_format_convert (AviMovie *movie, int stream, void *buffer, AviFormat from, AviFormat to, int *size) {
if (from == to)
- return buffer;
+ return buffer;
if (from != AVI_FORMAT_RGB24 &&
- to != AVI_FORMAT_RGB24)
- return avi_format_convert(movie, stream,
- avi_format_convert (movie, stream, buffer, from, AVI_FORMAT_RGB24, size),
- AVI_FORMAT_RGB24, to, size);
+ to != AVI_FORMAT_RGB24)
+ return avi_format_convert(movie, stream,
+ avi_format_convert (movie, stream, buffer, from, AVI_FORMAT_RGB24, size),
+ AVI_FORMAT_RGB24, to, size);
switch (to) {
case AVI_FORMAT_RGB24:
- switch (from) {
- case AVI_FORMAT_AVI_RGB:
- buffer = avi_converter_from_avi_rgb (movie, stream, buffer, size);
- break;
- case AVI_FORMAT_MJPEG:
- buffer = avi_converter_from_mjpeg (movie, stream, buffer, size);
- break;
- case AVI_FORMAT_RGB32:
- buffer = avi_converter_from_rgb32 (movie, stream, buffer, size);
- break;
- default:
- break;
- }
- break;
+ switch (from) {
+ case AVI_FORMAT_AVI_RGB:
+ buffer = avi_converter_from_avi_rgb (movie, stream, buffer, size);
+ break;
+ case AVI_FORMAT_MJPEG:
+ buffer = avi_converter_from_mjpeg (movie, stream, buffer, size);
+ break;
+ case AVI_FORMAT_RGB32:
+ buffer = avi_converter_from_rgb32 (movie, stream, buffer, size);
+ break;
+ default:
+ break;
+ }
+ break;
case AVI_FORMAT_AVI_RGB:
- buffer = avi_converter_to_avi_rgb (movie, stream, buffer, size);
- break;
+ buffer = avi_converter_to_avi_rgb (movie, stream, buffer, size);
+ break;
case AVI_FORMAT_MJPEG:
- buffer = avi_converter_to_mjpeg (movie, stream, buffer, size);
- break;
+ buffer = avi_converter_to_mjpeg (movie, stream, buffer, size);
+ break;
case AVI_FORMAT_RGB32:
- buffer = avi_converter_to_rgb32 (movie, stream, buffer, size);
- break;
+ buffer = avi_converter_to_rgb32 (movie, stream, buffer, size);
+ break;
default:
- break;
+ break;
}
return buffer;
@@ -88,11 +88,11 @@ 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;
+ return 0;
return FCC(fcc);
}
@@ -103,11 +103,11 @@ int avi_get_format_type (AviFormat format) {
case AVI_FORMAT_RGB32:
case AVI_FORMAT_AVI_RGB:
case AVI_FORMAT_MJPEG:
- return FCC("vids");
- break;
+ return FCC("vids");
+ break;
default:
- return 0;
- break;
+ return 0;
+ break;
}
}
@@ -116,14 +116,14 @@ int avi_get_format_fcc (AviFormat format) {
case AVI_FORMAT_RGB24:
case AVI_FORMAT_RGB32:
case AVI_FORMAT_AVI_RGB:
- return FCC("DIB ");
- break;
+ return FCC("DIB ");
+ break;
case AVI_FORMAT_MJPEG:
- return FCC("MJPG");
- break;
+ return FCC("MJPG");
+ break;
default:
- return 0;
- break;
+ return 0;
+ break;
}
}
@@ -132,13 +132,13 @@ int avi_get_format_compression (AviFormat format) {
case AVI_FORMAT_RGB24:
case AVI_FORMAT_RGB32:
case AVI_FORMAT_AVI_RGB:
- return 0;
- break;
+ return 0;
+ break;
case AVI_FORMAT_MJPEG:
- return FCC("MJPG");
- break;
+ return FCC("MJPG");
+ break;
default:
- return 0;
- break;
+ return 0;
+ break;
}
}
diff --git a/source/blender/avi/intern/mjpeg.c b/source/blender/avi/intern/mjpeg.c
index 6608e6c8363..d7212e710e9 100644
--- a/source/blender/avi/intern/mjpeg.c
+++ b/source/blender/avi/intern/mjpeg.c
@@ -134,13 +134,13 @@ static void std_huff_tables (j_decompress_ptr dinfo) {
0xf9, 0xfa };
add_huff_table(dinfo, &dinfo->dc_huff_tbl_ptrs[0],
- bits_dc_luminance, val_dc_luminance);
+ bits_dc_luminance, val_dc_luminance);
add_huff_table(dinfo, &dinfo->ac_huff_tbl_ptrs[0],
- bits_ac_luminance, val_ac_luminance);
+ bits_ac_luminance, val_ac_luminance);
add_huff_table(dinfo, &dinfo->dc_huff_tbl_ptrs[1],
- bits_dc_chrominance, val_dc_chrominance);
+ bits_dc_chrominance, val_dc_chrominance);
add_huff_table(dinfo, &dinfo->ac_huff_tbl_ptrs[1],
- bits_ac_chrominance, val_ac_chrominance);
+ bits_ac_chrominance, val_ac_chrominance);
}
static int Decode_JPEG(unsigned char *inBuffer, unsigned char *outBuffer, unsigned int width, unsigned int height, int bufsize) {
diff --git a/source/blender/avi/intern/options.c b/source/blender/avi/intern/options.c
index bab02ec2a40..7b194b86ab6 100644
--- a/source/blender/avi/intern/options.c
+++ b/source/blender/avi/intern/options.c
@@ -109,17 +109,17 @@ AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream,
}
- fseek (movie->fp, movie->offset_table[0], SEEK_SET);
- awrite (movie, movie->header, 1, sizeof(AviMainHeader), movie->fp, AVI_MAINH);
+ fseek (movie->fp, movie->offset_table[0], SEEK_SET);
+ awrite (movie, movie->header, 1, sizeof(AviMainHeader), movie->fp, AVI_MAINH);
- break;
+ break;
case AVI_OPTION_TYPE_STRH:
- break;
+ break;
case AVI_OPTION_TYPE_STRF:
- break;
+ break;
default:
- return AVI_ERROR_OPTION;
- break;
+ return AVI_ERROR_OPTION;
+ break;
}
return AVI_ERROR_NONE;
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 5976a2c98a6..bc2de70222d 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -45,7 +45,6 @@
#include "BLI_linklist.h" /* linknode */
#include "BLI_string.h"
-#include "BIF_gl.h"
#ifdef __APPLE__
#include "BKE_utildefines.h"
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 154c6347f50..965bad31991 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -165,28 +165,28 @@ struct DerivedMesh {
* passed as a float or short array, only one should be non-NULL.
*/
void (*foreachMappedVert)(
- DerivedMesh *dm,
- void (*func)(void *userData, int index, float *co,
- float *no_f, short *no_s),
- void *userData);
+ DerivedMesh *dm,
+ void (*func)(void *userData, int index, float *co,
+ float *no_f, short *no_s),
+ void *userData);
/* Iterate over each mapped edge in the derived mesh, calling the
* given function with the original edge and the mapped edge's new
* coordinates.
*/
void (*foreachMappedEdge)(DerivedMesh *dm,
- void (*func)(void *userData, int index,
- float *v0co, float *v1co),
- void *userData);
+ void (*func)(void *userData, int index,
+ float *v0co, float *v1co),
+ void *userData);
/* Iterate over each mapped face in the derived mesh, calling the
* given function with the original face and the mapped face's (or
* faces') center and normal.
*/
void (*foreachMappedFaceCenter)(DerivedMesh *dm,
- void (*func)(void *userData, int index,
- float *cent, float *no),
- void *userData);
+ void (*func)(void *userData, int index,
+ float *cent, float *no),
+ void *userData);
/* Iterate over all vertex points, calling DO_MINMAX with given args.
*
@@ -227,7 +227,7 @@ struct DerivedMesh {
*
* Also called for *final* editmode DerivedMeshes
*/
- void (*drawEdges)(DerivedMesh *dm, int drawLooseEdges);
+ void (*drawEdges)(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges);
/* Draw all loose edges (edges w/ no adjoining faces) */
void (*drawLooseEdges)(DerivedMesh *dm);
@@ -240,7 +240,7 @@ struct DerivedMesh {
* Also called for *final* editmode DerivedMeshes
*/
void (*drawFacesSolid)(DerivedMesh *dm, float (*partial_redraw_planes)[4],
- int fast, int (*setMaterial)(int, void *attribs));
+ int fast, int (*setMaterial)(int, void *attribs));
/* Draw all faces
* o If useTwoSided, draw front and back using col arrays
@@ -248,14 +248,14 @@ struct DerivedMesh {
* in ABGR format, and should be passed as per-face vertex color.
*/
void (*drawFacesColored)(DerivedMesh *dm, int useTwoSided,
- unsigned char *col1, unsigned char *col2);
+ unsigned char *col1, unsigned char *col2);
/* Draw all faces using MTFace
* o Drawing options too complicated to enumerate, look at code.
*/
void (*drawFacesTex)(DerivedMesh *dm,
- int (*setDrawOptions)(struct MTFace *tface,
- struct MCol *mcol, int matnr));
+ int (*setDrawOptions)(struct MTFace *tface,
+ struct MCol *mcol, int matnr));
/* Draw all faces with GLSL materials
* o setMaterial is called for every different material nr
@@ -278,17 +278,17 @@ struct DerivedMesh {
* smooth shaded.
*/
void (*drawMappedFaces)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index,
- int *drawSmooth_r),
- void *userData, int useColors);
+ int (*setDrawOptions)(void *userData, int index,
+ int *drawSmooth_r),
+ void *userData, int useColors);
/* Draw mapped faces using MTFace
* o Drawing options too complicated to enumerate, look at code.
*/
void (*drawMappedFacesTex)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData,
- int index),
- void *userData);
+ int (*setDrawOptions)(void *userData,
+ int index),
+ void *userData);
/* Draw mapped faces with GLSL materials
* o setMaterial is called for every different material nr
@@ -304,8 +304,8 @@ struct DerivedMesh {
* returns true
*/
void (*drawMappedEdges)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData, int index),
- void *userData);
+ int (*setDrawOptions)(void *userData, int index),
+ void *userData);
/* Draw mapped edges as lines with interpolation values
* o Only if !setDrawOptions or
@@ -315,12 +315,12 @@ struct DerivedMesh {
* NOTE: This routine is optional!
*/
void (*drawMappedEdgesInterp)(DerivedMesh *dm,
- int (*setDrawOptions)(void *userData,
- int index),
- void (*setDrawInterpOptions)(void *userData,
- int index,
- float t),
- void *userData);
+ int (*setDrawOptions)(void *userData,
+ int index),
+ void (*setDrawInterpOptions)(void *userData,
+ int index,
+ float t),
+ void *userData);
/* Release reference to the DerivedMesh. This function decides internally
* if the DerivedMesh will be freed, or cached for later use. */
@@ -337,14 +337,14 @@ void DM_init_funcs(DerivedMesh *dm);
* sets up the custom data layers)
*/
void DM_init(DerivedMesh *dm, DerivedMeshType type,
- int numVerts, int numEdges, int numFaces);
+ int numVerts, int numEdges, int numFaces);
/* utility function to initialise a DerivedMesh for the desired number
* of vertices, edges and faces, with a layer setup copied from source
*/
void DM_from_template(DerivedMesh *dm, DerivedMesh *source,
- DerivedMeshType type,
- int numVerts, int numEdges, int numFaces);
+ DerivedMeshType type,
+ int numVerts, int numEdges, int numFaces);
/* utility function to release a DerivedMesh's layers
* returns 1 if DerivedMesh has to be released by the backend, 0 otherwise
@@ -371,11 +371,11 @@ void DM_set_only_copy(DerivedMesh *dm, CustomDataMask mask);
* freed, see BKE_customdata.h for the different options
*/
void DM_add_vert_layer(struct DerivedMesh *dm, int type, int alloctype,
- void *layer);
+ void *layer);
void DM_add_edge_layer(struct DerivedMesh *dm, int type, int alloctype,
- void *layer);
+ void *layer);
void DM_add_face_layer(struct DerivedMesh *dm, int type, int alloctype,
- void *layer);
+ void *layer);
/* custom data access functions
* return pointer to data from first layer which matches type
@@ -408,11 +408,11 @@ void DM_set_face_data(struct DerivedMesh *dm, int index, int type, void *data);
* these copy all layers for which the CD_FLAG_NOCOPY flag is not set
*/
void DM_copy_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest,
- int source_index, int dest_index, int count);
+ int source_index, int dest_index, int count);
void DM_copy_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest,
- int source_index, int dest_index, int count);
+ int source_index, int dest_index, int count);
void DM_copy_face_data(struct DerivedMesh *source, struct DerivedMesh *dest,
- int source_index, int dest_index, int count);
+ int source_index, int dest_index, int count);
/* custom data free functions
* free count elements, starting at index
@@ -427,8 +427,8 @@ void DM_free_face_data(struct DerivedMesh *dm, int index, int count);
* indexed by dest_index in the dest mesh
*/
void DM_interp_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest,
- int *src_indices, float *weights,
- int count, int dest_index);
+ int *src_indices, float *weights,
+ int count, int dest_index);
/* interpolates edge data from the edges indexed by src_indices in the
* source mesh using the given weights and stores the result in the edge indexed
@@ -439,9 +439,9 @@ void DM_interp_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest,
*/
typedef float EdgeVertWeight[SUB_ELEMS_EDGE][SUB_ELEMS_EDGE];
void DM_interp_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest,
- int *src_indices,
- float *weights, EdgeVertWeight *vert_weights,
- int count, int dest_index);
+ int *src_indices,
+ float *weights, EdgeVertWeight *vert_weights,
+ int count, int dest_index);
/* interpolates face data from the faces indexed by src_indices in the
* source mesh using the given weights and stores the result in the face indexed
@@ -452,9 +452,9 @@ void DM_interp_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest,
*/
typedef float FaceVertWeight[SUB_ELEMS_FACE][SUB_ELEMS_FACE];
void DM_interp_face_data(struct DerivedMesh *source, struct DerivedMesh *dest,
- int *src_indices,
- float *weights, FaceVertWeight *vert_weights,
- int count, int dest_index);
+ int *src_indices,
+ float *weights, FaceVertWeight *vert_weights,
+ int count, int dest_index);
void DM_swap_face_data(struct DerivedMesh *dm, int index, int *corner_indices);
@@ -468,42 +468,42 @@ float *mesh_get_mapped_verts_nors(struct Scene *scene, struct Object *ob);
/* */
DerivedMesh *mesh_get_derived_final(struct Scene *scene, struct Object *ob,
- CustomDataMask dataMask);
+ CustomDataMask dataMask);
DerivedMesh *mesh_get_derived_deform(struct Scene *scene, struct Object *ob,
- CustomDataMask dataMask);
+ CustomDataMask dataMask);
DerivedMesh *mesh_create_derived_for_modifier(struct Scene *scene, struct Object *ob, struct ModifierData *md);
DerivedMesh *mesh_create_derived_render(struct Scene *scene, struct Object *ob,
- CustomDataMask dataMask);
+ CustomDataMask dataMask);
DerivedMesh *mesh_create_derived_index_render(struct Scene *scene, struct Object *ob, CustomDataMask dataMask, int index);
/* same as above but wont use render settings */
DerivedMesh *mesh_create_derived_view(struct Scene *scene, struct Object *ob,
- CustomDataMask dataMask);
+ CustomDataMask dataMask);
DerivedMesh *mesh_create_derived_no_deform(struct Scene *scene, struct Object *ob,
- float (*vertCos)[3],
- CustomDataMask dataMask);
+ float (*vertCos)[3],
+ CustomDataMask dataMask);
DerivedMesh *mesh_create_derived_no_deform_render(struct Scene *scene, struct Object *ob,
- float (*vertCos)[3],
- CustomDataMask dataMask);
+ float (*vertCos)[3],
+ CustomDataMask dataMask);
/* for gameengine */
DerivedMesh *mesh_create_derived_no_virtual(struct Scene *scene, struct Object *ob, float (*vertCos)[3],
- CustomDataMask dataMask);
+ CustomDataMask dataMask);
DerivedMesh *editmesh_get_derived_base(struct Object *, struct EditMesh *em);
DerivedMesh *editmesh_get_derived_cage(struct Scene *scene, struct Object *,
struct EditMesh *em, CustomDataMask dataMask);
DerivedMesh *editmesh_get_derived_cage_and_final(struct Scene *scene, struct Object *,
struct EditMesh *em, DerivedMesh **final_r,
- CustomDataMask dataMask);
+ CustomDataMask dataMask);
void makeDerivedMesh(struct Scene *scene, struct Object *ob, struct EditMesh *em, CustomDataMask dataMask);
/* returns an array of deform matrices for crazyspace correction, and the
number of modifiers left */
int editmesh_get_first_deform_matrices(struct Scene *, struct Object *, struct EditMesh *em,
- float (**deformmats)[3][3], float (**deformcos)[3]);
+ float (**deformmats)[3][3], float (**deformcos)[3]);
void weight_to_rgb(float input, float *fr, float *fg, float *fb);
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index b9576c343db..6b656f1d12e 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -45,7 +45,7 @@ struct Scene;
struct Main;
#define BLENDER_VERSION 252
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 1
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h
index 470db28cb72..aff102f2e09 100644
--- a/source/blender/blenkernel/BKE_bmesh.h
+++ b/source/blender/blenkernel/BKE_bmesh.h
@@ -218,11 +218,11 @@ typedef struct BME_TransData {
void *loc; /* a pointer to the data to transform (likely the vert's cos) */
float factor; /* primary scaling factor; also accumulates number of weighted edges for beveling tool */
float weight; /* another scaling factor; used primarily for propogating vertex weights to transforms; */
- /* weight is also used across recursive bevels to help with the math */
+ /* weight is also used across recursive bevels to help with the math */
float maxfactor; /* the unscaled, original factor (used only by "edge verts" in recursive beveling) */
float *max; /* the maximum distance this vert can be transformed; negative is infinite
- * it points to the "parent" maxfactor (where maxfactor makes little sense)
- * where the max limit is stored (limits are stored per-corner) */
+ * it points to the "parent" maxfactor (where maxfactor makes little sense)
+ * where the max limit is stored (limits are stored per-corner) */
} BME_TransData;
typedef struct BME_TransData_Head {
diff --git a/source/blender/blenkernel/BKE_booleanops.h b/source/blender/blenkernel/BKE_booleanops.h
index d323725ec19..dcf71645db3 100644
--- a/source/blender/blenkernel/BKE_booleanops.h
+++ b/source/blender/blenkernel/BKE_booleanops.h
@@ -44,6 +44,6 @@ int NewBooleanMesh(struct Scene *scene, struct Base *base, struct Base *base_sel
are in fact mesh object. On success returns a DerivedMesh. On failure
returns NULL and reports an error. */
struct DerivedMesh *NewBooleanDerivedMesh(struct DerivedMesh *dm, struct Object *ob, struct DerivedMesh *dm_select, struct Object *ob_select,
- int int_op_type);
+ int int_op_type);
#endif
diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h
index 33e8f930c9d..bff9f16b489 100644
--- a/source/blender/blenkernel/BKE_cdderivedmesh.h
+++ b/source/blender/blenkernel/BKE_cdderivedmesh.h
@@ -71,7 +71,7 @@ struct DerivedMesh *CDDM_copy(struct DerivedMesh *dm);
* elements are initialised to all zeros
*/
struct DerivedMesh *CDDM_from_template(struct DerivedMesh *source,
- int numVerts, int numEdges, int numFaces);
+ int numVerts, int numEdges, int numFaces);
/* applies vertex coordinates or normals to a CDDerivedMesh. if the MVert
* layer is a referenced layer, it will be duplicate to not overwrite the
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index ae3fdb91edf..48e2dbf4fec 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -167,7 +167,7 @@ void CTX_wm_menu_set(bContext *C, struct ARegion *menu);
/* Data Context
- listbases consist of CollectionPointerLink items and must be
- freed with BLI_freelistN!
+ freed with BLI_freelistN!
- the dir listbase consits of LinkData items */
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member);
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 2f65dab9b83..c07b26fd372 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -57,18 +57,18 @@ extern const CustomDataMask CD_MASK_FACECORNERS;
#define CD_DEFAULT 2 /* allocate and set to default */
#define CD_REFERENCE 3 /* use data pointers, set layer flag NOFREE */
#define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source
- has same number of elements */
+ has same number of elements */
/* initialises a CustomData object with the same layer setup as source.
* mask is a bitfield where (mask & (1 << (layer type))) indicates
* if a layer should be copied or not. alloctype must be one of the above. */
void CustomData_copy(const struct CustomData *source, struct CustomData *dest,
- CustomDataMask mask, int alloctype, int totelem);
+ CustomDataMask mask, int alloctype, int totelem);
/* same as the above, except that this will preserve existing layers, and only
* add the layers that were not there yet */
void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
- CustomDataMask mask, int alloctype, int totelem);
+ CustomDataMask mask, int alloctype, int totelem);
/* frees data associated with a CustomData object (doesn't free the object
* itself, though)
@@ -85,10 +85,10 @@ void CustomData_free_temporary(struct CustomData *data, int totelem);
* in editmode, use EM_add_data_layer instead of this function
*/
void *CustomData_add_layer(struct CustomData *data, int type, int alloctype,
- void *layer, int totelem);
+ void *layer, int totelem);
/*same as above but accepts a name */
void *CustomData_add_layer_named(struct CustomData *data, int type, int alloctype,
- void *layer, int totelem, char *name);
+ void *layer, int totelem, char *name);
/* frees the active or first data layer with the give type.
* returns 1 on succes, 0 if no layer with the given type is found
@@ -117,14 +117,14 @@ int CustomData_number_of_layers(const struct CustomData *data, int type);
* returns the layer data */
void *CustomData_duplicate_referenced_layer(struct CustomData *data, int type);
void *CustomData_duplicate_referenced_layer_named(struct CustomData *data,
- int type, char *name);
+ int type, char *name);
/* set the CD_FLAG_NOCOPY flag in custom data layers where the mask is
* zero for the layer type, so only layer types specified by the mask
* will be copied
*/
void CustomData_set_only_copy(const struct CustomData *data,
- CustomDataMask mask);
+ CustomDataMask mask);
/* copies data from one CustomData object to another
* objects need not be compatible, each source layer is copied to the
@@ -132,11 +132,11 @@ void CustomData_set_only_copy(const struct CustomData *data,
* return 1 on success, 0 on failure
*/
void CustomData_copy_data(const struct CustomData *source,
- struct CustomData *dest, int source_index,
- int dest_index, int count);
+ struct CustomData *dest, int source_index,
+ int dest_index, int count);
void CustomData_em_copy_data(const struct CustomData *source,
- struct CustomData *dest, void *src_block,
- void **dest_block);
+ struct CustomData *dest, void *src_block,
+ void **dest_block);
void CustomData_bmesh_copy_data(const struct CustomData *source,
struct CustomData *dest,void *src_block,
void **dest_block);
@@ -161,11 +161,11 @@ void CustomData_free_elem(struct CustomData *data, int index, int count);
* returns 1 on success, 0 on failure
*/
void CustomData_interp(const struct CustomData *source, struct CustomData *dest,
- int *src_indices, float *weights, float *sub_weights,
- int count, int dest_index);
+ int *src_indices, float *weights, float *sub_weights,
+ int count, int dest_index);
void CustomData_em_interp(struct CustomData *data, void **src_blocks,
- float *weights, float *sub_weights, int count,
- void *dest_block);
+ float *weights, float *sub_weights, int count,
+ void *dest_block);
void CustomData_bmesh_interp(struct CustomData *data, void **src_blocks,
float *weights, float *sub_weights, int count,
void *dest_block);
@@ -191,7 +191,7 @@ void *CustomData_bmesh_get_n(const struct CustomData *data, void *block, int typ
void *CustomData_get_layer(const struct CustomData *data, int type);
void *CustomData_get_layer_n(const struct CustomData *data, int type, int n);
void *CustomData_get_layer_named(const struct CustomData *data, int type,
- char *name);
+ char *name);
int CustomData_get_layer_index(const struct CustomData *data, int type);
int CustomData_get_named_layer_index(const struct CustomData *data, int type, char *name);
@@ -209,11 +209,11 @@ int CustomData_get_stencil_layer(const struct CustomData *data, int type);
* no effect if there is no layer of type
*/
void CustomData_set(const struct CustomData *data, int index, int type,
- void *source);
+ void *source);
void CustomData_em_set(struct CustomData *data, void *block, int type,
- void *source);
+ void *source);
void CustomData_em_set_n(struct CustomData *data, void *block, int type, int n,
- void *source);
+ void *source);
void CustomData_bmesh_set(const struct CustomData *data, void *block, int type,
void *source);
@@ -252,9 +252,9 @@ void CustomData_bmesh_free_block(struct CustomData *data, void **block);
/* copy custom data to/from layers as in mesh/derivedmesh, to editmesh
blocks of data. the CustomData's must not be compatible */
void CustomData_to_em_block(const struct CustomData *source,
- struct CustomData *dest, int index, void **block);
+ struct CustomData *dest, int index, void **block);
void CustomData_from_em_block(const struct CustomData *source,
- struct CustomData *dest, void *block, int index);
+ struct CustomData *dest, void *block, int index);
void CustomData_to_bmesh_block(const struct CustomData *source,
struct CustomData *dest, int src_index, void **dest_block);
void CustomData_from_bmesh_block(const struct CustomData *source,
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h
index 01a1126e464..febe0a11ae6 100644
--- a/source/blender/blenkernel/BKE_displist.h
+++ b/source/blender/blenkernel/BKE_displist.h
@@ -66,10 +66,10 @@ struct DerivedMesh;
/* used for curves, nurbs, mball, importing */
typedef struct DispList {
- struct DispList *next, *prev;
- short type, flag;
- int parts, nr;
- short col, rt; /* rt used by initrenderNurbs */
+ struct DispList *next, *prev;
+ short type, flag;
+ int parts, nr;
+ short col, rt; /* rt used by initrenderNurbs */
float *verts, *nors;
int *index;
unsigned int *col1, *col2;
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 6e364ef63b6..e33239293a8 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -114,7 +114,7 @@ int IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop);
/*this is the same as IDP_AddToGroup, only you pass an item
in the group list to be inserted after.*/
int IDP_InsertToGroup(struct IDProperty *group, struct IDProperty *previous,
- struct IDProperty *pnew);
+ struct IDProperty *pnew);
/*NOTE: this does not free the property!!
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index d99296068d9..f35dff53cd5 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -59,11 +59,11 @@ void curve_deform_vector(struct Scene *scene, struct Object *cuOb, struct Object
float *orco, float *vec, float mat[][3], int no_rot_axis);
void lattice_deform_verts(struct Object *laOb, struct Object *target,
- struct DerivedMesh *dm, float (*vertexCos)[3],
- int numVerts, char *vgroup);
+ struct DerivedMesh *dm, float (*vertexCos)[3],
+ int numVerts, char *vgroup);
void armature_deform_verts(struct Object *armOb, struct Object *target,
- struct DerivedMesh *dm, float (*vertexCos)[3],
- float (*defMats)[3][3], int numVerts, int deformflag,
+ struct DerivedMesh *dm, float (*vertexCos)[3],
+ float (*defMats)[3][3], int numVerts, int deformflag,
float (*prevCos)[3], const char *defgrp_name);
float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3];
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index c9f56ef7e3e..6db610f4d8d 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -130,22 +130,22 @@ typedef struct ModifierTypeInfo {
* and otherwise the ob argument.
*/
void (*deformVerts)(struct ModifierData *md, struct Object *ob,
- struct DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts,
- int useRenderParams, int isFinalCalc);
+ struct DerivedMesh *derivedData,
+ float (*vertexCos)[3], int numVerts,
+ int useRenderParams, int isFinalCalc);
/* Like deformVerts but called during editmode (for supporting modifiers)
*/
void (*deformVertsEM)(
- struct ModifierData *md, struct Object *ob,
- struct EditMesh *editData, struct DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts);
+ struct ModifierData *md, struct Object *ob,
+ struct EditMesh *editData, struct DerivedMesh *derivedData,
+ float (*vertexCos)[3], int numVerts);
/* Set deform matrix per vertex for crazyspace correction */
void (*deformMatricesEM)(
- struct ModifierData *md, struct Object *ob,
- struct EditMesh *editData, struct DerivedMesh *derivedData,
- float (*vertexCos)[3], float (*defMats)[3][3], int numVerts);
+ struct ModifierData *md, struct Object *ob,
+ struct EditMesh *editData, struct DerivedMesh *derivedData,
+ float (*vertexCos)[3], float (*defMats)[3][3], int numVerts);
/********************* Non-deform modifier functions *********************/
@@ -169,9 +169,9 @@ typedef struct ModifierTypeInfo {
* modified form), but must not release it.
*/
struct DerivedMesh *(*applyModifier)(
- struct ModifierData *md, struct Object *ob,
- struct DerivedMesh *derivedData,
- int useRenderParams, int isFinalCalc);
+ struct ModifierData *md, struct Object *ob,
+ struct DerivedMesh *derivedData,
+ int useRenderParams, int isFinalCalc);
/* Like applyModifier but called during editmode (for supporting
* modifiers).
@@ -181,9 +181,9 @@ typedef struct ModifierTypeInfo {
* derivedData apply as for applyModifier.
*/
struct DerivedMesh *(*applyModifierEM)(
- struct ModifierData *md, struct Object *ob,
- struct EditMesh *editData,
- struct DerivedMesh *derivedData);
+ struct ModifierData *md, struct Object *ob,
+ struct EditMesh *editData,
+ struct DerivedMesh *derivedData);
/********************* Optional functions *********************/
@@ -236,7 +236,7 @@ typedef struct ModifierTypeInfo {
* This function is optional.
*/
void (*updateDepgraph)(struct ModifierData *md, struct DagForest *forest, struct Scene *scene,
- struct Object *ob, struct DagNode *obNode);
+ struct Object *ob, struct DagNode *obNode);
/* Should return true if the modifier needs to be recalculated on time
* changes.
@@ -252,7 +252,7 @@ typedef struct ModifierTypeInfo {
* This function is optional.
*/
void (*foreachObjectLink)(struct ModifierData *md, struct Object *ob,
- ObjectWalkFunc walk, void *userData);
+ ObjectWalkFunc walk, void *userData);
/* Should call the given walk function with a pointer to each ID
* pointer (i.e. each datablock pointer) that the modifier data
@@ -263,7 +263,7 @@ typedef struct ModifierTypeInfo {
* will be used.
*/
void (*foreachIDLink)(struct ModifierData *md, struct Object *ob,
- IDWalkFunc walk, void *userData);
+ IDWalkFunc walk, void *userData);
} ModifierTypeInfo;
ModifierTypeInfo *modifierType_getInfo (ModifierType type);
@@ -286,15 +286,15 @@ int modifier_isEnabled(struct Scene *scene, struct ModifierData *md, i
void modifier_setError(struct ModifierData *md, char *format, ...);
void modifiers_foreachObjectLink(struct Object *ob,
- ObjectWalkFunc walk,
- void *userData);
+ ObjectWalkFunc walk,
+ void *userData);
void modifiers_foreachIDLink(struct Object *ob,
- IDWalkFunc walk,
- void *userData);
+ IDWalkFunc walk,
+ void *userData);
struct ModifierData *modifiers_findByType(struct Object *ob, ModifierType type);
void modifiers_clearErrors(struct Object *ob);
int modifiers_getCageIndex(struct Scene *scene, struct Object *ob,
- int *lastPossibleCageIndex_r, int virtual_);
+ int *lastPossibleCageIndex_r, int virtual_);
int modifiers_isSoftbodyEnabled(struct Object *ob);
int modifiers_isClothEnabled(struct Object *ob);
@@ -314,10 +314,10 @@ int modifiers_indexInObject(struct Object *ob, struct ModifierData *md
* end of the stack.
*/
struct LinkNode *modifiers_calcDataMasks(struct Scene *scene,
- struct Object *ob,
- struct ModifierData *md,
- CustomDataMask dataMask,
- int required_mode);
+ struct Object *ob,
+ struct ModifierData *md,
+ CustomDataMask dataMask,
+ int required_mode);
struct ModifierData *modifiers_getVirtualModifierList(struct Object *ob);
#endif
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 1362a191919..84995b60f4b 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -111,6 +111,8 @@ void where_is_object_simul(struct Scene *scene, struct Object *ob);
struct BoundBox *unit_boundbox(void);
void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]);
struct BoundBox *object_get_boundbox(struct Object *ob);
+void object_get_dimensions(struct Object *ob, float *value);
+void object_set_dimensions(struct Object *ob, const float *value);
void object_boundbox_flag(struct Object *ob, int flag, int set);
void minmax_object(struct Object *ob, float *min, float *max);
int minmax_object_duplis(struct Scene *scene, struct Object *ob, float *min, float *max);
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index e1c08e2cb3d..81fb724b3a5 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -69,13 +69,15 @@ typedef struct SculptSession {
struct MFace *mface;
int totvert, totface;
float *face_normals;
- struct PBVH *tree;
struct Object *ob;
struct KeyBlock *kb, *refkb;
/* Mesh connectivity */
struct ListBase *fmap;
+ /* PBVH acceleration structure */
+ struct PBVH *pbvh;
+
/* Used temporarily per-stroke */
float *vertexcosnos;
@@ -86,8 +88,7 @@ typedef struct SculptSession {
unsigned int texcache_side, *texcache, texcache_actual;
/* Layer brush persistence between strokes */
- float (*layer_co)[3]; /* Copy of the mesh vertices' locations */
- float *layer_disps; /* Displacements for each vertex */
+ float (*layer_co)[3]; /* Copy of the mesh vertices' locations */
struct SculptStroke *stroke;
struct StrokeCache *cache;
@@ -95,6 +96,6 @@ typedef struct SculptSession {
struct GPUDrawObject *drawobject;
} SculptSession;
-void free_sculptsession(SculptSession **);
+void free_sculptsession(struct Object *ob);
#endif
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 0268f2faf31..55f11e1066b 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -302,4 +302,10 @@ void BKE_ptcache_toggle_disk_cache(struct PTCacheID *pid);
/* Loads simulation from external (disk) cache files. */
void BKE_ptcache_load_external(struct PTCacheID *pid);
+/* Set correct flags after successful simulation step */
+void BKE_ptcache_validate(struct PointCache *cache, int framenr);
+
+/* Set correct flags after unsuccessful simulation step */
+void BKE_ptcache_invalidate(struct PointCache *cache);
+
#endif
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h
index 30b7e8cda53..ef7fa473ad0 100644
--- a/source/blender/blenkernel/BKE_softbody.h
+++ b/source/blender/blenkernel/BKE_softbody.h
@@ -39,8 +39,8 @@ 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];
- int nofsprings; int *springs;
+ float impdv[3],impdx[3];
+ int nofsprings; int *springs;
float choke,choke2,frozen;
float colball;
short flag;
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index 62ad86635c0..853fd99aa86 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -28,27 +28,29 @@
#ifndef BKE_SUBSURF_H
#define BKE_SUBSURF_H
-struct Mesh;
-struct Object;
+struct DMGridAdjacency;
+struct DMGridData;
struct DerivedMesh;
struct EditMesh;
+struct IndexNode;
+struct ListBase;
+struct Mesh;
struct MultiresSubsurf;
+struct Object;
+struct PBVH;
struct SubsurfModifierData;
-struct _CCGSubsurf;
-struct _CCGVert;
struct _CCGEdge;
struct _CCGFace;
-struct PBVH;
-struct DMGridData;
-struct DMGridAdjacency;
+struct _CCGSubsurf;
+struct _CCGVert;
/**************************** External *****************************/
struct DerivedMesh *subsurf_make_derived_from_derived(
- struct DerivedMesh *dm,
- struct SubsurfModifierData *smd,
- int useRenderParams, float (*vertCos)[3],
- int isFinalCalc, int editMode);
+ struct DerivedMesh *dm,
+ struct SubsurfModifierData *smd,
+ int useRenderParams, float (*vertCos)[3],
+ int isFinalCalc, int editMode);
void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]);
@@ -64,12 +66,14 @@ typedef struct CCGDerivedMesh {
struct {int startVert; struct _CCGVert *vert;} *vertMap;
struct {int startVert; int startEdge; struct _CCGEdge *edge;} *edgeMap;
struct {int startVert; int startEdge;
- int startFace; struct _CCGFace *face;} *faceMap;
+ int startFace; struct _CCGFace *face;} *faceMap;
short *edgeFlags;
char *faceFlags;
struct PBVH *pbvh;
+ struct ListBase *fmap;
+ struct IndexNode *fmap_mem;
struct DMGridData **gridData;
struct DMGridAdjacency *gridAdjacency;
diff --git a/source/blender/blenkernel/intern/BME_Customdata.c b/source/blender/blenkernel/intern/BME_Customdata.c
index 736b5e05798..d8a6b66d5bb 100644
--- a/source/blender/blenkernel/intern/BME_Customdata.c
+++ b/source/blender/blenkernel/intern/BME_Customdata.c
@@ -135,7 +135,7 @@ static void BME_CD_alloc_block(BME_CustomData *data, void **block)
}
void BME_CD_copy_data(const BME_CustomData *source, BME_CustomData *dest,
- void *src_block, void **dest_block)
+ void *src_block, void **dest_block)
{
const BME_LayerTypeInfo *typeInfo;
int dest_i, src_i;
@@ -151,7 +151,7 @@ void BME_CD_copy_data(const BME_CustomData *source, BME_CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
diff --git a/source/blender/blenkernel/intern/BME_eulers.c b/source/blender/blenkernel/intern/BME_eulers.c
index 9c9c71292c2..036cd4a23e2 100644
--- a/source/blender/blenkernel/intern/BME_eulers.c
+++ b/source/blender/blenkernel/intern/BME_eulers.c
@@ -71,7 +71,7 @@
code.
*The term "Euler Operator" is actually a misnomer when referring to a non-manifold
- data structure. Its use is in keeping with the convention established by others.
+ data structure. Its use is in keeping with the convention established by others.
TODO:
-Finish inserting 'strict' validation in all Eulers
diff --git a/source/blender/blenkernel/intern/BME_mesh.c b/source/blender/blenkernel/intern/BME_mesh.c
index f616d21c6fd..1bb419937b0 100644
--- a/source/blender/blenkernel/intern/BME_mesh.c
+++ b/source/blender/blenkernel/intern/BME_mesh.c
@@ -87,7 +87,7 @@ void BME_free_mesh(BME_Mesh *bm)
if(bm->ldata.totlayer) BLI_mempool_destroy(bm->ldata.pool);
if(bm->pdata.totlayer) BLI_mempool_destroy(bm->pdata.pool);
- /*free custom data*/
+ /*free custom data*/
CustomData_free(&bm->vdata,0);
CustomData_free(&bm->edata,0);
CustomData_free(&bm->ldata,0);
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index eb316c64af4..6778c9eb8ad 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -170,7 +170,7 @@ static void *_ehashIterator_getCurrent(EHashIterator *ehi) {
static void _ehashIterator_next(EHashIterator *ehi) {
if (ehi->curEntry) {
- ehi->curEntry = ehi->curEntry->next;
+ ehi->curEntry = ehi->curEntry->next;
while (!ehi->curEntry) {
ehi->curBucket++;
if (ehi->curBucket==ehi->eh->curSize)
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index e69686eeb00..9d15ac3f348 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -41,10 +41,11 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h" // N_T
-#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
+#include "BLI_math.h"
#include "BLI_memarena.h"
+#include "BLI_pbvh.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_displist.h"
@@ -113,7 +114,7 @@ static MFace *dm_getFaceArray(DerivedMesh *dm)
static MVert *dm_dupVertArray(DerivedMesh *dm)
{
MVert *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumVerts(dm),
- "dm_dupVertArray tmp");
+ "dm_dupVertArray tmp");
if(tmp) dm->copyVertArray(dm, tmp);
@@ -123,7 +124,7 @@ static MVert *dm_dupVertArray(DerivedMesh *dm)
static MEdge *dm_dupEdgeArray(DerivedMesh *dm)
{
MEdge *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumEdges(dm),
- "dm_dupEdgeArray tmp");
+ "dm_dupEdgeArray tmp");
if(tmp) dm->copyEdgeArray(dm, tmp);
@@ -133,7 +134,7 @@ static MEdge *dm_dupEdgeArray(DerivedMesh *dm)
static MFace *dm_dupFaceArray(DerivedMesh *dm)
{
MFace *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumFaces(dm),
- "dm_dupFaceArray tmp");
+ "dm_dupFaceArray tmp");
if(tmp) dm->copyFaceArray(dm, tmp);
@@ -161,7 +162,7 @@ void DM_init_funcs(DerivedMesh *dm)
}
void DM_init(DerivedMesh *dm, DerivedMeshType type,
- int numVerts, int numEdges, int numFaces)
+ int numVerts, int numEdges, int numFaces)
{
dm->type = type;
dm->numVertData = numVerts;
@@ -174,14 +175,14 @@ void DM_init(DerivedMesh *dm, DerivedMeshType type,
}
void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type,
- int numVerts, int numEdges, int numFaces)
+ int numVerts, int numEdges, int numFaces)
{
CustomData_copy(&source->vertData, &dm->vertData, CD_MASK_DERIVEDMESH,
- CD_CALLOC, numVerts);
+ CD_CALLOC, numVerts);
CustomData_copy(&source->edgeData, &dm->edgeData, CD_MASK_DERIVEDMESH,
- CD_CALLOC, numEdges);
+ CD_CALLOC, numEdges);
CustomData_copy(&source->faceData, &dm->faceData, CD_MASK_DERIVEDMESH,
- CD_CALLOC, numFaces);
+ CD_CALLOC, numFaces);
dm->type = type;
dm->numVertData = numVerts;
@@ -352,24 +353,24 @@ void DM_set_face_data(DerivedMesh *dm, int index, int type, void *data)
}
void DM_copy_vert_data(DerivedMesh *source, DerivedMesh *dest,
- int source_index, int dest_index, int count)
+ int source_index, int dest_index, int count)
{
CustomData_copy_data(&source->vertData, &dest->vertData,
- source_index, dest_index, count);
+ source_index, dest_index, count);
}
void DM_copy_edge_data(DerivedMesh *source, DerivedMesh *dest,
- int source_index, int dest_index, int count)
+ int source_index, int dest_index, int count)
{
CustomData_copy_data(&source->edgeData, &dest->edgeData,
- source_index, dest_index, count);
+ source_index, dest_index, count);
}
void DM_copy_face_data(DerivedMesh *source, DerivedMesh *dest,
- int source_index, int dest_index, int count)
+ int source_index, int dest_index, int count)
{
CustomData_copy_data(&source->faceData, &dest->faceData,
- source_index, dest_index, count);
+ source_index, dest_index, count);
}
void DM_free_vert_data(struct DerivedMesh *dm, int index, int count)
@@ -388,29 +389,29 @@ void DM_free_face_data(struct DerivedMesh *dm, int index, int count)
}
void DM_interp_vert_data(DerivedMesh *source, DerivedMesh *dest,
- int *src_indices, float *weights,
- int count, int dest_index)
+ int *src_indices, float *weights,
+ int count, int dest_index)
{
CustomData_interp(&source->vertData, &dest->vertData, src_indices,
- weights, NULL, count, dest_index);
+ weights, NULL, count, dest_index);
}
void DM_interp_edge_data(DerivedMesh *source, DerivedMesh *dest,
- int *src_indices,
- float *weights, EdgeVertWeight *vert_weights,
- int count, int dest_index)
+ int *src_indices,
+ float *weights, EdgeVertWeight *vert_weights,
+ int count, int dest_index)
{
CustomData_interp(&source->edgeData, &dest->edgeData, src_indices,
- weights, (float*)vert_weights, count, dest_index);
+ weights, (float*)vert_weights, count, dest_index);
}
void DM_interp_face_data(DerivedMesh *source, DerivedMesh *dest,
- int *src_indices,
- float *weights, FaceVertWeight *vert_weights,
- int count, int dest_index)
+ int *src_indices,
+ float *weights, FaceVertWeight *vert_weights,
+ int count, int dest_index)
{
CustomData_interp(&source->faceData, &dest->faceData, src_indices,
- weights, (float*)vert_weights, count, dest_index);
+ weights, (float*)vert_weights, count, dest_index);
}
void DM_swap_face_data(DerivedMesh *dm, int index, int *corner_indices)
@@ -509,7 +510,7 @@ static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
glEnd();
}
}
-static void emDM_drawEdges(DerivedMesh *dm, int drawLooseEdges)
+static void emDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges)
{
emDM_drawMappedEdges(dm, NULL, NULL);
}
@@ -635,8 +636,8 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, i, &drawSmooth);
if(draw) {
if (draw==2) { /* enabled with stipple */
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_quarttone);
+ glEnable(GL_POLYGON_STIPPLE);
+ glPolygonStipple(stipple_quarttone);
}
glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);
@@ -706,9 +707,9 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
}
static void emDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
- int (*drawParamsMapped)(void *userData, int index),
- void *userData)
+ int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
+ int (*drawParamsMapped)(void *userData, int index),
+ void *userData)
{
EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
EditMesh *em= emdm->em;
@@ -884,8 +885,8 @@ static void emDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void
}
static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs),
- int (*setDrawOptions)(void *userData, int index), void *userData)
+ int (*setMaterial)(int, void *attribs),
+ int (*setDrawOptions)(void *userData, int index), void *userData)
{
EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
EditMesh *em= emdm->em;
@@ -1034,7 +1035,7 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
}
static void emDM_drawFacesGLSL(DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs))
+ int (*setMaterial)(int, void *attribs))
{
dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
}
@@ -1151,7 +1152,7 @@ static void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r)
if(!v4) face_r->v4 = 0;
for(i = 0, ev = em->verts.first; v1 || v2 || v3 || v4;
- i++, ev = ev->next) {
+ i++, ev = ev->next) {
if(ev == v1) {
face_r->v1 = i;
v1 = NULL;
@@ -1297,12 +1298,12 @@ static void emDM_release(DerivedMesh *dm)
}
static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
- float (*vertexCos)[3])
+ float (*vertexCos)[3])
{
EditMeshDerivedMesh *emdm = MEM_callocN(sizeof(*emdm), "emdm");
DM_init(&emdm->dm, DM_TYPE_EDITMESH, BLI_countlist(&em->verts),
- BLI_countlist(&em->edges), BLI_countlist(&em->faces));
+ BLI_countlist(&em->edges), BLI_countlist(&em->faces));
emdm->dm.getMinMax = emDM_getMinMax;
@@ -1345,7 +1346,7 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
for(eve = em->verts.first, i = 0; eve; eve = eve->next, ++i)
DM_set_vert_data(&emdm->dm, i, CD_MDEFORMVERT,
- CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT));
+ CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT));
}
if(vertexCos) {
@@ -1596,9 +1597,9 @@ static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm)
* - apply deform modifiers and input vertexco
*/
static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos)[3],
- DerivedMesh **deform_r, DerivedMesh **final_r,
- int useRenderParams, int useDeform,
- int needMapping, CustomDataMask dataMask, int index, int useCache)
+ DerivedMesh **deform_r, DerivedMesh **final_r,
+ int useRenderParams, int useDeform,
+ int needMapping, CustomDataMask dataMask, int index, int useCache)
{
Mesh *me = ob->data;
ModifierData *firstmd, *md;
@@ -1716,7 +1717,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
*/
numVerts = dm->getNumVerts(dm);
deformedVerts =
- MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv");
+ MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv");
dm->getVertCos(dm, deformedVerts);
} else {
deformedVerts = mesh_getVertexCos(me, &numVerts);
@@ -1891,8 +1892,8 @@ static int editmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedM
}
static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, DerivedMesh **cage_r,
- DerivedMesh **final_r,
- CustomDataMask dataMask)
+ DerivedMesh **final_r,
+ CustomDataMask dataMask)
{
ModifierData *md;
float (*deformedVerts)[3] = NULL;
@@ -1947,7 +1948,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
*/
numVerts = dm->getNumVerts(dm);
deformedVerts =
- MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv");
+ MEM_mallocN(sizeof(*deformedVerts) * numVerts, "dfmv");
dm->getVertCos(dm, deformedVerts);
} else {
deformedVerts = editmesh_getVertexCos(em, &numVerts);
@@ -2029,8 +2030,8 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
*cage_r = dm;
} else {
*cage_r =
- getEditMeshDerivedMesh(em, ob,
- deformedVerts ? MEM_dupallocN(deformedVerts) : NULL);
+ getEditMeshDerivedMesh(em, ob,
+ deformedVerts ? MEM_dupallocN(deformedVerts) : NULL);
}
}
}
@@ -2094,6 +2095,15 @@ static void clear_mesh_caches(Object *ob)
ob->derivedDeform->release(ob->derivedDeform);
ob->derivedDeform= NULL;
}
+ /* we free pbvh on changes, except during sculpt since it can't deal with
+ changing PVBH node organization, we hope topology does not change in
+ the meantime .. weak */
+ if(ob->sculpt && ob->sculpt->pbvh) {
+ if(!ob->sculpt->cache) {
+ BLI_pbvh_free(ob->sculpt->pbvh);
+ ob->sculpt->pbvh= NULL;
+ }
+ }
}
static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
@@ -2202,7 +2212,7 @@ DerivedMesh *mesh_create_derived_view(Scene *scene, Object *ob, CustomDataMask d
}
DerivedMesh *mesh_create_derived_no_deform(Scene *scene, Object *ob, float (*vertCos)[3],
- CustomDataMask dataMask)
+ CustomDataMask dataMask)
{
DerivedMesh *final;
@@ -2212,7 +2222,7 @@ DerivedMesh *mesh_create_derived_no_deform(Scene *scene, Object *ob, float (*ver
}
DerivedMesh *mesh_create_derived_no_virtual(Scene *scene, Object *ob, float (*vertCos)[3],
- CustomDataMask dataMask)
+ CustomDataMask dataMask)
{
DerivedMesh *final;
@@ -2222,8 +2232,8 @@ DerivedMesh *mesh_create_derived_no_virtual(Scene *scene, Object *ob, float (*ve
}
DerivedMesh *mesh_create_derived_no_deform_render(Scene *scene, Object *ob,
- float (*vertCos)[3],
- CustomDataMask dataMask)
+ float (*vertCos)[3],
+ CustomDataMask dataMask)
{
DerivedMesh *final;
@@ -2235,7 +2245,7 @@ DerivedMesh *mesh_create_derived_no_deform_render(Scene *scene, Object *ob,
/***/
DerivedMesh *editmesh_get_derived_cage_and_final(Scene *scene, Object *obedit, EditMesh *em, DerivedMesh **final_r,
- CustomDataMask dataMask)
+ CustomDataMask dataMask)
{
/* if there's no derived mesh or the last data mask used doesn't include
* the data we need, rebuild the derived mesh
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index cf61de195e5..afd0b3a0f57 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -64,13 +64,13 @@
/* *********************** NOTE ON POSE AND ACTION **********************
- Pose is the local (object level) component of armature. The current
- object pose is saved in files, and (will be) is presorted for dependency
+ object pose is saved in files, and (will be) is presorted for dependency
- Actions have fewer (or other) channels, and write data to a Pose
- Currently ob->pose data is controlled in where_is_pose only. The (recalc)
- event system takes care of calling that
+ event system takes care of calling that
- The NLA system (here too) uses Poses as interpolation format for Actions
- Therefore we assume poses to be static, and duplicates of poses have channels in
- same order, for quick interpolation reasons
+ same order, for quick interpolation reasons
****************************** (ton) ************************************ */
@@ -1138,17 +1138,17 @@ static void blend_pose_strides(bPose *dst, bPose *src, float srcweight, short mo
bone matching diagram, strips A and B
- .------------------------.
- | A |
- '------------------------'
+ .------------------------.
+ | A |
+ '------------------------'
. . b2
- . .-------------v----------.
- . | B . |
- . '------------------------'
- . . .
- . . .
+ . .-------------v----------.
+ . | B . |
+ . '------------------------'
+ . . .
+ . . .
offset: . 0 . A-B . A-b2+B
- . . .
+ . . .
*/
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 9eb6c3ad467..b2ac32da138 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -439,7 +439,7 @@ void calc_curvepath(Object *ob)
fp= dist+1;
maxdist= dist+tot;
fac= 1.0f/((float)path->len-1.0f);
- fac = fac * path->totdist;
+ fac = fac * path->totdist;
for(a=0; a<path->len; a++) {
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 584f31769ef..9fb442f8600 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -769,11 +769,11 @@ static short animsys_remap_path (AnimMapper *remap, char *path, char **dst)
/* Write the given value to a setting using RNA, and return success */
static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_index, float value)
{
- // printf("%p %s %i %f\n", ptr, path, array_index, value);
-
PropertyRNA *prop;
PointerRNA new_ptr;
+ //printf("%p %s %i %f\n", ptr, path, array_index, value);
+
/* get property to write to */
if (RNA_path_resolve(ptr, path, &new_ptr, &prop))
{
@@ -781,7 +781,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
if (RNA_property_animateable(&new_ptr, prop))
{
int array_len= RNA_property_array_length(&new_ptr, prop);
-
+
if(array_len && array_index >= array_len)
{
if (G.f & G_DEBUG) {
@@ -789,10 +789,10 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
(ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "<No ID>",
path, array_index, array_len-1);
}
-
+
return 0;
}
-
+
switch (RNA_property_type(prop))
{
case PROP_BOOLEAN:
@@ -1003,7 +1003,12 @@ static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime)
animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime);
}
- if (strip->flag & NLASTRIP_FLAG_USR_TIME && strip->flag & NLASTRIP_FLAG_USR_TIME_CYCLIC)
+ /* if user can control the evaluation time (using F-Curves), consider the option which allows this time to be clamped
+ * to lie within extents of the action-clip, so that a steady changing rate of progress through several cycles of the clip
+ * can be achieved easily
+ */
+ // NOTE: if we add any more of these special cases, we better group them up nicely...
+ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) && (strip->flag & NLASTRIP_FLAG_USR_TIME_CYCLIC))
strip->strip_time= fmod(strip->strip_time - strip->actstart, strip->actend - strip->actstart);
}
@@ -1740,7 +1745,7 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re
*/
// TODO: need to double check that this all works correctly
if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM))
- {
+ {
/* evaluate NLA data */
if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF))
{
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 387b8a1d5b2..668ce9aadac 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -708,7 +708,7 @@ static void pchan_b_bone_defmats(bPoseChannel *pchan, int use_quaternion, int re
invert_m4_m4(b_bone_mats[0].mat, bone->arm_mat);
/* then we make the b_bone_mats:
- - first transform to local bone space
+ - first transform to local bone space
- translate over the curve to the bbone mat space
- transform with b_bone matrix
- transform back into global space */
@@ -905,7 +905,7 @@ static void pchan_bone_deform(bPoseChannel *pchan, float weight, float *vec, Dua
}
void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
- float (*vertexCos)[3], float (*defMats)[3][3],
+ float (*vertexCos)[3], float (*defMats)[3][3],
int numVerts, int deformflag,
float (*prevCos)[3], const char *defgrp_name)
{
@@ -983,9 +983,9 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
if(use_dverts) {
defnrToPC = MEM_callocN(sizeof(*defnrToPC) * numGroups,
- "defnrToBone");
+ "defnrToBone");
for(i = 0, dg = target->defbase.first; dg;
- i++, dg = dg->next) {
+ i++, dg = dg->next) {
defnrToPC[i] = get_pose_channel(armOb->pose, dg->name);
/* exclude non-deforming bones */
if(defnrToPC[i]) {
@@ -1070,10 +1070,10 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
if(bone && bone->flag & BONE_MULT_VG_ENV) {
weight *= distfactor_to_bone(co, bone->arm_head,
- bone->arm_tail,
- bone->rad_head,
- bone->rad_tail,
- bone->dist);
+ bone->arm_tail,
+ bone->rad_head,
+ bone->rad_tail,
+ bone->dist);
}
pchan_bone_deform(pchan, weight, vec, dq, smat, co, &contrib);
}
@@ -1083,7 +1083,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
*/
if(deformed == 0 && use_envelope) {
for(pchan = armOb->pose->chanbase.first; pchan;
- pchan = pchan->next) {
+ pchan = pchan->next) {
if(!(pchan->bone->flag & BONE_NO_DEFORM))
contrib += dist_bone_deform(pchan, vec, dq, smat, co);
}
@@ -1091,7 +1091,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
}
else if(use_envelope) {
for(pchan = armOb->pose->chanbase.first; pchan;
- pchan = pchan->next) {
+ pchan = pchan->next) {
if(!(pchan->bone->flag & BONE_NO_DEFORM))
contrib += dist_bone_deform(pchan, vec, dq, smat, co);
}
@@ -1293,10 +1293,10 @@ void pchan_apply_mat4(bPoseChannel *pchan, float mat[][4])
*/
void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4])
{
- float imat[4][4];
+ float imat[4][4];
- invert_m4_m4(imat, arm_mat);
- mul_m4_m4m4(delta_mat, pose_mat, imat);
+ invert_m4_m4(imat, arm_mat);
+ mul_m4_m4m4(delta_mat, pose_mat, imat);
}
/* **************** Rotation Mode Conversions ****************************** */
@@ -1369,21 +1369,21 @@ void BKE_rotMode_change_values (float quat[4], float eul[3], float axis[3], floa
*************************************************************************** */
/* Computes vector and roll based on a rotation. "mat" must
- contain only a rotation, and no scaling. */
+ contain only a rotation, and no scaling. */
void mat3_to_vec_roll(float mat[][3], float *vec, float *roll)
{
- if (vec)
- copy_v3_v3(vec, mat[1]);
+ if (vec)
+ copy_v3_v3(vec, mat[1]);
- if (roll) {
- float vecmat[3][3], vecmatinv[3][3], rollmat[3][3];
+ if (roll) {
+ float vecmat[3][3], vecmatinv[3][3], rollmat[3][3];
- vec_roll_to_mat3(mat[1], 0.0f, vecmat);
- invert_m3_m3(vecmatinv, vecmat);
- mul_m3_m3m3(rollmat, vecmatinv, mat);
+ vec_roll_to_mat3(mat[1], 0.0f, vecmat);
+ invert_m3_m3(vecmatinv, vecmat);
+ mul_m3_m3m3(rollmat, vecmatinv, mat);
- *roll= (float)atan2(rollmat[2][0], rollmat[2][2]);
- }
+ *roll= (float)atan2(rollmat[2][0], rollmat[2][2]);
+ }
}
/* Calculates the rest matrix of a bone based
diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c
index 5f9b4f11850..5f6a4278549 100644
--- a/source/blender/blenkernel/intern/bmfont.c
+++ b/source/blender/blenkernel/intern/bmfont.c
@@ -179,7 +179,7 @@ void detectBitmapFont(ImBuf *ibuf)
int i;
if (ibuf != NULL) {
- // bitmap must have an x size that is a power of two
+ // bitmap must have an x size that is a power of two
if (is_power_of_two(ibuf->x)) {
rect = (unsigned char *) (ibuf->rect + (ibuf->x * (ibuf->y - 1)));
// printf ("starts with: %s %c %c %c %c\n", rect, rect[0], rect[1], rect[2], rect[3]);
diff --git a/source/blender/blenkernel/intern/booleanops.c b/source/blender/blenkernel/intern/booleanops.c
index 710bbfaf12b..3e43dfbb4d5 100644
--- a/source/blender/blenkernel/intern/booleanops.c
+++ b/source/blender/blenkernel/intern/booleanops.c
@@ -137,7 +137,7 @@ static void VertexIt_Construct(CSG_VertexIteratorDescriptor *output, DerivedMesh
it->pos = 0;
- // assign iterator function pointers.
+ // assign iterator function pointers.
output->Step = VertexIt_Step;
output->Fill = VertexIt_Fill;
output->Done = VertexIt_Done;
@@ -353,9 +353,9 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
// create a new DerivedMesh
result = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements);
CustomData_merge(&dm1->faceData, &result->faceData, CD_MASK_DERIVEDMESH,
- CD_DEFAULT, face_it->num_elements);
+ CD_DEFAULT, face_it->num_elements);
CustomData_merge(&dm2->faceData, &result->faceData, CD_MASK_DERIVEDMESH,
- CD_DEFAULT, face_it->num_elements);
+ CD_DEFAULT, face_it->num_elements);
// step through the vertex iterators:
for (i = 0; !vertex_it->Done(vertex_it->it); i++) {
@@ -422,7 +422,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
mface->mat_nr = 0;
InterpCSGFace(result, orig_dm, i, orig_index, csgface.vertex_number,
- (orig_me == me2)? mapmat: NULL);
+ (orig_me == me2)? mapmat: NULL);
test_index_face(mface, &result->faceData, i, csgface.vertex_number);
}
@@ -588,7 +588,7 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type)
}
DerivedMesh *NewBooleanDerivedMesh(DerivedMesh *dm, struct Object *ob, DerivedMesh *dm_select, struct Object *ob_select,
- int int_op_type)
+ int int_op_type)
{
return NewBooleanDerivedMesh_intern(dm, ob, dm_select, ob_select, int_op_type, NULL, NULL);
}
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 4aaf95e7037..4b8c3a2a0f4 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -678,7 +678,7 @@ static void brush_painter_refresh_cache(BrushPainter *painter, float *pos)
short flt;
if ((brush->size != cache->lastsize) || (brush->alpha != cache->lastalpha)
- || (brush->jitter != cache->lastjitter)) {
+ || (brush->jitter != cache->lastjitter)) {
if (cache->ibuf) {
IMB_freeImBuf(cache->ibuf);
cache->ibuf= NULL;
@@ -938,7 +938,7 @@ unsigned int *brush_gen_texture_cache(Brush *br, int half_side)
*/
if(hasrgb & TEX_RGB)
texres.tin = (0.35 * texres.tr + 0.45 *
- texres.tg + 0.2 * texres.tb);
+ texres.tg + 0.2 * texres.tb);
texres.tin = texres.tin * 255.0;
((char*)texcache)[(iy*side+ix)*4] = (char)texres.tin;
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 65fda678ce0..1b7257519b1 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -210,7 +210,7 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const
}
else // Region 0
{
- // Minimum at interior lv
+ // Minimum at interior lv
float invDet;
if(fabs(Det) > FLT_EPSILON)
invDet = 1.0f / Det;
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 3a415d6564d..b3e702ceee9 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -39,12 +39,13 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
+#include "BKE_paint.h"
#include "BKE_utildefines.h"
-#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
+#include "BLI_math.h"
#include "BLI_pbvh.h"
#include "DNA_meshdata_types.h"
@@ -178,7 +179,7 @@ static ListBase *cdDM_getFaceMap(Object *ob, DerivedMesh *dm)
Mesh *me= ob->data;
create_vert_face_map(&cddm->fmap, &cddm->fmap_mem, me->mface,
- me->totvert, me->totface);
+ me->totvert, me->totface);
}
return cddm->fmap;
@@ -188,12 +189,22 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
+ if(!ob) {
+ cddm->pbvh= NULL;
+ return NULL;
+ }
+
+ if(!ob->sculpt)
+ return NULL;
+ if(ob->sculpt->pbvh)
+ cddm->pbvh= ob->sculpt->pbvh;
+
if(!cddm->pbvh && ob->type == OB_MESH) {
Mesh *me= ob->data;
cddm->pbvh = BLI_pbvh_new();
BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert,
- me->totface, me->totvert);
+ me->totface, me->totvert);
}
return cddm->pbvh;
@@ -290,7 +301,7 @@ static void cdDM_drawUVEdges(DerivedMesh *dm)
}
}
-static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges)
+static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *mvert = cddm->mvert;
@@ -301,7 +312,7 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges)
DEBUG_VBO( "Using legacy code. cdDM_drawEdges\n" );
glBegin(GL_LINES);
for(i = 0; i < dm->numEdgeData; i++, medge++) {
- if((medge->flag&ME_EDGEDRAW)
+ if((drawAllEdges || (medge->flag&ME_EDGEDRAW))
&& (drawLooseEdges || !(medge->flag&ME_LOOSEEDGE))) {
glVertex3fv(mvert[medge->v1].co);
glVertex3fv(mvert[medge->v2].co);
@@ -317,7 +328,7 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges)
GPU_edge_setup(dm);
if( !GPU_buffer_legacy(dm) ) {
for(i = 0; i < dm->numEdgeData; i++, medge++) {
- if((medge->flag&ME_EDGEDRAW)
+ if((drawAllEdges || (medge->flag&ME_EDGEDRAW))
&& (drawLooseEdges || !(medge->flag&ME_LOOSEEDGE))) {
draw = 1;
}
@@ -415,7 +426,7 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
return;
glShadeModel((mface->flag & ME_SMOOTH)? GL_SMOOTH: GL_FLAT);
- BLI_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors);
+ BLI_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors, (mface->flag & ME_SMOOTH));
glShadeModel(GL_FLAT);
}
@@ -573,9 +584,9 @@ static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned cha
}
static void cdDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
- int (*drawParamsMapped)(void *userData, int index),
- void *userData)
+ int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
+ int (*drawParamsMapped)(void *userData, int index),
+ void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *mv = cddm->mvert;
@@ -1272,10 +1283,10 @@ static void cdDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
}
static void cdDM_foreachMappedVert(
- DerivedMesh *dm,
- void (*func)(void *userData, int index, float *co,
- float *no_f, short *no_s),
- void *userData)
+ DerivedMesh *dm,
+ void (*func)(void *userData, int index, float *co,
+ float *no_f, short *no_s),
+ void *userData)
{
MVert *mv = CDDM_get_verts(dm);
int i, orig, *index = DM_get_vert_data_layer(dm, CD_ORIGINDEX);
@@ -1292,10 +1303,10 @@ static void cdDM_foreachMappedVert(
}
static void cdDM_foreachMappedEdge(
- DerivedMesh *dm,
- void (*func)(void *userData, int index,
- float *v0co, float *v1co),
- void *userData)
+ DerivedMesh *dm,
+ void (*func)(void *userData, int index,
+ float *v0co, float *v1co),
+ void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *mv = cddm->mvert;
@@ -1314,10 +1325,10 @@ static void cdDM_foreachMappedEdge(
}
static void cdDM_foreachMappedFaceCenter(
- DerivedMesh *dm,
- void (*func)(void *userData, int index,
- float *cent, float *no),
- void *userData)
+ DerivedMesh *dm,
+ void (*func)(void *userData, int index,
+ float *cent, float *no),
+ void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
MVert *mv = cddm->mvert;
@@ -1354,7 +1365,6 @@ static void cdDM_foreachMappedFaceCenter(
static void cdDM_free_internal(CDDerivedMesh *cddm)
{
- if(cddm->pbvh) BLI_pbvh_free(cddm->pbvh);
if(cddm->fmap) MEM_freeN(cddm->fmap);
if(cddm->fmap_mem) MEM_freeN(cddm->fmap_mem);
}
@@ -1466,11 +1476,11 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob)
alloctype= CD_REFERENCE;
CustomData_merge(&mesh->vdata, &dm->vertData, mask, alloctype,
- mesh->totvert);
+ mesh->totvert);
CustomData_merge(&mesh->edata, &dm->edgeData, mask, alloctype,
- mesh->totedge);
+ mesh->totedge);
CustomData_merge(&mesh->fdata, &dm->faceData, mask, alloctype,
- mesh->totface);
+ mesh->totface);
cddm->mvert = CustomData_get_layer(&dm->vertData, CD_MVERT);
cddm->medge = CustomData_get_layer(&dm->edgeData, CD_MEDGE);
@@ -1482,8 +1492,8 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob)
DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me)
{
DerivedMesh *dm = CDDM_new(BLI_countlist(&em->verts),
- BLI_countlist(&em->edges),
- BLI_countlist(&em->faces));
+ BLI_countlist(&em->edges),
+ BLI_countlist(&em->faces));
CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
EditVert *eve;
EditEdge *eed;
@@ -1496,11 +1506,11 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me)
dm->deformedOnly = 1;
CustomData_merge(&em->vdata, &dm->vertData, CD_MASK_DERIVEDMESH,
- CD_CALLOC, dm->numVertData);
+ CD_CALLOC, dm->numVertData);
/* CustomData_merge(&em->edata, &dm->edgeData, CD_MASK_DERIVEDMESH,
- CD_CALLOC, dm->numEdgeData); */
+ CD_CALLOC, dm->numEdgeData); */
CustomData_merge(&em->fdata, &dm->faceData, CD_MASK_DERIVEDMESH,
- CD_CALLOC, dm->numFaceData);
+ CD_CALLOC, dm->numFaceData);
/* set eve->hash to vert index */
for(i = 0, eve = em->verts.first; eve; eve = eve->next, ++i)
@@ -1519,7 +1529,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me)
index = dm->getVertDataArray(dm, CD_ORIGINDEX);
for(i = 0, eve = em->verts.first; i < dm->numVertData;
- i++, eve = eve->next, index++) {
+ i++, eve = eve->next, index++) {
MVert *mv = &mvert[i];
VECCOPY(mv->co, eve->co);
@@ -1539,7 +1549,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me)
index = dm->getEdgeDataArray(dm, CD_ORIGINDEX);
for(i = 0, eed = em->edges.first; i < dm->numEdgeData;
- i++, eed = eed->next, index++) {
+ i++, eed = eed->next, index++) {
MEdge *med = &medge[i];
med->v1 = eed->v1->tmp.l;
@@ -1559,7 +1569,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me)
index = dm->getFaceDataArray(dm, CD_ORIGINDEX);
for(i = 0, efa = em->faces.first; i < dm->numFaceData;
- i++, efa = efa->next, index++) {
+ i++, efa = efa->next, index++) {
MFace *mf = &mface[i];
mf->v1 = efa->v1->tmp.l;
@@ -1648,7 +1658,7 @@ DerivedMesh *CDDM_copy(DerivedMesh *source)
}
DerivedMesh *CDDM_from_template(DerivedMesh *source,
- int numVerts, int numEdges, int numFaces)
+ int numVerts, int numEdges, int numFaces)
{
CDDerivedMesh *cddm = cdDM_create("CDDM_from_template dest");
DerivedMesh *dm = &cddm->dm;
@@ -1718,7 +1728,7 @@ void CDDM_calc_normals(DerivedMesh *dm)
if(numVerts == 0) return;
temp_nors = MEM_callocN(numVerts * sizeof(*temp_nors),
- "CDDM_calc_normals temp_nors");
+ "CDDM_calc_normals temp_nors");
/* we don't want to overwrite any referenced layers */
mv = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MVERT);
@@ -1728,7 +1738,7 @@ void CDDM_calc_normals(DerivedMesh *dm)
face_nors = CustomData_get_layer(&dm->faceData, CD_NORMAL);
if(!face_nors)
face_nors = CustomData_add_layer(&dm->faceData, CD_NORMAL, CD_CALLOC,
- NULL, dm->numFaceData);
+ NULL, dm->numFaceData);
/* calculate face normals and add to vertex normals */
mf = CDDM_get_faces(dm);
@@ -1802,7 +1812,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
med = CustomData_get_layer(&edgeData, CD_MEDGE);
index = CustomData_get_layer(&edgeData, CD_ORIGINDEX);
for(i = 0; !BLI_edgehashIterator_isDone(ehi);
- BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) {
+ BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) {
BLI_edgehashIterator_getKey(ehi, (int*)&med->v1, (int*)&med->v2);
med->flag = ME_EDGEDRAW|ME_EDGERENDER;
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 7183a514225..33fe6212cd2 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -75,7 +75,7 @@ double tval()
static CM_SOLVER_DEF solvers [] =
{
{ "Implicit", CM_IMPLICIT, implicit_init, implicit_solver, implicit_free },
- // { "Implicit C++", CM_IMPLICITCPP, implicitcpp_init, implicitcpp_solver, implicitcpp_free },
+ // { "Implicit C++", CM_IMPLICITCPP, implicitcpp_init, implicitcpp_solver, implicitcpp_free },
};
/* ********** cloth engine ******* */
@@ -356,14 +356,12 @@ static int do_init_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
/* initialize simulation data if it didn't exist already */
if(clmd->clothObject == NULL) {
if(!cloth_from_object(ob, clmd, result, framenr, 1)) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
+ BKE_ptcache_invalidate(cache);
return 0;
}
if(clmd->clothObject == NULL) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
+ BKE_ptcache_invalidate(cache);
return 0;
}
@@ -436,20 +434,17 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
clmd->sim_parms->timescale= timescale;
if(!result) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
return dm;
}
if(clmd->sim_parms->reset || (framenr == (startframe - clmd->sim_parms->preroll)))
{
clmd->sim_parms->reset = 0;
- cache->flag |= PTCACHE_REDO_NEEDED;
+ cache->flag |= PTCACHE_OUTDATED;
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
- cache->simframe= 0;
+ BKE_ptcache_validate(cache, 0);
cache->last_exact= 0;
- cache->flag |= PTCACHE_SIMULATION_VALID;
cache->flag &= ~PTCACHE_REDO_NEEDED;
return result;
}
@@ -460,9 +455,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
* happen because of object changes! */
if(clmd->clothObject) {
if(result->getNumVerts(result) != clmd->clothObject->numverts) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
return result;
}
}
@@ -472,9 +465,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
/* handle continuous simulation with the play button */
if(BKE_ptcache_get_continue_physics() || ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe))) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
/* do simulation */
if(!do_init_cloth(ob, clmd, result, framenr))
@@ -488,9 +479,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
/* simulation is only active during a specific period */
if(framenr < startframe) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
return result;
}
else if(framenr > endframe) {
@@ -509,8 +498,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
if((framenr == startframe) && (clmd->sim_parms->preroll == 0)) {
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
do_init_cloth(ob, clmd, result, framenr);
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ BKE_ptcache_validate(cache, framenr);
cache->flag &= ~PTCACHE_REDO_NEEDED;
return result;
}
@@ -522,8 +510,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
implicit_set_positions(clmd);
cloth_to_object (ob, clmd, result);
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ BKE_ptcache_validate(cache, framenr);
if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
BKE_ptcache_write_cache(&pid, framenr);
@@ -532,13 +519,10 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
}
else if(cache_result==PTCACHE_READ_OLD) {
implicit_set_positions(clmd);
- cache->flag |= PTCACHE_SIMULATION_VALID;
}
else if( /*ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED)) { /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
/* if baked and nothing in cache, do nothing */
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
return result;
}
@@ -549,13 +533,10 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
clmd->sim_parms->timescale *= framenr - cache->simframe;
/* do simulation */
- cache->flag |= PTCACHE_SIMULATION_VALID;
- cache->simframe= framenr;
+ BKE_ptcache_validate(cache, framenr);
if(!do_step_cloth(ob, clmd, result, framenr)) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
}
else
BKE_ptcache_write_cache(&pid, framenr);
@@ -764,10 +745,10 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
verts = clothObj->verts;
if (((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING ) ||
- (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )) &&
- ((clmd->sim_parms->vgroup_mass>0) ||
- (clmd->sim_parms->vgroup_struct>0)||
- (clmd->sim_parms->vgroup_bend>0)))
+ (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )) &&
+ ((clmd->sim_parms->vgroup_mass>0) ||
+ (clmd->sim_parms->vgroup_struct>0)||
+ (clmd->sim_parms->vgroup_bend>0)))
{
for ( i = 0; i < numverts; i++, verts++ )
{
@@ -789,7 +770,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
verts->goal = ( float ) pow ( verts->goal , 4.0f );
if ( verts->goal >=SOFTGOALSNAP )
{
- verts->flags |= CLOTH_VERT_FLAG_PINNED;
+ verts->flags |= CLOTH_VERT_FLAG_PINNED;
}
}
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 6410d02603d..4c0c10c127a 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -754,10 +754,10 @@ void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile)
cmsErrorAction(LCMS_ERROR_SHOW);
hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8,
- proofingProfile,
- INTENT_ABSOLUTE_COLORIMETRIC,
- INTENT_ABSOLUTE_COLORIMETRIC,
- cmsFLAGS_SOFTPROOFING);
+ proofingProfile,
+ INTENT_ABSOLUTE_COLORIMETRIC,
+ INTENT_ABSOLUTE_COLORIMETRIC,
+ cmsFLAGS_SOFTPROOFING);
cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y);
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 78f1bb4e469..3ab5e9442b4 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -3054,7 +3054,7 @@ static void rbj_new_data (void *cdata)
bRigidBodyJointConstraint *data= (bRigidBodyJointConstraint *)cdata;
// removed code which set target of this constraint
- data->type=1;
+ data->type=1;
}
static void rbj_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 06921a0b9af..4fed662b6b4 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -569,7 +569,7 @@ static void calcknots(float *knots, short aantal, short order, short type)
float k;
int a, t;
- t = aantal+order;
+ t = aantal+order;
if(type==0) {
for(a=0;a<t;a++) {
@@ -624,7 +624,7 @@ static void makecyclicknots(float *knots, short pnts, short order)
}
b= order;
- c=pnts + order + order2;
+ c=pnts + order + order2;
for(a=pnts+order2; a<c; a++) {
knots[a]= knots[a-1]+ (knots[b]-knots[b-1]);
b--;
@@ -671,14 +671,14 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
int i, i1 = 0, i2 = 0 ,j, orderpluspnts, opp2, o2;
orderpluspnts= order+pnts;
- opp2 = orderpluspnts-1;
+ opp2 = orderpluspnts-1;
/* this is for float inaccuracy */
if(t < knots[0]) t= knots[0];
else if(t > knots[opp2]) t= knots[opp2];
/* this part is order '1' */
- o2 = order + 1;
+ o2 = order + 1;
for(i=0;i<opp2;i++) {
if(knots[i]!=knots[i+1] && t>= knots[i] && t<=knots[i+1]) {
basis[i]= 1.0;
@@ -1002,18 +1002,18 @@ void forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int i
f*= it;
rt3= (q3-q0+3.0f*(q1-q2))/f;
- q0= rt0;
+ q0= rt0;
q1= rt1+rt2+rt3;
q2= 2*rt2+6*rt3;
q3= 6*rt3;
- for(a=0; a<=it; a++) {
+ for(a=0; a<=it; a++) {
*p= q0;
p = (float *)(((char *)p)+stride);
q0+= q1;
- q1+= q2;
- q2+= q3;
- }
+ q1+= q2;
+ q2+= q3;
+ }
}
static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float *p3, float *p, int it, int stride)
@@ -1023,7 +1023,7 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float
*
* This could also be optimized like forward_diff_bezier */
int a;
- for(a=0; a<=it; a++) {
+ for(a=0; a<=it; a++) {
float t = (float)a / (float)it;
int i;
@@ -1032,7 +1032,7 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float
}
normalize_v3(p);
p = (float *)(((char *)p)+stride);
- }
+ }
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@@ -1061,7 +1061,7 @@ float *make_orco_surf(Object *ob)
sizev = nu->pntsv*nu->resolv;
if (nu->flagu & CU_NURB_CYCLIC) sizeu++;
if (nu->flagv & CU_NURB_CYCLIC) sizev++;
- if(nu->pntsv>1) tot+= sizeu * sizev;
+ if(nu->pntsv>1) tot+= sizeu * sizev;
nu= nu->next;
}
@@ -1464,7 +1464,7 @@ static short bevelinside(BevList *bl1,BevList *bl2)
/* there's a transition, calc intersection point */
mode= cu_isectLL(prevbevp->vec, bevp->vec, hvec1, hvec2, 0, 1, &lab, &mu, vec);
/* if lab==0.0 or lab==1.0 then the edge intersects exactly a transition
- only allow for one situation: we choose lab= 1.0
+ only allow for one situation: we choose lab= 1.0
*/
if(mode>=0 && lab!=0.0) {
if(vec[0]<hvec1[0]) links++;
@@ -2578,13 +2578,13 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
void testhandlesNurb(Nurb *nu)
{
- /* use when something has changed with handles.
- it treats all BezTriples with the following rules:
- PHASE 1: do types have to be altered?
- Auto handles: become aligned when selection status is NOT(000 || 111)
- Vector handles: become 'nothing' when (one half selected AND other not)
- PHASE 2: recalculate handles
- */
+ /* use when something has changed with handles.
+ it treats all BezTriples with the following rules:
+ PHASE 1: do types have to be altered?
+ Auto handles: become aligned when selection status is NOT(000 || 111)
+ Vector handles: become 'nothing' when (one half selected AND other not)
+ PHASE 2: recalculate handles
+ */
BezTriple *bezt;
short flag, a;
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index a0eef4d666e..a755170aae6 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -82,27 +82,27 @@ typedef struct LayerTypeInfo {
* count gives the number of elements in sources
*/
void (*interp)(void **sources, float *weights, float *sub_weights,
- int count, void *dest);
+ int count, void *dest);
- /* a function to swap the data in corners of the element */
+ /* a function to swap the data in corners of the element */
void (*swap)(void *data, int *corner_indices);
- /* a function to set a layer's data to default values. if NULL, the
+ /* a function to set a layer's data to default values. if NULL, the
default is assumed to be all zeros */
void (*set_default)(void *data, int count);
- /* a function to read data from a cdf file */
+ /* a function to read data from a cdf file */
int (*read)(CDataFile *cdf, void *data, int count);
- /* a function to write data to a cdf file */
+ /* a function to write data to a cdf file */
int (*write)(CDataFile *cdf, void *data, int count);
- /* a function to determine file size */
+ /* a function to determine file size */
size_t (*filesize)(CDataFile *cdf, void *data, int count);
} LayerTypeInfo;
static void layerCopy_mdeformvert(const void *source, void *dest,
- int count)
+ int count)
{
int i, size = sizeof(MDeformVert);
@@ -144,7 +144,7 @@ static void linklist_free_simple(void *link)
}
static void layerInterp_mdeformvert(void **sources, float *weights,
- float *sub_weights, int count, void *dest)
+ float *sub_weights, int count, void *dest)
{
MDeformVert *dvert = dest;
LinkNode *dest_dw = NULL; /* a list of lists of MDeformWeight pointers */
@@ -174,7 +174,7 @@ static void layerInterp_mdeformvert(void **sources, float *weights,
/* if this def_nr is not in the list, add it */
if(!node) {
MDeformWeight *tmp_dw = MEM_callocN(sizeof(*tmp_dw),
- "layerInterp_mdeformvert tmp_dw");
+ "layerInterp_mdeformvert tmp_dw");
tmp_dw->def_nr = dw->def_nr;
tmp_dw->weight = dw->weight * interp_weight;
BLI_linklist_prepend(&dest_dw, tmp_dw);
@@ -188,7 +188,7 @@ static void layerInterp_mdeformvert(void **sources, float *weights,
if(totweight) {
dvert->dw = MEM_callocN(sizeof(*dvert->dw) * totweight,
- "layerInterp_mdeformvert dvert->dw");
+ "layerInterp_mdeformvert dvert->dw");
dvert->totweight = totweight;
for(i = 0, node = dest_dw; node; node = node->next, ++i)
@@ -202,7 +202,7 @@ static void layerInterp_mdeformvert(void **sources, float *weights,
static void layerInterp_msticky(void **sources, float *weights,
- float *sub_weights, int count, void *dest)
+ float *sub_weights, int count, void *dest)
{
float co[2], w;
MSticky *mst;
@@ -234,7 +234,7 @@ static void layerCopy_tface(const void *source, void *dest, int count)
}
static void layerInterp_tface(void **sources, float *weights,
- float *sub_weights, int count, void *dest)
+ float *sub_weights, int count, void *dest)
{
MTFace *tf = dest;
int i, j, k;
@@ -278,9 +278,9 @@ static void layerSwap_tface(void *data, int *corner_indices)
MTFace *tf = data;
float uv[4][2];
static const short pin_flags[4] =
- { TF_PIN1, TF_PIN2, TF_PIN3, TF_PIN4 };
+ { TF_PIN1, TF_PIN2, TF_PIN3, TF_PIN4 };
static const char sel_flags[4] =
- { TF_SEL1, TF_SEL2, TF_SEL3, TF_SEL4 };
+ { TF_SEL1, TF_SEL2, TF_SEL3, TF_SEL4 };
short unwrap = tf->unwrap & ~(TF_PIN1 | TF_PIN2 | TF_PIN3 | TF_PIN4);
char flag = tf->flag & ~(TF_SEL1 | TF_SEL2 | TF_SEL3 | TF_SEL4);
int j;
@@ -310,7 +310,7 @@ static void layerSwap_tface(void *data, int *corner_indices)
static void layerDefault_tface(void *data, int count)
{
static MTFace default_tf = {{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, NULL,
- 0, 0, TF_DYNAMIC, 0, 0};
+ 0, 0, TF_DYNAMIC, 0, 0};
MTFace *tf = (MTFace*)data;
int i;
@@ -466,7 +466,7 @@ static void layerSwap_mdisps(void *data, int *ci)
}
static void layerInterp_mdisps(void **sources, float *weights, float *sub_weights,
- int count, void *dest)
+ int count, void *dest)
{
// XXX
#if 0
@@ -680,7 +680,7 @@ static void layerInterp_mloopuv(void **sources, float *weights,
}
static void layerInterp_mcol(void **sources, float *weights,
- float *sub_weights, int count, void *dest)
+ float *sub_weights, int count, void *dest)
{
MCol *mc = dest;
int i, j, k;
@@ -843,7 +843,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
int type, int alloctype, void *layerdata, int totelem, const char *name);
void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
- CustomDataMask mask, int alloctype, int totelem)
+ CustomDataMask mask, int alloctype, int totelem)
{
const LayerTypeInfo *typeInfo;
CustomDataLayer *layer, *newlayer;
@@ -887,7 +887,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
}
void CustomData_copy(const struct CustomData *source, struct CustomData *dest,
- CustomDataMask mask, int alloctype, int totelem)
+ CustomDataMask mask, int alloctype, int totelem)
{
memset(dest, 0, sizeof(*dest));
@@ -1142,7 +1142,7 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag)
static int customData_resize(CustomData *data, int amount)
{
CustomDataLayer *tmp = MEM_callocN(sizeof(*tmp)*(data->maxlayer + amount),
- "CustomData->layers");
+ "CustomData->layers");
if(!tmp) return 0;
data->maxlayer += amount;
@@ -1230,13 +1230,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
}
void *CustomData_add_layer(CustomData *data, int type, int alloctype,
- void *layerdata, int totelem)
+ void *layerdata, int totelem)
{
CustomDataLayer *layer;
const LayerTypeInfo *typeInfo= layerType_getInfo(type);
layer = customData_add_layer__internal(data, type, alloctype, layerdata,
- totelem, typeInfo->defaultname);
+ totelem, typeInfo->defaultname);
if(layer)
return layer->data;
@@ -1246,12 +1246,12 @@ void *CustomData_add_layer(CustomData *data, int type, int alloctype,
/*same as above but accepts a name*/
void *CustomData_add_layer_named(CustomData *data, int type, int alloctype,
- void *layerdata, int totelem, char *name)
+ void *layerdata, int totelem, char *name)
{
CustomDataLayer *layer;
layer = customData_add_layer__internal(data, type, alloctype, layerdata,
- totelem, name);
+ totelem, name);
if(layer)
return layer->data;
@@ -1345,7 +1345,7 @@ void *CustomData_duplicate_referenced_layer(struct CustomData *data, int type)
}
void *CustomData_duplicate_referenced_layer_named(struct CustomData *data,
- int type, char *name)
+ int type, char *name)
{
CustomDataLayer *layer;
int layer_index;
@@ -1390,7 +1390,7 @@ void CustomData_free_temporary(CustomData *data, int totelem)
}
void CustomData_set_only_copy(const struct CustomData *data,
- CustomDataMask mask)
+ CustomDataMask mask)
{
int i;
@@ -1400,7 +1400,7 @@ void CustomData_set_only_copy(const struct CustomData *data,
}
void CustomData_copy_data(const CustomData *source, CustomData *dest,
- int source_index, int dest_index, int count)
+ int source_index, int dest_index, int count)
{
const LayerTypeInfo *typeInfo;
int src_i, dest_i;
@@ -1415,7 +1415,7 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -1433,12 +1433,12 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
if(typeInfo->copy)
typeInfo->copy(src_data + src_offset,
- dest_data + dest_offset,
- count);
+ dest_data + dest_offset,
+ count);
else
memcpy(dest_data + dest_offset,
- src_data + src_offset,
- count * typeInfo->size);
+ src_data + src_offset,
+ count * typeInfo->size);
/* if there are multiple source & dest layers of the same type,
* we don't want to copy all source layers to the same dest, so
@@ -1462,7 +1462,7 @@ void CustomData_free_elem(CustomData *data, int index, int count)
int offset = typeInfo->size * index;
typeInfo->free((char *)data->layers[i].data + offset,
- count, typeInfo->size);
+ count, typeInfo->size);
}
}
}
@@ -1471,8 +1471,8 @@ void CustomData_free_elem(CustomData *data, int index, int count)
#define SOURCE_BUF_SIZE 100
void CustomData_interp(const CustomData *source, CustomData *dest,
- int *src_indices, float *weights, float *sub_weights,
- int count, int dest_index)
+ int *src_indices, float *weights, float *sub_weights,
+ int count, int dest_index)
{
int src_i, dest_i;
int dest_offset;
@@ -1485,7 +1485,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
*/
if(count > SOURCE_BUF_SIZE)
sources = MEM_callocN(sizeof(*sources) * count,
- "CustomData_interp sources");
+ "CustomData_interp sources");
/* interpolates a layer at a time */
dest_i = 0;
@@ -1497,7 +1497,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -1577,7 +1577,7 @@ void *CustomData_get_layer_n(const CustomData *data, int type, int n)
}
void *CustomData_get_layer_named(const struct CustomData *data, int type,
- char *name)
+ char *name)
{
int layer_index = CustomData_get_named_layer_index(data, type, name);
if(layer_index < 0) return NULL;
@@ -1625,21 +1625,21 @@ void CustomData_set(const CustomData *data, int index, int type, void *source)
void CustomData_em_free_block(CustomData *data, void **block)
{
- const LayerTypeInfo *typeInfo;
- int i;
+ const LayerTypeInfo *typeInfo;
+ int i;
if(!*block) return;
- for(i = 0; i < data->totlayer; ++i) {
- if(!(data->layers[i].flag & CD_FLAG_NOFREE)) {
- typeInfo = layerType_getInfo(data->layers[i].type);
+ for(i = 0; i < data->totlayer; ++i) {
+ if(!(data->layers[i].flag & CD_FLAG_NOFREE)) {
+ typeInfo = layerType_getInfo(data->layers[i].type);
- if(typeInfo->free) {
+ if(typeInfo->free) {
int offset = data->layers[i].offset;
- typeInfo->free((char*)*block + offset, 1, typeInfo->size);
+ typeInfo->free((char*)*block + offset, 1, typeInfo->size);
}
- }
- }
+ }
+ }
MEM_freeN(*block);
*block = NULL;
@@ -1659,7 +1659,7 @@ static void CustomData_em_alloc_block(CustomData *data, void **block)
}
void CustomData_em_copy_data(const CustomData *source, CustomData *dest,
- void *src_block, void **dest_block)
+ void *src_block, void **dest_block)
{
const LayerTypeInfo *typeInfo;
int dest_i, src_i;
@@ -1675,7 +1675,7 @@ void CustomData_em_copy_data(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -1752,7 +1752,7 @@ void CustomData_em_set_n(CustomData *data, void *block, int type, int n, void *s
}
void CustomData_em_interp(CustomData *data, void **src_blocks, float *weights,
- float *sub_weights, int count, void *dest_block)
+ float *sub_weights, int count, void *dest_block)
{
int i, j;
void *source_buf[SOURCE_BUF_SIZE];
@@ -1763,7 +1763,7 @@ void CustomData_em_interp(CustomData *data, void **src_blocks, float *weights,
*/
if(count > SOURCE_BUF_SIZE)
sources = MEM_callocN(sizeof(*sources) * count,
- "CustomData_interp sources");
+ "CustomData_interp sources");
/* interpolates a layer at a time */
for(i = 0; i < data->totlayer; ++i) {
@@ -1775,7 +1775,7 @@ void CustomData_em_interp(CustomData *data, void **src_blocks, float *weights,
sources[j] = (char *)src_blocks[j] + layer->offset;
typeInfo->interp(sources, weights, sub_weights, count,
- (char *)dest_block + layer->offset);
+ (char *)dest_block + layer->offset);
}
}
@@ -1801,7 +1801,7 @@ void CustomData_em_set_default(CustomData *data, void **block)
}
void CustomData_to_em_block(const CustomData *source, CustomData *dest,
- int src_index, void **dest_block)
+ int src_index, void **dest_block)
{
const LayerTypeInfo *typeInfo;
int dest_i, src_i, src_offset;
@@ -1817,7 +1817,7 @@ void CustomData_to_em_block(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -1847,7 +1847,7 @@ void CustomData_to_em_block(const CustomData *source, CustomData *dest,
}
void CustomData_from_em_block(const CustomData *source, CustomData *dest,
- void *src_block, int dest_index)
+ void *src_block, int dest_index)
{
const LayerTypeInfo *typeInfo;
int dest_i, src_i, dest_offset;
@@ -1860,7 +1860,7 @@ void CustomData_from_em_block(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -1923,20 +1923,20 @@ void CustomData_bmesh_init_pool(CustomData *data, int allocsize){
void CustomData_bmesh_free_block(CustomData *data, void **block)
{
- const LayerTypeInfo *typeInfo;
- int i;
+ const LayerTypeInfo *typeInfo;
+ int i;
if(!*block) return;
- for(i = 0; i < data->totlayer; ++i) {
- if(!(data->layers[i].flag & CD_FLAG_NOFREE)) {
- typeInfo = layerType_getInfo(data->layers[i].type);
+ for(i = 0; i < data->totlayer; ++i) {
+ if(!(data->layers[i].flag & CD_FLAG_NOFREE)) {
+ typeInfo = layerType_getInfo(data->layers[i].type);
- if(typeInfo->free) {
+ if(typeInfo->free) {
int offset = data->layers[i].offset;
typeInfo->free((char*)*block + offset, 1, typeInfo->size);
}
- }
- }
+ }
+ }
BLI_mempool_free(data->pool, *block);
*block = NULL;
@@ -1955,7 +1955,7 @@ static void CustomData_bmesh_alloc_block(CustomData *data, void **block)
}
void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
- void *src_block, void **dest_block)
+ void *src_block, void **dest_block)
{
const LayerTypeInfo *typeInfo;
int dest_i, src_i;
@@ -1971,7 +1971,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -2049,7 +2049,7 @@ void CustomData_bmesh_set_n(CustomData *data, void *block, int type, int n, void
}
void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights,
- float *sub_weights, int count, void *dest_block)
+ float *sub_weights, int count, void *dest_block)
{
int i, j;
void *source_buf[SOURCE_BUF_SIZE];
@@ -2060,7 +2060,7 @@ void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights
*/
if(count > SOURCE_BUF_SIZE)
sources = MEM_callocN(sizeof(*sources) * count,
- "CustomData_interp sources");
+ "CustomData_interp sources");
/* interpolates a layer at a time */
for(i = 0; i < data->totlayer; ++i) {
@@ -2071,7 +2071,7 @@ void CustomData_bmesh_interp(CustomData *data, void **src_blocks, float *weights
sources[j] = (char *)src_blocks[j] + layer->offset;
typeInfo->interp(sources, weights, sub_weights, count,
- (char *)dest_block + layer->offset);
+ (char *)dest_block + layer->offset);
}
}
@@ -2097,7 +2097,7 @@ void CustomData_bmesh_set_default(CustomData *data, void **block)
}
void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
- int src_index, void **dest_block)
+ int src_index, void **dest_block)
{
const LayerTypeInfo *typeInfo;
int dest_i, src_i, src_offset;
@@ -2113,7 +2113,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -2143,7 +2143,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
}
void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
- void *src_block, int dest_index)
+ void *src_block, int dest_index)
{
const LayerTypeInfo *typeInfo;
int dest_i, src_i, dest_offset;
@@ -2156,7 +2156,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while(dest_i < dest->totlayer
- && dest->layers[dest_i].type < source->layers[src_i].type)
+ && dest->layers[dest_i].type < source->layers[src_i].type)
++dest_i;
/* if there are no more dest layers, we're done */
@@ -2296,8 +2296,8 @@ int CustomData_verify_versions(struct CustomData *data, int index)
}
if (!keeplayer) {
- for (i=index+1; i < data->totlayer; ++i)
- data->layers[i-1] = data->layers[i];
+ for (i=index+1; i < data->totlayer; ++i)
+ data->layers[i-1] = data->layers[i];
data->totlayer--;
}
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 397a0526160..4e0270315ad 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -951,7 +951,7 @@ static void dag_node_print_dependency_cycle(DagForest *dag, DagNode *startnode,
{
DagNode *node;
- for(node = dag->DagNode.first; node; node= node->next)
+ for(node = dag->DagNode.first; node; node= node->next)
node->color= DAG_WHITE;
printf(" %s depends on %s through %s.\n", dag_node_name(endnode), dag_node_name(startnode), name);
@@ -1533,7 +1533,7 @@ int is_acyclic( DagForest *dag) {
void set_node_xy(DagNode *node, float x, float y)
{
- node->x = x;
+ node->x = x;
node->y = y;
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index ed7d11872c1..3480564e00e 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -490,7 +490,7 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un
float *orco, *vnors, *nors, imat[3][3], mat[4][4], vec[3];
int a, i, need_orco, totface, totvert;
CustomDataMask dataMask = CD_MASK_BAREMESH | CD_MASK_MCOL
- | CD_MASK_MTFACE | CD_MASK_NORMAL;
+ | CD_MASK_MTFACE | CD_MASK_NORMAL;
init_fastshade_for_ob(re, ob, &need_orco, mat, imat);
@@ -1365,7 +1365,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
}
} else {
if (ELEM(ob->type, OB_CURVE, OB_FONT) && (cu->flag & CU_DEFORM_FILL)) {
- curve_to_filledpoly(cu, nurb, &cu->disp);
+ curve_to_filledpoly(cu, nurb, dispbase);
}
dm= CDDM_from_curve_customDB(ob, dispbase);
@@ -1784,9 +1784,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
if(cu->flag & CU_PATH) calc_curvepath(ob);
- if (!forRender) {
- tex_space_curve(cu);
- }
+ if (!forRender) {
+ tex_space_curve(cu);
+ }
if(!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts);
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 14375c23d57..66e7f805f50 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -955,15 +955,15 @@ void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *
}
/* -------- pdDoEffectors() --------
- generic force/speed system, now used for particles and softbodies
- scene = scene where it runs in, for time and stuff
+ generic force/speed system, now used for particles and softbodies
+ scene = scene where it runs in, for time and stuff
lb = listbase with objects that take part in effecting
opco = global coord, as input
- force = force accumulator
- speed = actual current speed which can be altered
+ force = force accumulator
+ speed = actual current speed which can be altered
cur_time = "external" time in frames, is constant for static particles
loc_time = "local" time in frames, range <0-1> for the lifetime of particle
- par_layer = layer the caller is in
+ par_layer = layer the caller is in
flags = only used for softbody wind now
guide = old speed of particle
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c
index 772a589f520..91c5a633ff6 100644
--- a/source/blender/blenkernel/intern/exotic.c
+++ b/source/blender/blenkernel/intern/exotic.c
@@ -129,19 +129,19 @@ static int is_stl(char *str)
#define READSTLVERT { \
if (fread(mvert->co, sizeof(float), 3, fpSTL) != 3) { \
- char error_msg[255]; \
- MEM_freeN(vertdata); \
- MEM_freeN(facedata); \
- fclose(fpSTL); \
- sprintf(error_msg, "Problems reading face %d!", i); \
- return; \
+ char error_msg[255]; \
+ MEM_freeN(vertdata); \
+ MEM_freeN(facedata); \
+ fclose(fpSTL); \
+ sprintf(error_msg, "Problems reading face %d!", i); \
+ return; \
} \
else { \
- if (ENDIAN_ORDER==B_ENDIAN) { \
- SWITCH_INT(mvert->co[0]); \
- SWITCH_INT(mvert->co[1]); \
- SWITCH_INT(mvert->co[2]); \
- } \
+ if (ENDIAN_ORDER==B_ENDIAN) { \
+ SWITCH_INT(mvert->co[0]); \
+ SWITCH_INT(mvert->co[1]); \
+ SWITCH_INT(mvert->co[2]); \
+ } \
} \
}
@@ -267,9 +267,9 @@ static void read_stl_mesh_binary(Scene *scene, char *str)
me->totvert = totvert;
me->totface = totface;
me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN,
- vertdata, totvert);
+ vertdata, totvert);
me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN,
- facedata, totface);
+ facedata, totface);
mesh_add_normals_flags(me);
make_edges(me, 0);
@@ -410,9 +410,9 @@ static void read_stl_mesh_ascii(Scene *scene, char *str)
me->totface = totface;
me->totvert = totvert;
me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC,
- NULL, totvert);
+ NULL, totvert);
me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC,
- NULL, totface);
+ NULL, totface);
/* Copy vert coords and create topology */
mvert = me->mvert;
@@ -862,7 +862,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb)
/* count the nr of lines */
tot= 0;
index= iv->data[0];
- lll = iv->datalen[0]-1;
+ lll = iv->datalen[0]-1;
for(a=0; a<lll; a++) {
if(index[0]!= -1 && index[1]!= -1) tot++;
index++;
@@ -1009,7 +1009,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb)
}
/* indices */
- lll = index[0] - 2;
+ lll = index[0] - 2;
for(b=0; b<lll; b++) {
idata[0]= first;
idata[1]= first+1;
@@ -1045,7 +1045,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb)
/* count triangles */
face= 0;
index= iv->data[0];
- lll = iv->datalen[0]-2;
+ lll = iv->datalen[0]-2;
for(a=0; a<lll; a++) {
if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) face++;
index++;
@@ -1123,7 +1123,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb)
/* count triangles */
face= 0;
index= iv->data[0];
- lll=iv->datalen[0]-2;
+ lll=iv->datalen[0]-2;
for(a=0; a<lll; a++) {
if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) face++;
index++;
@@ -1155,7 +1155,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb)
index= iv->data[0];
idata= dl->index;
- lll=iv->datalen[0]-2;
+ lll=iv->datalen[0]-2;
for(a=lll; a>0; a--) {
if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) {
@@ -1476,9 +1476,9 @@ static void displist_to_mesh(Scene *scene, DispList *dlfirst)
me->totvert= totvert;
me->totface= totface;
me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC,
- NULL, me->totvert);
+ NULL, me->totvert);
me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC,
- NULL, me->totface);
+ NULL, me->totface);
maxvertidx= totvert-1;
mvert= me->mvert;
@@ -1956,8 +1956,8 @@ void write_stl(Scene *scene, char *str)
fseek(fpSTL, 80, SEEK_SET);
if (ENDIAN_ORDER==B_ENDIAN) {
- SWITCH_INT(numfacets);
- }
+ SWITCH_INT(numfacets);
+ }
fwrite(&numfacets, 4*sizeof(char), 1, fpSTL);
fclose(fpSTL);
@@ -2574,13 +2574,13 @@ void write_dxf(struct Scene *scene, char *str)
/* The header part of the DXF */
write_group(0, "SECTION");
- write_group(2, "HEADER");
+ write_group(2, "HEADER");
write_group(0, "ENDSEC");
/* The blocks part of the DXF */
write_group(0, "SECTION");
- write_group(2, "BLOCKS");
+ write_group(2, "BLOCKS");
/* only write meshes we're using in this scene */
@@ -2604,7 +2604,7 @@ void write_dxf(struct Scene *scene, char *str)
/* The entities part of the DXF */
write_group(0, "SECTION");
- write_group(2, "ENTITIES");
+ write_group(2, "ENTITIES");
/* Write all the mesh objects */
base= scene->base.first;
@@ -3056,7 +3056,7 @@ static void dxf_read_line(Scene *scene, int noob) {
hasbumped=1;
}
- /* 2D Polyline state vars */
+ /* 2D Polyline state vars */
static Object *p2dhold=NULL;
static Mesh *p2dmhold=NULL;
static char oldplay[32];
@@ -3131,35 +3131,35 @@ static void dxf_read_ellipse(Scene *scene, int noob)
read_group(id, val);
while(id!=0) {
if (id==8) {
- BLI_strncpy(layname, val, sizeof(layname));
+ BLI_strncpy(layname, val, sizeof(layname));
} else if (id==10) {
- center[0]= (float) atof(val);
+ center[0]= (float) atof(val);
} else if (id==20) {
- center[1]= (float) atof(val);
+ center[1]= (float) atof(val);
} else if (id==30) {
- center[2]= (float) atof(val);
+ center[2]= (float) atof(val);
} else if (id==11) {
- axis_endpoint[0]= (float) atof(val);
+ axis_endpoint[0]= (float) atof(val);
} else if (id==21) {
- axis_endpoint[1]= (float) atof(val);
+ axis_endpoint[1]= (float) atof(val);
} else if (id==31) {
- axis_endpoint[2]= (float) atof(val);
+ axis_endpoint[2]= (float) atof(val);
} else if (id==40) {
- axis_ratio = (float) atof(val);
+ axis_ratio = (float) atof(val);
} else if (id==41) {
printf("dxf: start = %f", atof(val) * 180/M_PI);
- start_angle = -atof(val) + M_PI_2;
+ start_angle = -atof(val) + M_PI_2;
} else if (id==42) {
printf("dxf: end = %f", atof(val) * 180/M_PI);
end_angle = -atof(val) + M_PI_2;
} else if (id==62) {
- int colorid= atoi(val);
- CLAMP(colorid, 1, 255);
- dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]);
+ int colorid= atoi(val);
+ CLAMP(colorid, 1, 255);
+ dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]);
} else if (id==67) {
- vspace= atoi(val);
+ vspace= atoi(val);
} else if (id==100) {
- isArc = 1;
+ isArc = 1;
} else if (id==210) {
extrusion[0] = atof(val);
} else if (id==220) {
@@ -3290,28 +3290,28 @@ static void dxf_read_arc(Scene *scene, int noob)
read_group(id, val);
while(id!=0) {
if (id==8) {
- BLI_strncpy(layname, val, sizeof(layname));
+ BLI_strncpy(layname, val, sizeof(layname));
} else if (id==10) {
- center[0]= (float) atof(val);
+ center[0]= (float) atof(val);
} else if (id==20) {
- center[1]= (float) atof(val);
+ center[1]= (float) atof(val);
} else if (id==30) {
- center[2]= (float) atof(val);
+ center[2]= (float) atof(val);
} else if (id==40) {
- dia = (float) atof(val);
+ dia = (float) atof(val);
} else if (id==62) {
- int colorid= atoi(val);
+ int colorid= atoi(val);
- CLAMP(colorid, 1, 255);
- dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]);
+ CLAMP(colorid, 1, 255);
+ dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]);
} else if (id==67) {
- vspace= atoi(val);
+ vspace= atoi(val);
} else if (id==100) {
- isArc = 1;
+ isArc = 1;
} else if (id==50) {
- start_angle = (90 - atoi(val)) * M_PI/180.0;
+ start_angle = (90 - atoi(val)) * M_PI/180.0;
} else if (id==51) {
- end_angle = (90 - atoi(val)) * M_PI/180.0;
+ end_angle = (90 - atoi(val)) * M_PI/180.0;
} else if (id==210) {
extrusion[0] = atof(val);
} else if (id==220) {
diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c
index 22eb0578f72..118a44507c9 100644
--- a/source/blender/blenkernel/intern/fluidsim.c
+++ b/source/blender/blenkernel/intern/fluidsim.c
@@ -148,7 +148,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
fss->lastgoodframe = -1;
- fss->flag = 0;
+ fss->flag |= OB_FLUIDSIM_ACTIVE;
}
#endif
@@ -609,9 +609,9 @@ void fluid_get_bb(MVert *mvert, int totvert, float obmat[][4],
//-------------------------------------------------------------------------------
void initElbeemMesh(struct Scene *scene, struct Object *ob,
- int *numVertices, float **vertices,
- int *numTriangles, int **triangles,
- int useGlobalCoords, int modifierIndex)
+ int *numVertices, float **vertices,
+ int *numTriangles, int **triangles,
+ int useGlobalCoords, int modifierIndex)
{
DerivedMesh *dm = NULL;
MVert *mvert;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 6c73a3ae64c..d4a5b5b2531 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -305,10 +305,10 @@ static void fcm_fn_generator_new_data (void *mdata)
*/
static double sinc (double x)
{
- if (fabs(x) < 0.0001)
- return 1.0;
- else
- return sin(M_PI * x) / (M_PI * x);
+ if (fabs(x) < 0.0001)
+ return 1.0;
+ else
+ return sin(M_PI * x) / (M_PI * x);
}
static void fcm_fn_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime)
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 1ca39bbaac4..9b8c05ac88c 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -160,7 +160,7 @@ According to RFC 3629 "UTF-8, a transformation format of ISO 10646"
(http://tools.ietf.org/html/rfc3629), the valid UTF-8 encoding are:
Char. number range | UTF-8 octet sequence
- (hexadecimal) | (binary)
+ (hexadecimal) | (binary)
--------------------+---------------------------------------------
0000 0000-0000 007F | 0xxxxxxx
0000 0080-0000 07FF | 110xxxxx 10xxxxxx
@@ -202,7 +202,7 @@ int utf8towchar(wchar_t *w, char *c)
*w = '?';
}
} else
- *w=(c[0] & 0x7f);
+ *w=(c[0] & 0x7f);
c++;
w++;
@@ -832,8 +832,8 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
linedata4[lnr]= wsnr;
if ( (tb->h != 0.0) &&
- ((-(yof-(tb->y/cu->fsize))) > ((tb->h/cu->fsize)-(linedist*cu->fsize))) &&
- (cu->totbox > (curbox+1)) ) {
+ ((-(yof-(tb->y/cu->fsize))) > ((tb->h/cu->fsize)-(linedist*cu->fsize))) &&
+ (cu->totbox > (curbox+1)) ) {
maxlen= 0;
tb++;
curbox++;
@@ -927,13 +927,13 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
ct++;
}
} else if((cu->spacemode==CU_FLUSH) &&
- (cu->tb[0].w != 0.0)) {
+ (cu->tb[0].w != 0.0)) {
for(i=0;i<lnr;i++)
if(linedata2[i]>1)
linedata[i]= (linedata3[i]-linedata[i])/(linedata2[i]-1);
for (i=0; i<=slen; i++) {
for (j=i; (mem[j]) && (mem[j]!='\n') &&
- (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++);
+ (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++);
// if ((mem[j]!='\r') && (mem[j]!='\n') && (mem[j])) {
ct->xof+= ct->charnr*linedata[ct->linenr];
// }
@@ -944,10 +944,10 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
float curofs= 0.0f;
for (i=0; i<=slen; i++) {
for (j=i; (mem[j]) && (mem[j]!='\n') &&
- (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++);
+ (mem[j]!='\r') && (chartransdata[j].dobreak==0) && (j<slen); j++);
if ((mem[j]!='\r') && (mem[j]!='\n') &&
- ((chartransdata[j].dobreak!=0))) {
- if (mem[i]==' ') curofs += (linedata3[ct->linenr]-linedata[ct->linenr])/linedata4[ct->linenr];
+ ((chartransdata[j].dobreak!=0))) {
+ if (mem[i]==' ') curofs += (linedata3[ct->linenr]-linedata[ct->linenr])/linedata4[ct->linenr];
ct->xof+= curofs;
}
if (mem[i]=='\n' || mem[i]=='\r' || chartransdata[i].dobreak) curofs= 0;
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 7981c66d2f6..98b3522059c 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -289,12 +289,12 @@ IDProperty *IDP_CopyArray(IDProperty *prop)
/*taken from readfile.c*/
#define SWITCH_LONGINT(a) { \
- char s_i, *p_i; \
- p_i= (char *)&(a); \
- s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \
- s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \
- s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \
- s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; }
+ char s_i, *p_i; \
+ p_i= (char *)&(a); \
+ s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \
+ s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \
+ s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \
+ s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; }
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 85f15094740..1a3c53e293f 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -446,16 +446,16 @@ static ImBuf *add_ibuf_size(int width, int height, char *name, int floatbuf, sho
strcpy(ibuf->name, "//Untitled");
ibuf->userflags |= IB_BITMAPDIRTY;
- switch(uvtestgrid) {
- case 1:
- BKE_image_buf_fill_checker(rect, rect_float, width, height);
- break;
- case 2:
- BKE_image_buf_fill_checker_color(rect, rect_float, width, height);
- break;
- default:
- BKE_image_buf_fill_color(rect, rect_float, width, height, color);
- }
+ switch(uvtestgrid) {
+ case 1:
+ BKE_image_buf_fill_checker(rect, rect_float, width, height);
+ break;
+ case 2:
+ BKE_image_buf_fill_checker_color(rect, rect_float, width, height);
+ break;
+ default:
+ BKE_image_buf_fill_color(rect, rect_float, width, height, color);
+ }
return ibuf;
}
diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c
index 2c4851b1835..eb256e3775b 100644
--- a/source/blender/blenkernel/intern/image_gen.c
+++ b/source/blender/blenkernel/intern/image_gen.c
@@ -73,8 +73,8 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt
int checkerwidth= 32, dark= 1;
int x, y;
- unsigned char *rect_orig= rect;
- float *rect_float_orig= rect_float;
+ unsigned char *rect_orig= rect;
+ float *rect_float_orig= rect_float;
float h=0.0, hoffs=0.0, hue=0.0, s=0.9, v=0.9, r, g, b;
@@ -109,8 +109,8 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt
}
}
- rect= rect_orig;
- rect_float= rect_float_orig;
+ rect= rect_orig;
+ rect_float= rect_float_orig;
/* 2nd pass, colored + */
for(y= 0; y<height; y++) {
@@ -179,12 +179,12 @@ static void checker_board_color_fill(unsigned char *rect, float *rect_float, int
sat= 1.0;
hue_step= larger_pow2(width / 8);
- if(hue_step < 8) hue_step= 8;
+ if(hue_step < 8) hue_step= 8;
for(y= 0; y < height; y++)
{
- val= 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */
+ val= 0.1 + (y * (0.4 / height)); /* use a number lower then 1.0 else its too bright */
for(x= 0; x < width; x++)
{
hue= (float)((double)(x/hue_step) * 1.0 / width * hue_step);
@@ -301,55 +301,55 @@ extern void stamp_font_begin(int size);
static void checker_board_text(unsigned char *rect, float *rect_float, int width, int height, int step, int outline)
{
- int x, y;
- int pen_x, pen_y;
- char text[3]= {'A', '1', '\0'};
+ int x, y;
+ int pen_x, pen_y;
+ char text[3]= {'A', '1', '\0'};
- /* hard coded size! */
+ /* hard coded size! */
stamp_font_begin(54);
- BLF_buffer(rect_float, rect, width, height, 4);
+ BLF_buffer(rect_float, rect, width, height, 4);
for(y= 0; y < height; y+=step)
{
- text[1]= '1';
+ text[1]= '1';
for(x= 0; x < width; x+=step)
{
- /* hard coded offset */
- pen_x = x + 33;
- pen_y = y + 44;
+ /* hard coded offset */
+ pen_x = x + 33;
+ pen_y = y + 44;
- /* terribly crappy outline font! */
- BLF_buffer_col(1.0, 1.0, 1.0, 1.0);
-
- BLF_position(pen_x-outline, pen_y, 0.0);
- BLF_draw_buffer(text);
- BLF_position(pen_x+outline, pen_y, 0.0);
- BLF_draw_buffer(text);
- BLF_position(pen_x, pen_y-outline, 0.0);
- BLF_draw_buffer(text);
- BLF_position(pen_x, pen_y+outline, 0.0);
- BLF_draw_buffer(text);
+ /* terribly crappy outline font! */
+ BLF_buffer_col(1.0, 1.0, 1.0, 1.0);
+
+ BLF_position(pen_x-outline, pen_y, 0.0);
+ BLF_draw_buffer(text);
+ BLF_position(pen_x+outline, pen_y, 0.0);
+ BLF_draw_buffer(text);
+ BLF_position(pen_x, pen_y-outline, 0.0);
+ BLF_draw_buffer(text);
+ BLF_position(pen_x, pen_y+outline, 0.0);
+ BLF_draw_buffer(text);
- BLF_position(pen_x-outline, pen_y-outline, 0.0);
- BLF_draw_buffer(text);
- BLF_position(pen_x+outline, pen_y+outline, 0.0);
- BLF_draw_buffer(text);
- BLF_position(pen_x-outline, pen_y+outline, 0.0);
- BLF_draw_buffer(text);
- BLF_position(pen_x+outline, pen_y-outline, 0.0);
- BLF_draw_buffer(text);
-
- BLF_buffer_col(0.0, 0.0, 0.0, 1.0);
- BLF_position(pen_x, pen_y, 0.0);
- BLF_draw_buffer(text);
+ BLF_position(pen_x-outline, pen_y-outline, 0.0);
+ BLF_draw_buffer(text);
+ BLF_position(pen_x+outline, pen_y+outline, 0.0);
+ BLF_draw_buffer(text);
+ BLF_position(pen_x-outline, pen_y+outline, 0.0);
+ BLF_draw_buffer(text);
+ BLF_position(pen_x+outline, pen_y-outline, 0.0);
+ BLF_draw_buffer(text);
+
+ BLF_buffer_col(0.0, 0.0, 0.0, 1.0);
+ BLF_position(pen_x, pen_y, 0.0);
+ BLF_draw_buffer(text);
- text[1]++;
+ text[1]++;
}
- text[0]++;
+ text[0]++;
}
- /* cleanup the buffer. */
+ /* cleanup the buffer. */
BLF_buffer(0, 0, 0, 0, 0);
}
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 2c0ca0f69f9..cd3326857c7 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1811,7 +1811,7 @@ void do_versions_ipos_to_animato(Main *main)
Sequence * seq;
for(seq = scene->ed->seqbasep->first;
- seq; seq = seq->next) {
+ seq; seq = seq->next) {
short adrcode = SEQ_FAC1;
if (G.f & G_DEBUG)
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 9c78742ada0..31b0a809ebe 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -178,11 +178,11 @@ Key *copy_key(Key *key)
void make_local_key(Key *key)
{
- /* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
- if(key==0) return;
+ /* - only lib users: do nothing
+ * - only local users: set flag
+ * - mixed: make copy
+ */
+ if(key==0) return;
key->id.lib= 0;
new_id(0, (ID *)key, 0);
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 347fd01299f..b7003f45626 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -714,7 +714,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
/* find the group (weak loop-in-loop) */
for(index = 0, curdef = target->defbase.first; curdef;
- curdef = curdef->next, index++)
+ curdef = curdef->next, index++)
if (!strcmp(curdef->name, vgroup))
break;
@@ -746,7 +746,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
VECCOPY(vec, vertexCos[a]);
calc_curve_deform(scene, cuOb, vec, defaxis, &cd, NULL);
interp_v3_v3v3(vertexCos[a], vertexCos[a], vec,
- dvert->dw[j].weight);
+ dvert->dw[j].weight);
mul_m4_v3(cd.objectspace, vertexCos[a]);
break;
}
@@ -804,7 +804,7 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target, float *orco
}
void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
- float (*vertexCos)[3], int numVerts, char *vgroup)
+ float (*vertexCos)[3], int numVerts, char *vgroup)
{
int a;
int use_vgroups;
@@ -834,7 +834,7 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
/* find the group (weak loop-in-loop) */
for(curdef = target->defbase.first; curdef;
- curdef = curdef->next, index++)
+ curdef = curdef->next, index++)
if(!strcmp(curdef->name, vgroup)) break;
if(curdef && (me->dvert || dm)) {
@@ -865,7 +865,7 @@ int object_deform_mball(Object *ob)
for (dl=ob->disp.first; dl; dl=dl->next) {
lattice_deform_verts(ob->parent, ob, NULL,
- (float(*)[3]) dl->verts, dl->nr, NULL);
+ (float(*)[3]) dl->verts, dl->nr, NULL);
}
return 1;
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 91e53742fea..bea641d2140 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -598,10 +598,10 @@ static ID *alloc_libblock_notest(short type)
break;
case ID_PA:
id = MEM_callocN(sizeof(ParticleSettings), "ParticleSettings");
- break;
+ break;
case ID_WM:
id = MEM_callocN(sizeof(wmWindowManager), "Window manager");
- break;
+ break;
case ID_GD:
id = MEM_callocN(sizeof(bGPdata), "Grease Pencil");
break;
@@ -682,7 +682,7 @@ void *copy_libblock(void *rt)
static void free_library(Library *lib)
{
- /* no freeing needed for libraries yet */
+ /* no freeing needed for libraries yet */
}
static void (*free_windowmanager_cb)(bContext *, wmWindowManager *)= NULL;
@@ -1362,17 +1362,17 @@ void text_idbutton(struct ID *id, char *text)
if(id) {
if(GS(id->name)==ID_SCE)
strcpy(text, "SCE: ");
- else if(GS(id->name)==ID_SCE)
+ else if(GS(id->name)==ID_SCE)
strcpy(text, "SCR: ");
- else if(GS(id->name)==ID_MA && ((Material*)id)->use_nodes)
+ else if(GS(id->name)==ID_MA && ((Material*)id)->use_nodes)
strcpy(text, "NT: ");
- else {
+ else {
text[0]= id->name[0];
text[1]= id->name[1];
text[2]= ':';
text[3]= ' ';
text[4]= 0;
- }
+ }
}
else
strcpy(text, "");
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 9a1177f0f84..6d1f9d1d1bf 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -245,9 +245,9 @@ void make_local_material(Material *ma)
int a, local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(ma->id.lib==0) return;
if(ma->id.us==1) {
@@ -1065,15 +1065,15 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col)
}
break;
case MA_RAMP_DARK:
- tmp=col[0]+((1-col[0])*facm);
- if(tmp < *r) *r= tmp;
- if(g) {
- tmp=col[1]+((1-col[1])*facm);
- if(tmp < *g) *g= tmp;
- tmp=col[2]+((1-col[2])*facm);
- if(tmp < *b) *b= tmp;
- }
- break;
+ tmp=col[0]+((1-col[0])*facm);
+ if(tmp < *r) *r= tmp;
+ if(g) {
+ tmp=col[1]+((1-col[1])*facm);
+ if(tmp < *g) *g= tmp;
+ tmp=col[2]+((1-col[2])*facm);
+ if(tmp < *b) *b= tmp;
+ }
+ break;
case MA_RAMP_LIGHT:
tmp= fac*col[0];
if(tmp > *r) *r= tmp;
@@ -1125,7 +1125,7 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col)
if(tmp <= 0.0f)
*r = 0.0f;
else if (( tmp = (1.0f - (1.0f - (*r)) / tmp )) < 0.0f)
- *r = 0.0f;
+ *r = 0.0f;
else if (tmp > 1.0f)
*r=1.0f;
else
@@ -1136,17 +1136,17 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col)
if(tmp <= 0.0f)
*g = 0.0f;
else if (( tmp = (1.0f - (1.0f - (*g)) / tmp )) < 0.0f )
- *g = 0.0f;
+ *g = 0.0f;
else if(tmp >1.0f)
*g=1.0f;
else
*g = tmp;
- tmp = facm + fac*col[2];
- if(tmp <= 0.0f)
+ tmp = facm + fac*col[2];
+ if(tmp <= 0.0f)
*b = 0.0f;
else if (( tmp = (1.0f - (1.0f - (*b)) / tmp )) < 0.0f )
- *b = 0.0f;
+ *b = 0.0f;
else if(tmp >1.0f)
*b= 1.0f;
else
@@ -1203,36 +1203,36 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col)
}
}
break;
- case MA_RAMP_SOFT:
- if (g){
- float scr, scg, scb;
+ case MA_RAMP_SOFT:
+ if (g){
+ float scr, scg, scb;
- /* first calculate non-fac based Screen mix */
- scr = 1.0f - (1.0f - col[0]) * (1.0f - *r);
- scg = 1.0f - (1.0f - col[1]) * (1.0f - *g);
- scb = 1.0f - (1.0f - col[2]) * (1.0f - *b);
+ /* first calculate non-fac based Screen mix */
+ scr = 1.0f - (1.0f - col[0]) * (1.0f - *r);
+ scg = 1.0f - (1.0f - col[1]) * (1.0f - *g);
+ scb = 1.0f - (1.0f - col[2]) * (1.0f - *b);
- *r = facm*(*r) + fac*(((1.0f - *r) * col[0] * (*r)) + (*r * scr));
- *g = facm*(*g) + fac*(((1.0f - *g) * col[1] * (*g)) + (*g * scg));
- *b = facm*(*b) + fac*(((1.0f - *b) * col[2] * (*b)) + (*b * scb));
- }
- break;
- case MA_RAMP_LINEAR:
- if (col[0] > 0.5f)
- *r = *r + fac*(2.0f*(col[0]-0.5f));
- else
- *r = *r + fac*(2.0f*(col[0]) - 1.0f);
- if (g){
- if (col[1] > 0.5f)
- *g = *g + fac*(2.0f*(col[1]-0.5f));
- else
- *g = *g + fac*(2.0f*(col[1]) -1.0f);
- if (col[2] > 0.5f)
- *b = *b + fac*(2.0f*(col[2]-0.5f));
- else
- *b = *b + fac*(2.0f*(col[2]) - 1.0f);
- }
- break;
+ *r = facm*(*r) + fac*(((1.0f - *r) * col[0] * (*r)) + (*r * scr));
+ *g = facm*(*g) + fac*(((1.0f - *g) * col[1] * (*g)) + (*g * scg));
+ *b = facm*(*b) + fac*(((1.0f - *b) * col[2] * (*b)) + (*b * scb));
+ }
+ break;
+ case MA_RAMP_LINEAR:
+ if (col[0] > 0.5f)
+ *r = *r + fac*(2.0f*(col[0]-0.5f));
+ else
+ *r = *r + fac*(2.0f*(col[0]) - 1.0f);
+ if (g){
+ if (col[1] > 0.5f)
+ *g = *g + fac*(2.0f*(col[1]-0.5f));
+ else
+ *g = *g + fac*(2.0f*(col[1]) -1.0f);
+ if (col[2] > 0.5f)
+ *b = *b + fac*(2.0f*(col[2]-0.5f));
+ else
+ *b = *b + fac*(2.0f*(col[2]) - 1.0f);
+ }
+ break;
}
}
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index d65870b71ce..98578312766 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -686,7 +686,7 @@ void *new_pgn_element(int size)
if(cur) {
if(size+offs < blocksize) {
adr= (void *) (cur->data+offs);
- offs+= size;
+ offs+= size;
return adr;
}
}
@@ -1091,7 +1091,7 @@ int getedge (EDGELIST *table[],
q = table[HASH(i1, j1, k1)+HASH(i2, j2, k2)];
for (; q != NULL; q = q->next)
if (q->i1 == i1 && q->j1 == j1 && q->k1 == k1 &&
- q->i2 == i2 && q->j2 == j2 && q->k2 == k2)
+ q->i2 == i2 && q->j2 == j2 && q->k2 == k2)
return q->vid;
return -1;
}
@@ -1240,7 +1240,7 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
p->z = neg.z;
return;
}
- if((dx == 0.0f) && (dz == 0.0f)){
+ if((dx == 0.0f) && (dz == 0.0f)){
p->x = neg.x;
p->y = neg.y - negative*dy/(positive-negative);
p->z = neg.z;
@@ -1272,7 +1272,7 @@ void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2,
p->y = 0.5f*(pos.y + neg.y);
if ((function(p->x,p->y,p->z)) > 0.0) pos.y = p->y; else neg.y = p->y;
}
- }
+ }
if((dx == 0.0f) && (dy == 0.0f)){
p->x = neg.x;
@@ -1580,7 +1580,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
if(ml->s > 10.0) ml->s = 10.0;
/* 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);
@@ -2120,8 +2120,8 @@ void metaball_polygonize(Scene *scene, Object *ob)
/* don't polygonize metaballs with too high resolution (base mball to small) */
if(metaball_tree) {
if(ob->size[0]<=0.0001f*(metaball_tree->first->x_max - metaball_tree->first->x_min) ||
- ob->size[1]<=0.0001f*(metaball_tree->first->y_max - metaball_tree->first->y_min) ||
- ob->size[2]<=0.0001f*(metaball_tree->first->z_max - metaball_tree->first->z_min))
+ ob->size[1]<=0.0001f*(metaball_tree->first->y_max - metaball_tree->first->y_min) ||
+ ob->size[2]<=0.0001f*(metaball_tree->first->z_max - metaball_tree->first->z_min))
{
MEM_freeN(mainb);
return;
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 15f9fc4ac11..543895a5973 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -108,7 +108,7 @@ void unlink_mesh(Mesh *me)
}
if(me->key) {
- me->key->id.us--;
+ me->key->id.us--;
if (me->key->id.us == 0 && me->key->ipo )
me->key->ipo->id.us--;
}
@@ -274,9 +274,9 @@ void make_local_mesh(Mesh *me)
int local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(me->id.lib==0) return;
if(me->id.us==1) {
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 4c4abf80db4..5cda09cad85 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -42,6 +42,7 @@
#include "BLI_kdtree.h"
#include "BLI_rand.h"
+#include "BLI_uvproject.h"
#include "MEM_guardedalloc.h"
@@ -68,6 +69,7 @@
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_scene.h"
@@ -204,7 +206,7 @@ static int curveModifier_isDisabled(ModifierData *md, int userRenderParams)
}
static void curveModifier_foreachObjectLink(
- ModifierData *md, Object *ob,
+ ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
void *userData)
{
@@ -215,7 +217,7 @@ static void curveModifier_foreachObjectLink(
static void curveModifier_updateDepgraph(
ModifierData *md, DagForest *forest, Scene *scene,
- Object *ob, DagNode *obNode)
+ Object *ob, DagNode *obNode)
{
CurveModifierData *cmd = (CurveModifierData*) md;
@@ -228,7 +230,7 @@ static void curveModifier_updateDepgraph(
}
static void curveModifier_deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ ModifierData *md, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
CurveModifierData *cmd = (CurveModifierData*) md;
@@ -239,7 +241,7 @@ static void curveModifier_deformVerts(
static void curveModifier_deformVertsEM(
ModifierData *md, Object *ob, EditMesh *editData,
- DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+ DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
@@ -280,7 +282,7 @@ static int latticeModifier_isDisabled(ModifierData *md, int userRenderParams)
}
static void latticeModifier_foreachObjectLink(
- ModifierData *md, Object *ob,
+ ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
void *userData)
{
@@ -317,7 +319,7 @@ static void modifier_vgroup_cache(ModifierData *md, float (*vertexCos)[3])
static void latticeModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
LatticeModifierData *lmd = (LatticeModifierData*) md;
@@ -325,12 +327,12 @@ static void latticeModifier_deformVerts(
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
lattice_deform_verts(lmd->object, ob, derivedData,
- vertexCos, numVerts, lmd->name);
+ vertexCos, numVerts, lmd->name);
}
static void latticeModifier_deformVertsEM(
ModifierData *md, Object *ob, EditMesh *editData,
- DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+ DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
@@ -463,22 +465,22 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob,
maxVerts = dm->getNumVerts(dm);
vertMap = MEM_callocN(sizeof(*vertMap) * maxVerts,
- "build modifier vertMap");
+ "build modifier vertMap");
for(i = 0; i < maxVerts; ++i) vertMap[i] = i;
maxEdges = dm->getNumEdges(dm);
edgeMap = MEM_callocN(sizeof(*edgeMap) * maxEdges,
- "build modifier edgeMap");
+ "build modifier edgeMap");
for(i = 0; i < maxEdges; ++i) edgeMap[i] = i;
maxFaces = dm->getNumFaces(dm);
faceMap = MEM_callocN(sizeof(*faceMap) * maxFaces,
- "build modifier faceMap");
+ "build modifier faceMap");
for(i = 0; i < maxFaces; ++i) faceMap[i] = i;
if (ob) {
frac = bsystem_time(md->scene, ob, md->scene->r.cfra,
- bmd->start - 1.0f) / bmd->length;
+ bmd->start - 1.0f) / bmd->length;
} else {
frac = md->scene->r.cfra - bmd->start / bmd->length;
}
@@ -493,7 +495,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob,
if(bmd->randomize)
BLI_array_randomize(faceMap, sizeof(*faceMap),
- maxFaces, bmd->seed);
+ maxFaces, bmd->seed);
/* get the set of all vert indices that will be in the final mesh,
* mapped to the new indices
@@ -532,7 +534,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob,
} else if(numEdges) {
if(bmd->randomize)
BLI_array_randomize(edgeMap, sizeof(*edgeMap),
- maxEdges, bmd->seed);
+ maxEdges, bmd->seed);
/* get the set of all vert indices that will be in the final mesh,
* mapped to the new indices
@@ -563,7 +565,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob,
if(bmd->randomize)
BLI_array_randomize(vertMap, sizeof(*vertMap),
- maxVerts, bmd->seed);
+ maxVerts, bmd->seed);
/* get the set of all vert indices that will be in the final mesh,
* mapped to the new indices
@@ -576,7 +578,7 @@ static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob,
* the mesh
*/
result = CDDM_from_template(dm, BLI_ghash_size(vertHash),
- BLI_ghash_size(edgeHash), numFaces);
+ BLI_ghash_size(edgeHash), numFaces);
/* copy the vertices across */
for(hashIter = BLI_ghashIterator_new(vertHash);
@@ -662,7 +664,7 @@ static CustomDataMask maskModifier_requiredDataMask(Object *ob, ModifierData *md
}
static void maskModifier_foreachObjectLink(
- ModifierData *md, Object *ob,
+ ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
void *userData)
{
@@ -1028,7 +1030,7 @@ static void arrayModifier_copyData(ModifierData *md, ModifierData *target)
}
static void arrayModifier_foreachObjectLink(
- ModifierData *md, Object *ob,
+ ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
void *userData)
{
@@ -1124,13 +1126,13 @@ static int calc_mapping(IndexMapEntry *indexMap, int oldIndex, int copyNum)
return indexMap[oldIndex].new;
else
return calc_mapping(indexMap, indexMap[oldIndex].merge,
- copyNum - 1);
+ copyNum - 1);
}
}
static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
Scene *scene, Object *ob, DerivedMesh *dm,
- int initFlags)
+ int initFlags)
{
int i, j;
/* offset matrix */
@@ -1160,7 +1162,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
unit_m4(offset);
indexMap = MEM_callocN(sizeof(*indexMap) * dm->getNumVerts(dm),
- "indexmap");
+ "indexmap");
src_mvert = dm->getVertArray(dm);
@@ -1185,7 +1187,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
mul_serie_m4(result_mat, offset,
obinv, amd->offset_ob->obmat,
- NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
copy_m4_m4(offset, result_mat);
}
@@ -1542,12 +1544,12 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
mface[numFaces].v4 = vert_map[mface[numFaces].v4];
test_index_face(&mface[numFaces], &result->faceData,
- numFaces, 4);
+ numFaces, 4);
}
else
{
test_index_face(&mface[numFaces], &result->faceData,
- numFaces, 3);
+ numFaces, 3);
}
origindex[numFaces] = ORIGINDEX_NONE;
@@ -1643,12 +1645,12 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
mface[numFaces].v4 = vert_map[mface[numFaces].v4];
test_index_face(&mface[numFaces], &result->faceData,
- numFaces, 4);
+ numFaces, 4);
}
else
{
test_index_face(&mface[numFaces], &result->faceData,
- numFaces, 3);
+ numFaces, 3);
}
origindex[numFaces] = ORIGINDEX_NONE;
@@ -1714,7 +1716,7 @@ static void mirrorModifier_copyData(ModifierData *md, ModifierData *target)
}
static void mirrorModifier_foreachObjectLink(
- ModifierData *md, Object *ob,
+ ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
void *userData)
{
@@ -1924,7 +1926,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
}
static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd,
- Object *ob, DerivedMesh *dm,
+ Object *ob, DerivedMesh *dm,
int initFlags)
{
DerivedMesh *result = dm;
@@ -2198,7 +2200,7 @@ static void smoothmesh_print(SmoothMesh *mesh)
dm->getVert(dm, vert->oldIndex, &mv);
printf("%3d: ind={%3d, %3d}, pos={% 5.1f, % 5.1f, % 5.1f}",
- i, vert->oldIndex, vert->newIndex,
+ i, vert->oldIndex, vert->newIndex,
mv.co[0], mv.co[1], mv.co[2]);
printf(", faces={");
for(node = vert->faces; node != NULL; node = node->next) {
@@ -2213,7 +2215,7 @@ static void smoothmesh_print(SmoothMesh *mesh)
LinkNode *node;
printf("%4d: indices={%4d, %4d}, verts={%4d, %4d}",
- i,
+ i,
edge->oldIndex, edge->newIndex,
edge->verts[0]->newIndex, edge->verts[1]->newIndex);
if(edge->verts[0] == edge->verts[1]) printf(" <- DUPLICATE VERTEX");
@@ -2229,7 +2231,7 @@ static void smoothmesh_print(SmoothMesh *mesh)
SmoothFace *face = &mesh->faces[i];
printf("%4d: indices={%4d, %4d}, edges={", i,
- face->oldIndex, face->newIndex);
+ face->oldIndex, face->newIndex);
for(j = 0; j < SMOOTHFACE_MAX_EDGES && face->edges[j]; j++) {
if(face->flip[j])
printf(" -%-2d", face->edges[j]->newIndex);
@@ -2257,7 +2259,7 @@ static SmoothMesh *smoothmesh_from_derivedmesh(DerivedMesh *dm)
totface = dm->getNumFaces(dm);
mesh = smoothmesh_new(totvert, totedge, totface,
- totvert, totedge, totface);
+ totvert, totedge, totface);
mesh->dm = dm;
@@ -2390,7 +2392,7 @@ static SmoothVert *other_vert(SmoothEdge *edge, SmoothVert *vert)
* (this should never happen)
*/
static SmoothEdge *other_edge(SmoothFace *face, SmoothVert *vert,
- SmoothEdge *edge)
+ SmoothEdge *edge)
{
int i,j;
for(i = 0; i < SMOOTHFACE_MAX_EDGES && face->edges[i]; i++) {
@@ -2584,7 +2586,7 @@ static void edge_replace_vert(void *ptr, void *userdata)
#ifdef EDGESPLIT_DEBUG_3
printf("replacing vert %4d with %4d in edge %4d",
- find->newIndex, replace->newIndex, edge->newIndex);
+ find->newIndex, replace->newIndex, edge->newIndex);
printf(": {%4d, %4d}", edge->verts[0]->newIndex, edge->verts[1]->newIndex);
#endif
@@ -2620,14 +2622,14 @@ static void face_replace_edge(void *ptr, void *userdata)
#ifdef EDGESPLIT_DEBUG_3
printf("replacing edge %4d with %4d in face %4d",
- find->newIndex, replace->newIndex, face->newIndex);
+ find->newIndex, replace->newIndex, face->newIndex);
if(face->edges[3])
printf(": {%2d %2d %2d %2d}",
- face->edges[0]->newIndex, face->edges[1]->newIndex,
+ face->edges[0]->newIndex, face->edges[1]->newIndex,
face->edges[2]->newIndex, face->edges[3]->newIndex);
else
printf(": {%2d %2d %2d}",
- face->edges[0]->newIndex, face->edges[1]->newIndex,
+ face->edges[0]->newIndex, face->edges[1]->newIndex,
face->edges[2]->newIndex);
#endif
@@ -2642,11 +2644,11 @@ static void face_replace_edge(void *ptr, void *userdata)
#ifdef EDGESPLIT_DEBUG_3
if(face->edges[3])
printf(" -> {%2d %2d %2d %2d}\n",
- face->edges[0]->newIndex, face->edges[1]->newIndex,
+ face->edges[0]->newIndex, face->edges[1]->newIndex,
face->edges[2]->newIndex, face->edges[3]->newIndex);
else
printf(" -> {%2d %2d %2d}\n",
- face->edges[0]->newIndex, face->edges[1]->newIndex,
+ face->edges[0]->newIndex, face->edges[1]->newIndex,
face->edges[2]->newIndex);
#endif
}
@@ -2696,7 +2698,7 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge,
LinkNode *visited_edges = NULL;
#ifdef EDGESPLIT_DEBUG_1
printf("=== START === find_other_sharp_edge(edge = %4d, vert = %4d)\n",
- edge->newIndex, vert->newIndex);
+ edge->newIndex, vert->newIndex);
#endif
/* get a face on which to start */
@@ -2717,10 +2719,10 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge,
* seen before
*/
while(face && !edge_is_sharp(edge2, flags, threshold)
- && !linklist_contains(visited_edges, edge2)) {
+ && !linklist_contains(visited_edges, edge2)) {
#ifdef EDGESPLIT_DEBUG_3
printf("current face %4d; current edge %4d\n", face->newIndex,
- edge2->newIndex);
+ edge2->newIndex);
#endif
/* get the next face */
face = other_face(edge2, face);
@@ -2738,30 +2740,30 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge,
edge2 = other_edge(face, vert, edge2);
#ifdef EDGESPLIT_DEBUG_3
printf("next face %4d; next edge %4d\n",
- face->newIndex, edge2->newIndex);
+ face->newIndex, edge2->newIndex);
} else {
printf("loose edge: %4d\n", edge2->newIndex);
#endif
}
- }
+ }
- /* either we came back to the start edge or we found a sharp/loose edge */
- if(linklist_contains(visited_edges, edge2))
- /* we came back to the start edge */
- edge2 = NULL;
+ /* either we came back to the start edge or we found a sharp/loose edge */
+ if(linklist_contains(visited_edges, edge2))
+ /* we came back to the start edge */
+ edge2 = NULL;
- BLI_linklist_free(visited_edges, NULL);
+ BLI_linklist_free(visited_edges, NULL);
#ifdef EDGESPLIT_DEBUG_1
- printf("=== END === find_other_sharp_edge(edge = %4d, vert = %4d), "
- "returning edge %d\n",
+ printf("=== END === find_other_sharp_edge(edge = %4d, vert = %4d), "
+ "returning edge %d\n",
edge->newIndex, vert->newIndex, edge2 ? edge2->newIndex : -1);
#endif
- return edge2;
+ return edge2;
}
static void split_single_vert(SmoothVert *vert, SmoothFace *face,
- SmoothMesh *mesh)
+ SmoothMesh *mesh)
{
SmoothVert *copy_vert;
ReplaceData repdata;
@@ -2819,17 +2821,17 @@ static void pop_propagate_stack(SmoothEdge **edge, SmoothVert **vert, SmoothMesh
static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh);
static void propagate_split(SmoothEdge *edge, SmoothVert *vert,
- SmoothMesh *mesh)
+ SmoothMesh *mesh)
{
SmoothEdge *edge2;
LinkNode *visited_faces = NULL;
#ifdef EDGESPLIT_DEBUG_1
printf("=== START === propagate_split(edge = %4d, vert = %4d)\n",
- edge->newIndex, vert->newIndex);
+ edge->newIndex, vert->newIndex);
#endif
edge2 = find_other_sharp_edge(vert, edge, &visited_faces,
- mesh->threshold, mesh->flags);
+ mesh->threshold, mesh->flags);
if(!edge2) {
/* didn't find a sharp or loose edge, so we've hit a dead end */
@@ -2871,7 +2873,7 @@ static void propagate_split(SmoothEdge *edge, SmoothVert *vert,
BLI_linklist_free(visited_faces, NULL);
#ifdef EDGESPLIT_DEBUG_1
printf("=== END === propagate_split(edge = %4d, vert = %4d)\n",
- edge->newIndex, vert->newIndex);
+ edge->newIndex, vert->newIndex);
#endif
}
@@ -2884,11 +2886,11 @@ static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh)
LinkNode *visited_faces = NULL;
#ifdef EDGESPLIT_DEBUG_1
printf("=== START === split_edge(edge = %4d, vert = %4d)\n",
- edge->newIndex, vert->newIndex);
+ edge->newIndex, vert->newIndex);
#endif
edge2 = find_other_sharp_edge(vert, edge, &visited_faces,
- mesh->threshold, mesh->flags);
+ mesh->threshold, mesh->flags);
if(!edge2) {
/* didn't find a sharp or loose edge, so try the other vert */
@@ -2958,12 +2960,12 @@ static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh)
BLI_linklist_free(visited_faces, NULL);
#ifdef EDGESPLIT_DEBUG_1
printf("=== END === split_edge(edge = %4d, vert = %4d)\n",
- edge->newIndex, vert->newIndex);
+ edge->newIndex, vert->newIndex);
#endif
}
static void tag_and_count_extra_edges(SmoothMesh *mesh, float split_angle,
- int flags, int *extra_edges)
+ int flags, int *extra_edges)
{
/* if normal1 dot normal2 < threshold, angle is greater, so split */
/* FIXME not sure if this always works */
@@ -3327,7 +3329,7 @@ static int displaceModifier_dependsOnTime(ModifierData *md)
}
static void displaceModifier_foreachObjectLink(ModifierData *md, Object *ob,
- ObjectWalkFunc walk, void *userData)
+ ObjectWalkFunc walk, void *userData)
{
DisplaceModifierData *dmd = (DisplaceModifierData*) md;
@@ -3352,7 +3354,7 @@ static int displaceModifier_isDisabled(ModifierData *md, int useRenderParams)
}
static void displaceModifier_updateDepgraph(
- ModifierData *md, DagForest *forest, Scene *scene,
+ ModifierData *md, DagForest *forest, Scene *scene,
Object *ob, DagNode *obNode)
{
DisplaceModifierData *dmd = (DisplaceModifierData*) md;
@@ -3385,7 +3387,7 @@ static void validate_layer_name(const CustomData *data, int type, char *name, ch
}
static void get_texture_coords(DisplaceModifierData *dmd, Object *ob,
- DerivedMesh *dm,
+ DerivedMesh *dm,
float (*co)[3], float (*texco)[3],
int numVerts)
{
@@ -3492,7 +3494,7 @@ static void get_texture_value(Tex *texture, float *tex_co, TexResult *texres)
/* dm must be a CDDerivedMesh */
static void displaceModifier_do(
DisplaceModifierData *dmd, Object *ob,
- DerivedMesh *dm, float (*vertexCos)[3], int numVerts)
+ DerivedMesh *dm, float (*vertexCos)[3], int numVerts)
{
int i;
MVert *mvert;
@@ -3509,7 +3511,7 @@ static void displaceModifier_do(
dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
tex_co = MEM_callocN(sizeof(*tex_co) * numVerts,
- "displaceModifier_do tex_co");
+ "displaceModifier_do tex_co");
get_texture_coords(dmd, ob, dm, vertexCos, tex_co, numVerts);
for(i = 0; i < numVerts; ++i) {
@@ -3565,12 +3567,12 @@ static void displaceModifier_do(
static void displaceModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
DerivedMesh *dm= get_cddm(md->scene, ob, NULL, derivedData, vertexCos);
displaceModifier_do((DisplaceModifierData *)md, ob, dm,
- vertexCos, numVerts);
+ vertexCos, numVerts);
if(dm != derivedData)
dm->release(dm);
@@ -3583,7 +3585,7 @@ static void displaceModifier_deformVertsEM(
DerivedMesh *dm= get_cddm(md->scene, ob, editData, derivedData, vertexCos);
displaceModifier_do((DisplaceModifierData *)md, ob, dm,
- vertexCos, numVerts);
+ vertexCos, numVerts);
if(dm != derivedData)
dm->release(dm);
@@ -3642,18 +3644,18 @@ static void uvprojectModifier_foreachObjectLink(ModifierData *md, Object *ob,
}
static void uvprojectModifier_foreachIDLink(ModifierData *md, Object *ob,
- IDWalkFunc walk, void *userData)
+ IDWalkFunc walk, void *userData)
{
UVProjectModifierData *umd = (UVProjectModifierData*) md;
walk(userData, ob, (ID **)&umd->image);
uvprojectModifier_foreachObjectLink(md, ob, (ObjectWalkFunc)walk,
- userData);
+ userData);
}
static void uvprojectModifier_updateDepgraph(ModifierData *md,
- DagForest *forest, Scene *scene, Object *ob, DagNode *obNode)
+ DagForest *forest, Scene *scene, Object *ob, DagNode *obNode)
{
UVProjectModifierData *umd = (UVProjectModifierData*) md;
int i;
@@ -3672,6 +3674,7 @@ typedef struct Projector {
Object *ob; /* object this projector is derived from */
float projmat[4][4]; /* projection matrix */
float normal[3]; /* projector normal in world space */
+ void *uci; /* optional uv-project info (panorama projection) */
} Projector;
static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
@@ -3687,9 +3690,11 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
int num_projectors = 0;
float aspect;
char uvname[32];
+ float aspx= umd->aspectx ? umd->aspectx : 1.0f;
+ float aspy= umd->aspecty ? umd->aspecty : 1.0f;
+ int free_uci= 0;
- if(umd->aspecty != 0) aspect = umd->aspectx / umd->aspecty;
- else aspect = 1.0f;
+ aspect = aspx / aspy;
for(i = 0; i < umd->num_projectors; ++i)
if(umd->projectors[i])
@@ -3704,20 +3709,6 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
/* make sure we're using an existing layer */
validate_layer_name(&dm->faceData, CD_MTFACE, umd->uvlayer_name, uvname);
- /* make sure we are not modifying the original UV layer */
- tface = CustomData_duplicate_referenced_layer_named(&dm->faceData,
- CD_MTFACE, uvname);
-
- numVerts = dm->getNumVerts(dm);
-
- coords = MEM_callocN(sizeof(*coords) * numVerts,
- "uvprojectModifier_do coords");
- dm->getVertCos(dm, coords);
-
- /* convert coords to world space */
- for(i = 0, co = coords; i < numVerts; ++i, ++co)
- mul_m4_v3(ob->obmat, *co);
-
/* calculate a projection matrix and normal for each projector */
for(i = 0; i < num_projectors; ++i) {
float tmpmat[4][4];
@@ -3728,7 +3719,13 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
if(projectors[i].ob->type == OB_CAMERA) {
cam = (Camera *)projectors[i].ob->data;
- if(cam->type == CAM_PERSP) {
+ projectors[i].uci= NULL;
+
+ if(cam->flag & CAM_PANORAMA) {
+ projectors[i].uci= project_camera_info(projectors[i].ob, NULL, aspx, aspy);
+ free_uci= 1;
+ }
+ else if(cam->type == CAM_PERSP) {
float perspmat[4][4];
float xmax;
float xmin;
@@ -3777,15 +3774,15 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
offsetmat[3][0] = offsetmat[3][1] = offsetmat[3][2] = 0.5;
if (cam) {
- if (umd->aspectx == umd->aspecty) {
+ if (aspx == aspy) {
offsetmat[3][0] -= cam->shiftx;
offsetmat[3][1] -= cam->shifty;
- } else if (umd->aspectx < umd->aspecty) {
- offsetmat[3][0] -=(cam->shiftx * umd->aspecty/umd->aspectx);
+ } else if (aspx < aspy) {
+ offsetmat[3][0] -=(cam->shiftx * aspy/aspx);
offsetmat[3][1] -= cam->shifty;
} else {
offsetmat[3][0] -= cam->shiftx;
- offsetmat[3][1] -=(cam->shifty * umd->aspectx/umd->aspecty);
+ offsetmat[3][1] -=(cam->shifty * aspx/aspy);
}
}
@@ -3798,8 +3795,23 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
mul_mat3_m4_v3(projectors[i].ob->obmat, projectors[i].normal);
}
+ /* make sure we are not modifying the original UV layer */
+ tface = CustomData_duplicate_referenced_layer_named(&dm->faceData,
+ CD_MTFACE, uvname);
+
+
+ numVerts = dm->getNumVerts(dm);
+
+ coords = MEM_callocN(sizeof(*coords) * numVerts,
+ "uvprojectModifier_do coords");
+ dm->getVertCos(dm, coords);
+
+ /* convert coords to world space */
+ for(i = 0, co = coords; i < numVerts; ++i, ++co)
+ mul_m4_v3(ob->obmat, *co);
+
/* if only one projector, project coords to UVs */
- if(num_projectors == 1)
+ if(num_projectors == 1 && projectors[0].uci==NULL)
for(i = 0, co = coords; i < numVerts; ++i, ++co)
mul_project_m4_v4(projectors[0].projmat, *co);
@@ -3809,17 +3821,26 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
/* apply coords as UVs, and apply image if tfaces are new */
for(i = 0, mf = mface; i < numFaces; ++i, ++mf, ++tface) {
if(override_image || !image || tface->tpage == image) {
- if(num_projectors == 1) {
- /* apply transformed coords as UVs */
- tface->uv[0][0] = coords[mf->v1][0];
- tface->uv[0][1] = coords[mf->v1][1];
- tface->uv[1][0] = coords[mf->v2][0];
- tface->uv[1][1] = coords[mf->v2][1];
- tface->uv[2][0] = coords[mf->v3][0];
- tface->uv[2][1] = coords[mf->v3][1];
- if(mf->v4) {
- tface->uv[3][0] = coords[mf->v4][0];
- tface->uv[3][1] = coords[mf->v4][1];
+ if(num_projectors == 1) {
+ if(projectors[0].uci) {
+ project_from_camera(tface->uv[0], coords[mf->v1], projectors[0].uci);
+ project_from_camera(tface->uv[1], coords[mf->v2], projectors[0].uci);
+ project_from_camera(tface->uv[2], coords[mf->v3], projectors[0].uci);
+ if(mf->v3)
+ project_from_camera(tface->uv[3], coords[mf->v4], projectors[0].uci);
+ }
+ else {
+ /* apply transformed coords as UVs */
+ tface->uv[0][0] = coords[mf->v1][0];
+ tface->uv[0][1] = coords[mf->v1][1];
+ tface->uv[1][0] = coords[mf->v2][0];
+ tface->uv[1][1] = coords[mf->v2][1];
+ tface->uv[2][0] = coords[mf->v3][0];
+ tface->uv[2][1] = coords[mf->v3][1];
+ if(mf->v4) {
+ tface->uv[3][0] = coords[mf->v4][0];
+ tface->uv[3][1] = coords[mf->v4][1];
+ }
}
} else {
/* multiple projectors, select the closest to face normal
@@ -3857,23 +3878,32 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
best_projector = &projectors[j];
}
}
-
- mul_project_m4_v4(best_projector->projmat, co1);
- mul_project_m4_v4(best_projector->projmat, co2);
- mul_project_m4_v4(best_projector->projmat, co3);
- if(mf->v4)
- mul_project_m4_v4(best_projector->projmat, co4);
-
- /* apply transformed coords as UVs */
- tface->uv[0][0] = co1[0];
- tface->uv[0][1] = co1[1];
- tface->uv[1][0] = co2[0];
- tface->uv[1][1] = co2[1];
- tface->uv[2][0] = co3[0];
- tface->uv[2][1] = co3[1];
- if(mf->v4) {
- tface->uv[3][0] = co4[0];
- tface->uv[3][1] = co4[1];
+
+ if(best_projector->uci) {
+ project_from_camera(tface->uv[0], coords[mf->v1], best_projector->uci);
+ project_from_camera(tface->uv[1], coords[mf->v2], best_projector->uci);
+ project_from_camera(tface->uv[2], coords[mf->v3], best_projector->uci);
+ if(mf->v3)
+ project_from_camera(tface->uv[3], coords[mf->v4], best_projector->uci);
+ }
+ else {
+ mul_project_m4_v4(best_projector->projmat, co1);
+ mul_project_m4_v4(best_projector->projmat, co2);
+ mul_project_m4_v4(best_projector->projmat, co3);
+ if(mf->v4)
+ mul_project_m4_v4(best_projector->projmat, co4);
+
+ /* apply transformed coords as UVs */
+ tface->uv[0][0] = co1[0];
+ tface->uv[0][1] = co1[1];
+ tface->uv[1][0] = co2[0];
+ tface->uv[1][1] = co2[1];
+ tface->uv[2][0] = co3[0];
+ tface->uv[2][1] = co3[1];
+ if(mf->v4) {
+ tface->uv[3][0] = co4[0];
+ tface->uv[3][1] = co4[1];
+ }
}
}
}
@@ -3885,7 +3915,15 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
}
MEM_freeN(coords);
-
+
+ if(free_uci) {
+ int j;
+ for(j = 0; j < num_projectors; ++j) {
+ if(projectors[j].uci) {
+ MEM_freeN(projectors[j].uci);
+ }
+ }
+ }
return dm;
}
@@ -4092,7 +4130,7 @@ static CustomDataMask smoothModifier_requiredDataMask(Object *ob, ModifierData *
}
static void smoothModifier_do(
- SmoothModifierData *smd, Object *ob, DerivedMesh *dm,
+ SmoothModifierData *smd, Object *ob, DerivedMesh *dm,
float (*vertexCos)[3], int numVerts)
{
MDeformVert *dvert = NULL;
@@ -4220,7 +4258,7 @@ static void smoothModifier_do(
}
static void smoothModifier_deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ ModifierData *md, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0);
@@ -4234,7 +4272,7 @@ static void smoothModifier_deformVerts(
static void smoothModifier_deformVertsEM(
ModifierData *md, Object *ob, EditMesh *editData,
- DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+ DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm= get_dm(md->scene, ob, editData, derivedData, NULL, 0);
@@ -4302,7 +4340,7 @@ static CustomDataMask castModifier_requiredDataMask(Object *ob, ModifierData *md
static void castModifier_foreachObjectLink(
ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
- void *userData)
+ void *userData)
{
CastModifierData *cmd = (CastModifierData*) md;
@@ -4311,7 +4349,7 @@ static void castModifier_foreachObjectLink(
static void castModifier_updateDepgraph(
ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
- DagNode *obNode)
+ DagNode *obNode)
{
CastModifierData *cmd = (CastModifierData*) md;
@@ -4325,7 +4363,7 @@ static void castModifier_updateDepgraph(
static void castModifier_sphere_do(
CastModifierData *cmd, Object *ob, DerivedMesh *dm,
- float (*vertexCos)[3], int numVerts)
+ float (*vertexCos)[3], int numVerts)
{
MDeformVert *dvert = NULL;
@@ -4502,7 +4540,7 @@ static void castModifier_sphere_do(
static void castModifier_cuboid_do(
CastModifierData *cmd, Object *ob, DerivedMesh *dm,
- float (*vertexCos)[3], int numVerts)
+ float (*vertexCos)[3], int numVerts)
{
MDeformVert *dvert = NULL;
Object *ctrl_ob = NULL;
@@ -4772,17 +4810,13 @@ static void castModifier_cuboid_do(
}
static void castModifier_deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ ModifierData *md, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
DerivedMesh *dm = NULL;
CastModifierData *cmd = (CastModifierData *)md;
- if (ob->type == OB_MESH) {
- /* DerivedMesh is used only in case object is MESH */
- /* so we could optimize modifier applying by skipping DM creation */
- dm = get_dm(md->scene, ob, NULL, derivedData, NULL, 0);
- }
+ dm = get_dm(md->scene, ob, NULL, derivedData, NULL, 0);
if (cmd->type == MOD_CAST_TYPE_CUBOID) {
castModifier_cuboid_do(cmd, ob, dm, vertexCos, numVerts);
@@ -4795,7 +4829,7 @@ static void castModifier_deformVerts(
}
static void castModifier_deformVertsEM(
- ModifierData *md, Object *ob, EditMesh *editData,
+ ModifierData *md, Object *ob, EditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = get_dm(md->scene, ob, editData, derivedData, NULL, 0);
@@ -4873,7 +4907,7 @@ static void waveModifier_foreachObjectLink(
}
static void waveModifier_foreachIDLink(ModifierData *md, Object *ob,
- IDWalkFunc walk, void *userData)
+ IDWalkFunc walk, void *userData)
{
WaveModifierData *wmd = (WaveModifierData*) md;
@@ -4884,7 +4918,7 @@ static void waveModifier_foreachIDLink(ModifierData *md, Object *ob,
static void waveModifier_updateDepgraph(
ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
- DagNode *obNode)
+ DagNode *obNode)
{
WaveModifierData *wmd = (WaveModifierData*) md;
@@ -4921,7 +4955,7 @@ static CustomDataMask waveModifier_requiredDataMask(Object *ob, ModifierData *md
}
static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob,
- DerivedMesh *dm,
+ DerivedMesh *dm,
float (*co)[3], float (*texco)[3],
int numVerts)
{
@@ -5009,7 +5043,7 @@ static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob,
static void waveModifier_do(WaveModifierData *md,
Scene *scene, Object *ob, DerivedMesh *dm,
- float (*vertexCos)[3], int numVerts)
+ float (*vertexCos)[3], int numVerts)
{
WaveModifierData *wmd = (WaveModifierData*) md;
MVert *mvert = NULL;
@@ -5057,7 +5091,7 @@ static void waveModifier_do(WaveModifierData *md,
if(wmd->texture) {
tex_co = MEM_mallocN(sizeof(*tex_co) * numVerts,
- "waveModifier_do tex_co");
+ "waveModifier_do tex_co");
wavemod_get_texture_coords(wmd, ob, dm, vertexCos, tex_co, numVerts);
}
@@ -5165,7 +5199,7 @@ static void waveModifier_do(WaveModifierData *md,
}
static void waveModifier_deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ ModifierData *md, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
DerivedMesh *dm= derivedData;
@@ -5183,7 +5217,7 @@ static void waveModifier_deformVerts(
}
static void waveModifier_deformVertsEM(
- ModifierData *md, Object *ob, EditMesh *editData,
+ ModifierData *md, Object *ob, EditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm= derivedData;
@@ -5237,8 +5271,8 @@ static int armatureModifier_isDisabled(ModifierData *md, int useRenderParams)
}
static void armatureModifier_foreachObjectLink(
- ModifierData *md, Object *ob,
- void (*walk)(void *userData, Object *ob, Object **obpoin),
+ ModifierData *md, Object *ob,
+ void (*walk)(void *userData, Object *ob, Object **obpoin),
void *userData)
{
ArmatureModifierData *amd = (ArmatureModifierData*) md;
@@ -5247,7 +5281,7 @@ static void armatureModifier_foreachObjectLink(
}
static void armatureModifier_updateDepgraph(
- ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
+ ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
DagNode *obNode)
{
ArmatureModifierData *amd = (ArmatureModifierData*) md;
@@ -5262,14 +5296,14 @@ static void armatureModifier_updateDepgraph(
static void armatureModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
ArmatureModifierData *amd = (ArmatureModifierData*) md;
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
armature_deform_verts(amd->object, ob, derivedData, vertexCos, NULL,
- numVerts, amd->deformflag,
+ numVerts, amd->deformflag,
(float(*)[3])amd->prevCos, amd->defgrp_name);
/* free cache */
if(amd->prevCos) {
@@ -5288,15 +5322,15 @@ static void armatureModifier_deformVertsEM(
if(!derivedData) dm = CDDM_from_editmesh(editData, ob->data);
armature_deform_verts(amd->object, ob, dm, vertexCos, NULL, numVerts,
- amd->deformflag, NULL, amd->defgrp_name);
+ amd->deformflag, NULL, amd->defgrp_name);
if(!derivedData) dm->release(dm);
}
static void armatureModifier_deformMatricesEM(
- ModifierData *md, Object *ob, EditMesh *editData,
+ ModifierData *md, Object *ob, EditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3],
- float (*defMats)[3][3], int numVerts)
+ float (*defMats)[3][3], int numVerts)
{
ArmatureModifierData *amd = (ArmatureModifierData*) md;
DerivedMesh *dm = derivedData;
@@ -5304,7 +5338,7 @@ static void armatureModifier_deformMatricesEM(
if(!derivedData) dm = CDDM_from_editmesh(editData, ob->data);
armature_deform_verts(amd->object, ob, dm, vertexCos, defMats, numVerts,
- amd->deformflag, NULL, amd->defgrp_name);
+ amd->deformflag, NULL, amd->defgrp_name);
if(!derivedData) dm->release(dm);
}
@@ -5362,7 +5396,7 @@ static int hookModifier_isDisabled(ModifierData *md, int useRenderParams)
static void hookModifier_foreachObjectLink(
ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
- void *userData)
+ void *userData)
{
HookModifierData *hmd = (HookModifierData*) md;
@@ -5385,7 +5419,7 @@ static void hookModifier_updateDepgraph(ModifierData *md, DagForest *forest, Sce
}
static void hookModifier_deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ ModifierData *md, Object *ob, DerivedMesh *derivedData,
float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
HookModifierData *hmd = (HookModifierData*) md;
@@ -5405,7 +5439,7 @@ static void hookModifier_deformVerts(
}
invert_m4_m4(ob->imat, ob->obmat);
mul_serie_m4(mat, ob->imat, dmat, hmd->parentinv,
- NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
/* vertex indices? */
if(hmd->indexar) {
@@ -5507,7 +5541,7 @@ static void hookModifier_deformVerts(
}
static void hookModifier_deformVertsEM(
- ModifierData *md, Object *ob, EditMesh *editData,
+ ModifierData *md, Object *ob, EditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
@@ -5523,7 +5557,7 @@ static void hookModifier_deformVertsEM(
static void softbodyModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
}
@@ -5984,13 +6018,826 @@ static DerivedMesh *solidifyModifier_applyModifier(ModifierData *md,
}
static DerivedMesh *solidifyModifier_applyModifierEM(ModifierData *md,
- Object *ob,
- EditMesh *editData,
- DerivedMesh *derivedData)
+ Object *ob,
+ EditMesh *editData,
+ DerivedMesh *derivedData)
{
return solidifyModifier_applyModifier(md, ob, derivedData, 0, 1);
}
+/* Screw */
+
+/* Screw modifier: revolves the edges about an axis
+*/
+
+/* used for gathering edge connectivity */
+typedef struct ScrewVertConnect {
+ float dist; /* distance from the center axis */
+ float co[3]; /* loaction relative to the transformed axis */
+ float no[3]; /* calc normal of the vertex */
+ int v[2]; /* 2 verts on either side of this one */
+ MEdge *e[2]; /* edges on either side, a bit of a waste since each edge ref's 2 edges */
+ char flag;
+} ScrewVertConnect;
+
+typedef struct ScrewVertIter {
+ ScrewVertConnect * v_array;
+ ScrewVertConnect * v_poin;
+ int v;
+ int v_other;
+ MEdge *e;
+} ScrewVertIter;
+
+#define ScrewVertIter_INIT(iter, array, v_init, dir)\
+ iter.v_array = array;\
+ iter.v = v_init;\
+ if (v_init>=0) {\
+ iter.v_poin = &array[v_init];\
+ iter.v_other = iter.v_poin->v[dir];\
+ if (dir)\
+ iter.e = iter.v_poin->e[0];\
+ else\
+ iter.e = iter.v_poin->e[1];\
+ } else {\
+ iter.v_poin= NULL;\
+ iter.e= NULL;\
+ }
+
+
+#define ScrewVertIter_NEXT(iter)\
+ if (iter.v_poin->v[0] == iter.v_other) {\
+ iter.v_other= iter.v;\
+ iter.v= iter.v_poin->v[1];\
+ } else if (iter.v_poin->v[1] == iter.v_other) {\
+ iter.v_other= iter.v;\
+ iter.v= iter.v_poin->v[0];\
+ }\
+ if (iter.v >=0) {\
+ iter.v_poin= &iter.v_array[iter.v];\
+ if ( iter.v_poin->e[0] != iter.e ) iter.e= iter.v_poin->e[0];\
+ else iter.e= iter.v_poin->e[1];\
+ } else {\
+ iter.e= NULL;\
+ iter.v_poin= NULL;\
+ }
+
+static void screwModifier_initData(ModifierData *md)
+{
+ ScrewModifierData *ltmd= (ScrewModifierData*) md;
+ ltmd->ob_axis= NULL;
+ ltmd->angle= M_PI * 2.0;
+ ltmd->axis= 2;
+ ltmd->flag= 0;
+ ltmd->steps= 16;
+ ltmd->render_steps= 16;
+ ltmd->iter= 1;
+}
+
+static void screwModifier_copyData(ModifierData *md, ModifierData *target)
+{
+ ScrewModifierData *sltmd= (ScrewModifierData*) md;
+ ScrewModifierData *tltmd= (ScrewModifierData*) target;
+
+ tltmd->ob_axis= sltmd->ob_axis;
+ tltmd->angle= sltmd->angle;
+ tltmd->axis= sltmd->axis;
+ tltmd->flag= sltmd->flag;
+ tltmd->steps= sltmd->steps;
+ tltmd->render_steps= sltmd->render_steps;
+ tltmd->screw_ofs= sltmd->screw_ofs;
+ tltmd->iter= sltmd->iter;
+}
+
+static DerivedMesh *screwModifier_applyModifier(ModifierData *md, Object *ob,
+ DerivedMesh *derivedData,
+ int useRenderParams, int isFinalCalc)
+{
+ DerivedMesh *dm= derivedData;
+ DerivedMesh *result;
+ ScrewModifierData *ltmd= (ScrewModifierData*) md;
+
+ int *origindex;
+ int mface_index=0;
+ int i, j;
+ int i1,i2;
+ int steps= ltmd->steps;
+ int maxVerts=0, maxEdges=0, maxFaces=0;
+ int totvert= dm->getNumVerts(dm);
+ int totedge= dm->getNumEdges(dm);
+
+ char axis_char, close;
+ float angle= ltmd->angle;
+ float screw_ofs= ltmd->screw_ofs;
+ float axis_vec[3]= {0.0f, 0.0f, 0.0f};
+ float tmp_vec1[3], tmp_vec2[3];
+ float mat3[3][3];
+ float mtx_tx[4][4]; /* transform the coords by an object relative to this objects transformation */
+ float mtx_tx_inv[4][4]; /* inverted */
+ float mtx_tmp_a[4][4];
+
+ int vc_tot_linked= 0;
+ short other_axis_1, other_axis_2;
+ float *tmpf1, *tmpf2;
+
+ MFace *mface_new, *mf_new;
+ MEdge *medge_orig, *med_orig, *med_new, *med_new_firstloop, *medge_new;
+ MVert *mvert_new, *mvert_orig, *mv_orig, *mv_new, *mv_new_base;
+
+ ScrewVertConnect *vc, *vc_tmp, *vert_connect= NULL;
+
+ float mat[4][4] = {{0.0f, 0.0f, 0.0f, 0.0f},
+ {0.0f, 0.0f, 0.0f, 0.0f},
+ {0.0f, 0.0f, 0.0f, 0.0f},
+ {0.0f, 0.0f, 0.0f, 1.0f}};
+
+ /* dont do anything? */
+ if (!totvert)
+ return CDDM_from_template(dm, 0, 0, 0);
+
+ steps= useRenderParams ? ltmd->render_steps : ltmd->steps;
+
+ switch(ltmd->axis) {
+ case 0:
+ other_axis_1=1;
+ other_axis_2=2;
+ break;
+ case 1:
+ other_axis_1=0;
+ other_axis_2=2;
+ break;
+ case 2:
+ other_axis_1=0;
+ other_axis_2=1;
+ break;
+ }
+
+ axis_vec[ltmd->axis]= 1.0f;
+
+ if (ltmd->ob_axis) {
+ float mtx3_tx[3][3];
+ /* calc the matrix relative to the axis object */
+ invert_m4_m4(mtx_tmp_a, ob->obmat);
+ copy_m4_m4(mtx_tx_inv, ltmd->ob_axis->obmat);
+ mul_m4_m4m4(mtx_tx, mtx_tx_inv, mtx_tmp_a);
+
+ copy_m3_m4(mtx3_tx, mtx_tx);
+
+ /* calc the axis vec */
+ mul_m3_v3(mtx3_tx, axis_vec);
+ normalize_v3(axis_vec);
+
+ /* screw */
+ if(ltmd->flag & MOD_SCREW_OBJECT_OFFSET) {
+ /* find the offset along this axis relative to this objects matrix */
+ float totlen = len_v3(mtx_tx[3]);
+
+ if(totlen != 0.0f) {
+ float zero[3]={0.0f, 0.0f, 0.0f};
+ float cp[3];
+ screw_ofs= closest_to_line_v3(cp, mtx_tx[3], zero, axis_vec);
+ }
+ else {
+ screw_ofs= 0.0f;
+ }
+ }
+
+ /* angle */
+
+#if 0 // cant incluide this, not pradictable enough, though quite fun,.
+ if(ltmd->flag & MOD_SCREW_OBJECT_ANGLE) {
+
+
+ float vec[3] = {0,1,0};
+ float cross1[3];
+ float cross2[3];
+ cross_v3_v3v3(cross1, vec, axis_vec);
+
+ mul_v3_m3v3(cross2, mtx3_tx, cross1);
+ {
+ float c1[3];
+ float c2[3];
+ float axis_tmp[3];
+
+ cross_v3_v3v3(c1, cross2, axis_vec);
+ cross_v3_v3v3(c2, axis_vec, c1);
+
+
+ angle= angle_v3v3(cross1, c2);
+
+ cross_v3_v3v3(axis_tmp, cross1, c2);
+ normalize_v3(axis_tmp);
+
+ if(len_v3v3(axis_tmp, axis_vec) > 1.0f)
+ angle= -angle;
+
+ }
+ }
+#endif
+ }
+ else {
+ /* exis char is used by i_rotate*/
+ axis_char= 'X' + ltmd->axis;
+
+ /* useful to be able to use the axis vec in some cases still */
+ zero_v3(axis_vec);
+ axis_vec[ltmd->axis]= 1.0f;
+ }
+
+ /* apply the multiplier */
+ angle *= ltmd->iter;
+ screw_ofs *= ltmd->iter;
+
+ /* multiplying the steps is a bit tricky, this works best */
+ steps = ((steps + 1) * ltmd->iter) - (ltmd->iter - 1);
+
+ /* will the screw be closed?
+ * Note! smaller then FLT_EPSILON*100 gives problems with float precission so its never closed. */
+ if (fabs(screw_ofs) <= (FLT_EPSILON*100) && fabs(fabs(angle) - (M_PI * 2)) <= (FLT_EPSILON*100)) {
+ close= 1;
+ steps--;
+ if(steps < 2) steps= 2;
+
+ maxVerts = totvert * steps; /* -1 because we're joining back up */
+ maxEdges = (totvert * steps) + /* these are the edges between new verts */
+ (totedge * steps); /* -1 because vert edges join */
+ maxFaces = totedge * steps;
+
+ screw_ofs= 0.0f;
+ }
+ else {
+ close= 0;
+ if(steps < 2) steps= 2;
+
+ maxVerts = totvert * steps; /* -1 because we're joining back up */
+ maxEdges = (totvert * (steps-1)) + /* these are the edges between new verts */
+ (totedge * steps); /* -1 because vert edges join */
+ maxFaces = totedge * (steps-1);
+ }
+
+ result= CDDM_from_template(dm, maxVerts, maxEdges, maxFaces);
+
+ /* copy verts from mesh */
+ mvert_orig = dm->getVertArray(dm);
+ medge_orig = dm->getEdgeArray(dm);
+
+ mvert_new = result->getVertArray(result);
+ mface_new = result->getFaceArray(result);
+ medge_new = result->getEdgeArray(result);
+
+ origindex= result->getFaceDataArray(result, CD_ORIGINDEX);
+
+ /* Set the locations of the first set of verts */
+
+ mv_new= mvert_new;
+ mv_orig= mvert_orig;
+
+ /* Copy the first set of edges */
+ med_orig= medge_orig;
+ med_new= medge_new;
+ for (i=0; i < totedge; i++, med_orig++, med_new++) {
+ med_new->v1= med_orig->v1;
+ med_new->v2= med_orig->v2;
+ med_new->crease= med_orig->crease;
+ med_new->flag= med_orig->flag & ~ME_LOOSEEDGE;
+ }
+
+ if(ltmd->flag & MOD_SCREW_NORMAL_CALC) {
+ /*
+ * Normal Calculation (for face flipping)
+ * Sort edge verts for correct face flipping
+ * NOT REALLY NEEDED but face flipping is nice.
+ *
+ * */
+
+
+ /* Notice!
+ *
+ * Since we are only ordering the edges here it can avoid mallocing the
+ * extra space by abusing the vert array berfore its filled with new verts.
+ * The new array for vert_connect must be at least sizeof(ScrewVertConnect) * totvert
+ * and the size of our resulting meshes array is sizeof(MVert) * totvert * 3
+ * so its safe to use the second 2 thrids of MVert the array for vert_connect,
+ * just make sure ScrewVertConnect struct is no more then twice as big as MVert,
+ * at the moment there is no chance of that being a problem,
+ * unless MVert becomes half its current size.
+ *
+ * once the edges are ordered, vert_connect is not needed and it can be used for verts
+ *
+ * This makes the modifier faster with one less alloc.
+ */
+
+ vert_connect= MEM_mallocN(sizeof(ScrewVertConnect) * totvert, "ScrewVertConnect");
+ //vert_connect= (ScrewVertConnect *) &medge_new[totvert]; /* skip the first slice of verts */
+ vc= vert_connect;
+
+ /* Copy Vert Locations */
+ /* - We can do this in a later loop - only do here if no normal calc */
+ if (!totedge) {
+ for (i=0; i < totvert; i++, mv_orig++, mv_new++) {
+ copy_v3_v3(mv_new->co, mv_orig->co);
+ normalize_v3_v3(vc->no, mv_new->co); /* no edges- this is realy a dummy normal */
+ }
+ }
+ else {
+ /*printf("\n\n\n\n\nStarting Modifier\n");*/
+ /* set edge users */
+ med_new= medge_new;
+ mv_new= mvert_new;
+
+ if (ltmd->ob_axis) {
+ /*mtx_tx is initialized early on */
+ for (i=0; i < totvert; i++, mv_new++, mv_orig++, vc++) {
+ vc->co[0]= mv_new->co[0]= mv_orig->co[0];
+ vc->co[1]= mv_new->co[1]= mv_orig->co[1];
+ vc->co[2]= mv_new->co[2]= mv_orig->co[2];
+
+ vc->flag= 0;
+ vc->e[0]= vc->e[1]= NULL;
+ vc->v[0]= vc->v[1]= -1;
+
+ mul_m4_v3(mtx_tx, vc->co);
+ /* length in 2d, dont sqrt because this is only for comparison */
+ vc->dist = vc->co[other_axis_1]*vc->co[other_axis_1] +
+ vc->co[other_axis_2]*vc->co[other_axis_2];
+
+ /* printf("location %f %f %f -- %f\n", vc->co[0], vc->co[1], vc->co[2], vc->dist);*/
+ }
+ }
+ else {
+ for (i=0; i < totvert; i++, mv_new++, mv_orig++, vc++) {
+ vc->co[0]= mv_new->co[0]= mv_orig->co[0];
+ vc->co[1]= mv_new->co[1]= mv_orig->co[1];
+ vc->co[2]= mv_new->co[2]= mv_orig->co[2];
+
+ vc->flag= 0;
+ vc->e[0]= vc->e[1]= NULL;
+ vc->v[0]= vc->v[1]= -1;
+
+ /* length in 2d, dont sqrt because this is only for comparison */
+ vc->dist = vc->co[other_axis_1]*vc->co[other_axis_1] +
+ vc->co[other_axis_2]*vc->co[other_axis_2];
+
+ /* printf("location %f %f %f -- %f\n", vc->co[0], vc->co[1], vc->co[2], vc->dist);*/
+ }
+ }
+
+ /* this loop builds connectivity info for verts */
+ for (i=0; i<totedge; i++, med_new++) {
+ vc= &vert_connect[med_new->v1];
+
+ if (vc->v[0]==-1) { /* unused */
+ vc->v[0]= med_new->v2;
+ vc->e[0]= med_new;
+ }
+ else if (vc->v[1]==-1) {
+ vc->v[1]= med_new->v2;
+ vc->e[1]= med_new;
+ }
+ else {
+ vc->v[0]= vc->v[1]= -2; /* erro value - dont use, 3 edges on vert */
+ }
+
+ vc= &vert_connect[med_new->v2];
+
+ /* same as above but swap v1/2 */
+ if (vc->v[0]==-1) { /* unused */
+ vc->v[0]= med_new->v1;
+ vc->e[0]= med_new;
+ }
+ else if (vc->v[1]==-1) {
+ vc->v[1]= med_new->v1;
+ vc->e[1]= med_new;
+ }
+ else {
+ vc->v[0]= vc->v[1]= -2; /* erro value - dont use, 3 edges on vert */
+ }
+ }
+
+ /* find the first vert */
+ vc= vert_connect;
+ for (i=0; i < totvert; i++, vc++) {
+ int VBEST=-1, ed_loop_closed=0; /* vert and vert new */
+ int ed_loop_flip;
+ float fl= -1.0f;
+ ScrewVertIter lt_iter;
+
+ /* Now do search for connected verts, order all edges and flip them
+ * so resulting faces are flipped the right way */
+ vc_tot_linked= 0; /* count the number of linked verts for this loop */
+ if (vc->flag==0) {
+ /*printf("Loop on connected vert: %i\n", i);*/
+
+ for(j=0; j<2; j++) {
+ /*printf("\tSide: %i\n", j);*/
+ ScrewVertIter_INIT(lt_iter, vert_connect, i, j);
+ if (j==1) {
+ ScrewVertIter_NEXT(lt_iter);
+ }
+ while (lt_iter.v_poin) {
+ /*printf("\t\tVERT: %i\n", lt_iter.v);*/
+ if (lt_iter.v_poin->flag) {
+ /*printf("\t\t\tBreaking Found end\n");*/
+ //endpoints[0]= endpoints[1]= -1;
+ ed_loop_closed= 1; /* circle */
+ break;
+ }
+ lt_iter.v_poin->flag= 1;
+ vc_tot_linked++;
+ /*printf("Testing 2 floats %f : %f\n", fl, lt_iter.v_poin->dist);*/
+ if (fl <= lt_iter.v_poin->dist) {
+ fl= lt_iter.v_poin->dist;
+ VBEST= lt_iter.v;
+ /*printf("\t\t\tVERT BEST: %i\n", VBEST);*/
+ }
+ ScrewVertIter_NEXT(lt_iter);
+ if (!lt_iter.v_poin) {
+ /*printf("\t\t\tFound End Also Num %i\n", j);*/
+ /*endpoints[j]= lt_iter.v_other;*/ /* other is still valid */
+ break;
+ }
+ }
+ }
+
+ /* now we have a collection of used edges. flip their edges the right way*/
+ /*if (VBEST !=-1) - */
+
+ /*printf("Done Looking - vc_tot_linked: %i\n", vc_tot_linked);*/
+
+ if (vc_tot_linked>1) {
+ float vf_1, vf_2, vf_best;
+
+ vc_tmp= &vert_connect[VBEST];
+
+ tmpf1= vert_connect[vc_tmp->v[0]].co;
+ tmpf2= vert_connect[vc_tmp->v[1]].co;
+
+
+ /* edge connects on each side! */
+ if ((vc_tmp->v[0] > -1) && (vc_tmp->v[1] > -1)) {
+ /*printf("Verts on each side (%i %i)\n", vc_tmp->v[0], vc_tmp->v[1]);*/
+ /* find out which is higher */
+
+ vf_1= tmpf1[ltmd->axis];
+ vf_2= tmpf2[ltmd->axis];
+ vf_best= vc_tmp->co[ltmd->axis];
+
+ if (vf_1 < vf_best && vf_best < vf_2) {
+ ed_loop_flip= 0;
+ }
+ else if (vf_1 > vf_best && vf_best > vf_2) {
+ ed_loop_flip= 1;
+ }
+ else {
+ /* not so simple to work out wich edge is higher */
+ sub_v3_v3v3(tmp_vec1, tmpf1, vc_tmp->co);
+ sub_v3_v3v3(tmp_vec1, tmpf2, vc_tmp->co);
+ normalize_v3(tmp_vec1);
+ normalize_v3(tmp_vec2);
+
+ if (tmp_vec1[ltmd->axis] < tmp_vec2[ltmd->axis]) {
+ ed_loop_flip= 1;
+ }
+ else {
+ ed_loop_flip= 0;
+ }
+ }
+ }
+ else if (vc_tmp->v[0] >= 0) { /*vertex only connected on 1 side */
+ /*printf("Verts on ONE side (%i %i)\n", vc_tmp->v[0], vc_tmp->v[1]);*/
+ if (tmpf1[ltmd->axis] < vc_tmp->co[ltmd->axis]) { /* best is above */
+ ed_loop_flip= 1;
+ }
+ else { /* best is below or even... in even case we cant know whet to do. */
+ ed_loop_flip= 0;
+ }
+
+ }/* else {
+ printf("No Connected ___\n");
+ }*/
+
+ /*printf("flip direction %i\n", ed_loop_flip);*/
+
+
+ /* switch the flip option if set */
+ if (ltmd->flag & MOD_SCREW_NORMAL_FLIP)
+ ed_loop_flip= !ed_loop_flip;
+
+ if (angle < 0.0f)
+ ed_loop_flip= !ed_loop_flip;
+
+ /* if its closed, we only need 1 loop */
+ for(j=ed_loop_closed; j<2; j++) {
+ /*printf("Ordering Side J %i\n", j);*/
+
+ ScrewVertIter_INIT(lt_iter, vert_connect, VBEST, j);
+ /*printf("\n\nStarting - Loop\n");*/
+ lt_iter.v_poin->flag= 1; /* so a non loop will traverse the other side */
+
+
+ /* If this is the vert off the best vert and
+ * the best vert has 2 edges connected too it
+ * then swap the flip direction */
+ if (j==1 && (vc_tmp->v[0] > -1) && (vc_tmp->v[1] > -1))
+ ed_loop_flip= !ed_loop_flip;
+
+ while (lt_iter.v_poin && lt_iter.v_poin->flag != 2) {
+ /*printf("\tOrdering Vert V %i\n", lt_iter.v);*/
+
+ lt_iter.v_poin->flag= 2;
+ if (lt_iter.e) {
+ if (lt_iter.v == lt_iter.e->v1) {
+ if (ed_loop_flip==0) {
+ /*printf("\t\t\tFlipping 0\n");*/
+ SWAP(int, lt_iter.e->v1, lt_iter.e->v2);
+ }/* else {
+ printf("\t\t\tFlipping Not 0\n");
+ }*/
+ }
+ else if (lt_iter.v == lt_iter.e->v2) {
+ if (ed_loop_flip==1) {
+ /*printf("\t\t\tFlipping 1\n");*/
+ SWAP(int, lt_iter.e->v1, lt_iter.e->v2);
+ }/* else {
+ printf("\t\t\tFlipping Not 1\n");
+ }*/
+ }/* else {
+ printf("\t\tIncorrect edge topology");
+ }*/
+ }/* else {
+ printf("\t\tNo Edge at this point\n");
+ }*/
+ ScrewVertIter_NEXT(lt_iter);
+ }
+ }
+ }
+ }
+
+ /* *VERTEX NORMALS*
+ * we know the surrounding edges are ordered correctly now
+ * so its safe to create vertex normals.
+ *
+ * calculate vertex normals that can be propodated on lathing
+ * use edge connectivity work this out */
+ if (vc->v[0]>=0) {
+ if (vc->v[1]>=0) {
+ /* 2 edges connedted */
+ /* make 2 connecting vert locations relative to the middle vert */
+ sub_v3_v3v3(tmp_vec1, mvert_new[vc->v[0]].co, mvert_new[i].co);
+ sub_v3_v3v3(tmp_vec2, mvert_new[vc->v[1]].co, mvert_new[i].co);
+ /* normalize so both edges have the same influence, no matter their length */
+ normalize_v3(tmp_vec1);
+ normalize_v3(tmp_vec2);
+
+ /* vc_no_tmp1 - this line is the average direction of both connecting edges
+ *
+ * Use the edge order to make the subtraction, flip the normal the right way
+ * edge should be there but check just in case... */
+ if (vc->e && vc->e[0]->v1 == i) {
+ sub_v3_v3v3(tmp_vec1, tmp_vec1, tmp_vec2);
+ }
+ else {
+ sub_v3_v3v3(tmp_vec1, tmp_vec2, tmp_vec1);
+ }
+ }
+ else {
+ /* only 1 edge connected - same as above except
+ * dont need to average edge direction */
+ if (vc->e && vc->e[0]->v2 == i) {
+ sub_v3_v3v3(tmp_vec1, mvert_new[i].co, mvert_new[vc->v[0]].co);
+ }
+ else {
+ sub_v3_v3v3(tmp_vec1, mvert_new[vc->v[0]].co, mvert_new[i].co);
+ }
+ }
+
+ /* vc_no_tmp2 - is a line 90d from the pivot to the vec
+ * This is used so the resulting normal points directly away from the middle */
+ cross_v3_v3v3(tmp_vec2, axis_vec, vc->co);
+
+ /* edge average vector and right angle to the pivot make the normal */
+ cross_v3_v3v3(vc->no, tmp_vec1, tmp_vec2);
+
+ }
+ else {
+ copy_v3_v3(vc->no, vc->co);
+ }
+
+ /* we wont be looping on this data again so copy normals here */
+ if (angle < 0.0f)
+ negate_v3(vc->no);
+
+ normalize_v3(vc->no);
+ normal_float_to_short_v3(mvert_new[i].no, vc->no);
+
+ /* Done with normals */
+ }
+ }
+ }
+ else {
+
+ if (ltmd->flag & MOD_SCREW_NORMAL_FLIP) {
+ mv_orig= mvert_orig;
+ mv_new= mvert_new + (totvert-1);
+
+ for (i=0; i < totvert; i++, mv_new--, mv_orig++) {
+ copy_v3_v3(mv_new->co, mv_orig->co);
+ }
+ }
+ else {
+ mv_orig= mvert_orig;
+ mv_new= mvert_new;
+
+ for (i=0; i < totvert; i++, mv_new++, mv_orig++) {
+ copy_v3_v3(mv_new->co, mv_orig->co);
+ }
+ }
+ }
+ /* done with edge connectivity based normal flipping */
+
+
+ /* Add Faces */
+ for (i=1; i < steps; i++) {
+ float step_angle;
+ float no_tx[3];
+ /* Rotation Matrix */
+ if (close) step_angle= (angle / steps) * i;
+ else step_angle= (angle / (steps-1)) * i;
+
+ if (ltmd->ob_axis) {
+ axis_angle_to_mat3(mat3, axis_vec, step_angle);
+ copy_m4_m3(mat, mat3);
+ }
+ else {
+ unit_m4(mat);
+ rotate_m4(mat, axis_char, step_angle);
+ copy_m3_m4(mat3, mat);
+ }
+
+ if(screw_ofs)
+ madd_v3_v3fl(mat[3], axis_vec, screw_ofs * ((float)i / (float)(steps-1)));
+
+ mv_new_base= mvert_new;
+ mv_new= &mvert_new[totvert*i]; /* advance to the next slice */
+
+ for (j=0; j<totvert; j++, mv_new_base++, mv_new++) {
+ /* set normal */
+ if(vert_connect) {
+ mul_v3_m3v3(no_tx, mat3, vert_connect[j].no);
+
+ /* set the normal now its transformed */
+ normal_float_to_short_v3(mv_new->no, no_tx);
+ }
+
+ /* set location */
+ copy_v3_v3(mv_new->co, mv_new_base->co);
+
+ /* only need to set these if using non cleared memory */
+ /*mv_new->mat_nr= mv_new->flag= 0;*/
+
+ if (ltmd->ob_axis) {
+ sub_v3_v3(mv_new->co, mtx_tx[3]);
+
+ mul_m4_v3(mat, mv_new->co);
+
+ add_v3_v3(mv_new->co, mtx_tx[3]);
+ }
+ else {
+ mul_m4_v3(mat, mv_new->co);
+ }
+
+ /* add the new edge */
+ med_new->v1= j+(i*totvert);
+ med_new->v2= med_new->v1 - totvert;
+ med_new->flag= ME_EDGEDRAW|ME_EDGERENDER;
+ med_new++;
+ }
+ }
+
+ /* we can avoid if using vert alloc trick */
+ if(vert_connect) {
+ MEM_freeN(vert_connect);
+ vert_connect= NULL;
+ }
+
+ if (close) {
+ /* last loop of edges, previous loop dosnt account for the last set of edges */
+ for (i=0; i<totvert; i++) {
+ med_new->v1= i;
+ med_new->v2= i+((steps-1)*totvert);
+ med_new->flag= ME_EDGEDRAW|ME_EDGERENDER;
+ med_new++;
+ }
+ }
+
+ mf_new= mface_new;
+ med_new_firstloop= medge_new;
+
+ for (i=0; i < totedge; i++, med_new_firstloop++) {
+ /* for each edge, make a cylinder of quads */
+ i1= med_new_firstloop->v1;
+ i2= med_new_firstloop->v2;
+
+ for (j=0; j < steps-1; j++) {
+
+ /* new face */
+ mf_new->v1= i1;
+ mf_new->v2= i2;
+ mf_new->v3= i2 + totvert;
+ mf_new->v4= i1 + totvert;
+
+ if( !mf_new->v3 || !mf_new->v4 ) {
+ SWAP(int, mf_new->v1, mf_new->v3);
+ SWAP(int, mf_new->v2, mf_new->v4);
+ }
+ mf_new->flag= ME_SMOOTH;
+ origindex[mface_index]= ORIGINDEX_NONE;
+ mf_new++;
+ mface_index++;
+
+ /* new vertical edge */
+ if (j) { /* The first set is alredy dome */
+ med_new->v1= i1;
+ med_new->v2= i2;
+ med_new->flag= med_new_firstloop->flag;
+ med_new->crease= med_new_firstloop->crease;
+ med_new++;
+ }
+ i1 += totvert;
+ i2 += totvert;
+ }
+
+ /* close the loop*/
+ if (close) {
+ mf_new->v1= i1;
+ mf_new->v2= i2;
+ mf_new->v3= med_new_firstloop->v2;
+ mf_new->v4= med_new_firstloop->v1;
+
+ if( !mf_new->v3 || !mf_new->v4 ) {
+ SWAP(int, mf_new->v1, mf_new->v3);
+ SWAP(int, mf_new->v2, mf_new->v4);
+ }
+ mf_new->flag= ME_SMOOTH;
+ origindex[mface_index]= ORIGINDEX_NONE;
+ mf_new++;
+ mface_index++;
+ }
+
+ /* new vertical edge */
+ med_new->v1= i1;
+ med_new->v2= i2;
+ med_new->flag= med_new_firstloop->flag & ~ME_LOOSEEDGE;
+ med_new->crease= med_new_firstloop->crease;
+ med_new++;
+ }
+
+ if((ltmd->flag & MOD_SCREW_NORMAL_CALC)==0) {
+ CDDM_calc_normals(result);
+ }
+
+ return result;
+}
+
+
+static void screwModifier_updateDepgraph(
+ ModifierData *md, DagForest *forest,
+ Scene *scene, Object *ob, DagNode *obNode)
+{
+ ScrewModifierData *ltmd= (ScrewModifierData*) md;
+
+ if(ltmd->ob_axis) {
+ DagNode *curNode= dag_get_node(forest, ltmd->ob_axis);
+
+ dag_add_relation(forest, curNode, obNode,
+ DAG_RL_DATA_DATA | DAG_RL_OB_DATA,
+ "Screw Modifier");
+ }
+}
+
+static void screwModifier_foreachObjectLink(
+ ModifierData *md, Object *ob,
+ void (*walk)(void *userData, Object *ob, Object **obpoin),
+ void *userData)
+{
+ ScrewModifierData *ltmd= (ScrewModifierData*) md;
+
+ walk(userData, ob, &ltmd->ob_axis);
+}
+
+/* This dosnt work with material*/
+static DerivedMesh *screwModifier_applyModifierEM(
+ ModifierData *md, Object *ob, EditMesh *editData,
+ DerivedMesh *derivedData)
+{
+ return screwModifier_applyModifier(md, ob, derivedData, 0, 1);
+}
+
+static int screwModifier_dependsOnTime(ModifierData *md)
+{
+ return 0;
+}
+
+
/* Smoke */
static void smokeModifier_initData(ModifierData *md)
@@ -6013,7 +6860,7 @@ static void smokeModifier_freeData(ModifierData *md)
static void smokeModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
SmokeModifierData *smd = (SmokeModifierData*) md;
DerivedMesh *dm = dm= get_cddm(md->scene, ob, NULL, derivedData, vertexCos);
@@ -6031,7 +6878,7 @@ static int smokeModifier_dependsOnTime(ModifierData *md)
static void smokeModifier_updateDepgraph(
ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
- DagNode *obNode)
+ DagNode *obNode)
{
/*SmokeModifierData *smd = (SmokeModifierData *) md;
if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
@@ -6103,7 +6950,7 @@ static DerivedMesh *clothModifier_applyModifier(ModifierData *md, Object *ob,
static void clothModifier_updateDepgraph(
ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
- DagNode *obNode)
+ DagNode *obNode)
{
ClothModifierData *clmd = (ClothModifierData*) md;
@@ -6243,7 +7090,7 @@ static int collisionModifier_dependsOnTime(ModifierData *md)
static void collisionModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
CollisionModifierData *collmd = (CollisionModifierData*) md;
DerivedMesh *dm = NULL;
@@ -6412,7 +7259,7 @@ static int surfaceModifier_dependsOnTime(ModifierData *md)
static void surfaceModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
SurfaceModifierData *surmd = (SurfaceModifierData*) md;
unsigned int numverts = 0, i = 0;
@@ -6506,7 +7353,7 @@ static int booleanModifier_isDisabled(ModifierData *md, int useRenderParams)
}
static void booleanModifier_foreachObjectLink(
- ModifierData *md, Object *ob,
+ ModifierData *md, Object *ob,
void (*walk)(void *userData, Object *ob, Object **obpoin),
void *userData)
{
@@ -6538,7 +7385,7 @@ static DerivedMesh *booleanModifier_applyModifier(
/* we do a quick sanity check */
if(dm && (derivedData->getNumFaces(derivedData) > 3)
- && bmd->object && dm->getNumFaces(dm) > 3) {
+ && bmd->object && dm->getNumFaces(dm) > 3) {
DerivedMesh *result = NewBooleanDerivedMesh(dm, bmd->object, derivedData, ob,
1 + bmd->operation);
@@ -6641,8 +7488,8 @@ static CustomDataMask particleSystemModifier_requiredDataMask(Object *ob, Modifi
/* saves the current emitter state for a particle system and calculates particles */
static void particleSystemModifier_deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
DerivedMesh *dm = derivedData;
ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md;
@@ -6711,8 +7558,8 @@ static void particleSystemModifier_deformVerts(
* updates is coded */
#if 0
static void particleSystemModifier_deformVertsEM(
- ModifierData *md, Object *ob, EditMesh *editData,
- DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+ ModifierData *md, Object *ob, EditMesh *editData,
+ DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm = derivedData;
@@ -7031,7 +7878,7 @@ static CustomDataMask explodeModifier_requiredDataMask(Object *ob, ModifierData
static void explodeModifier_createFacepa(ExplodeModifierData *emd,
ParticleSystemModifierData *psmd,
- Object *ob, DerivedMesh *dm)
+ Object *ob, DerivedMesh *dm)
{
ParticleSystem *psys=psmd->psys;
MFace *fa=0, *mface=0;
@@ -7870,7 +8717,7 @@ static DerivedMesh * fluidsimModifier_applyModifier(
static void fluidsimModifier_updateDepgraph(
ModifierData *md, DagForest *forest, Scene *scene,
- Object *ob, DagNode *obNode)
+ Object *ob, DagNode *obNode)
{
FluidsimModifierData *fluidmd= (FluidsimModifierData*) md;
Base *base;
@@ -7961,7 +8808,7 @@ static void meshdeformModifier_foreachObjectLink(
}
static void meshdeformModifier_updateDepgraph(
- ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
+ ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
DagNode *obNode)
{
MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
@@ -8029,7 +8876,7 @@ static float meshdeform_dynamic_bind(MeshDeformModifierData *mmd, float (*dco)[3
static void meshdeformModifier_do(
ModifierData *md, Object *ob, DerivedMesh *dm,
- float (*vertexCos)[3], int numVerts)
+ float (*vertexCos)[3], int numVerts)
{
MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
Mesh *me= (mmd->object)? mmd->object->data: NULL;
@@ -8197,7 +9044,7 @@ static void meshdeformModifier_deformVerts(
}
static void meshdeformModifier_deformVertsEM(
- ModifierData *md, Object *ob, EditMesh *editData,
+ ModifierData *md, Object *ob, EditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
{
DerivedMesh *dm;
@@ -8251,10 +9098,10 @@ static DerivedMesh *multiresModifier_applyModifier(ModifierData *md, Object *ob,
result->release(result);
result= cddm;
}
- else if(ob->mode & OB_MODE_SCULPT) {
+ else if((ob->mode & OB_MODE_SCULPT) && ob->sculpt) {
/* would be created on the fly too, just nicer this
way on first stroke after e.g. switching levels */
- result->getPBVH(ob, result);
+ ob->sculpt->pbvh= result->getPBVH(ob, result);
}
return result;
@@ -8450,7 +9297,7 @@ static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, Edi
static void shapekeyModifier_deformVerts(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
KeyBlock *kb= ob_get_keyblock(ob);
float (*deformedVerts)[3];
@@ -8475,9 +9322,9 @@ static void shapekeyModifier_deformVertsEM(
}
static void shapekeyModifier_deformMatricesEM(
- ModifierData *md, Object *ob, EditMesh *editData,
+ ModifierData *md, Object *ob, EditMesh *editData,
DerivedMesh *derivedData, float (*vertexCos)[3],
- float (*defMats)[3][3], int numVerts)
+ float (*defMats)[3][3], int numVerts)
{
Key *key= ob_get_key(ob);
KeyBlock *kb= ob_get_keyblock(ob);
@@ -8921,6 +9768,22 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
mti->applyModifier = solidifyModifier_applyModifier;
mti->applyModifierEM = solidifyModifier_applyModifierEM;
typeArrInit = 0;
+
+ mti = INIT_TYPE(Screw);
+ mti->type = eModifierTypeType_Constructive;
+ mti->flags = eModifierTypeFlag_AcceptsMesh
+ | eModifierTypeFlag_SupportsEditmode
+ | eModifierTypeFlag_EnableInEditmode
+ | eModifierTypeFlag_AcceptsCVs;
+
+ mti->initData = screwModifier_initData;
+ mti->copyData = screwModifier_copyData;
+ mti->foreachObjectLink = screwModifier_foreachObjectLink;
+ mti->dependsOnTime = screwModifier_dependsOnTime;
+ mti->updateDepgraph = screwModifier_updateDepgraph;
+ mti->applyModifier = screwModifier_applyModifier;
+ mti->applyModifierEM = screwModifier_applyModifierEM;
+
#undef INIT_TYPE
}
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 248b7ed407d..c70d12bcb75 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -34,14 +34,15 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "BLI_math.h"
#include "BLI_blenlib.h"
+#include "BLI_math.h"
#include "BLI_pbvh.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
+#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_subsurf.h"
#include "BKE_utildefines.h"
@@ -109,11 +110,16 @@ void multires_mark_as_modified(Object *ob)
void multires_force_update(Object *ob)
{
-
- if(ob && ob->derivedFinal) {
- ob->derivedFinal->needsFree =1;
- ob->derivedFinal->release(ob->derivedFinal);
- ob->derivedFinal = NULL;
+ if(ob) {
+ if(ob->derivedFinal) {
+ ob->derivedFinal->needsFree =1;
+ ob->derivedFinal->release(ob->derivedFinal);
+ ob->derivedFinal = NULL;
+ }
+ if(ob->sculpt && ob->sculpt->pbvh) {
+ BLI_pbvh_free(ob->sculpt->pbvh);
+ ob->sculpt->pbvh= NULL;
+ }
}
}
@@ -650,7 +656,7 @@ void multires_stitch_grids(Object *ob)
}
DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int local_mmd, DerivedMesh *dm, Object *ob,
- int useRenderParams, int isFinalCalc)
+ int useRenderParams, int isFinalCalc)
{
Mesh *me= ob->data;
DerivedMesh *result;
@@ -840,7 +846,7 @@ 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;
IndexNode *node = NULL;
@@ -859,7 +865,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)
+ const int totvert, const int totedge)
{
int i,j;
IndexNode *node = NULL;
@@ -925,7 +931,7 @@ static void multires_load_old_edges(ListBase **emap, MultiresLevel *lvl, int *vv
}
static void multires_load_old_faces(ListBase **fmap, ListBase **emap, MultiresLevel *lvl, int *vvmap, int dst,
- int v1, int v2, int v3, int v4, int st2, int st3)
+ int v1, int v2, int v3, int v4, int st2, int st3)
{
int fmid;
int emid13, emid14, emid23, emid24;
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 56da45ed19a..4af007a5f91 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -44,6 +44,7 @@
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "BKE_library.h"
+#include "BKE_utildefines.h"
#include "RNA_access.h"
#include "nla_private.h"
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 10da12753e7..5bd9694e768 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1048,11 +1048,11 @@ bNodeTree *ntreeAddTree(int type)
ntree->alltypes.last = NULL;
/* this helps RNA identify ID pointers as nodetree */
- if(ntree->type==NTREE_SHADER)
+ if(ntree->type==NTREE_SHADER)
BLI_strncpy(ntree->id.name, "NTShader Nodetree", sizeof(ntree->id.name));
- else if(ntree->type==NTREE_COMPOSIT)
+ else if(ntree->type==NTREE_COMPOSIT)
BLI_strncpy(ntree->id.name, "NTCompositing Nodetree", sizeof(ntree->id.name));
- else if(ntree->type==NTREE_TEXTURE)
+ else if(ntree->type==NTREE_TEXTURE)
BLI_strncpy(ntree->id.name, "NTTexture Nodetree", sizeof(ntree->id.name));
ntreeInitTypes(ntree);
@@ -1354,9 +1354,9 @@ void ntreeMakeLocal(bNodeTree *ntree)
int local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(ntree->id.lib==NULL) return;
if(ntree->id.us==1) {
@@ -1547,7 +1547,7 @@ bNode *nodeGetActiveID(bNodeTree *ntree, short idtype)
if(ntree==NULL) return NULL;
/* check for group edit */
- for(node= ntree->nodes.first; node; node= node->next)
+ for(node= ntree->nodes.first; node; node= node->next)
if(node->flag & NODE_GROUP_EDIT)
break;
@@ -1571,7 +1571,7 @@ int nodeSetActiveID(bNodeTree *ntree, short idtype, ID *id)
if(ntree==NULL) return ok;
/* check for group edit */
- for(node= ntree->nodes.first; node; node= node->next)
+ for(node= ntree->nodes.first; node; node= node->next)
if(node->flag & NODE_GROUP_EDIT)
break;
@@ -2519,10 +2519,39 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
/* local tree then owns all compbufs */
bNodeTree *ntreeLocalize(bNodeTree *ntree)
{
- bNodeTree *ltree= ntreeCopyTree(ntree, 0);
+ bNodeTree *ltree;
bNode *node;
bNodeSocket *sock;
+ bAction *action_backup= NULL, *tmpact_backup= NULL;
+
+ /* Workaround for copying an action on each render!
+ * set action to NULL so animdata actions dont get copied */
+ AnimData *adt= BKE_animdata_from_id(&ntree->id);
+
+ if(adt) {
+ action_backup= adt->action;
+ tmpact_backup= adt->tmpact;
+
+ adt->action= NULL;
+ adt->tmpact= NULL;
+ }
+
+ /* node copy func */
+ ltree= ntreeCopyTree(ntree, 0);
+
+ if(adt) {
+ AnimData *ladt= BKE_animdata_from_id(&ltree->id);
+
+ adt->action= ladt->action= action_backup;
+ adt->tmpact= ladt->tmpact= tmpact_backup;
+
+ if(action_backup) action_backup->id.us++;
+ if(tmpact_backup) tmpact_backup->id.us++;
+
+ }
+ /* end animdata uglyness */
+
/* move over the compbufs */
/* right after ntreeCopyTree() oldsock pointers are valid */
for(node= ntree->nodes.first; node; node= node->next) {
@@ -2641,7 +2670,7 @@ static void gpu_from_node_stack(ListBase *sockets, bNodeStack **ns, GPUNodeStack
for (sock=sockets->first, i=0; sock; sock=sock->next, i++) {
memset(&gs[i], 0, sizeof(gs[i]));
- QUATCOPY(gs[i].vec, ns[i]->vec);
+ QUATCOPY(gs[i].vec, ns[i]->vec);
gs[i].link= ns[i]->data;
if (sock->type == SOCK_VALUE)
@@ -2734,7 +2763,7 @@ void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat)
if(node->typeinfo->gpufunc(mat, node, gpuin, gpuout))
data_from_gpu_stack(&node->outputs, nsout, gpuout);
}
- else if(node->type==NODE_GROUP && node->id) {
+ else if(node->type==NODE_GROUP && node->id) {
node_get_stack(node, stack, nsin, nsout);
gpu_node_group_execute(stack, mat, node, nsin, nsout);
}
@@ -2994,7 +3023,7 @@ void nodeRegisterType(ListBase *typelist, const bNodeType *ntype)
bNodeType *ntypen= MEM_callocN(sizeof(bNodeType), "node type");
*ntypen= *ntype;
BLI_addtail(typelist, ntypen);
- }
+ }
}
static void registerCompositNodes(ListBase *ntypelist)
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index b08754a7a3f..e4350cfde7f 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -58,8 +58,9 @@
#include "DNA_world_types.h"
#include "BLI_blenlib.h"
-#include "BLI_math.h"
#include "BLI_editVert.h"
+#include "BLI_math.h"
+#include "BLI_pbvh.h"
#include "BKE_utildefines.h"
@@ -231,23 +232,26 @@ void object_free_display(Object *ob)
freedisplist(&ob->disp);
}
-void free_sculptsession(SculptSession **ssp)
+void free_sculptsession(Object *ob)
{
- if(ssp && *ssp) {
- SculptSession *ss = *ssp;
+ if(ob && ob->sculpt) {
+ SculptSession *ss = ob->sculpt;
+ DerivedMesh *dm= ob->derivedFinal;
+
+ if(ss->pbvh)
+ BLI_pbvh_free(ss->pbvh);
+ if(dm && dm->getPBVH)
+ dm->getPBVH(NULL, dm); /* signal to clear */
if(ss->texcache)
MEM_freeN(ss->texcache);
- if(ss->layer_disps)
- MEM_freeN(ss->layer_disps);
-
if(ss->layer_co)
MEM_freeN(ss->layer_co);
MEM_freeN(ss);
- *ssp = NULL;
+ ob->sculpt = NULL;
}
}
@@ -306,7 +310,7 @@ void free_object(Object *ob)
if(ob->bsoft) bsbFree(ob->bsoft);
if(ob->gpulamp.first) GPU_lamp_free(ob);
- free_sculptsession(&ob->sculpt);
+ free_sculptsession(ob);
if(ob->pc_ids.first) BLI_freelistN(&ob->pc_ids);
}
@@ -710,9 +714,9 @@ void make_local_camera(Camera *cam)
int local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(cam->id.lib==0) return;
if(cam->id.us==1) {
@@ -858,9 +862,9 @@ void make_local_lamp(Lamp *la)
int local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(la->id.lib==0) return;
if(la->id.us==1) {
@@ -1356,9 +1360,9 @@ void make_local_object(Object *ob)
int local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(ob->id.lib==NULL) return;
@@ -1766,7 +1770,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
/* vec: 4 items! */
- if( where_on_path(par, ctime, vec, dir, NULL, &radius) ) {
+ if( where_on_path(par, ctime, vec, dir, NULL, &radius) ) {
if(cu->flag & CU_FOLLOW) {
vec_to_quat( quat,dir, ob->trackflag, ob->upflag);
@@ -2301,6 +2305,44 @@ void object_boundbox_flag(Object *ob, int flag, int set)
}
}
+void object_get_dimensions(Object *ob, float *value)
+{
+ BoundBox *bb = NULL;
+
+ bb= object_get_boundbox(ob);
+ if (bb) {
+ float scale[3];
+
+ mat4_to_size( scale,ob->obmat);
+
+ value[0] = fabs(scale[0]) * (bb->vec[4][0] - bb->vec[0][0]);
+ value[1] = fabs(scale[1]) * (bb->vec[2][1] - bb->vec[0][1]);
+ value[2] = fabs(scale[2]) * (bb->vec[1][2] - bb->vec[0][2]);
+ } else {
+ value[0] = value[1] = value[2] = 0.f;
+ }
+}
+
+void object_set_dimensions(Object *ob, const float *value)
+{
+ BoundBox *bb = NULL;
+
+ bb= object_get_boundbox(ob);
+ if (bb) {
+ float scale[3], len[3];
+
+ 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];
+ len[2] = bb->vec[1][2] - bb->vec[0][2];
+
+ if (len[0] > 0.f) ob->size[0] = value[0] / len[0];
+ if (len[1] > 0.f) ob->size[1] = value[1] / len[1];
+ if (len[2] > 0.f) ob->size[2] = value[2] / len[2];
+ }
+}
+
void minmax_object(Object *ob, float *min, float *max)
{
BoundBox bb;
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index f228dc5002e..bd9e041dab4 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2926,7 +2926,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
ParticleCacheKey *ca, **cache= edit->pathcache;
ParticleEditSettings *pset = &scene->toolsettings->particle;
- PTCacheEditPoint *point = edit->points;
+ PTCacheEditPoint *point = NULL;
PTCacheEditKey *ekey = NULL;
ParticleSystem *psys = edit->psys;
@@ -2941,7 +2941,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
float hairmat[4][4], rotmat[3][3], prev_tangent[3];
int k,i;
int steps = (int)pow(2.0, (double)pset->draw_step);
- int totpart = edit->totpoint;
+ int totpart = edit->totpoint, recalc_set=0;
float sel_col[3];
float nosel_col[3];
@@ -2951,6 +2951,11 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/* clear out old and create new empty path cache */
psys_free_path_cache(edit->psys, edit);
cache= edit->pathcache= psys_alloc_path_cache_buffers(&edit->pathcachebufs, totpart, steps+1);
+
+ /* set flag for update (child particles check this too) */
+ for(i=0, point=edit->points; i<totpart; i++, point++)
+ point->flag |= PEP_EDIT_RECALC;
+ recalc_set = 1;
}
frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f;
@@ -2972,7 +2977,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
}
/*---first main loop: create all actual particles' paths---*/
- for(i=0; i<totpart; i++, pa+=pa?1:0, point++){
+ for(i=0, point=edit->points; i<totpart; i++, pa+=pa?1:0, point++){
if(edit->totcached && !(point->flag & PEP_EDIT_RECALC))
continue;
@@ -3124,6 +3129,12 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
ParticleSimulationData sim = {scene, ob, psys, psys_get_modifier(ob, psys), NULL};
psys_cache_child_paths(&sim, cfra, 1);
}
+
+ /* clear recalc flag if set here */
+ if(recalc_set) {
+ for(i=0, point=edit->points; i<totpart; i++, point++)
+ point->flag &= ~PEP_EDIT_RECALC;
+ }
}
/************************************************/
/* Particle Key handling */
@@ -3466,9 +3477,9 @@ void make_local_particlesettings(ParticleSettings *part)
int local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(part->id.lib==0) return;
if(part->id.us==1) {
@@ -4238,7 +4249,7 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
normalize_v3(side);
cross_v3_v3v3(nor, vec, side);
- unit_m4(mat);
+ unit_m4(mat);
VECCOPY(mat[0], vec);
VECCOPY(mat[1], side);
VECCOPY(mat[2], nor);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 38808131f92..a99a8affbd3 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -159,8 +159,7 @@ void psys_reset(ParticleSystem *psys, int mode)
psys_free_path_cache(psys, psys->edit);
/* reset point cache */
- psys->pointcache->flag &= ~PTCACHE_SIMULATION_VALID;
- psys->pointcache->simframe= 0;
+ BKE_ptcache_invalidate(psys->pointcache);
}
static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
@@ -287,7 +286,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
node: the allocated links - total derived mesh element count
nodearray: the array of nodes aligned with the base mesh's elements, so
- each original elements can reference its derived elements
+ each original elements can reference its derived elements
*/
Mesh *me= (Mesh*)ob->data;
PARTICLE_P;
@@ -512,18 +511,18 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
static void hammersley_create(float *out, int n, int seed, float amount)
{
RNG *rng;
- double p, t, offs[2];
- int k, kk;
+ double p, t, offs[2];
+ int k, kk;
rng = rng_new(31415926 + n + seed);
offs[0]= rng_getDouble(rng) + amount;
offs[1]= rng_getDouble(rng) + amount;
rng_free(rng);
- for (k = 0; k < n; k++) {
- t = 0;
- for (p = 0.5, kk = k; kk; p *= 0.5, kk >>= 1)
- if (kk & 1) /* kk mod 2 = 1 */
+ for (k = 0; k < n; k++) {
+ t = 0;
+ for (p = 0.5, kk = k; kk; p *= 0.5, kk >>= 1)
+ if (kk & 1) /* kk mod 2 = 1 */
t += p;
out[2*k + 0]= fmod((double)k/(double)n + offs[0], 1.0);
@@ -546,7 +545,7 @@ static void init_mv_jit(float *jit, int num, int seed2, float amount)
rng = rng_new(31415926 + num + seed2);
x= 0;
- num2 = 2 * num;
+ num2 = 2 * num;
for(i=0; i<num2; i+=2) {
jit[i]= x + amount*rad1*(0.5f - rng_getFloat(rng));
@@ -2215,21 +2214,17 @@ static void set_keyed_keys(ParticleSimulationData *sim)
void psys_make_temp_pointcache(Object *ob, ParticleSystem *psys)
{
PointCache *cache = psys->pointcache;
- PTCacheID pid;
-
- if((cache->flag & PTCACHE_DISK_CACHE)==0 || cache->mem_cache.first)
- return;
- BKE_ptcache_id_from_particles(&pid, ob, psys);
-
- BKE_ptcache_disk_to_mem(&pid);
+ if(cache->flag & PTCACHE_DISK_CACHE && cache->mem_cache.first == NULL) {
+ PTCacheID pid;
+ BKE_ptcache_id_from_particles(&pid, ob, psys);
+ BKE_ptcache_disk_to_mem(&pid);
+ }
}
static void psys_clear_temp_pointcache(ParticleSystem *psys)
{
- if((psys->pointcache->flag & PTCACHE_DISK_CACHE)==0)
- return;
-
- BKE_ptcache_free_mem(&psys->pointcache->mem_cache);
+ if(psys->pointcache->flag & PTCACHE_DISK_CACHE)
+ BKE_ptcache_free_mem(&psys->pointcache->mem_cache);
}
void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
{
@@ -3202,15 +3197,11 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
{
ParticleSystem *psys = sim->psys;
ParticleSettings *part=psys->part;
- KDTree *tree=0;
- //IpoCurve *icu_esize=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system
-/* Material *ma=give_current_material(sim->ob, part->omat); */
BoidBrainData bbd;
PARTICLE_P;
float timestep;
- int totpart;
/* current time */
- float ctime, ipotime; // XXX old animation system
+ float ctime;
/* frame & time changes */
float dfra, dtime, pa_dtime, pa_dfra=0.0;
float birthtime, dietime;
@@ -3218,200 +3209,157 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
/* where have we gone in time since last time */
dfra= cfra - psys->cfra;
- totpart=psys->totpart;
-
timestep = psys_get_timestep(sim);
dtime= dfra*timestep;
ctime= cfra*timestep;
- ipotime= cfra; // XXX old animation system
-
-#if 0 // XXX old animation system
- if(part->flag&PART_ABS_TIME && part->ipo){
- calc_ipo(part->ipo, cfra);
- execute_ipo((ID *)part, part->ipo);
- }
-#endif // XXX old animation system
if(dfra<0.0){
- float *vg_size=0;
- //if(part->type==PART_REACTOR)
- // vg_size=psys_cache_vgroup(sim->psmd->dm,psys,PSYS_VG_SIZE);
-
LOOP_EXISTING_PARTICLES {
- /* set correct ipo timing */
-#if 0 // XXX old animation system
- if((part->flag&PART_ABS_TIME)==0 && part->ipo){
- ipotime=100.0f*(cfra-pa->time)/pa->lifetime;
- calc_ipo(part->ipo, ipotime);
- execute_ipo((ID *)part, part->ipo);
- }
-#endif // XXX old animation system
pa->size = part->size;
if(part->randsize > 0.0)
pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
reset_particle(sim, pa, dtime, cfra);
}
-
- if(vg_size)
- MEM_freeN(vg_size);
+ return;
}
- else{
- BLI_srandom(31415926 + (int)cfra + psys->seed);
- psys_update_effectors(sim);
+ BLI_srandom(31415926 + (int)cfra + psys->seed);
- if(part->type != PART_HAIR)
- sim->colliders = get_collider_cache(sim->scene, NULL);
+ psys_update_effectors(sim);
- if(part->phystype==PART_PHYS_BOIDS){
- ParticleTarget *pt = psys->targets.first;
- bbd.sim = sim;
- bbd.part = part;
- bbd.cfra = cfra;
- bbd.dfra = dfra;
- bbd.timestep = timestep;
+ if(part->type != PART_HAIR)
+ sim->colliders = get_collider_cache(sim->scene, NULL);
- psys_update_particle_tree(psys, cfra);
+ if(part->phystype==PART_PHYS_BOIDS){
+ ParticleTarget *pt = psys->targets.first;
+ bbd.sim = sim;
+ bbd.part = part;
+ bbd.cfra = cfra;
+ bbd.dfra = dfra;
+ bbd.timestep = timestep;
- boids_precalc_rules(part, cfra);
+ psys_update_particle_tree(psys, cfra);
- for(; pt; pt=pt->next) {
- if(pt->ob)
- psys_update_particle_tree(BLI_findlink(&pt->ob->particlesystem, pt->psys-1), cfra);
- }
+ boids_precalc_rules(part, cfra);
+
+ for(; pt; pt=pt->next) {
+ if(pt->ob)
+ psys_update_particle_tree(BLI_findlink(&pt->ob->particlesystem, pt->psys-1), cfra);
}
+ }
- /* main loop: calculate physics for all particles */
- LOOP_SHOWN_PARTICLES {
- copy_particle_key(&pa->prev_state,&pa->state,1);
-
- /* set correct ipo timing */
-#if 0 // XXX old animation system
- if((part->flag&PART_ABS_TIME)==0 && part->ipo){
- ipotime=100.0f*(cfra-pa->time)/pa->lifetime;
- calc_ipo(part->ipo, ipotime);
- execute_ipo((ID *)part, part->ipo);
- }
-#endif // XXX old animation system
- //update_particle_settings(psys, part, &tpart, pa);
+ /* main loop: calculate physics for all particles */
+ LOOP_SHOWN_PARTICLES {
+ copy_particle_key(&pa->prev_state,&pa->state,1);
- pa->size = part->size;
- if(part->randsize > 0.0)
- pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
+ pa->size = part->size;
+ if(part->randsize > 0.0)
+ pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
- ///* reactions can change birth time so they need to be checked first */
- //if(psys->reactevents.first && ELEM(pa->alive,PARS_DEAD,PARS_KILLED)==0)
- // react_to_events(psys,p);
+ ///* reactions can change birth time so they need to be checked first */
+ //if(psys->reactevents.first && ELEM(pa->alive,PARS_DEAD,PARS_KILLED)==0)
+ // react_to_events(psys,p);
- birthtime = pa->time;
- dietime = birthtime + pa->lifetime;
+ birthtime = pa->time;
+ dietime = birthtime + pa->lifetime;
- pa_dfra = dfra;
- pa_dtime = dtime;
+ pa_dfra = dfra;
+ pa_dtime = dtime;
- if(dietime <= cfra && psys->cfra < dietime){
- /* particle dies some time between this and last step */
- pa_dfra = dietime - ((birthtime > psys->cfra) ? birthtime : psys->cfra);
- pa_dtime = pa_dfra * timestep;
- pa->alive = PARS_DYING;
- }
- else if(birthtime <= cfra && birthtime >= psys->cfra){
- /* particle is born some time between this and last step*/
- reset_particle(sim, pa, dtime, cfra);
- pa->alive = PARS_ALIVE;
- pa_dfra = cfra - birthtime;
- pa_dtime = pa_dfra*timestep;
- }
- else if(dietime < cfra){
- /* nothing to be done when particle is dead */
- }
+ if(dietime <= cfra && psys->cfra < dietime){
+ /* particle dies some time between this and last step */
+ pa_dfra = dietime - ((birthtime > psys->cfra) ? birthtime : psys->cfra);
+ pa_dtime = pa_dfra * timestep;
+ pa->alive = PARS_DYING;
+ }
+ else if(birthtime <= cfra && birthtime >= psys->cfra){
+ /* particle is born some time between this and last step*/
+ reset_particle(sim, pa, dtime, cfra);
+ pa->alive = PARS_ALIVE;
+ pa_dfra = cfra - birthtime;
+ pa_dtime = pa_dfra*timestep;
+ }
+ else if(dietime < cfra){
+ /* nothing to be done when particle is dead */
+ }
+
+ /* only reset unborn particles if they're shown or if the particle is born soon*/
+ if(pa->alive==PARS_UNBORN
+ && (part->flag & PART_UNBORN || cfra + psys->pointcache->step > pa->time))
+ reset_particle(sim, pa, dtime, cfra);
+ else if(part->phystype == PART_PHYS_NO)
+ reset_particle(sim, pa, dtime, cfra);
+
+ if(dfra>0.0 && ELEM(pa->alive,PARS_ALIVE,PARS_DYING)){
+ switch(part->phystype){
+ case PART_PHYS_NEWTON:
+ /* do global forces & effectors */
+ apply_particle_forces(sim, p, pa_dfra, cfra);
+
+ /* deflection */
+ if(sim->colliders)
+ deflect_particle(sim, p, pa_dfra, cfra);
+
+ /* rotations */
+ rotate_particle(part, pa, pa_dfra, timestep);
+ break;
+ case PART_PHYS_BOIDS:
+ {
+ bbd.goal_ob = NULL;
+ boid_brain(&bbd, p, pa);
+ if(pa->alive != PARS_DYING) {
+ boid_body(&bbd, pa);
- /* only reset unborn particles if they're shown or if the particle is born soon*/
- if(pa->alive==PARS_UNBORN
- && (part->flag & PART_UNBORN || cfra + psys->pointcache->step > pa->time))
- reset_particle(sim, pa, dtime, cfra);
- else if(part->phystype == PART_PHYS_NO)
- reset_particle(sim, pa, dtime, cfra);
-
- if(dfra>0.0 && ELEM(pa->alive,PARS_ALIVE,PARS_DYING)){
- switch(part->phystype){
- case PART_PHYS_NEWTON:
- /* do global forces & effectors */
- apply_particle_forces(sim, p, pa_dfra, cfra);
-
/* deflection */
if(sim->colliders)
deflect_particle(sim, p, pa_dfra, cfra);
-
- /* rotations */
- rotate_particle(part, pa, pa_dfra, timestep);
- break;
- case PART_PHYS_BOIDS:
- {
- bbd.goal_ob = NULL;
- boid_brain(&bbd, p, pa);
- if(pa->alive != PARS_DYING) {
- boid_body(&bbd, pa);
-
- /* deflection */
- if(sim->colliders)
- deflect_particle(sim, p, pa_dfra, cfra);
- }
- break;
}
+ break;
}
+ }
- if(pa->alive == PARS_DYING){
- //push_reaction(ob,psys,p,PART_EVENT_DEATH,&pa->state);
+ if(pa->alive == PARS_DYING){
+ //push_reaction(ob,psys,p,PART_EVENT_DEATH,&pa->state);
- pa->alive=PARS_DEAD;
- pa->state.time=pa->dietime;
- }
- else
- pa->state.time=cfra;
-
- //push_reaction(ob,psys,p,PART_EVENT_NEAR,&pa->state);
+ pa->alive=PARS_DEAD;
+ pa->state.time=pa->dietime;
}
- }
+ else
+ pa->state.time=cfra;
- free_collider_cache(&sim->colliders);
+ //push_reaction(ob,psys,p,PART_EVENT_NEAR,&pa->state);
+ }
}
- if(tree)
- BLI_kdtree_free(tree);
+ free_collider_cache(&sim->colliders);
+}
+static void update_children(ParticleSimulationData *sim)
+{
+ if((sim->psys->part->type == PART_HAIR) && (sim->psys->flag & PSYS_HAIR_DONE)==0)
+ /* don't generate children while growing hair - waste of time */
+ psys_free_children(sim->psys);
+ else if(sim->psys->part->childtype && sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
+ distribute_particles(sim, PART_FROM_CHILD);
+ else
+ psys_free_children(sim->psys);
}
-
/* updates cached particles' alive & other flags etc..*/
static void cached_step(ParticleSimulationData *sim, float cfra)
{
ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part;
- //IpoCurve *icu_esize = NULL; //=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system
-/* Material *ma = give_current_material(sim->ob,part->omat); */
PARTICLE_P;
- float disp, birthtime, dietime, *vg_size= NULL; // XXX ipotime=cfra
+ float disp, birthtime, dietime;
BLI_srandom(psys->seed);
- if(part->from!=PART_FROM_PARTICLE)
- vg_size= psys_cache_vgroup(sim->psmd->dm,psys,PSYS_VG_SIZE);
-
psys_update_effectors(sim);
disp= (float)get_current_display_percentage(psys)/100.0f;
LOOP_PARTICLES {
-#if 0 // XXX old animation system
- if((part->flag&PART_ABS_TIME)==0 && part->ipo){
- ipotime=100.0f*(cfra-pa->time)/pa->lifetime;
- calc_ipo(part->ipo, ipotime);
- execute_ipo((ID *)part, part->ipo);
- }
-#endif // XXX old animation system
- //update_settings_with_particle(psys, part, pa);
-
pa->size = part->size;
if(part->randsize > 0.0)
pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
@@ -3427,12 +3375,10 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
if(part->flag & PART_UNBORN && (psys->pointcache->flag & PTCACHE_EXTERNAL) == 0)
reset_particle(sim, pa, 0.0f, cfra);
}
- else if(dietime <= cfra){
+ else if(dietime <= cfra)
pa->alive = PARS_DEAD;
- }
- else{
+ else
pa->alive = PARS_ALIVE;
- }
if(psys->lattice){
end_latt_deform(psys->lattice);
@@ -3444,114 +3390,8 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
else
pa->flag &= ~PARS_NO_DISP;
}
-
- /* make sure that children are up to date */
- if(psys->part->childtype && psys->totchild != get_psys_tot_child(sim->scene, psys)) {
- realloc_particles(sim, psys->totpart);
- distribute_particles(sim, PART_FROM_CHILD);
- }
-
- psys_update_path_cache(sim, cfra);
-
- if(vg_size)
- MEM_freeN(vg_size);
}
-static void psys_changed_type(ParticleSimulationData *sim)
-{
- ParticleSettings *part = sim->psys->part;
- PTCacheID pid;
-
- BKE_ptcache_id_from_particles(&pid, sim->ob, sim->psys);
-
- /* system type has changed so set sensible defaults and clear non applicable flags */
- if(part->from == PART_FROM_PARTICLE) {
- //if(part->type != PART_REACTOR)
- part->from = PART_FROM_FACE;
- if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
- part->distr = PART_DISTR_JIT;
- }
-
- if(part->phystype != PART_PHYS_KEYED)
- sim->psys->flag &= ~PSYS_KEYED;
-
- if(part->type == PART_HAIR) {
- if(ELEM4(part->ren_as, PART_DRAW_NOT, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR)==0)
- part->ren_as = PART_DRAW_PATH;
-
- if(ELEM3(part->draw_as, PART_DRAW_NOT, PART_DRAW_REND, PART_DRAW_PATH)==0)
- part->draw_as = PART_DRAW_REND;
-
- CLAMP(part->path_start, 0.0f, 100.0f);
- CLAMP(part->path_end, 0.0f, 100.0f);
-
- BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
- }
- else {
- free_hair(sim->ob, sim->psys, 1);
-
- CLAMP(part->path_start, 0.0f, MAX2(100.0f, part->end + part->lifetime));
- CLAMP(part->path_end, 0.0f, MAX2(100.0f, part->end + part->lifetime));
- }
-
- psys_reset(sim->psys, PSYS_RESET_ALL);
-}
-void psys_check_boid_data(ParticleSystem *psys)
-{
- BoidParticle *bpa;
- PARTICLE_P;
-
- pa = psys->particles;
-
- if(!pa)
- return;
-
- if(psys->part && psys->part->phystype==PART_PHYS_BOIDS) {
- if(!pa->boid) {
- bpa = MEM_callocN(psys->totpart * sizeof(BoidParticle), "Boid Data");
-
- LOOP_PARTICLES
- pa->boid = bpa++;
- }
- }
- else if(pa->boid){
- MEM_freeN(pa->boid);
- LOOP_PARTICLES
- pa->boid = NULL;
- }
-}
-static void psys_changed_physics(ParticleSimulationData *sim)
-{
- ParticleSettings *part = sim->psys->part;
-
- if(ELEM(part->phystype, PART_PHYS_NO, PART_PHYS_KEYED)) {
- PTCacheID pid;
- BKE_ptcache_id_from_particles(&pid, sim->ob, sim->psys);
- BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
- }
- else {
- free_keyed_keys(sim->psys);
- sim->psys->flag &= ~PSYS_KEYED;
- }
-
- if(part->phystype == PART_PHYS_BOIDS && part->boids == NULL) {
- BoidState *state;
-
- part->boids = MEM_callocN(sizeof(BoidSettings), "Boid Settings");
- boid_default_settings(part->boids);
-
- state = boid_new_state(part->boids);
- BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Separate));
- BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Flock));
-
- ((BoidRule*)state->rules.first)->flag |= BOIDRULE_CURRENT;
-
- state->flag |= BOIDSTATE_CURRENT;
- BLI_addtail(&part->boids->states, state);
- }
-
- psys_check_boid_data(sim->psys);
-}
static void particles_fluid_step(ParticleSimulationData *sim, int cfra)
{
ParticleSystem *psys = sim->psys;
@@ -3660,200 +3500,127 @@ static void particles_fluid_step(ParticleSimulationData *sim, int cfra)
#endif // DISABLE_ELBEEM
}
-/* Calculates the next state for all particles of the system */
-/* In particles code most fra-ending are frames, time-ending are fra*timestep (seconds)*/
+static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float cfra)
+{
+ ParticleSystem *psys = sim->psys;
+ ParticleSettings *part = psys->part;
+ int oldtotpart = psys->totpart;
+ int totpart = oldtotpart;
+
+ if(pid && psys->pointcache->flag & PTCACHE_EXTERNAL)
+ totpart = pid->cache->totpoint;
+ else if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
+ totpart = part->grid_res*part->grid_res*part->grid_res;
+ else
+ totpart = psys->part->totpart;
+
+ if(totpart != oldtotpart)
+ realloc_particles(sim, totpart);
+
+ return totpart - oldtotpart;
+}
+/* Calculates the next state for all particles of the system
+ * In particles code most fra-ending are frames, time-ending are fra*timestep (seconds)
+ * 1. Emit particles
+ * 2. Check cache (if used) and return if frame is cached
+ * 3. Do dynamics
+ * 4. Save to cache */
static void system_step(ParticleSimulationData *sim, float cfra)
{
ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part;
PointCache *cache = psys->pointcache;
- PTCacheID pid;
+ PTCacheID pid, *use_cache = NULL;
PARTICLE_P;
- int totpart, oldtotpart, totchild, oldtotchild;
+ int oldtotpart;
float disp, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, *vg_size= 0;
- int init= 0, distr= 0, alloc= 0, usecache= 0, only_children_changed= 0;
- int framenr, framedelta, startframe, endframe;
+ int init= 0, emit= 0, only_children_changed= 0;
+ int framenr, framedelta, startframe = 0, endframe = 100;
framenr= (int)sim->scene->r.cfra;
framedelta= framenr - cache->simframe;
- /* set suitable cache range automatically */
- if((cache->flag & (PTCACHE_BAKING|PTCACHE_BAKED))==0 && !(psys->flag & PSYS_HAIR_DYNAMICS))
- psys_get_pointcache_start_end(sim->scene, sim->psys, &cache->startframe, &cache->endframe);
-
- BKE_ptcache_id_from_particles(&pid, sim->ob, psys);
- BKE_ptcache_id_time(&pid, sim->scene, 0.0f, &startframe, &endframe, NULL);
-
- psys_clear_temp_pointcache(sim->psys);
-
- /* update ipo's */
-#if 0 // XXX old animation system
- if((part->flag & PART_ABS_TIME) && part->ipo) {
- calc_ipo(part->ipo, cfra);
- execute_ipo((ID *)part, part->ipo);
+ /* cache shouldn't be used for hair or "continue physics" */
+ if(part->type != PART_HAIR && BKE_ptcache_get_continue_physics() == 0) {
+ BKE_ptcache_id_from_particles(&pid, sim->ob, psys);
+ use_cache = &pid;
}
-#endif // XXX old animation system
- /* hair if it's already done is handled separate */
- if(part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DONE)) {
- hair_step(sim, cfra);
- psys->cfra = cfra;
- psys->recalc = 0;
- return;
- }
- /* fluid is also handled separate */
- else if(part->type == PART_FLUID) {
- particles_fluid_step(sim, framenr);
- psys->cfra = cfra;
- psys->recalc = 0;
- return;
- }
+ if(use_cache) {
+ psys_clear_temp_pointcache(sim->psys);
- /* cache shouldn't be used for hair or "none" or "keyed" physics */
- if(part->type == PART_HAIR || ELEM(part->phystype, PART_PHYS_NO, PART_PHYS_KEYED))
- usecache= 0;
- else if(BKE_ptcache_get_continue_physics())
- usecache= 0;
- else
- usecache= 1;
+ /* set suitable cache range automatically */
+ if((cache->flag & (PTCACHE_BAKING|PTCACHE_BAKED))==0)
+ psys_get_pointcache_start_end(sim->scene, sim->psys, &cache->startframe, &cache->endframe);
+
+ BKE_ptcache_id_time(&pid, sim->scene, 0.0f, &startframe, &endframe, NULL);
- if(usecache) {
- /* frame clamping */
+ /* simulation is only active during a specific period */
if(framenr < startframe) {
psys_reset(psys, PSYS_RESET_CACHE_MISS);
- psys->cfra = cfra;
- psys->recalc = 0;
return;
}
else if(framenr > endframe) {
framenr= endframe;
}
-
+
if(framenr == startframe) {
- BKE_ptcache_id_reset(sim->scene, &pid, PTCACHE_RESET_OUTDATED);
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ BKE_ptcache_id_reset(sim->scene, use_cache, PTCACHE_RESET_OUTDATED);
+ BKE_ptcache_validate(cache, framenr);
cache->flag &= ~PTCACHE_REDO_NEEDED;
}
}
+/* 1. emit particles */
+
/* verify if we need to reallocate */
oldtotpart = psys->totpart;
- oldtotchild = psys->totchild;
-
- if(psys->pointcache->flag & PTCACHE_EXTERNAL)
- totpart = pid.cache->totpoint;
- else if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
- totpart = part->grid_res*part->grid_res*part->grid_res;
- else
- totpart = psys->part->totpart;
- totchild = get_psys_tot_child(sim->scene, psys);
-
- if(oldtotpart != totpart || oldtotchild != totchild) {
- only_children_changed = (oldtotpart == totpart);
- alloc = 1;
- distr= 1;
- init= 1;
- }
- if(psys->recalc & PSYS_RECALC_RESET) {
- distr= 1;
- init= 1;
- }
+ emit = emit_particles(sim, use_cache, cfra);
+ init = emit*emit + (psys->recalc & PSYS_RECALC_RESET);
if(init) {
- if(distr) {
- if(alloc) {
- realloc_particles(sim, totpart);
-
- if(oldtotpart && usecache && !only_children_changed) {
- BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
- BKE_ptcache_id_from_particles(&pid, sim->ob, psys);
- }
- }
-
- if(!only_children_changed)
- distribute_particles(sim, part->from);
-
- if((psys->part->type == PART_HAIR) && !(psys->flag & PSYS_HAIR_DONE))
- /* don't generate children while growing hair - waste of time */
- psys_free_children(psys);
- else if(get_psys_tot_child(sim->scene, psys))
- distribute_particles(sim, PART_FROM_CHILD);
- }
-
- if(!only_children_changed) {
- free_keyed_keys(psys);
-
- initialize_all_particles(sim);
-
-
- if(alloc) {
- reset_all_particles(sim, 0.0, cfra, oldtotpart);
- }
- }
+ distribute_particles(sim, part->from);
+ initialize_all_particles(sim);
+ reset_all_particles(sim, 0.0, cfra, oldtotpart);
/* flag for possible explode modifiers after this system */
sim->psmd->flag |= eParticleSystemFlag_Pars;
}
- /* try to read from the cache */
- if(usecache) {
- int result = BKE_ptcache_read_cache(&pid, cfra, sim->scene->r.frs_sec);
+/* 2. try to read from the cache */
+ if(use_cache) {
+ int cache_result = BKE_ptcache_read_cache(use_cache, cfra, sim->scene->r.frs_sec);
- if(result == PTCACHE_READ_EXACT || result == PTCACHE_READ_INTERPOLATED) {
+ if(ELEM(cache_result, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED)) {
cached_step(sim, cfra);
- psys->cfra=cfra;
- psys->recalc = 0;
+ update_children(sim);
+ psys_update_path_cache(sim, cfra);
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ BKE_ptcache_validate(cache, framenr);
- if(result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
- BKE_ptcache_write_cache(&pid, (int)cfra);
+ if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
+ BKE_ptcache_write_cache(use_cache, framenr);
return;
}
- else if(result==PTCACHE_READ_OLD) {
+ else if(cache_result == PTCACHE_READ_OLD) {
psys->cfra = (float)cache->simframe;
- LOOP_PARTICLES {
- /* update alive status */
- if(pa->time > psys->cfra)
- pa->alive = PARS_UNBORN;
- else if(pa->dietime <= psys->cfra)
- pa->alive = PARS_DEAD;
- else
- pa->alive = PARS_ALIVE;
- }
+ cached_step(sim, psys->cfra);
}
else if(cfra != startframe && ( /*sim->ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED))) { /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
psys_reset(psys, PSYS_RESET_CACHE_MISS);
- psys->cfra=cfra;
- psys->recalc = 0;
return;
}
- }
- else {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
- }
- /* if on second frame, write cache for first frame */
- if(usecache && psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
- BKE_ptcache_write_cache(&pid, startframe);
-
- if(part->phystype==PART_PHYS_KEYED)
- psys_count_keyed_targets(sim);
-
- /* initialize vertex groups */
- if(part->from!=PART_FROM_PARTICLE) {
- vg_vel= psys_cache_vgroup(sim->psmd->dm,psys,PSYS_VG_VEL);
- vg_tan= psys_cache_vgroup(sim->psmd->dm,psys,PSYS_VG_TAN);
- vg_rot= psys_cache_vgroup(sim->psmd->dm,psys,PSYS_VG_ROT);
- vg_size= psys_cache_vgroup(sim->psmd->dm,psys,PSYS_VG_SIZE);
+ /* if on second frame, write cache for first frame */
+ if(psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
+ BKE_ptcache_write_cache(use_cache, startframe);
}
+ else
+ BKE_ptcache_invalidate(cache);
+/* 3. do dynamics */
/* set particles to be not calculated TODO: can't work with pointcache */
disp= (float)get_current_display_percentage(psys)/100.0f;
@@ -3880,36 +3647,118 @@ static void system_step(ParticleSimulationData *sim, float cfra)
}
}
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
-
- psys->recalc = 0;
- psys->cfra = cfra;
-
- /* only write cache starting from second frame */
- if(usecache && framenr != startframe)
- BKE_ptcache_write_cache(&pid, (int)cfra);
-
- /* for keyed particles the path is allways known so it can be drawn */
- if(part->phystype==PART_PHYS_KEYED) {
- set_keyed_keys(sim);
- psys_update_path_cache(sim,(int)cfra);
+/* 4. only write cache starting from second frame */
+ if(use_cache) {
+ BKE_ptcache_validate(cache, framenr);
+ if(framenr != startframe)
+ BKE_ptcache_write_cache(use_cache, framenr);
}
- else if(psys->pathcache)
- psys_free_path_cache(psys, NULL);
- /* cleanup */
- if(vg_vel) MEM_freeN(vg_vel);
- if(vg_tan) MEM_freeN(vg_tan);
- if(vg_rot) MEM_freeN(vg_rot);
- if(vg_size) MEM_freeN(vg_size);
+ if(init)
+ update_children(sim);
+/* cleanup */
if(psys->lattice){
end_latt_deform(psys->lattice);
psys->lattice= NULL;
}
}
+/* system type has changed so set sensible defaults and clear non applicable flags */
+static void psys_changed_type(ParticleSimulationData *sim)
+{
+ ParticleSettings *part = sim->psys->part;
+ PTCacheID pid;
+
+ BKE_ptcache_id_from_particles(&pid, sim->ob, sim->psys);
+
+ if(part->from == PART_FROM_PARTICLE) {
+ //if(part->type != PART_REACTOR)
+ part->from = PART_FROM_FACE;
+ if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
+ part->distr = PART_DISTR_JIT;
+ }
+
+ if(part->phystype != PART_PHYS_KEYED)
+ sim->psys->flag &= ~PSYS_KEYED;
+
+ if(part->type == PART_HAIR) {
+ if(ELEM4(part->ren_as, PART_DRAW_NOT, PART_DRAW_PATH, PART_DRAW_OB, PART_DRAW_GR)==0)
+ part->ren_as = PART_DRAW_PATH;
+
+ if(ELEM3(part->draw_as, PART_DRAW_NOT, PART_DRAW_REND, PART_DRAW_PATH)==0)
+ part->draw_as = PART_DRAW_REND;
+
+ CLAMP(part->path_start, 0.0f, 100.0f);
+ CLAMP(part->path_end, 0.0f, 100.0f);
+
+ BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
+ }
+ else {
+ free_hair(sim->ob, sim->psys, 1);
+
+ CLAMP(part->path_start, 0.0f, MAX2(100.0f, part->end + part->lifetime));
+ CLAMP(part->path_end, 0.0f, MAX2(100.0f, part->end + part->lifetime));
+ }
+
+ psys_reset(sim->psys, PSYS_RESET_ALL);
+}
+void psys_check_boid_data(ParticleSystem *psys)
+{
+ BoidParticle *bpa;
+ PARTICLE_P;
+
+ pa = psys->particles;
+
+ if(!pa)
+ return;
+
+ if(psys->part && psys->part->phystype==PART_PHYS_BOIDS) {
+ if(!pa->boid) {
+ bpa = MEM_callocN(psys->totpart * sizeof(BoidParticle), "Boid Data");
+
+ LOOP_PARTICLES
+ pa->boid = bpa++;
+ }
+ }
+ else if(pa->boid){
+ MEM_freeN(pa->boid);
+ LOOP_PARTICLES
+ pa->boid = NULL;
+ }
+}
+static void psys_changed_physics(ParticleSimulationData *sim)
+{
+ ParticleSettings *part = sim->psys->part;
+
+ if(ELEM(part->phystype, PART_PHYS_NO, PART_PHYS_KEYED)) {
+ PTCacheID pid;
+ BKE_ptcache_id_from_particles(&pid, sim->ob, sim->psys);
+ BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
+ }
+ else {
+ free_keyed_keys(sim->psys);
+ sim->psys->flag &= ~PSYS_KEYED;
+ }
+
+ if(part->phystype == PART_PHYS_BOIDS && part->boids == NULL) {
+ BoidState *state;
+
+ part->boids = MEM_callocN(sizeof(BoidSettings), "Boid Settings");
+ boid_default_settings(part->boids);
+
+ state = boid_new_state(part->boids);
+ BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Separate));
+ BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Flock));
+
+ ((BoidRule*)state->rules.first)->flag |= BOIDRULE_CURRENT;
+
+ state->flag |= BOIDSTATE_CURRENT;
+ BLI_addtail(&part->boids->states, state);
+ }
+
+ psys_check_boid_data(sim->psys);
+}
static int hair_needs_recalc(ParticleSystem *psys)
{
if(!(psys->flag & PSYS_EDITED) && (!psys->edit || !psys->edit->edited) &&
@@ -3920,10 +3769,12 @@ static int hair_needs_recalc(ParticleSystem *psys)
return 0;
}
-/* main particle update call, checks that things are ok on the large scale before actual particle calculations */
+/* main particle update call, checks that things are ok on the large scale and
+ * then advances in to actual particle calculations depending on particle type */
void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
{
ParticleSimulationData sim = {scene, ob, psys, NULL, NULL};
+ ParticleSettings *part = psys->part;
float cfra;
/* drawdata is outdated after ANY change */
@@ -3947,35 +3798,81 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
return;
/* execute drivers only, as animation has already been done */
- BKE_animsys_evaluate_animdata(&psys->part->id, psys->part->adt, cfra, ADT_RECALC_DRIVERS);
+ BKE_animsys_evaluate_animdata(&part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
if(psys->recalc & PSYS_RECALC_TYPE)
psys_changed_type(&sim);
else if(psys->recalc & PSYS_RECALC_PHYS)
psys_changed_physics(&sim);
- /* (re-)create hair */
- if(psys->part->type==PART_HAIR && hair_needs_recalc(psys)) {
- float hcfra=0.0f;
- int i;
-
- free_hair(ob, psys, 0);
+ switch(part->type) {
+ case PART_HAIR:
+ {
+ /* (re-)create hair */
+ if(hair_needs_recalc(psys)) {
+ float hcfra=0.0f;
+ int i, recalc = psys->recalc;
+
+ free_hair(ob, psys, 0);
+
+ /* first step is negative so particles get killed and reset */
+ psys->cfra= 1.0f;
+
+ for(i=0; i<=part->hair_step; i++){
+ hcfra=100.0f*(float)i/(float)psys->part->hair_step;
+ BKE_animsys_evaluate_animdata(&part->id, part->adt, hcfra, ADT_RECALC_ANIM);
+ system_step(&sim, hcfra);
+ psys->cfra = hcfra;
+ psys->recalc = 0;
+ save_hair(&sim, hcfra);
+ }
- /* first step is negative so particles get killed and reset */
- psys->cfra= 1.0f;
+ psys->flag |= PSYS_HAIR_DONE;
+ psys->recalc = recalc;
+ }
- for(i=0; i<=psys->part->hair_step; i++){
- hcfra=100.0f*(float)i/(float)psys->part->hair_step;
- BKE_animsys_evaluate_animdata(&psys->part->id, psys->part->adt, hcfra, ADT_RECALC_ANIM);
- system_step(&sim, hcfra);
- save_hair(&sim, hcfra);
+ if(psys->flag & PSYS_HAIR_DONE)
+ hair_step(&sim, cfra);
+ break;
+ }
+ case PART_FLUID:
+ {
+ particles_fluid_step(&sim, (int)cfra);
+ break;
}
+ default:
+ {
+ switch(part->phystype) {
+ case PART_PHYS_NO:
+ case PART_PHYS_KEYED:
+ {
+ if(emit_particles(&sim, NULL, cfra)) {
+ free_keyed_keys(psys);
+ distribute_particles(&sim, part->from);
+ initialize_all_particles(&sim);
+ }
+ reset_all_particles(&sim, 0.0, cfra, 0);
- psys->flag |= PSYS_HAIR_DONE;
+ if(part->phystype == PART_PHYS_KEYED) {
+ psys_count_keyed_targets(&sim);
+ set_keyed_keys(&sim);
+ psys_update_path_cache(&sim,(int)cfra);
+ }
+ break;
+ }
+ default:
+ {
+ /* the main dynamic particle system step */
+ system_step(&sim, cfra);
+ break;
+ }
+ }
+ break;
+ }
}
- /* the main particle system step */
- system_step(&sim, cfra);
+ psys->cfra = cfra;
+ psys->recalc = 0;
/* save matrix for duplicators */
invert_m4_m4(psys->imat, ob->obmat);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 7e73f9b23e7..9f0c7289350 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1144,7 +1144,7 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
if (!BLI_exists(filename)) {
return NULL;
}
- fp = fopen(filename, "rb");
+ fp = fopen(filename, "rb");
} else if (mode==PTCACHE_FILE_WRITE) {
BLI_make_existing_file(filename); /* will create the dir if needs be, same as //textures is created */
fp = fopen(filename, "wb");
@@ -1153,13 +1153,13 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
fp = fopen(filename, "rb+");
}
- if (!fp)
- return NULL;
+ if (!fp)
+ return NULL;
pf= MEM_mallocN(sizeof(PTCacheFile), "PTCacheFile");
pf->fp= fp;
- return pf;
+ return pf;
}
static void ptcache_file_close(PTCacheFile *pf)
@@ -2081,9 +2081,8 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
}
if(reset) {
- cache->flag &= ~(PTCACHE_REDO_NEEDED|PTCACHE_SIMULATION_VALID);
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
+ cache->flag &= ~PTCACHE_REDO_NEEDED;
if(pid->type == PTCACHE_TYPE_CLOTH)
cloth_free_modifier(pid->ob, pid->calldata);
@@ -2861,3 +2860,15 @@ void BKE_ptcache_update_info(PTCacheID *pid)
else
sprintf(cache->info, "%s.", mem_info);
}
+
+void BKE_ptcache_validate(PointCache *cache, int framenr)
+{
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+ cache->simframe = framenr;
+}
+void BKE_ptcache_invalidate(PointCache *cache)
+{
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
+ cache->simframe = 0;
+ cache->last_exact = 0;
+} \ No newline at end of file
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index bc66f4d52d3..e32f5aac517 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -446,18 +446,18 @@ void init_actuator(bActuator *act)
case ACT_VISIBILITY:
act->data= MEM_callocN(sizeof(bVisibilityActuator), "visibility act");
break;
- case ACT_2DFILTER:
- act->data = MEM_callocN(sizeof( bTwoDFilterActuator ), "2d filter act");
- break;
- case ACT_PARENT:
- act->data = MEM_callocN(sizeof( bParentActuator ), "parent act");
- break;
+ case ACT_2DFILTER:
+ act->data = MEM_callocN(sizeof( bTwoDFilterActuator ), "2d filter act");
+ break;
+ case ACT_PARENT:
+ act->data = MEM_callocN(sizeof( bParentActuator ), "parent act");
+ break;
case ACT_STATE:
- act->data = MEM_callocN(sizeof( bStateActuator ), "state act");
- break;
+ act->data = MEM_callocN(sizeof( bStateActuator ), "state act");
+ break;
case ACT_ARMATURE:
- act->data = MEM_callocN(sizeof( bArmatureActuator ), "armature act");
- break;
+ act->data = MEM_callocN(sizeof( bArmatureActuator ), "armature act");
+ break;
default:
; /* this is very severe... I cannot make any memory for this */
/* logic brick... */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index df6e0c78661..8f8241baa8e 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -205,17 +205,17 @@ Scene *copy_scene(Main *bmain, Scene *sce, int type)
/* NOTE: part of SCE_COPY_LINK_DATA and SCE_COPY_FULL operations
* are done outside of blenkernel with ED_objects_single_users! */
- /* camera */
+ /* camera */
if(type == SCE_COPY_LINK_DATA || type == SCE_COPY_FULL) {
- ID_NEW(scen->camera);
+ ID_NEW(scen->camera);
}
/* world */
if(type == SCE_COPY_FULL) {
- if(scen->world) {
- id_us_plus((ID *)scen->world);
- scen->world= copy_world(scen->world);
- }
+ if(scen->world) {
+ id_us_plus((ID *)scen->world);
+ scen->world= copy_world(scen->world);
+ }
}
sound_create_scene(scen);
@@ -238,9 +238,9 @@ void free_scene(Scene *sce)
if(sce->gpd) {
#if 0 // removed since this can be invalid memory when freeing everything
- // since the grease pencil data is free'd before the scene.
- // since grease pencil data is not (yet?), shared between objects
- // its probably safe not to do this, some save and reload will free this.
+ // since the grease pencil data is free'd before the scene.
+ // since grease pencil data is not (yet?), shared between objects
+ // its probably safe not to do this, some save and reload will free this.
sce->gpd->id.us--;
#endif
sce->gpd= NULL;
@@ -431,9 +431,10 @@ Scene *add_scene(char *name)
pset->fade_frames= 2;
pset->selectmode= SCE_SELECT_PATH;
for(a=0; a<PE_TOT_BRUSH; a++) {
- pset->brush[a].strength= 50;
+ pset->brush[a].strength= 0.5;
pset->brush[a].size= 50;
pset->brush[a].step= 10;
+ pset->brush[a].count= 10;
}
pset->brush[PE_BRUSH_CUT].strength= 100;
@@ -627,7 +628,7 @@ int next_object(Scene *scene, int val, Base **base, Object **ob)
fase= F_SCENE;
}
else {
- /* exception: empty scene */
+ /* exception: empty scene */
if(scene->set && scene->set->base.first) {
*base= scene->set->base.first;
*ob= (*base)->object;
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 7cabb620085..33c90d1a94e 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -230,9 +230,9 @@ static ImBuf * IMB_cast_away_list(ImBuf * i)
}
static void do_plugin_effect(Scene *scene, Sequence *seq, int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
+ float facf0, float facf1, int x, int y,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3, struct ImBuf *out)
{
char *cp;
int float_rendering;
@@ -323,7 +323,7 @@ static void do_plugin_effect(Scene *scene, Sequence *seq, int cfra,
}
static int do_plugin_early_out(struct Sequence *seq,
- float facf0, float facf1)
+ float facf0, float facf1)
{
return 0;
}
@@ -348,7 +348,7 @@ static void init_alpha_over_or_under(Sequence * seq)
}
static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y,
- char * rect1, char *rect2, char *out)
+ char * rect1, char *rect2, char *out)
{
int fac2, mfac, fac, fac4;
int xo, tempc;
@@ -414,7 +414,7 @@ static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y,
}
static void do_alphaover_effect_float(float facf0, float facf1, int x, int y,
- float * rect1, float *rect2, float *out)
+ float * rect1, float *rect2, float *out)
{
float fac2, mfac, fac, fac4;
int xo;
@@ -568,8 +568,8 @@ void do_alphaunder_effect_byte(
static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y,
- float *rect1, float *rect2,
- float *out)
+ float *rect1, float *rect2,
+ float *out)
{
float fac2, mfac, fac, fac4;
int xo;
@@ -763,9 +763,9 @@ void do_cross_effect_float(float facf0, float facf1, int x, int y,
/* carefull: also used by speed effect! */
static void do_cross_effect(Scene *scene, Sequence *seq, int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
+ float facf0, float facf1, int x, int y,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3, struct ImBuf *out)
{
if (out->rect_float) {
do_cross_effect_float(
@@ -854,7 +854,7 @@ static float gammaCorrect(float c)
if (i < 0) res = -pow(abs(c), valid_gamma);
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
else res = gamma_range_table[i] +
- ( (c - color_domain_table[i]) * gamfactor_table[i]);
+ ( (c - color_domain_table[i]) * gamfactor_table[i]);
return res;
} /* end of float gammaCorrect(float col) */
@@ -871,7 +871,7 @@ static float invGammaCorrect(float col)
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
else res = inv_gamma_range_table[i] +
- ( (col - color_domain_table[i]) * inv_gamfactor_table[i]);
+ ( (col - color_domain_table[i]) * inv_gamfactor_table[i]);
return res;
} /* end of float invGammaCorrect(float col) */
@@ -926,10 +926,10 @@ static void free_gammacross(Sequence * seq)
}
static void do_gammacross_effect_byte(float facf0, float facf1,
- int x, int y,
- unsigned char *rect1,
- unsigned char *rect2,
- unsigned char *out)
+ int x, int y,
+ unsigned char *rect1,
+ unsigned char *rect2,
+ unsigned char *out)
{
int fac1, fac2, col;
int xo;
@@ -982,9 +982,9 @@ static void do_gammacross_effect_byte(float facf0, float facf1,
}
static void do_gammacross_effect_float(float facf0, float facf1,
- int x, int y,
- float *rect1, float *rect2,
- float *out)
+ int x, int y,
+ float *rect1, float *rect2,
+ float *out)
{
float fac1, fac2;
int xo;
@@ -1050,8 +1050,8 @@ static void do_gammacross_effect(Scene *scene, Sequence *seq, int cfra,
********************************************************************** */
static void do_add_effect_byte(float facf0, float facf1, int x, int y,
- unsigned char *rect1, unsigned char *rect2,
- unsigned char *out)
+ unsigned char *rect1, unsigned char *rect2,
+ unsigned char *out)
{
int col, xo, fac1, fac3;
char *rt1, *rt2, *rt;
@@ -1162,8 +1162,8 @@ static void do_add_effect(Scene *scene, Sequence *seq, int cfra,
********************************************************************** */
static void do_sub_effect_byte(float facf0, float facf1,
- int x, int y,
- char *rect1, char *rect2, char *out)
+ int x, int y,
+ char *rect1, char *rect2, char *out)
{
int col, xo, fac1, fac3;
char *rt1, *rt2, *rt;
@@ -1382,8 +1382,8 @@ static void do_drop_effect(Scene *scene, Sequence *seq, int cfra,
********************************************************************** */
static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
- unsigned char *rect1, unsigned char *rect2,
- unsigned char *out)
+ unsigned char *rect1, unsigned char *rect2,
+ unsigned char *out)
{
int xo, fac1, fac3;
char *rt1, *rt2, *rt;
@@ -1431,8 +1431,8 @@ static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
}
static void do_mul_effect_float(float facf0, float facf1, int x, int y,
- float *rect1, float *rect2,
- float *out)
+ float *rect1, float *rect2,
+ float *out)
{
int xo;
float fac1, fac3;
@@ -1611,13 +1611,13 @@ float hyp3,hyp4,b4,b5
output = in_band(wipezone,width,hyp,facf0,1,1);
else
output = in_band(wipezone,width,hyp,facf0,0,1);
- }
+ }
else {
if(b1 < b2)
output = in_band(wipezone,width,hyp,facf0,0,1);
else
output = in_band(wipezone,width,hyp,facf0,1,1);
- }
+ }
break;
case DO_DOUBLE_WIPE:
@@ -1657,50 +1657,50 @@ float hyp3,hyp4,b4,b5
if( hyp < hwidth && hyp2 > hwidth )
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(!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
- temp3: angle of low side of blur
- temp4: angle of high side of blur
- */
- output = 1.0f - facf0;
- widthf = wipe->edgeWidth*2.0f*(float)M_PI;
- temp1 = 2.0f * (float)M_PI * facf0;
+ break;
+ case DO_CLOCK_WIPE:
+ /*
+ temp1: angle of effect center 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
+ */
+ output = 1.0f - facf0;
+ widthf = wipe->edgeWidth*2.0f*(float)M_PI;
+ temp1 = 2.0f * (float)M_PI * facf0;
- if(wipe->forward){
- temp1 = 2.0f*(float)M_PI - temp1;
- }
+ if(wipe->forward){
+ temp1 = 2.0f*(float)M_PI - temp1;
+ }
- x = x - halfx;
- y = y - halfy;
-
- temp2 = asin(abs(y)/sqrt(x*x + y*y));
- if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2;
- else if(x<=0 && y <= 0) temp2 += (float)M_PI;
- else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
-
- if(wipe->forward){
- temp3 = temp1-(widthf*0.5f)*facf0;
- temp4 = temp1+(widthf*0.5f)*(1-facf0);
- } else{
- temp3 = temp1-(widthf*0.5f)*(1-facf0);
- temp4 = temp1+(widthf*0.5f)*facf0;
+ x = x - halfx;
+ y = y - halfy;
+
+ temp2 = asin(abs(y)/sqrt(x*x + y*y));
+ if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2;
+ else if(x<=0 && y <= 0) temp2 += (float)M_PI;
+ else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
+
+ if(wipe->forward){
+ temp3 = temp1-(widthf*0.5f)*facf0;
+ temp4 = temp1+(widthf*0.5f)*(1-facf0);
+ } else{
+ temp3 = temp1-(widthf*0.5f)*(1-facf0);
+ temp4 = temp1+(widthf*0.5f)*facf0;
}
- if (temp3 < 0) temp3 = 0;
- if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI;
+ if (temp3 < 0) temp3 = 0;
+ if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI;
- if(temp2 < temp3) output = 0;
- else if (temp2 > temp4) output = 1;
- else output = (temp2-temp3)/(temp4-temp3);
- if(x == 0 && y == 0) output = 1;
+ if(temp2 < temp3) output = 0;
+ else if (temp2 > temp4) output = 1;
+ else output = (temp2-temp3)/(temp4-temp3);
+ if(x == 0 && y == 0) output = 1;
if(output != output) output = 1;
if(wipe->forward) output = 1 - output;
break;
@@ -1735,9 +1735,9 @@ float hyp3,hyp4,b4,b5
if( hyp < hwidth && hyp2 > hwidth )
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;
@@ -1776,11 +1776,11 @@ float hyp3,hyp4,b4,b5
hwidth = width*0.5f;
temp1 = (halfx-(halfx)*facf0);
- pointdist = sqrt(temp1*temp1 + temp1*temp1);
+ pointdist = sqrt(temp1*temp1 + temp1*temp1);
- temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
- if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1);
- else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1);
+ temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
+ if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1);
+ else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1);
if(!wipe->forward) output = 1-output;
@@ -1936,14 +1936,14 @@ static void do_wipe_effect(Scene *scene, Sequence *seq, int cfra,
{
if (out->rect_float) {
do_wipe_effect_float(seq,
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
+ facf0, facf1, x, y,
+ ibuf1->rect_float, ibuf2->rect_float,
+ out->rect_float);
} else {
do_wipe_effect_byte(seq,
- facf0, facf1, x, y,
- (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
- (unsigned char*) out->rect);
+ facf0, facf1, x, y,
+ (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
+ (unsigned char*) out->rect);
}
}
/* **********************************************************************
@@ -2466,8 +2466,8 @@ static void RVAddBitmaps_float (float* a, float* b, float* c,
/* For each pixel whose total luminance exceeds the threshold, */
/* Multiply it's value by BOOST and add it to the output map */
static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
- int width, int height, int threshold,
- float boost, float clamp)
+ int width, int height, int threshold,
+ float boost, float clamp)
{
int x,y,index;
int intensity;
@@ -2475,7 +2475,7 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
for(y=0;y< height;y++) {
for (x=0;x< width;x++) {
- index= (x+y*width)*4;
+ index= (x+y*width)*4;
/* Isolate the intensity */
intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold);
@@ -2495,8 +2495,8 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
}
static void RVIsolateHighlights_float (float* in, float* out,
- int width, int height, float threshold,
- float boost, float clamp)
+ int width, int height, float threshold,
+ float boost, float clamp)
{
int x,y,index;
float intensity;
@@ -2504,7 +2504,7 @@ static void RVIsolateHighlights_float (float* in, float* out,
for(y=0;y< height;y++) {
for (x=0;x< width;x++) {
- index= (x+y*width)*4;
+ index= (x+y*width)*4;
/* Isolate the intensity */
intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold);
@@ -2593,14 +2593,14 @@ static void do_glow_effect(Scene *scene, Sequence *seq, int cfra,
{
if (out->rect_float) {
do_glow_effect_float(seq,
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
+ facf0, facf1, x, y,
+ ibuf1->rect_float, ibuf2->rect_float,
+ out->rect_float);
} else {
do_glow_effect_byte(seq,
- facf0, facf1, x, y,
- (char*) ibuf1->rect, (char*) ibuf2->rect,
- (char*) out->rect);
+ facf0, facf1, x, y,
+ (char*) ibuf1->rect, (char*) ibuf2->rect,
+ (char*) out->rect);
}
}
@@ -2726,7 +2726,7 @@ static void init_speed_effect(Sequence *seq)
if(seq->effectdata) MEM_freeN(seq->effectdata);
seq->effectdata = MEM_callocN(sizeof(struct SpeedControlVars),
- "speedcontrolvars");
+ "speedcontrolvars");
v = (SpeedControlVars *)seq->effectdata;
v->globalSpeed = 1.0;
@@ -2807,7 +2807,7 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
return;
}
if (!seq->seq1) { /* make coverity happy and check for (CID 598)
- input strip ... */
+ input strip ... */
return;
}
@@ -2854,16 +2854,16 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
for (cfra = 1; cfra < v->length; cfra++) {
if(fcu) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = seq->startdisp + cfra;
- div = 1.0;
- } else {
- ctime= cfra;
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
+ if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
+ ctime = seq->startdisp + cfra;
+ div = 1.0;
+ } else {
+ ctime= cfra;
+ div= v->length / 100.0f;
+ if(div==0.0) return;
+ }
- facf = evaluate_fcurve(fcu, ctime/div);
+ facf = evaluate_fcurve(fcu, ctime/div);
} else {
facf = fallback_fac;
}
@@ -2885,19 +2885,19 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
for (cfra = 0; cfra < v->length; cfra++) {
if(fcu) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = seq->startdisp + cfra;
- div = 1.0;
- } else {
- ctime= cfra;
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
+ if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
+ ctime = seq->startdisp + cfra;
+ div = 1.0;
+ } else {
+ ctime= cfra;
+ div= v->length / 100.0f;
+ if(div==0.0) return;
+ }
- facf = evaluate_fcurve(fcu, ctime / div);
- if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
- facf *= v->length;
- }
+ facf = evaluate_fcurve(fcu, ctime / div);
+ if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
+ facf *= v->length;
+ }
}
if (!fcu) {
@@ -3005,16 +3005,16 @@ static void get_default_fac_fade(struct Sequence *seq, int cfra,
}
static void do_overdrop_effect(Scene *scene, Sequence *seq, int cfra,
- float fac, float facf,
- int x, int y, struct ImBuf * ibuf1,
- struct ImBuf * ibuf2,
- struct ImBuf * ibuf3,
- struct ImBuf * out)
+ float fac, float facf,
+ int x, int y, struct ImBuf * ibuf1,
+ struct ImBuf * ibuf2,
+ struct ImBuf * ibuf3,
+ struct ImBuf * out)
{
do_drop_effect(scene, seq, cfra, fac, facf, x, y,
- ibuf1, ibuf2, ibuf3, out);
+ ibuf1, ibuf2, ibuf3, out);
do_alphaover_effect(scene, seq, cfra, fac, facf, x, y,
- ibuf1, ibuf2, ibuf3, out);
+ ibuf1, ibuf2, ibuf3, out);
}
static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 1309bdf465b..17f6bd10859 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -426,7 +426,7 @@ void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq)
}
static void do_seq_count_cb(ListBase *seqbase, int *totseq,
- int (*test_func)(Sequence * seq))
+ int (*test_func)(Sequence * seq))
{
Sequence *seq;
@@ -444,7 +444,7 @@ static void do_seq_count_cb(ListBase *seqbase, int *totseq,
}
static void do_build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int depth,
- int (*test_func)(Sequence * seq))
+ int (*test_func)(Sequence * seq))
{
Sequence *seq;
@@ -466,7 +466,7 @@ static void do_build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int depth,
}
void build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int *totseq,
- int (*test_func)(Sequence * seq))
+ int (*test_func)(Sequence * seq))
{
Sequence **tseqar;
@@ -581,7 +581,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq)
new_tstripdata(seq);
if (seq->type != SEQ_SCENE && seq->type != SEQ_META &&
- seq->type != SEQ_IMAGE) {
+ seq->type != SEQ_IMAGE) {
BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name);
BLI_path_abs(str, G.sce);
}
@@ -939,7 +939,7 @@ static void do_effect(Scene *scene, int cfra, Sequence *seq, TStripElem * se)
se3= se->se3;
if ( (se1==0 || se2==0 || se3==0)
- || (se1->ibuf==0 || se2->ibuf==0 || se3->ibuf==0)) {
+ || (se1->ibuf==0 || se2->ibuf==0 || se3->ibuf==0)) {
make_black_ibuf(se->ibuf);
return;
}
@@ -1056,7 +1056,7 @@ static TStripElem *give_tstripelem(Sequence *seq, int cfra)
se = seq->strip->tstripdata;
if (se == 0 && seq->len > 0) {
se = seq->strip->tstripdata = alloc_tstripdata(seq->len,
- "tstripelems");
+ "tstripelems");
}
nr = give_stripelem_index(seq, cfra);
@@ -1074,7 +1074,7 @@ static TStripElem *give_tstripelem(Sequence *seq, int cfra)
alpha over mode...
*/
if (seq->blend_mode != SEQ_BLEND_REPLACE ||
- (/*seq->ipo && seq->ipo->curve.first &&*/
+ (/*seq->ipo && seq->ipo->curve.first &&*/
(!(seq->type & SEQ_EFFECT) || !seq->seq1))) {
Strip * s = seq->strip;
if (cfra < seq->start) {
@@ -1325,7 +1325,7 @@ static struct ImBuf * seq_proxy_fetch(Scene *scene, Sequence * seq, int cfra, in
#if 0
static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int cfra,
- int build_proxy_run, int render_size);
+ int build_proxy_run, int render_size);
static void seq_proxy_build_frame(Scene *scene, Sequence * seq, int cfra, int render_size)
{
@@ -1348,7 +1348,7 @@ static void seq_proxy_build_frame(Scene *scene, Sequence * seq, int cfra, int re
/* that's why it is called custom... */
if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
return;
- }
+ }
if (!seq_proxy_get_fname(scene, seq, cfra, name, render_size)) {
return;
@@ -1425,7 +1425,7 @@ static void seq_proxy_rebuild(Scene *scene, Sequence * seq)
sequential order */
if (seq->flag & SEQ_REVERSE_FRAMES) {
for (cfra = seq->enddisp-seq->endstill-1;
- cfra >= seq->startdisp + seq->startstill; cfra--) {
+ cfra >= seq->startdisp + seq->startstill; cfra--) {
TStripElem * tse = give_tstripelem(seq, cfra);
if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) {
@@ -1439,7 +1439,7 @@ static void seq_proxy_rebuild(Scene *scene, Sequence * seq)
}
} else {
for (cfra = seq->startdisp + seq->startstill;
- cfra < seq->enddisp - seq->endstill; cfra++) {
+ cfra < seq->enddisp - seq->endstill; cfra++) {
TStripElem * tse = give_tstripelem(seq, cfra);
if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) {
@@ -1499,12 +1499,12 @@ static StripColorBalance calc_cb(StripColorBalance * cb_)
}
static void make_cb_table_byte(float lift, float gain, float gamma,
- unsigned char * table, float mul)
+ unsigned char * table, float mul)
{
int y;
for (y = 0; y < 256; y++) {
- float v = 1.0 * y / 255;
+ float v = 1.0 * y / 255;
v *= gain;
v += lift;
v = pow(v, gamma);
@@ -1525,7 +1525,7 @@ static void make_cb_table_float(float lift, float gain, float gamma,
int y;
for (y = 0; y < 256; y++) {
- float v = (float) y * 1.0 / 255.0;
+ float v = (float) y * 1.0 / 255.0;
v *= gain;
v += lift;
v = pow(v, gamma);
@@ -1574,7 +1574,7 @@ static void color_balance_byte_float(Sequence * seq, TStripElem* se, float mul)
for (c = 0; c < 3; c++) {
make_cb_table_float(cb.lift[c], cb.gain[c], cb.gamma[c],
- cb_tab[c], mul);
+ cb_tab[c], mul);
}
for (i = 0; i < 256; i++) {
@@ -1631,8 +1631,8 @@ static void color_balance(Sequence * seq, TStripElem* se, float mul)
- Flip X + Flip Y (could be done afterwards, backward compatibility)
- Promote image to float data (affects pipeline operations afterwards)
- Color balance (is most efficient in the byte -> float
- (future: half -> float should also work fine!)
- case, if done on load, since we can use lookup tables)
+ (future: half -> float should also work fine!)
+ case, if done on load, since we can use lookup tables)
- Premultiply
*/
@@ -1642,13 +1642,13 @@ static int input_have_to_preprocess(Scene *scene, Sequence * seq, TStripElem* se
float mul;
if ((seq->flag & SEQ_FILTERY) ||
- (seq->flag & SEQ_USE_CROP) ||
- (seq->flag & SEQ_USE_TRANSFORM) ||
- (seq->flag & SEQ_FLIPX) ||
- (seq->flag & SEQ_FLIPY) ||
- (seq->flag & SEQ_USE_COLOR_BALANCE) ||
- (seq->flag & SEQ_MAKE_PREMUL) ||
- (se->ibuf->x != seqrectx || se->ibuf->y != seqrecty)) {
+ (seq->flag & SEQ_USE_CROP) ||
+ (seq->flag & SEQ_USE_TRANSFORM) ||
+ (seq->flag & SEQ_FLIPX) ||
+ (seq->flag & SEQ_FLIPY) ||
+ (seq->flag & SEQ_USE_COLOR_BALANCE) ||
+ (seq->flag & SEQ_MAKE_PREMUL) ||
+ (se->ibuf->x != seqrectx || se->ibuf->y != seqrecty)) {
return TRUE;
}
@@ -1703,8 +1703,8 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf
}
if (c.top + c.bottom >= se->ibuf->y ||
- c.left + c.right >= se->ibuf->x ||
- t.xofs >= dx || t.yofs >= dy) {
+ c.left + c.right >= se->ibuf->x ||
+ t.xofs >= dx || t.yofs >= dy) {
make_black_ibuf(se->ibuf);
} else {
ImBuf * i;
@@ -1716,9 +1716,9 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf
}
IMB_rectcpy(i, se->ibuf,
- t.xofs, t.yofs,
- c.left, c.bottom,
- sx, sy);
+ t.xofs, t.yofs,
+ c.left, c.bottom,
+ sx, sy);
IMB_freeImBuf(se->ibuf);
@@ -1783,7 +1783,7 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf
if(se->ibuf->x != seqrectx || se->ibuf->y != seqrecty ) {
if(scene->r.mode & R_OSA) {
IMB_scaleImBuf(se->ibuf,
- (short)seqrectx, (short)seqrecty);
+ (short)seqrectx, (short)seqrecty);
} else {
IMB_scalefastImBuf(se->ibuf,
(short)seqrectx, (short)seqrecty);
@@ -1818,14 +1818,14 @@ static void test_and_auto_discard_ibuf_stills(Strip * strip)
{
if (strip->ibuf_startstill) {
if (!strip->ibuf_startstill->rect &&
- !strip->ibuf_startstill->rect_float) {
+ !strip->ibuf_startstill->rect_float) {
IMB_freeImBuf(strip->ibuf_startstill);
strip->ibuf_startstill = 0;
}
}
if (strip->ibuf_endstill) {
if (!strip->ibuf_endstill->rect &&
- !strip->ibuf_endstill->rect_float) {
+ !strip->ibuf_endstill->rect_float) {
IMB_freeImBuf(strip->ibuf_endstill);
strip->ibuf_endstill = 0;
}
@@ -1841,8 +1841,8 @@ static void copy_from_ibuf_still(Sequence * seq, TStripElem * se)
se->ibuf = IMB_dupImBuf(seq->strip->ibuf_startstill);
}
if (se->nr == seq->len - 1
- && (seq->len != 1)
- && seq->strip->ibuf_endstill) {
+ && (seq->len != 1)
+ && seq->strip->ibuf_endstill) {
IMB_cache_limiter_touch(seq->strip->ibuf_endstill);
se->ibuf = IMB_dupImBuf(seq->strip->ibuf_endstill);
@@ -1938,7 +1938,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
ListBase *seqbasep, int cfra, int chanshown, int render_size);
static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int cfra,
- int build_proxy_run, int render_size)
+ int build_proxy_run, int render_size)
{
char name[FILE_MAXDIR+FILE_MAXFILE];
int use_limiter = TRUE;
@@ -1973,7 +1973,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
se->ibuf = meta_se->ibuf_comp;
if(se->ibuf &&
(!input_have_to_preprocess(scene, seq, se, cfra) ||
- build_proxy_run)) {
+ build_proxy_run)) {
IMB_refImBuf(se->ibuf);
if (build_proxy_run) {
IMB_cache_limiter_unref(se->ibuf);
@@ -2021,9 +2021,9 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
do_effect(scene, cfra, seq, se);
if (input_have_to_preprocess(scene, seq, se, cfra) &&
- !build_proxy_run) {
+ !build_proxy_run) {
if ((se->se1 && (se->ibuf == se->se1->ibuf)) ||
- (se->se2 && (se->ibuf == se->se2->ibuf))) {
+ (se->se2 && (se->ibuf == se->se2->ibuf))) {
struct ImBuf * i
= IMB_dupImBuf(se->ibuf);
@@ -2087,8 +2087,8 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
se->ibuf = IMB_anim_absolute(seq->anim, se->nr + seq->anim_startofs);
/* we don't need both (speed reasons)! */
if (se->ibuf
- && se->ibuf->rect_float
- && se->ibuf->rect) {
+ && se->ibuf->rect_float
+ && se->ibuf->rect) {
imb_freerectImBuf(se->ibuf);
}
@@ -2347,7 +2347,7 @@ static TStripElem* do_handle_speed_effect(Scene *scene, Sequence * seq, int cfra
}
if (cfra_left == cfra_right ||
- (s->flags & SEQ_SPEED_BLEND) == 0) {
+ (s->flags & SEQ_SPEED_BLEND) == 0) {
test_and_auto_discard_ibuf(se);
if (se->ibuf == NULL) {
@@ -2458,8 +2458,8 @@ static int seq_must_swap_input_in_blend_mode(Sequence * seq)
those two effects */
if (seq->blend_mode == SEQ_ALPHAOVER ||
- seq->blend_mode == SEQ_ALPHAUNDER ||
- seq->blend_mode == SEQ_OVERDROP) {
+ seq->blend_mode == SEQ_ALPHAUNDER ||
+ seq->blend_mode == SEQ_OVERDROP) {
swap_input = TRUE;
}
@@ -2495,7 +2495,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
TStripElem* se = 0;
count = get_shown_sequences(seqbasep, cfra, chanshown,
- (Sequence **)&seq_arr);
+ (Sequence **)&seq_arr);
if (!count) {
return 0;
@@ -2519,7 +2519,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
if(count == 1) {
se = do_build_seq_recursively(scene, seq_arr[0],
- cfra, render_size);
+ cfra, render_size);
if (se->ibuf) {
se->ibuf_comp = se->ibuf;
IMB_refImBuf(se->ibuf_comp);
@@ -2632,7 +2632,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
continue;
if (se1->ibuf_comp->rect_float ||
- se2->ibuf->rect_float) {
+ se2->ibuf->rect_float) {
se2->ibuf_comp = IMB_allocImBuf(
(short)seqrectx, (short)seqrecty,
32, IB_rectfloat, 0);
@@ -2644,20 +2644,20 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
if (!se1->ibuf_comp->rect_float &&
- se2->ibuf_comp->rect_float) {
+ se2->ibuf_comp->rect_float) {
IMB_float_from_rect(se1->ibuf_comp);
}
if (!se2->ibuf->rect_float &&
- se2->ibuf_comp->rect_float) {
+ se2->ibuf_comp->rect_float) {
IMB_float_from_rect(se2->ibuf);
}
if (!se1->ibuf_comp->rect &&
- !se2->ibuf_comp->rect_float) {
+ !se2->ibuf_comp->rect_float) {
IMB_rect_from_float(se1->ibuf_comp);
}
if (!se2->ibuf->rect &&
- !se2->ibuf_comp->rect_float) {
+ !se2->ibuf_comp->rect_float) {
IMB_rect_from_float(se2->ibuf);
}
@@ -2944,8 +2944,8 @@ static void seq_stop_threads()
seq_thread_shutdown = TRUE;
- pthread_cond_broadcast(&wakeup_cond);
- pthread_mutex_unlock(&wakeup_lock);
+ pthread_cond_broadcast(&wakeup_cond);
+ pthread_mutex_unlock(&wakeup_lock);
for(tslot = running_threads.first; tslot; tslot= tslot->next) {
pthread_join(tslot->pthread, NULL);
@@ -3043,10 +3043,10 @@ ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int
for (e = prefetch_done.first; e; e = e->next) {
if (cfra == e->cfra &&
- chanshown == e->chanshown &&
- rectx == e->rectx &&
- recty == e->recty &&
- render_size == e->render_size) {
+ chanshown == e->chanshown &&
+ rectx == e->rectx &&
+ recty == e->recty &&
+ render_size == e->render_size) {
success = TRUE;
found_something = TRUE;
break;
@@ -3056,10 +3056,10 @@ ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int
if (!e) {
for (e = prefetch_wait.first; e; e = e->next) {
if (cfra == e->cfra &&
- chanshown == e->chanshown &&
- rectx == e->rectx &&
- recty == e->recty &&
- render_size == e->render_size) {
+ chanshown == e->chanshown &&
+ rectx == e->rectx &&
+ recty == e->recty &&
+ render_size == e->render_size) {
found_something = TRUE;
break;
}
@@ -3070,13 +3070,13 @@ ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int
PrefetchThread *tslot;
for(tslot = running_threads.first;
- tslot; tslot= tslot->next) {
+ tslot; tslot= tslot->next) {
if (tslot->current &&
- cfra == tslot->current->cfra &&
- chanshown == tslot->current->chanshown &&
- rectx == tslot->current->rectx &&
- recty == tslot->current->recty &&
- render_size== tslot->current->render_size){
+ cfra == tslot->current->cfra &&
+ chanshown == tslot->current->chanshown &&
+ rectx == tslot->current->rectx &&
+ recty == tslot->current->recty &&
+ render_size== tslot->current->render_size){
found_something = TRUE;
break;
}
@@ -3148,19 +3148,19 @@ static void free_imbuf_seq_except(Scene *scene, int cfra)
TStripElem * curelem = give_tstripelem(seq, cfra);
for(a = 0, se = seq->strip->tstripdata;
- a < seq->strip->len && se; a++, se++) {
+ a < seq->strip->len && se; a++, se++) {
if(se != curelem) {
free_imbuf_strip_elem(se);
}
}
for(a = 0, se = seq->strip->tstripdata_startstill;
- a < seq->strip->startstill && se; a++, se++) {
+ a < seq->strip->startstill && se; a++, se++) {
if(se != curelem) {
free_imbuf_strip_elem(se);
}
}
for(a = 0, se = seq->strip->tstripdata_endstill;
- a < seq->strip->endstill && se; a++, se++) {
+ a < seq->strip->endstill && se; a++, se++) {
if(se != curelem) {
free_imbuf_strip_elem(se);
}
@@ -3219,15 +3219,15 @@ void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage)
for(seq= seqbase->first; seq; seq= seq->next) {
if(seq->strip) {
for(a = 0, se = seq->strip->tstripdata;
- a < seq->strip->len && se; a++, se++) {
+ a < seq->strip->len && se; a++, se++) {
free_imbuf_strip_elem(se);
}
for(a = 0, se = seq->strip->tstripdata_startstill;
- a < seq->strip->startstill && se; a++, se++) {
+ a < seq->strip->startstill && se; a++, se++) {
free_imbuf_strip_elem(se);
}
for(a = 0, se = seq->strip->tstripdata_endstill;
- a < seq->strip->endstill && se; a++, se++) {
+ a < seq->strip->endstill && se; a++, se++) {
free_imbuf_strip_elem(se);
}
if(seq->strip->ibuf_startstill) {
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 69209699a69..00e81063760 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1197,8 +1197,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
if(cache_result == PTCACHE_READ_EXACT)
{
- cache->flag |= PTCACHE_SIMULATION_VALID;
- cache->simframe= framenr;
+ BKE_ptcache_validate(cache, framenr);
if(sds->wt)
{
@@ -1206,8 +1205,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
if(cache_result_wt == PTCACHE_READ_EXACT)
{
- cache_wt->flag |= PTCACHE_SIMULATION_VALID;
- cache_wt->simframe= framenr;
+ BKE_ptcache_validate(cache_wt, framenr);
}
}
return;
@@ -1223,8 +1221,6 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
/* do simulation */
// low res
- cache->flag |= PTCACHE_SIMULATION_VALID;
- cache->simframe= framenr;
// simulate the actual smoke (c++ code in intern/smoke)
// DG: interesting commenting this line + deactivating loading of noise files
@@ -1239,6 +1235,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
if(get_lamp(scene, light))
smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp, -7.0*sds->dx);
+ BKE_ptcache_validate(cache, framenr);
BKE_ptcache_write_cache(&pid, framenr);
if(sds->wt)
@@ -1250,8 +1247,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
smoke_turbulence_step(sds->wt, sds->fluid);
}
- cache_wt->flag |= PTCACHE_SIMULATION_VALID;
- cache_wt->simframe= framenr;
+ BKE_ptcache_validate(cache_wt, framenr);
BKE_ptcache_write_cache(&pid_wt, framenr);
}
@@ -1283,11 +1279,11 @@ long long smoke_get_mem_req(int xres, int yres, int zres, int amplify)
// print out memory requirements
long long int coarseSize = sizeof(float) * totalCells * 22 +
- sizeof(unsigned char) * totalCells;
+ sizeof(unsigned char) * totalCells;
long long int fineSize = sizeof(float) * amplifiedCells * 7 + // big grids
- sizeof(float) * totalCells * 8 + // small grids
- sizeof(float) * 128 * 128 * 128; // noise tile
+ sizeof(float) * totalCells * 8 + // small grids
+ sizeof(float) * 128 * 128 * 128; // noise tile
long long int totalMB = (coarseSize + fineSize) / (1024 * 1024);
@@ -1296,83 +1292,83 @@ long long smoke_get_mem_req(int xres, int yres, int zres, int amplify)
static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, float *tRay, bresenham_callback cb, float *result, float *input, int res[3], float correct)
{
- int dx, dy, dz, i, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2;
- int pixel[3];
-
- pixel[0] = x1;
- pixel[1] = y1;
- pixel[2] = z1;
-
- dx = x2 - x1;
- dy = y2 - y1;
- dz = z2 - z1;
-
- x_inc = (dx < 0) ? -1 : 1;
- l = abs(dx);
- y_inc = (dy < 0) ? -1 : 1;
- m = abs(dy);
- z_inc = (dz < 0) ? -1 : 1;
- n = abs(dz);
- dx2 = l << 1;
- dy2 = m << 1;
- dz2 = n << 1;
-
- if ((l >= m) && (l >= n)) {
- err_1 = dy2 - l;
- err_2 = dz2 - l;
- for (i = 0; i < l; i++) {
- if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
- break;
- if (err_1 > 0) {
- pixel[1] += y_inc;
- err_1 -= dx2;
- }
- if (err_2 > 0) {
- pixel[2] += z_inc;
- err_2 -= dx2;
- }
- err_1 += dy2;
- err_2 += dz2;
- pixel[0] += x_inc;
- }
- } else if ((m >= l) && (m >= n)) {
- err_1 = dx2 - m;
- err_2 = dz2 - m;
- for (i = 0; i < m; i++) {
- if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
- break;
- if (err_1 > 0) {
- pixel[0] += x_inc;
- err_1 -= dy2;
- }
- if (err_2 > 0) {
- pixel[2] += z_inc;
- err_2 -= dy2;
- }
- err_1 += dx2;
- err_2 += dz2;
- pixel[1] += y_inc;
- }
- } else {
- err_1 = dy2 - n;
- err_2 = dx2 - n;
- for (i = 0; i < n; i++) {
- if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
- break;
- if (err_1 > 0) {
- pixel[1] += y_inc;
- err_1 -= dz2;
- }
- if (err_2 > 0) {
- pixel[0] += x_inc;
- err_2 -= dz2;
- }
- err_1 += dy2;
- err_2 += dx2;
- pixel[2] += z_inc;
- }
- }
- cb(result, input, res, pixel, tRay, correct);
+ int dx, dy, dz, i, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2;
+ int pixel[3];
+
+ pixel[0] = x1;
+ pixel[1] = y1;
+ pixel[2] = z1;
+
+ dx = x2 - x1;
+ dy = y2 - y1;
+ dz = z2 - z1;
+
+ x_inc = (dx < 0) ? -1 : 1;
+ l = abs(dx);
+ y_inc = (dy < 0) ? -1 : 1;
+ m = abs(dy);
+ z_inc = (dz < 0) ? -1 : 1;
+ n = abs(dz);
+ dx2 = l << 1;
+ dy2 = m << 1;
+ dz2 = n << 1;
+
+ if ((l >= m) && (l >= n)) {
+ err_1 = dy2 - l;
+ err_2 = dz2 - l;
+ for (i = 0; i < l; i++) {
+ if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
+ break;
+ if (err_1 > 0) {
+ pixel[1] += y_inc;
+ err_1 -= dx2;
+ }
+ if (err_2 > 0) {
+ pixel[2] += z_inc;
+ err_2 -= dx2;
+ }
+ err_1 += dy2;
+ err_2 += dz2;
+ pixel[0] += x_inc;
+ }
+ } else if ((m >= l) && (m >= n)) {
+ err_1 = dx2 - m;
+ err_2 = dz2 - m;
+ for (i = 0; i < m; i++) {
+ if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
+ break;
+ if (err_1 > 0) {
+ pixel[0] += x_inc;
+ err_1 -= dy2;
+ }
+ if (err_2 > 0) {
+ pixel[2] += z_inc;
+ err_2 -= dy2;
+ }
+ err_1 += dx2;
+ err_2 += dz2;
+ pixel[1] += y_inc;
+ }
+ } else {
+ err_1 = dy2 - n;
+ err_2 = dx2 - n;
+ for (i = 0; i < n; i++) {
+ if(cb(result, input, res, pixel, tRay, correct) <= FLT_EPSILON)
+ break;
+ if (err_1 > 0) {
+ pixel[1] += y_inc;
+ err_1 -= dz2;
+ }
+ if (err_2 > 0) {
+ pixel[0] += x_inc;
+ err_2 -= dz2;
+ }
+ err_1 += dy2;
+ err_2 += dx2;
+ pixel[2] += z_inc;
+ }
+ }
+ cb(result, input, res, pixel, tRay, correct);
}
static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct)
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index af40d9be643..e6f500aab15 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -123,7 +123,7 @@ typedef struct SBScratch {
typedef struct SB_thread_context {
Scene *scene;
- Object *ob;
+ Object *ob;
float forcetime;
float timenow;
int ifirst;
@@ -191,7 +191,7 @@ static float sb_time_scale(Object *ob)
/*hrms .. this could be IPO as well :)
estimated range [0.001 sluggish slug - 100.0 very fast (i hope ODE solver can handle that)]
1 approx = a unit 1 pendulum at g = 9.8 [earth conditions] has period 65 frames
- theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM)
+ theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM)
*/
}
return (1.0f);
@@ -280,7 +280,7 @@ typedef struct ccd_Mesh {
static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
{
- ccd_Mesh *pccd_M = NULL;
+ ccd_Mesh *pccd_M = NULL;
ccdf_minmax *mima =NULL;
MFace *mface=NULL;
float v[3],hull;
@@ -299,17 +299,17 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
pccd_M->mprevvert=NULL;
- /* blow it up with forcefield ranges */
+ /* blow it up with forcefield ranges */
hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft);
/* alloc and copy verts*/
pccd_M->mvert = dm->dupVertArray(dm);
- /* ah yeah, put the verices to global coords once */
+ /* ah yeah, put the verices to global coords once */
/* and determine the ortho BB on the fly */
for(i=0; i < pccd_M->totvert; i++){
mul_m4_v3(ob->obmat, pccd_M->mvert[i].co);
- /* evaluate limits */
+ /* evaluate limits */
VECCOPY(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);
@@ -321,10 +321,10 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
}
/* alloc and copy faces*/
- pccd_M->mface = dm->dupFaceArray(dm);
+ pccd_M->mface = dm->dupFaceArray(dm);
/* 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;
@@ -334,7 +334,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
- VECCOPY(v,pccd_M->mvert[mface->v1].co);
+ VECCOPY(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);
@@ -342,7 +342,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mvert[mface->v2].co);
+ VECCOPY(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);
@@ -377,7 +377,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
}
static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
{
- ccdf_minmax *mima =NULL;
+ ccdf_minmax *mima =NULL;
MFace *mface=NULL;
float v[3],hull;
int i;
@@ -393,20 +393,20 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
pccd_M->bbmax[0]=pccd_M->bbmax[1]=pccd_M->bbmax[2]=-1e30f;
- /* blow it up with forcefield ranges */
+ /* blow it up with forcefield ranges */
hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft);
/* rotate current to previous */
if(pccd_M->mprevvert) MEM_freeN(pccd_M->mprevvert);
- pccd_M->mprevvert = pccd_M->mvert;
+ pccd_M->mprevvert = pccd_M->mvert;
/* alloc and copy verts*/
- pccd_M->mvert = dm->dupVertArray(dm);
- /* ah yeah, put the verices to global coords once */
+ pccd_M->mvert = dm->dupVertArray(dm);
+ /* ah yeah, put the verices to global coords once */
/* and determine the ortho BB on the fly */
for(i=0; i < pccd_M->totvert; i++){
mul_m4_v3(ob->obmat, pccd_M->mvert[i].co);
- /* evaluate limits */
+ /* evaluate limits */
VECCOPY(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);
@@ -416,7 +416,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
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 */
+ /* evaluate limits */
VECCOPY(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);
@@ -437,7 +437,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
- VECCOPY(v,pccd_M->mvert[mface->v1].co);
+ VECCOPY(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);
@@ -445,7 +445,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mvert[mface->v2].co);
+ VECCOPY(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);
@@ -472,7 +472,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
}
- VECCOPY(v,pccd_M->mprevvert[mface->v1].co);
+ VECCOPY(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);
@@ -480,7 +480,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
- VECCOPY(v,pccd_M->mprevvert[mface->v2].co);
+ VECCOPY(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);
@@ -667,7 +667,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
}
}
- /* now we can announce new springs */
+ /* now we can announce new springs */
ob->soft->totspring += nofquads *2;
}
}
@@ -703,7 +703,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad
}
else {printf("oops we should not get here - add_2nd_order_springs");}
}
- if (bpo){/* so now we have a 2nd order humpdidump */
+ if (bpo){/* so now we have a 2nd order humpdidump */
for(c=bpo->nofsprings;c>0;c--){
bs2 = sb->bspring + bpo->springs[c-1];
if ((bs2->v1 != notthis) && (bs2->v1 > v0)){
@@ -711,7 +711,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad
if (addsprings){
bs3->v1= v0;
bs3->v2= bs2->v1;
- bs3->springtype =SB_BEND;
+ bs3->springtype =SB_BEND;
bs3++;
}
}
@@ -720,7 +720,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad
if (addsprings){
bs3->v1= v0;
bs3->v2= bs2->v2;
- bs3->springtype =SB_BEND;
+ bs3->springtype =SB_BEND;
bs3++;
}
@@ -1039,7 +1039,7 @@ static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_laye
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
- while (!BLI_ghashIterator_isDone(ihash) ) {
+ while (!BLI_ghashIterator_isDone(ihash) ) {
ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash);
ob = BLI_ghashIterator_getKey (ihash);
@@ -1068,7 +1068,7 @@ static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_laye
}
/* so now we have the 2 boxes overlapping */
- /* forces actually not used */
+ /* forces actually not used */
deflected = 2;
}
@@ -1114,7 +1114,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
- while (!BLI_ghashIterator_isDone(ihash) ) {
+ while (!BLI_ghashIterator_isDone(ihash) ) {
ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash);
ob = BLI_ghashIterator_getKey (ihash);
@@ -1205,7 +1205,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
- while (!BLI_ghashIterator_isDone(ihash) ) {
+ while (!BLI_ghashIterator_isDone(ihash) ) {
ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash);
ob = BLI_ghashIterator_getKey (ihash);
@@ -1396,11 +1396,11 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
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);
}
}
}
@@ -1433,7 +1433,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
- while (!BLI_ghashIterator_isDone(ihash) ) {
+ while (!BLI_ghashIterator_isDone(ihash) ) {
ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash);
ob = BLI_ghashIterator_getKey (ihash);
@@ -1583,7 +1583,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
add_v3_v3v3(bs->ext_force,bs->ext_force,feedback);
bs->flag |= BSF_INTERSECT;
//bs->cf=damp;
- bs->cf=sb->choke*0.01f;
+ bs->cf=sb->choke*0.01f;
}
}
@@ -1690,8 +1690,8 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,
}
else
sb_threads[i].ifirst = 0;
- sb_threads[i].do_effector = do_effector;
- sb_threads[i].do_deflector = 0;// not used here
+ sb_threads[i].do_effector = do_effector;
+ sb_threads[i].do_deflector = 0;// not used here
sb_threads[i].fieldfactor = 0.0f;// not used here
sb_threads[i].windfactor = 0.0f;// not used here
sb_threads[i].nr= i;
@@ -1707,7 +1707,7 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,
}
else
exec_scan_for_ext_spring_forces(&sb_threads[0]);
- /* clean up */
+ /* clean up */
MEM_freeN(sb_threads);
pdEndEffectors(&do_effector);
@@ -1722,7 +1722,7 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl
int winner =1;
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;
@@ -1751,7 +1751,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
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},
- vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
+ 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,force_mag_norm,minx,miny,minz,maxx,maxy,maxz,
innerfacethickness = -0.5f, outerfacethickness = 0.2f,
@@ -1764,7 +1764,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
outerforceaccu[0]=outerforceaccu[1]=outerforceaccu[2]=0.0f;
innerforceaccu[0]=innerforceaccu[1]=innerforceaccu[2]=0.0f;
/* go */
- while (!BLI_ghashIterator_isDone(ihash) ) {
+ while (!BLI_ghashIterator_isDone(ihash) ) {
ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash);
ob = BLI_ghashIterator_getKey (ihash);
@@ -1815,7 +1815,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
fa = (ff*outerfacethickness-outerfacethickness);
fa *= fa;
fa = 1.0f/fa;
- avel[0]=avel[1]=avel[2]=0.0f;
+ avel[0]=avel[1]=avel[2]=0.0f;
/* use mesh*/
while (a--) {
if (
@@ -1938,7 +1938,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
VECADD(avel,avel,ve);
cavel ++;
}
- *intrusion += facedist;
+ *intrusion += facedist;
ci++;
}
@@ -1948,7 +1948,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
float dist;
closest_to_line_segment_v3(ve, opco, nv1, nv2);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
@@ -1957,7 +1957,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
closest_to_line_segment_v3(ve, opco, nv2, nv3);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
@@ -1966,7 +1966,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
closest_to_line_segment_v3(ve, opco, nv3, nv1);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
@@ -2181,11 +2181,11 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* intitialize */
if (sb) {
/* check conditions for various options */
- /* +++ could be done on object level to squeeze out the last bits of it */
+ /* +++ could be done on object level to squeeze out the last bits of it */
do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF));
do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL);
do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES));
- /* --- could be done on object level to squeeze out the last bits of it */
+ /* --- could be done on object level to squeeze out the last bits of it */
}
else {
printf("Error expected a SB here \n");
@@ -2207,14 +2207,14 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* naive ball self collision */
/* needs to be done if goal snaps or not */
if(do_selfcollision){
- int attached;
+ int attached;
BodyPoint *obp;
BodySpring *bs;
int c,b;
float velcenter[3],dvel[3],def[3];
float distance;
float compare;
- float bstune = sb->ballstiff;
+ float bstune = sb->ballstiff;
for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) {
compare = (obp->colball + bp->colball);
@@ -2222,7 +2222,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* rather check the AABBoxes before ever calulating the real distance */
/* mathematically it is completly nuts, but performace is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
- distance = normalize_v3(def);
+ distance = normalize_v3(def);
if (distance < compare ){
/* exclude body points attached with a spring */
attached = 0;
@@ -2363,7 +2363,7 @@ 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(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 */
@@ -2377,7 +2377,7 @@ return 0; /*done fine*/
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 0;
}
@@ -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);
@@ -2416,8 +2416,8 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t
}
else
sb_threads[i].ifirst = 0;
- sb_threads[i].do_effector = do_effector;
- sb_threads[i].do_deflector = do_deflector;
+ sb_threads[i].do_effector = do_effector;
+ sb_threads[i].do_deflector = do_deflector;
sb_threads[i].fieldfactor = fieldfactor;
sb_threads[i].windfactor = windfactor;
sb_threads[i].nr= i;
@@ -2435,7 +2435,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t
}
else
exec_softbody_calc_forces(&sb_threads[0]);
- /* clean up */
+ /* clean up */
MEM_freeN(sb_threads);
}
@@ -2904,12 +2904,12 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
float maxerrpos= 0.0f,maxerrvel = 0.0f;
int a,fuzzy=0;
- forcetime *= sb_time_scale(ob);
+ forcetime *= sb_time_scale(ob);
- aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f;
- aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f;
+ aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f;
+ aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f;
- /* old one with homogenous masses */
+ /* old one with homogenous masses */
/* claim a minimum mass for vertex */
/*
if (sb->nodemass > 0.009999f) timeovermass = forcetime/sb->nodemass;
@@ -2920,11 +2920,11 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* now we have individual masses */
/* claim a minimum mass for vertex */
if (_final_mass(ob,bp) > 0.009999f) timeovermass = forcetime/_final_mass(ob,bp);
- else timeovermass = forcetime/0.009999f;
+ else timeovermass = forcetime/0.009999f;
if(_final_goal(ob,bp) < SOFTGOALSNAP){
- /* this makes t~ = t */
+ /* this makes t~ = t */
if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec);
/* so here is (v)' = a(cceleration) = sum(F_springs)/m + gravitation + some friction forces + more forces*/
@@ -2952,7 +2952,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
}
else {VECADD(bp->vec, bp->vec, bp->force);}
- /* this makes t~ = t+dt */
+ /* this makes t~ = t+dt */
if(!(mid_flags & MID_PRESERVE)) VECCOPY(dx,bp->vec);
/* so here is (x)'= v(elocity) */
@@ -2969,7 +2969,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
bp->frozen =MIN2(bp->frozen*1.05f,1.0f);
}
mul_v3_fl(dx,bp->frozen);
- */
+ */
/* again some nasty if's to have heun in here too */
if (mode ==1){
VECCOPY(bp->prevpos,bp->pos);
@@ -3102,12 +3102,12 @@ static void softbody_swap_state(Object *ob,float *ppos,float *pvel)
VECCOPY(temp, bp->vec);
VECCOPY(bp->vec,pv);
- VECCOPY(pv,temp);
+ VECCOPY(pv,temp);
pv+=3;
VECCOPY(temp, bp->pos);
VECCOPY(bp->pos,pp);
- VECCOPY(pp,temp);
+ VECCOPY(pp,temp);
pp+=3;
}
}
@@ -3185,7 +3185,7 @@ static void interpolate_exciter(Object *ob, int timescale, int time)
/* ************ convertors ********** */
/* for each object type we need;
- - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry
+ - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry
*/
static void get_scalar_from_vertexgroup(Object *ob, int vertID, short groupindex, float *target)
@@ -3294,7 +3294,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
/* this is where '2.5 every thing is animateable' goes wrong in the first place jow_go_for2_5 */
/* 1st coding action to take : move this to frame level */
/* reads: leave the bp->goal as it was read from vertex group / or default .. we will need it at per frame call */
- /* should be fixed for meshes */
+ /* should be fixed for meshes */
// bp->goal= sb->mingoal + bp->goal*goalfac; /* do not do here jow_go_for2_5 */
}
else{
@@ -3358,7 +3358,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
build_bps_springlist(ob); /* yes we need to do it again*/
}
springs_from_mesh(ob); /* write the 'rest'-lenght of the springs */
- if (ob->softflag & OB_SB_SELF) {calculate_collision_balls(ob);}
+ if (ob->softflag & OB_SB_SELF) {calculate_collision_balls(ob);}
}
@@ -3515,7 +3515,7 @@ static void lattice_to_softbody(Scene *scene, Object *ob)
if (ob->softflag & OB_SB_EDGES){
totspring = ((lt->pntsu -1) * lt->pntsv
- + (lt->pntsv -1) * lt->pntsu) * lt->pntsw
+ + (lt->pntsv -1) * lt->pntsu) * lt->pntsw
+lt->pntsu*lt->pntsv*(lt->pntsw -1);
if (ob->softflag & OB_SB_QUADS){
totspring += 4*(lt->pntsu -1) * (lt->pntsv -1) * (lt->pntsw-1);
@@ -4058,17 +4058,13 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
/* check for changes in mesh, should only happen in case the mesh
* structure changes during an animation */
if(sb->bpoint && numVerts != sb->totpoint) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
return;
}
/* clamp frame ranges */
if(framenr < startframe) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- //cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
return;
}
else if(framenr > endframe) {
@@ -4101,8 +4097,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
/* continue physics special case */
if(BKE_ptcache_get_continue_physics()) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
+ BKE_ptcache_invalidate(cache);
/* do simulation */
dtime = timescale;
softbody_update_positions(ob, sb, vertexCos, numVerts);
@@ -4115,14 +4110,13 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
if(sb->totpoint==0) {
return;
}
- if(framenr == startframe) {
+ if(framenr == startframe) {
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
/* first frame, no simulation to do, just set the positions */
softbody_update_positions(ob, sb, vertexCos, numVerts);
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ BKE_ptcache_validate(cache, framenr);
cache->flag &= ~PTCACHE_REDO_NEEDED;
return;
}
@@ -4133,8 +4127,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
softbody_to_object(ob, vertexCos, numVerts, sb->local);
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ BKE_ptcache_validate(cache, framenr);
if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
BKE_ptcache_write_cache(&pid, framenr);
@@ -4142,13 +4135,11 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
return;
}
else if(cache_result==PTCACHE_READ_OLD) {
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ ; /* do nothing */
}
else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {
/* if baked and nothing in cache, do nothing */
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- cache->last_exact= 0;
+ BKE_ptcache_invalidate(cache);
return;
}
@@ -4166,8 +4157,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
softbody_to_object(ob, vertexCos, numVerts, 0);
- cache->simframe= framenr;
- cache->flag |= PTCACHE_SIMULATION_VALID;
+ BKE_ptcache_validate(cache, framenr);
BKE_ptcache_write_cache(&pid, framenr);
}
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index c5c3ae0f022..9078566f109 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -42,11 +42,12 @@
#include "DNA_scene_types.h"
#include "BKE_cdderivedmesh.h"
-#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
+#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_subsurf.h"
+#include "BKE_utildefines.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
@@ -374,7 +375,7 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result,
/* face weighting */
static void calc_ss_weights(int gridFaces,
- FaceVertWeight **qweight, FaceVertWeight **tweight)
+ FaceVertWeight **qweight, FaceVertWeight **tweight)
{
FaceVertWeight *qw, *tw;
int x, y, j;
@@ -417,7 +418,7 @@ static void calc_ss_weights(int gridFaces,
}
static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
- float (*vertexCos)[3], int useFlatSubdiv)
+ float (*vertexCos)[3], int useFlatSubdiv)
{
float creaseFactor = (float) ccgSubSurf_getSubdivisionLevels(ss);
CCGVertHDL fVerts[4];
@@ -456,10 +457,10 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
float crease;
crease = useFlatSubdiv ? creaseFactor :
- me->crease * creaseFactor / 255.0f;
+ me->crease * creaseFactor / 255.0f;
ccgSubSurf_syncEdge(ss, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(me->v1),
- SET_INT_IN_POINTER(me->v2), crease, &e);
+ SET_INT_IN_POINTER(me->v2), crease, &e);
((int*)ccgSubSurf_getEdgeUserData(ss, e))[1] = (index)? *index++: i;
}
@@ -479,7 +480,7 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
// other parts of code significantly to handle missing faces.
// since this really shouldn't even be possible we just bail.
if(ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), fVerts[3] ? 4 : 3,
- fVerts, &f) == eCCGError_InvalidValue) {
+ fVerts, &f) == eCCGError_InvalidValue) {
static int hasGivenError = 0;
if(!hasGivenError) {
@@ -852,7 +853,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
MEdge *med = &medge[i];
if(ccgdm->drawInteriorEdges)
- med->flag = ME_EDGEDRAW | ME_EDGERENDER;
+ med->flag = ME_EDGEDRAW | ME_EDGERENDER;
med->v1 = getFaceIndex(ss, f, S, x, 0, edgeSize, gridSize);
med->v2 = getFaceIndex(ss, f, S, x + 1, 0, edgeSize, gridSize);
i++;
@@ -864,20 +865,20 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
med = &medge[i];
if(ccgdm->drawInteriorEdges)
- med->flag = ME_EDGEDRAW | ME_EDGERENDER;
+ med->flag = ME_EDGEDRAW | ME_EDGERENDER;
med->v1 = getFaceIndex(ss, f, S, x, y,
- edgeSize, gridSize);
+ edgeSize, gridSize);
med->v2 = getFaceIndex(ss, f, S, x, y + 1,
- edgeSize, gridSize);
+ edgeSize, gridSize);
i++;
med = &medge[i];
if(ccgdm->drawInteriorEdges)
- med->flag = ME_EDGEDRAW | ME_EDGERENDER;
+ med->flag = ME_EDGEDRAW | ME_EDGERENDER;
med->v1 = getFaceIndex(ss, f, S, y, x,
- edgeSize, gridSize);
+ edgeSize, gridSize);
med->v2 = getFaceIndex(ss, f, S, y + 1, x,
- edgeSize, gridSize);
+ edgeSize, gridSize);
i++;
}
}
@@ -896,7 +897,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
if(edgeFlags) {
if(edgeIdx != -1) {
flags |= (edgeFlags[index] & (ME_SEAM | ME_SHARP))
- | ME_EDGEDRAW | ME_EDGERENDER;
+ | ME_EDGEDRAW | ME_EDGERENDER;
}
} else {
flags |= ME_EDGEDRAW | ME_EDGERENDER;
@@ -935,13 +936,13 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface)
for(x = 0; x < gridSize - 1; x++) {
MFace *mf = &mface[i];
mf->v1 = getFaceIndex(ss, f, S, x + 0, y + 0,
- edgeSize, gridSize);
+ edgeSize, gridSize);
mf->v2 = getFaceIndex(ss, f, S, x + 0, y + 1,
- edgeSize, gridSize);
+ edgeSize, gridSize);
mf->v3 = getFaceIndex(ss, f, S, x + 1, y + 1,
- edgeSize, gridSize);
+ edgeSize, gridSize);
mf->v4 = getFaceIndex(ss, f, S, x + 1, y + 0,
- edgeSize, gridSize);
+ edgeSize, gridSize);
mf->mat_nr = mat_nr;
mf->flag = flag;
@@ -1114,7 +1115,7 @@ static void ccgDM_drawVerts(DerivedMesh *dm) {
ccgFaceIterator_free(fi);
glEnd();
}
-static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges) {
+static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges) {
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGEdgeIterator *ei = ccgSubSurf_getEdgeIterator(ss);
@@ -1219,7 +1220,7 @@ static void ccgDM_glNormalFast(float *a, float *b, float *c, float *d)
static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm)
{
- if(ccgdm->pbvh) {
+ if(ccgdm->pbvh && ccgdm->multires.mmd) {
CCGFace **faces;
int totface;
@@ -1250,7 +1251,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
return;
glShadeModel((faceFlags[0] & ME_SMOOTH)? GL_SMOOTH: GL_FLAT);
- BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL);
+ BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL, (faceFlags[0] & ME_SMOOTH));
glShadeModel(GL_FLAT);
}
@@ -1767,8 +1768,8 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *u
if (draw) {
if (draw==2) {
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_quarttone);
+ glEnable(GL_POLYGON_STIPPLE);
+ glPolygonStipple(stipple_quarttone);
}
for (S=0; S<numVerts; S++) {
@@ -1935,12 +1936,13 @@ static void ccgDM_release(DerivedMesh *dm) {
ccgdm->multires.update(dm);
}
- if(ccgdm->pbvh) BLI_pbvh_free(ccgdm->pbvh);
if(ccgdm->gridFaces) MEM_freeN(ccgdm->gridFaces);
if(ccgdm->gridData) MEM_freeN(ccgdm->gridData);
if(ccgdm->gridAdjacency) MEM_freeN(ccgdm->gridAdjacency);
if(ccgdm->gridOffset) MEM_freeN(ccgdm->gridOffset);
if(ccgdm->freeSS) ccgSubSurf_free(ccgdm->ss);
+ if(ccgdm->fmap) MEM_freeN(ccgdm->fmap);
+ if(ccgdm->fmap_mem) MEM_freeN(ccgdm->fmap_mem);
MEM_freeN(ccgdm->edgeFlags);
MEM_freeN(ccgdm->faceFlags);
MEM_freeN(ccgdm->vertMap);
@@ -2185,11 +2187,35 @@ static int *ccgDM_getGridOffset(DerivedMesh *dm)
return ccgdm->gridOffset;
}
+static ListBase *ccgDM_getFaceMap(Object *ob, DerivedMesh *dm)
+{
+ CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
+
+ if(!ccgdm->multires.mmd && !ccgdm->fmap && ob->type == OB_MESH) {
+ Mesh *me= ob->data;
+
+ create_vert_face_map(&ccgdm->fmap, &ccgdm->fmap_mem, me->mface,
+ me->totvert, me->totface);
+ }
+
+ return ccgdm->fmap;
+}
+
static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
{
CCGDerivedMesh *ccgdm= (CCGDerivedMesh*)dm;
int gridSize, numGrids;
+ if(!ob) {
+ ccgdm->pbvh= NULL;
+ return NULL;
+ }
+
+ if(!ob->sculpt)
+ return NULL;
+ if(ob->sculpt->pbvh)
+ ccgdm->pbvh= ob->sculpt->pbvh;
+
if(ccgdm->pbvh)
return ccgdm->pbvh;
@@ -2199,25 +2225,25 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
gridSize = ccgDM_getGridSize(dm);
numGrids = ccgDM_getNumGrids(dm);
- ccgdm->pbvh = BLI_pbvh_new();
+ ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
BLI_pbvh_build_grids(ccgdm->pbvh, ccgdm->gridData, ccgdm->gridAdjacency,
numGrids, gridSize, (void**)ccgdm->gridFaces);
}
else if(ob->type == OB_MESH) {
Mesh *me= ob->data;
- ccgdm->pbvh = BLI_pbvh_new();
+ ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
BLI_pbvh_build_mesh(ccgdm->pbvh, me->mface, me->mvert,
- me->totface, me->totvert);
+ me->totface, me->totvert);
}
return ccgdm->pbvh;
}
static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
- int drawInteriorEdges,
- int useSubsurfUv,
- DerivedMesh *dm)
+ int drawInteriorEdges,
+ int useSubsurfUv,
+ DerivedMesh *dm)
{
CCGDerivedMesh *ccgdm = MEM_callocN(sizeof(*ccgdm), "ccgdm");
CCGVertIterator *vi;
@@ -2265,6 +2291,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.getGridData = ccgDM_getGridData;
ccgdm->dm.getGridAdjacency = ccgDM_getGridAdjacency;
ccgdm->dm.getGridOffset = ccgDM_getGridOffset;
+ ccgdm->dm.getFaceMap = ccgDM_getFaceMap;
ccgdm->dm.getPBVH = ccgDM_getPBVH;
ccgdm->dm.getVertCos = ccgdm_getVertCos;
@@ -2365,7 +2392,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
}
DM_interp_vert_data(dm, &ccgdm->dm, vertIdx, weight[0][0],
- numVerts, vertNum);
+ numVerts, vertNum);
++vertNum;
for(S = 0; S < numVerts; S++) {
@@ -2379,7 +2406,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
w[nextS] = weight[x][0][2];
w[otherS] = weight[x][0][3];
DM_interp_vert_data(dm, &ccgdm->dm, vertIdx, w,
- numVerts, vertNum);
+ numVerts, vertNum);
++vertNum;
}
}
@@ -2396,7 +2423,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
w[nextS] = weight[y * gridFaces + x][0][2];
w[otherS] = weight[y * gridFaces + x][0][3];
DM_interp_vert_data(dm, &ccgdm->dm, vertIdx, w,
- numVerts, vertNum);
+ numVerts, vertNum);
++vertNum;
}
}
@@ -2422,7 +2449,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
}
DM_interp_face_data(dm, &ccgdm->dm, &origIndex, NULL,
- &w, 1, faceNum);
+ &w, 1, faceNum);
weight++;
++faceNum;
@@ -2505,10 +2532,10 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
/***/
struct DerivedMesh *subsurf_make_derived_from_derived(
- struct DerivedMesh *dm,
- struct SubsurfModifierData *smd,
- int useRenderParams, float (*vertCos)[3],
- int isFinalCalc, int editMode)
+ struct DerivedMesh *dm,
+ struct SubsurfModifierData *smd,
+ int useRenderParams, float (*vertCos)[3],
+ int isFinalCalc, int editMode)
{
int useSimple = smd->subdivType == ME_SIMPLE_SUBSURF;
int useAging = smd->flags & eSubsurfModifierFlag_DebugIncr;
@@ -2520,12 +2547,12 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
int levels= (smd->modifier.scene)? get_render_subsurf_level(&smd->modifier.scene->r, smd->levels): smd->levels;
smd->emCache = _getSubSurf(smd->emCache, levels, useAging, 0,
- useSimple);
+ useSimple);
ss_sync_from_derivedmesh(smd->emCache, dm, vertCos, useSimple);
result = getCCGDerivedMesh(smd->emCache,
- drawInteriorEdges,
- useSubsurfUv, dm);
+ drawInteriorEdges,
+ useSubsurfUv, dm);
} else if(useRenderParams) {
/* Do not use cache in render mode. */
CCGSubSurf *ss;
@@ -2563,13 +2590,13 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
if(useIncremental && isFinalCalc) {
smd->mCache = ss = _getSubSurf(smd->mCache, levels,
- useAging, 0, useSimple);
+ useAging, 0, useSimple);
ss_sync_from_derivedmesh(ss, dm, vertCos, useSimple);
result = getCCGDerivedMesh(smd->mCache,
- drawInteriorEdges,
- useSubsurfUv, dm);
+ drawInteriorEdges,
+ useSubsurfUv, dm);
} else {
if (smd->mCache && isFinalCalc) {
ccgSubSurf_free(smd->mCache);
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index a0908529a3a..98ff0b2da1a 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -184,7 +184,7 @@ Text *add_empty_text(char *name)
ta->name= NULL;
- init_undo_text(ta);
+ init_undo_text(ta);
ta->nlines=1;
ta->flags= TXT_ISDIRTY | TXT_ISMEM;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 0a3f46b617e..48f819a7091 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -643,9 +643,9 @@ void make_local_texture(Tex *tex)
int a, local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(tex->id.lib==0) return;
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 0ac8b14166d..1e1e41a07e7 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -135,9 +135,9 @@ void make_local_world(World *wrld)
int local=0, lib=0;
/* - only lib users: do nothing
- * - only local users: set flag
- * - mixed: make copy
- */
+ * - only local users: set flag
+ * - mixed: make copy
+ */
if(wrld->id.lib==0) return;
if(wrld->id.us==1) {
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index ccef6832be8..ff6ebcc487f 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -206,7 +206,7 @@ static const char** get_file_extensions(int format)
}
case FFMPEG_MPEG2: {
static const char * rv[] = { ".dvd", ".vob", ".mpg", ".mpeg",
- NULL };
+ NULL };
return rv;
}
case FFMPEG_MPEG4: {
@@ -271,7 +271,7 @@ static int write_video_frame(RenderData *rd, AVFrame* frame, ReportList *reports
}
outsize = avcodec_encode_video(c, video_buffer, video_buffersize,
- frame);
+ frame);
if (outsize != 0) {
AVPacket packet;
av_init_packet(&packet);
@@ -446,7 +446,7 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char
/* prepare a video stream for the output file */
static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContext* of,
- int rectx, int recty)
+ int rectx, int recty)
{
AVStream* st;
AVCodecContext* c;
@@ -552,7 +552,7 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
video_buffersize = 2000000;
video_buffer = (uint8_t*)MEM_mallocN(video_buffersize,
- "FFMPEG video buffer");
+ "FFMPEG video buffer");
current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
@@ -1053,7 +1053,7 @@ IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int
/* not all versions of ffmpeg include that, so here we go ... */
static const AVOption *my_av_find_opt(void *v, const char *name,
- const char *unit, int mask, int flags){
+ const char *unit, int mask, int flags){
AVClass *c= *(AVClass**)v;
const AVOption *o= c->option;
diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c
index d715d18877d..cf3a36419b4 100644
--- a/source/blender/blenkernel/intern/writeframeserver.c
+++ b/source/blender/blenkernel/intern/writeframeserver.c
@@ -201,7 +201,7 @@ static int handle_request(RenderData *rd, char * req)
*p = 0;
if (strcmp(path, "/index.html") == 0
- || strcmp(path, "/") == 0) {
+ || strcmp(path, "/") == 0) {
safe_puts(index_page);
return -1;
}
@@ -287,7 +287,7 @@ int frameserver_loop(RenderData *rd, ReportList *reports)
tv.tv_sec = 10;
tv.tv_usec = 0;
- rval = select(connsock + 1, &readfds, NULL, NULL, &tv);
+ rval = select(connsock + 1, &readfds, NULL, NULL, &tv);
if (rval > 0) {
break;
} else if (rval == 0) {
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index c77f76a6674..3ed8169f260 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -44,7 +44,7 @@ MINLINE void zero_v4(float r[4]);
MINLINE void copy_v2_v2(float r[2], const float a[2]);
MINLINE void copy_v3_v3(float r[3], const float a[3]);
-MINLINE void copy_v4_v4(float r[4], float a[4]);
+MINLINE void copy_v4_v4(float r[4], const float a[4]);
MINLINE void swap_v2_v2(float a[2], float b[2]);
MINLINE void swap_v3_v3(float a[3], float b[3]);
@@ -52,14 +52,14 @@ MINLINE void swap_v4_v4(float a[4], float b[4]);
/********************************* Arithmetic ********************************/
-MINLINE void add_v2_v2(float r[2], float a[2]);
-MINLINE void add_v2_v2v2(float r[2], float a[2], float b[2]);
-MINLINE void add_v3_v3(float r[3], float a[3]);
-MINLINE void add_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void add_v2_v2(float r[2], const float a[2]);
+MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2]);
+MINLINE void add_v3_v3(float r[3], const float a[3]);
+MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3]);
-MINLINE void sub_v2_v2(float r[2], float a[2]);
-MINLINE void sub_v2_v2v2(float r[2], float a[2], float b[2]);
-MINLINE void sub_v3_v3(float r[3], float a[3]);
+MINLINE void sub_v2_v2(float r[2], const float a[2]);
+MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2]);
+MINLINE void sub_v3_v3(float r[3], const float a[3]);
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3]);
MINLINE void mul_v2_fl(float r[2], float f);
@@ -67,14 +67,14 @@ MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f);
MINLINE void mul_v3_fl(float r[3], float f);
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f);
MINLINE void mul_v2_v2(float r[2], const float a[2]);
-MINLINE void mul_v3_v3(float r[3], float a[3]);
-MINLINE void mul_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void mul_v3_v3(float r[3], const float a[3]);
+MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3]);
-MINLINE void madd_v3_v3fl(float r[3], float a[3], float f);
-MINLINE void madd_v3_v3v3(float r[3], float a[3], float b[3]);
-MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], const float f);
-MINLINE void madd_v3_v3v3fl(float r[3], float a[3], float b[3], float f);
-MINLINE void madd_v3_v3v3v3(float r[3], float a[3], float b[3], float c[3]);
+MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f);
+MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3]);
+MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f);
+MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f);
+MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
MINLINE void negate_v3(float r[3]);
MINLINE void negate_v3_v3(float r[3], const float a[3]);
@@ -106,6 +106,7 @@ void interp_v2_v2v2v2(float r[2], const float a[2], const float b[2], const floa
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t);
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3]);
void interp_v3_v3v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float w[4]);
+void interp_v4_v4v4(float r[4], const float a[4], const float b[4], const float t);
void mid_v3_v3v3(float r[3], float a[3], float b[3]);
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index da59c5695a4..0da5b8529bb 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -47,7 +47,7 @@ typedef void (*BLI_pbvh_HitCallback)(PBVHNode *node, void *data);
PBVH *BLI_pbvh_new(void);
void BLI_pbvh_build_mesh(PBVH *bvh, struct MFace *faces, struct MVert *verts,
- int totface, int totvert);
+ int totface, int totvert);
void BLI_pbvh_build_grids(PBVH *bvh, struct DMGridData **grids,
struct DMGridAdjacency *gridadj, int totgrid,
int gridsize, void **gridfaces);
@@ -71,7 +71,7 @@ void BLI_pbvh_search_gather(PBVH *bvh,
hit first */
void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitCallback cb, void *data,
- float ray_start[3], float ray_normal[3], int original);
+ float ray_start[3], float ray_normal[3], int original);
int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
float ray_start[3], float ray_normal[3], float *dist);
@@ -79,7 +79,7 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
void BLI_pbvh_node_draw(PBVHNode *node, void *data);
int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data);
-void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3]);
+void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], int smooth);
/* Node Access */
@@ -182,7 +182,7 @@ typedef struct PBVHVertexIter {
vi.height= vi.gridsize; \
vi.grid= vi.grids[vi.grid_indices[vi.g]]; \
vi.skip= 0; \
- \
+ \
/*if(mode == PVBH_ITER_UNIQUE) { \
vi.grid += subm->grid.offset; \
vi.skip= subm->grid.skip; \
@@ -193,7 +193,7 @@ typedef struct PBVHVertexIter {
vi.width= vi.totvert; \
vi.height= 1; \
} \
- \
+ \
for(vi.gy=0; vi.gy<vi.height; vi.gy++) { \
if(vi.grid) vi.grid += vi.skip; \
\
diff --git a/source/blender/blenlib/BLI_uvproject.h b/source/blender/blenlib/BLI_uvproject.h
new file mode 100644
index 00000000000..a77ca60fc15
--- /dev/null
+++ b/source/blender/blenlib/BLI_uvproject.h
@@ -0,0 +1,40 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef BKE_UVPROJECT_H
+#define BKE_UVPROJECT_H
+
+struct UvCameraInfo;
+struct Object;
+
+/* create uv info from the camera, needs to be freed */
+struct UvCameraInfo *project_camera_info(struct Object *ob, float rotmat[4][4], float winx, float winy);
+
+/* apply uv from uvinfo (camera) */
+void project_from_camera(float target[2], float source[3], struct UvCameraInfo *uci);
+
+/* apply uv from perspective matrix */
+void project_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy);
+
+/* apply ortho uv's */
+void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4]);
+
+#endif
diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h
index 0827df7e6d1..77abb15b953 100644
--- a/source/blender/blenlib/BLI_vfontdata.h
+++ b/source/blender/blenlib/BLI_vfontdata.h
@@ -53,7 +53,7 @@ typedef struct VFontData {
typedef struct VChar {
struct VChar *next, *prev;
- ListBase nurbsbase;
+ ListBase nurbsbase;
intptr_t index;
float resol;
float width;
diff --git a/source/blender/blenlib/intern/BLI_bfile.c b/source/blender/blenlib/intern/BLI_bfile.c
index 3306283ad3f..b5dd764d6c6 100644
--- a/source/blender/blenlib/intern/BLI_bfile.c
+++ b/source/blender/blenlib/intern/BLI_bfile.c
@@ -72,7 +72,7 @@ void setup_temp();
/*** Exported functions ***/
BFILE *BLI_bfile_fopen(const char *path, const char *mode, int bflags,
- BEnvVarFam envvars)
+ BEnvVarFam envvars)
{
BFILE *bfile;
@@ -107,7 +107,7 @@ BFILE *BLI_bfile_fopen(const char *path, const char *mode, int bflags,
BFILE *BLI_bfile_open(const char *pathname, int flags, int bflags,
- BEnvVarFam envvars)
+ BEnvVarFam envvars)
{
BFILE *bfile;
@@ -171,7 +171,7 @@ ssize_t BLI_bfile_read(BFILE *f, void *buf, size_t count) {
size_t BLI_bfile_fwrite(const void *ptr, size_t size, size_t nmemb,
- BFILE *f)
+ BFILE *f)
{
size_t ret;
@@ -389,7 +389,7 @@ void expand_envvars(char* src, char* dst) {
}
/* Figure the name of the env var we just found */
strncpy(name, hit1 + ENVVAR_P_SIZE,
- hit2 - (hit1 + ENVVAR_P_SIZE));
+ hit2 - (hit1 + ENVVAR_P_SIZE));
name[hit2 - (hit1 + ENVVAR_P_SIZE)] = '\0';
/* See if we can get something with that name */
value = getenv(name);
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index b95f276a702..82241ad2cfb 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -138,7 +138,7 @@ void *BLI_ghashIterator_getValue(GHashIterator *ghi) {
void BLI_ghashIterator_step(GHashIterator *ghi) {
if (ghi->curEntry) {
- ghi->curEntry= ghi->curEntry->next;
+ ghi->curEntry= ghi->curEntry->next;
while (!ghi->curEntry) {
ghi->curBucket++;
if (ghi->curBucket==ghi->gh->nbuckets)
@@ -173,7 +173,7 @@ unsigned int BLI_ghashutil_inthash(void *ptr) {
key += ~(key << 9);
key ^= (key >> 17);
- return (unsigned int)(key & 0xffffffff);
+ return (unsigned int)(key & 0xffffffff);
}
int BLI_ghashutil_intcmp(void *a, void *b) {
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index bba9b1793c7..4d64f4a50ff 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -1490,7 +1490,7 @@ static float fast_ray_nearest_hit(const BVHRayCastData *data, const BVHNode *nod
dist = t1x;
if (t1y > dist) dist = t1y;
- if (t1z > dist) dist = t1z;
+ if (t1z > dist) dist = t1z;
return dist;
}
@@ -1613,7 +1613,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
{
dfs_raycast(&data, root);
// iterative_raycast(&data, root);
- }
+ }
if(hit)
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index f9c5fc58a63..62d6f6b936c 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -92,13 +92,13 @@ void BLI_linklist_append(LinkNode **listp, void *ptr) {
nlink->next = NULL;
if(node == NULL){
- *listp = nlink;
- } else {
- while(node->next != NULL){
- node = node->next;
- }
- node->next = nlink;
- }
+ *listp = nlink;
+ } else {
+ while(node->next != NULL){
+ node = node->next;
+ }
+ node->next = nlink;
+ }
}
void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, MemArena *ma) {
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index eebffd6bd6e..1c910dbb519 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack2d.c
@@ -240,17 +240,17 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
if (vert->free & quad_flags[j]) {
switch (j) {
case BL:
- SET_BOXRIGHT(box, vert->x);
- SET_BOXTOP(box, vert->y);
- break;
+ SET_BOXRIGHT(box, vert->x);
+ SET_BOXTOP(box, vert->y);
+ break;
case TR:
- SET_BOXLEFT(box, vert->x);
- SET_BOXBOTTOM(box, vert->y);
- break;
+ SET_BOXLEFT(box, vert->x);
+ SET_BOXBOTTOM(box, vert->y);
+ break;
case TL:
- SET_BOXRIGHT(box, vert->x);
- SET_BOXBOTTOM(box, vert->y);
- break;
+ SET_BOXRIGHT(box, vert->x);
+ SET_BOXBOTTOM(box, vert->y);
+ break;
case BR:
SET_BOXLEFT(box, vert->x);
SET_BOXTOP(box, vert->y);
@@ -302,11 +302,11 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
case TR:
box->v[BL]= vert;
vert->trb = box;
- break;
+ break;
case TL:
box->v[BR]= vert;
vert->tlb = box;
- break;
+ break;
case BR:
box->v[TL]= vert;
vert->brb = box;
@@ -314,7 +314,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
case BL:
box->v[TR]= vert;
vert->blb = box;
- break;
+ break;
}
/* Mask free flags for verts that are
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index f7c16a0a8b2..2367af470fe 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -77,7 +77,7 @@ enum BPathTypes {
BPATH_SEQ,
BPATH_CDATA,
- BPATH_DONE
+ BPATH_DONE
};
void BLI_bpathIterator_init( struct BPathIterator *bpi, char *base_path ) {
diff --git a/source/blender/blenlib/intern/dynamiclist.c b/source/blender/blenlib/intern/dynamiclist.c
index 48ba8247ea9..f059ce3736a 100644
--- a/source/blender/blenlib/intern/dynamiclist.c
+++ b/source/blender/blenlib/intern/dynamiclist.c
@@ -179,7 +179,7 @@ void *BLI_dlist_find_link(DynamicList *dlist, unsigned int index)
if(!dlist || !dlist->da.items) return NULL;
if((index <= dlist->da.last_item_index) && (index >= 0) && (dlist->da.count>0)){
- return dlist->da.items[index];
+ return dlist->da.items[index];
}
else {
return NULL;
diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c
index a5c0e3f5b79..4f93abf8357 100644
--- a/source/blender/blenlib/intern/edgehash.c
+++ b/source/blender/blenlib/intern/edgehash.c
@@ -82,7 +82,7 @@ void BLI_edgehash_insert(EdgeHash *eh, int v0, int v1, void *val) {
v1 ^= v0;
v0 ^= v1;
}
- hash = EDGEHASH(v0,v1)%eh->nbuckets;
+ hash = EDGEHASH(v0,v1)%eh->nbuckets;
e->v0 = v0;
e->v1 = v1;
@@ -215,7 +215,7 @@ void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val) {
void BLI_edgehashIterator_step(EdgeHashIterator *ehi) {
if (ehi->curEntry) {
- ehi->curEntry= ehi->curEntry->next;
+ ehi->curEntry= ehi->curEntry->next;
while (!ehi->curEntry) {
ehi->curBucket++;
if (ehi->curBucket==ehi->eh->nbuckets)
diff --git a/source/blender/blenlib/intern/fnmatch.c b/source/blender/blenlib/intern/fnmatch.c
index ccb6fa72ea8..a78f9ad7585 100644
--- a/source/blender/blenlib/intern/fnmatch.c
+++ b/source/blender/blenlib/intern/fnmatch.c
@@ -66,97 +66,97 @@ fnmatch (const char *pattern, const char *string, int flags)
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
while ((c = *p++) != '\0')
- {
- c = FOLD (c);
+ {
+ c = FOLD (c);
- switch (c)
+ switch (c)
{
case '?':
if (*n == '\0')
- return FNM_NOMATCH;
+ return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
- return FNM_NOMATCH;
+ return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
- return FNM_NOMATCH;
+ return FNM_NOMATCH;
break;
case '\\':
if (!(flags & FNM_NOESCAPE))
- {
- c = *p++;
- if (c == '\0')
+ {
+ c = *p++;
+ if (c == '\0')
/* Trailing \ loses. */
return FNM_NOMATCH;
- c = FOLD (c);
- }
+ c = FOLD (c);
+ }
if (FOLD (*n) != c)
- return FNM_NOMATCH;
+ return FNM_NOMATCH;
break;
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
- (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
- return FNM_NOMATCH;
+ (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++)
- {
- if ((flags & FNM_FILE_NAME) && *n == '/')
+ {
+ if ((flags & FNM_FILE_NAME) && *n == '/')
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
- else if (c == '?')
+ else if (c == '?')
{
/* A ? needs to match one character. */
if (*n == '\0')
- /* There isn't another character; no match. */
- return FNM_NOMATCH;
+ /* There isn't another character; no match. */
+ return FNM_NOMATCH;
else
- /* One character of the string is consumed in matching
- this ? wildcard, so *??? won't match if there are
- less than three characters. */
- ++n;
+ /* One character of the string is consumed in matching
+ this ? wildcard, so *??? won't match if there are
+ less than three characters. */
+ ++n;
+ }
}
- }
if (c == '\0')
- return 0;
+ return 0;
{
- char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
- c1 = FOLD (c1);
- for (--p; *n != '\0'; ++n)
- if ((c == '[' || FOLD (*n) == c1) &&
+ char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
+ c1 = FOLD (c1);
+ for (--p; *n != '\0'; ++n)
+ if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0;
- return FNM_NOMATCH;
+ return FNM_NOMATCH;
}
case '[':
{
- /* Nonzero if the sense of the character class is inverted. */
- register int not;
+ /* Nonzero if the sense of the character class is inverted. */
+ register int not;
- if (*n == '\0')
- return FNM_NOMATCH;
+ if (*n == '\0')
+ return FNM_NOMATCH;
- if ((flags & FNM_PERIOD) && *n == '.' &&
+ if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
- return FNM_NOMATCH;
+ return FNM_NOMATCH;
- not = (*p == '!' || *p == '^');
- if (not)
- ++p;
+ not = (*p == '!' || *p == '^');
+ if (not)
+ ++p;
- c = *p++;
- for (;;)
- {
+ c = *p++;
+ for (;;)
+ {
register char cstart = c, cend = c;
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
- if (*p == '\0')
- return FNM_NOMATCH;
- cstart = cend = *p++;
+ if (*p == '\0')
+ return FNM_NOMATCH;
+ cstart = cend = *p++;
}
cstart = cend = FOLD (cstart);
@@ -174,14 +174,14 @@ fnmatch (const char *pattern, const char *string, int flags)
if (c == '-' && *p != ']')
{
- cend = *p++;
- if (!(flags & FNM_NOESCAPE) && cend == '\\')
- cend = *p++;
- if (cend == '\0')
- return FNM_NOMATCH;
- cend = FOLD (cend);
-
- c = *p++;
+ cend = *p++;
+ if (!(flags & FNM_NOESCAPE) && cend == '\\')
+ cend = *p++;
+ if (cend == '\0')
+ return FNM_NOMATCH;
+ cend = FOLD (cend);
+
+ c = *p++;
}
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
@@ -189,15 +189,15 @@ fnmatch (const char *pattern, const char *string, int flags)
if (c == ']')
break;
- }
- if (!not)
- return FNM_NOMATCH;
- break;
+ }
+ if (!not)
+ return FNM_NOMATCH;
+ break;
matched:;
- /* Skip the rest of the [...] that already matched. */
- while (c != ']')
- {
+ /* Skip the rest of the [...] that already matched. */
+ while (c != ']')
+ {
if (c == '\0')
/* [... (unterminated) loses. */
return FNM_NOMATCH;
@@ -205,31 +205,31 @@ fnmatch (const char *pattern, const char *string, int flags)
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
- if (*p == '\0')
- return FNM_NOMATCH;
- /* XXX 1003.2d11 is unclear if this is right. */
- ++p;
+ if (*p == '\0')
+ return FNM_NOMATCH;
+ /* XXX 1003.2d11 is unclear if this is right. */
+ ++p;
+ }
}
- }
- if (not)
- return FNM_NOMATCH;
+ if (not)
+ return FNM_NOMATCH;
}
break;
default:
if (c != FOLD (*n))
- return FNM_NOMATCH;
+ return FNM_NOMATCH;
}
- ++n;
- }
+ ++n;
+ }
if (*n == '\0')
- return 0;
+ return 0;
if ((flags & FNM_LEADING_DIR) && *n == '/')
- /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
- return 0;
+ /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
+ return 0;
return FNM_NOMATCH;
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 9227803b681..6d6abc88999 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -429,7 +429,7 @@ static int check_freetypefont(PackedFile * pf)
&face );
if(err) {
success = 0;
- //XXX error("This is not a valid font");
+ //XXX error("This is not a valid font");
}
else {
/*
@@ -522,14 +522,14 @@ int BLI_vfontchar_from_freetypefont(VFont *vfont, unsigned long character)
typedef struct FT_Outline_
{
- short n_contours; /* number of contours in glyph */
- short n_points; /* number of points in the glyph */
+ short n_contours; /* number of contours in glyph */
+ short n_points; /* number of points in the glyph */
- FT_Vector* points; /* the outline's points */
- char* tags; /* the points flags */
- short* contours; /* the contour end points */
+ FT_Vector* points; /* the outline's points */
+ char* tags; /* the points flags */
+ short* contours; /* the contour end points */
- int flags; /* outline masks */
+ int flags; /* outline masks */
} FT_Outline;
@@ -569,44 +569,44 @@ The following rules are applied to decompose the contour's points into segments
Note that it is possible to mix conic and cubic arcs in a single contour, even though no current
font driver produces such outlines.
- * # on
- * off
- __---__
+ * # on
+ * off
+ __---__
#-__ _-- -_
- --__ _- -
- --__ # \
- --__ #
- -#
- Two "on" points
+ --__ _- -
+ --__ # \
+ --__ #
+ -#
+ Two "on" points
Two "on" points and one "conic" point
- between them
+ between them
- *
+ *
# __ Two "on" points with two "conic"
\ - - points between them. The point
- \ / \ marked '0' is the middle of the
- - 0 \ "off" points, and is a 'virtual'
- -_ _- # "on" point where the curve passes.
- -- It does not appear in the point
- list.
- *
+ \ / \ marked '0' is the middle of the
+ - 0 \ "off" points, and is a 'virtual'
+ -_ _- # "on" point where the curve passes.
+ -- It does not appear in the point
+ list.
+ *
- * # on
- * * off
- __---__
- _-- -_
- _- -
+ * # on
+ * * off
+ __---__
+ _-- -_
+ _- -
# \
- #
+ #
- Two "on" points
+ Two "on" points
and two "cubic" point
- between them
+ between them
Each glyph's original outline points are located on a grid of indivisible units. The points are stored
diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c
index 8301f790614..686b35a878e 100644
--- a/source/blender/blenlib/intern/math_base.c
+++ b/source/blender/blenlib/intern/math_base.c
@@ -45,12 +45,12 @@ double copysign(double x, double y)
/* from python 3.1 pymath.c */
double round(double x)
{
- double absx, y;
- absx = fabs(x);
- y = floor(absx);
- if (absx - y >= 0.5)
- y += 1.0;
- return copysign(y, x);
+ double absx, y;
+ absx = fabs(x);
+ y = floor(absx);
+ if (absx - y >= 0.5)
+ y += 1.0;
+ return copysign(y, x);
}
#endif
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 633585a3336..a1bb2754d95 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -365,21 +365,21 @@ int constrain_rgb(float *r, float *g, float *b)
{
float w;
- /* Amount of white needed is w = - min(0, *r, *g, *b) */
+ /* Amount of white needed is w = - min(0, *r, *g, *b) */
- w = (0 < *r) ? 0 : *r;
- w = (w < *g) ? w : *g;
- w = (w < *b) ? w : *b;
- w = -w;
+ w = (0 < *r) ? 0 : *r;
+ w = (w < *g) ? w : *g;
+ w = (w < *b) ? w : *b;
+ w = -w;
- /* Add just enough white to make r, g, b all positive. */
+ /* Add just enough white to make r, g, b all positive. */
- if (w > 0) {
- *r += w; *g += w; *b += w;
- return 1; /* Color modified to fit RGB gamut */
- }
+ if (w > 0) {
+ *r += w; *g += w; *b += w;
+ return 1; /* Color modified to fit RGB gamut */
+ }
- return 0; /* Color within RGB gamut */
+ return 0; /* Color within RGB gamut */
}
float rgb_to_grayscale(float rgb[3])
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index f2454f05977..27f36752f80 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -957,7 +957,7 @@ int isect_line_line_strict_v3(float v1[3], float v2[3], float v3[3], float v4[3]
int isect_aabb_aabb_v3(float min1[3], float max1[3], float min2[3], float max2[3])
{
return (min1[0]<max2[0] && min1[1]<max2[1] && min1[2]<max2[2] &&
- min2[0]<max1[0] && min2[1]<max1[1] && min2[2]<max1[2]);
+ min2[0]<max1[0] && min2[1]<max1[1] && min2[2]<max1[2]);
}
/* find closest point to p on line through l1,l2 and return lambda,
@@ -1396,14 +1396,14 @@ void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3
wtot = w[0]+w[1]+w[2];
if (wtot != 0.0f) {
- wtot_inv = 1.0f/wtot;
+ wtot_inv = 1.0f/wtot;
- w[0] = w[0]*wtot_inv;
- w[1] = w[1]*wtot_inv;
- w[2] = w[2]*wtot_inv;
+ w[0] = w[0]*wtot_inv;
+ w[1] = w[1]*wtot_inv;
+ w[2] = w[2]*wtot_inv;
}
else /* dummy values for zero area face */
- w[0] = w[1] = w[2] = 1.0f/3.0f;
+ w[0] = w[1] = w[2] = 1.0f/3.0f;
}
/* given 2 triangles in 3D space, and a point in relation to the first triangle.
@@ -1608,21 +1608,21 @@ void interp_cubic_v3(float *x, float *v,float *x1, float *v1, float *x2, float *
void orthographic_m4(float matrix[][4],float left, float right, float bottom, float top, float nearClip, float farClip)
{
- float Xdelta, Ydelta, Zdelta;
+ float Xdelta, Ydelta, Zdelta;
- Xdelta = right - left;
- Ydelta = top - bottom;
- Zdelta = farClip - nearClip;
- if (Xdelta == 0.0 || Ydelta == 0.0 || Zdelta == 0.0) {
+ Xdelta = right - left;
+ Ydelta = top - bottom;
+ Zdelta = farClip - nearClip;
+ if (Xdelta == 0.0 || Ydelta == 0.0 || Zdelta == 0.0) {
return;
- }
- unit_m4(matrix);
- matrix[0][0] = 2.0f/Xdelta;
- matrix[3][0] = -(right + left)/Xdelta;
- matrix[1][1] = 2.0f/Ydelta;
- matrix[3][1] = -(top + bottom)/Ydelta;
- matrix[2][2] = -2.0f/Zdelta; /* note: negate Z */
- matrix[3][2] = -(farClip + nearClip)/Zdelta;
+ }
+ unit_m4(matrix);
+ matrix[0][0] = 2.0f/Xdelta;
+ matrix[3][0] = -(right + left)/Xdelta;
+ matrix[1][1] = 2.0f/Ydelta;
+ matrix[3][1] = -(top + bottom)/Ydelta;
+ matrix[2][2] = -2.0f/Zdelta; /* note: negate Z */
+ matrix[3][2] = -(farClip + nearClip)/Zdelta;
}
void perspective_m4(float mat[][4],float left, float right, float bottom, float top, float nearClip, float farClip)
@@ -1644,22 +1644,22 @@ void perspective_m4(float mat[][4],float left, float right, float bottom, float
mat[2][3] = -1.0f;
mat[3][2] = (-2.0f * nearClip * farClip)/Zdelta;
mat[0][1] = mat[0][2] = mat[0][3] =
- mat[1][0] = mat[1][2] = mat[1][3] =
- mat[3][0] = mat[3][1] = mat[3][3] = 0.0;
+ mat[1][0] = mat[1][2] = mat[1][3] =
+ mat[3][0] = mat[3][1] = mat[3][3] = 0.0;
}
static void i_multmatrix(float icand[][4], float Vm[][4])
{
- int row, col;
- float temp[4][4];
-
- for(row=0 ; row<4 ; row++)
- for(col=0 ; col<4 ; col++)
- temp[row][col] = icand[row][0] * Vm[0][col]
- + icand[row][1] * Vm[1][col]
- + icand[row][2] * Vm[2][col]
- + icand[row][3] * Vm[3][col];
+ int row, col;
+ float temp[4][4];
+
+ for(row=0 ; row<4 ; row++)
+ for(col=0 ; col<4 ; col++)
+ temp[row][col] = icand[row][0] * Vm[0][col]
+ + icand[row][1] * Vm[1][col]
+ + icand[row][2] * Vm[2][col]
+ + icand[row][3] * Vm[3][col];
copy_m4_m4(Vm, temp);
}
@@ -1669,10 +1669,10 @@ void polarview_m4(float Vm[][4],float dist, float azimuth, float incidence, floa
unit_m4(Vm);
- translate_m4(Vm,0.0, 0.0, -dist);
- rotate_m4(Vm,'z',-twist);
- rotate_m4(Vm,'x',-incidence);
- rotate_m4(Vm,'z',-azimuth);
+ translate_m4(Vm,0.0, 0.0, -dist);
+ rotate_m4(Vm,'z',-twist);
+ rotate_m4(Vm,'x',-incidence);
+ rotate_m4(Vm,'z',-azimuth);
}
void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py, float pz, float twist)
@@ -1706,8 +1706,8 @@ void lookat_m4(float mat[][4],float vx, float vy, float vz, float px, float py,
i_multmatrix(mat1, mat);
- mat1[1][1] = mat1[2][2] = 1.0f; /* be careful here to reinit */
- mat1[1][2] = mat1[2][1] = 0.0; /* those modified by the last */
+ mat1[1][1] = mat1[2][2] = 1.0f; /* be careful here to reinit */
+ mat1[1][2] = mat1[2][1] = 0.0; /* those modified by the last */
/* paragraph */
if (hyp != 0.0f) { /* rotate Y */
@@ -1879,7 +1879,7 @@ void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2,
/* vector clouds */
/* 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])
input
(
@@ -1903,13 +1903,13 @@ pointers may be NULL if not needed
/* can't believe there is none in math utils */
float _det_m3(float m2[3][3])
{
- float det = 0.f;
- if (m2){
- det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
- -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
- +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
- }
- return det;
+ float det = 0.f;
+ if (m2){
+ det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
+ -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
+ +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
+ }
+ return det;
}
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index b3dd5a09f71..fca8cf445d1 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -154,17 +154,17 @@ void mul_m4_m4m4(float m1[][4], float m2[][4], float m3[][4])
void mul_m3_m3m3(float m1[][3], float m3[][3], float m2[][3])
{
/* m1[i][j] = m2[i][k]*m3[k][j], args are flipped! */
- m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
- m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
- m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
+ m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
+ m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
+ m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
- m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
- m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
- m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
+ m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
+ m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
+ m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
- m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
- m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
- m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
+ m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
+ m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
+ m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
}
void mul_m4_m4m3(float (*m1)[4], float (*m3)[4], float (*m2)[3])
@@ -183,18 +183,18 @@ void mul_m4_m4m3(float (*m1)[4], float (*m3)[4], float (*m2)[3])
/* m1 = m2 * m3, ignore the elements on the 4th row/column of m3*/
void mul_m3_m3m4(float m1[][3], float m2[][3], float m3[][4])
{
- /* m1[i][j] = m2[i][k] * m3[k][j] */
- m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] +m2[0][2] * m3[2][0];
- m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] +m2[0][2] * m3[2][1];
- m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] +m2[0][2] * m3[2][2];
+ /* m1[i][j] = m2[i][k] * m3[k][j] */
+ m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] +m2[0][2] * m3[2][0];
+ m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] +m2[0][2] * m3[2][1];
+ m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] +m2[0][2] * m3[2][2];
- m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] +m2[1][2] * m3[2][0];
- m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] +m2[1][2] * m3[2][1];
- m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] +m2[1][2] * m3[2][2];
+ m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] +m2[1][2] * m3[2][0];
+ m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] +m2[1][2] * m3[2][1];
+ m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] +m2[1][2] * m3[2][2];
- m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] +m2[2][2] * m3[2][0];
- m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] +m2[2][2] * m3[2][1];
- m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] +m2[2][2] * m3[2][2];
+ m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] +m2[2][2] * m3[2][0];
+ m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] +m2[2][2] * m3[2][1];
+ m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] +m2[2][2] * m3[2][2];
}
void mul_m4_m3m4(float (*m1)[4], float (*m3)[3], float (*m2)[4])
@@ -437,8 +437,8 @@ int invert_m3_m3(float m1[3][3], float m2[3][3])
/* then determinant old matrix! */
det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
- -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
- +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
+ -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
+ +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
success= (det != 0);
@@ -823,8 +823,8 @@ float determinant_m3(float a1, float a2, float a3,
float ans;
ans = a1 * determinant_m2(b2, b3, c2, c3)
- - b1 * determinant_m2(a2, a3, c2, c3)
- + c1 * determinant_m2(a2, a3, b2, b3);
+ - b1 * determinant_m2(a2, a3, c2, c3)
+ + c1 * determinant_m2(a2, a3, b2, b3);
return ans;
}
@@ -855,9 +855,9 @@ float determinant_m4(float m[][4])
d4= m[3][3];
ans = a1 * determinant_m3(b2, b3, b4, c2, c3, c4, d2, d3, d4)
- - b1 * determinant_m3(a2, a3, a4, c2, c3, c4, d2, d3, d4)
- + c1 * determinant_m3(a2, a3, a4, b2, b3, b4, d2, d3, d4)
- - d1 * determinant_m3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
+ - b1 * determinant_m3(a2, a3, a4, c2, c3, c4, d2, d3, d4)
+ + c1 * determinant_m3(a2, a3, a4, b2, b3, b4, d2, d3, d4)
+ - d1 * determinant_m3(a2, a3, a4, b2, b3, b4, c2, c3, c4);
return ans;
}
@@ -938,54 +938,47 @@ void scale_m4_fl(float m[][4], float scale)
void translate_m4(float mat[][4],float Tx, float Ty, float Tz)
{
- mat[3][0] += (Tx*mat[0][0] + Ty*mat[1][0] + Tz*mat[2][0]);
- mat[3][1] += (Tx*mat[0][1] + Ty*mat[1][1] + Tz*mat[2][1]);
- mat[3][2] += (Tx*mat[0][2] + Ty*mat[1][2] + Tz*mat[2][2]);
+ mat[3][0] += (Tx*mat[0][0] + Ty*mat[1][0] + Tz*mat[2][0]);
+ mat[3][1] += (Tx*mat[0][1] + Ty*mat[1][1] + Tz*mat[2][1]);
+ mat[3][2] += (Tx*mat[0][2] + Ty*mat[1][2] + Tz*mat[2][2]);
}
-void rotate_m4(float mat[][4], char axis,float angle)
+void rotate_m4(float mat[][4], const char axis, const float angle)
{
int col;
- float temp[4];
- float cosine, sine;
-
- for(col=0; col<4 ; col++) /* init temp to zero matrix */
- temp[col] = 0;
-
- angle = (float)(angle*(3.1415926535/180.0));
- cosine = (float)cos(angle);
- sine = (float)sin(angle);
- switch(axis){
- case 'x':
- case 'X':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[1][col] + sine*mat[2][col];
- for(col=0 ; col<4 ; col++) {
- mat[2][col] = - sine*mat[1][col] + cosine*mat[2][col];
- mat[1][col] = temp[col];
+ float temp[4]= {0.0f, 0.0f, 0.0f, 0.0f};
+ float cosine, sine;
+
+ cosine = (float)cos(angle);
+ sine = (float)sin(angle);
+ switch(axis){
+ case 'X':
+ for(col=0 ; col<4 ; col++)
+ temp[col] = cosine*mat[1][col] + sine*mat[2][col];
+ for(col=0 ; col<4 ; col++) {
+ mat[2][col] = - sine*mat[1][col] + cosine*mat[2][col];
+ mat[1][col] = temp[col];
}
- break;
-
- case 'y':
- case 'Y':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[0][col] - sine*mat[2][col];
- for(col=0 ; col<4 ; col++) {
- mat[2][col] = sine*mat[0][col] + cosine*mat[2][col];
- mat[0][col] = temp[col];
- }
+ break;
+
+ case 'Y':
+ for(col=0 ; col<4 ; col++)
+ temp[col] = cosine*mat[0][col] - sine*mat[2][col];
+ for(col=0 ; col<4 ; col++) {
+ mat[2][col] = sine*mat[0][col] + cosine*mat[2][col];
+ mat[0][col] = temp[col];
+ }
break;
- case 'z':
- case 'Z':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[0][col] + sine*mat[1][col];
- for(col=0 ; col<4 ; col++) {
- mat[1][col] = - sine*mat[0][col] + cosine*mat[1][col];
- mat[0][col] = temp[col];
- }
+ case 'Z':
+ for(col=0 ; col<4 ; col++)
+ temp[col] = cosine*mat[0][col] + sine*mat[1][col];
+ for(col=0 ; col<4 ; col++) {
+ mat[1][col] = - sine*mat[0][col] + cosine*mat[1][col];
+ mat[0][col] = temp[col];
+ }
break;
- }
+ }
}
void blend_m3_m3m3(float out[][3], float dst[][3], float src[][3], float srcweight)
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index b6dc0ca06cd..4af0a3a4248 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -900,12 +900,12 @@ void quat_to_eul(float *eul,float *quat)
/* XYZ order */
void eul_to_quat(float *quat,float *eul)
{
- float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
+ float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
- ti = eul[0]*0.5f; tj = eul[1]*0.5f; th = eul[2]*0.5f;
- ci = (float)cos(ti); cj = (float)cos(tj); ch = (float)cos(th);
- si = (float)sin(ti); sj = (float)sin(tj); sh = (float)sin(th);
- cc = ci*ch; cs = ci*sh; sc = si*ch; ss = si*sh;
+ ti = eul[0]*0.5f; tj = eul[1]*0.5f; th = eul[2]*0.5f;
+ ci = (float)cos(ti); cj = (float)cos(tj); ch = (float)cos(th);
+ si = (float)sin(ti); sj = (float)sin(tj); sh = (float)sin(th);
+ cc = ci*ch; cs = ci*sh; sc = si*ch; ss = si*sh;
quat[0] = cj*cc + sj*ss;
quat[1] = cj*sc - sj*cs;
@@ -1025,7 +1025,7 @@ void mat3_to_compatible_eul(float *eul, float *oldrot,float mat[][3])
/* Euler Rotation Order Code:
* was adapted from
- ANSI C code from the article
+ ANSI C code from the article
"Euler Angle Conversion"
by Ken Shoemake, shoemake@graphics.cis.upenn.edu
in "Graphics Gems IV", Academic Press, 1994
@@ -1299,11 +1299,11 @@ void eulO_to_gimbal_axis(float gmat[][3], float *eul, short order)
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
+ misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Author: Ladislav Kavan, kavanl@cs.tcd.ie
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 97f5ea73ea9..8032cd64de5 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -55,6 +55,16 @@ void interp_v3_v3v3(float target[3], const float a[3], const float b[3], const f
target[2]= s*a[2] + t*b[2];
}
+void interp_v4_v4v4(float target[4], const float a[4], const float b[4], const float t)
+{
+ float s = 1.0f-t;
+
+ target[0]= s*a[0] + t*b[0];
+ target[1]= s*a[1] + t*b[1];
+ target[2]= s*a[2] + t*b[2];
+ target[3]= s*a[3] + t*b[3];
+}
+
/* weight 3 vectors,
* 'w' must be unit length but is not a vector, just 3 weights */
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 9bb960340ac..f82daaa8af6 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -66,7 +66,7 @@ MINLINE void copy_v3_v3(float r[3], const float a[3])
r[2]= a[2];
}
-MINLINE void copy_v4_v4(float r[4], float a[4])
+MINLINE void copy_v4_v4(float r[4], const float a[4])
{
r[0]= a[0];
r[1]= a[1];
@@ -97,45 +97,45 @@ MINLINE void swap_v4_v4(float a[4], float b[4])
/********************************* Arithmetic ********************************/
-MINLINE void add_v2_v2(float *r, float *a)
+MINLINE void add_v2_v2(float *r, const float *a)
{
r[0] += a[0];
r[1] += a[1];
}
-MINLINE void add_v2_v2v2(float *r, float *a, float *b)
+MINLINE void add_v2_v2v2(float *r, const float *a, const float *b)
{
r[0]= a[0] + b[0];
r[1]= a[1] + b[1];
}
-MINLINE void add_v3_v3(float *r, float *a)
+MINLINE void add_v3_v3(float *r, const float *a)
{
r[0] += a[0];
r[1] += a[1];
r[2] += a[2];
}
-MINLINE void add_v3_v3v3(float *r, float *a, float *b)
+MINLINE void add_v3_v3v3(float *r, const float *a, const float *b)
{
r[0]= a[0] + b[0];
r[1]= a[1] + b[1];
r[2]= a[2] + b[2];
}
-MINLINE void sub_v2_v2(float *r, float *a)
+MINLINE void sub_v2_v2(float *r, const float *a)
{
r[0] -= a[0];
r[1] -= a[1];
}
-MINLINE void sub_v2_v2v2(float *r, float *a, float *b)
+MINLINE void sub_v2_v2v2(float *r, const float *a, const float *b)
{
r[0]= a[0] - b[0];
r[1]= a[1] - b[1];
}
-MINLINE void sub_v3_v3(float *r, float *a)
+MINLINE void sub_v3_v3(float *r, const float *a)
{
r[0] -= a[0];
r[1] -= a[1];
@@ -181,48 +181,48 @@ MINLINE void mul_v2_v2(float r[2], const float a[2])
r[1] *= a[1];
}
-MINLINE void mul_v3_v3(float r[3], float a[3])
+MINLINE void mul_v3_v3(float r[3], const float a[3])
{
r[0] *= a[0];
r[1] *= a[1];
r[2] *= a[2];
}
-MINLINE void madd_v3_v3fl(float r[3], float a[3], float f)
+MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
{
r[0] += a[0]*f;
r[1] += a[1]*f;
r[2] += a[2]*f;
}
-MINLINE void madd_v3_v3v3(float r[3], float a[3], float b[3])
+MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3])
{
r[0] += a[0]*b[0];
r[1] += a[1]*b[1];
r[2] += a[2]*b[2];
}
-MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], const float f)
+MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
{
r[0] = a[0] + b[0]*f;
r[1] = a[1] + b[1]*f;
}
-MINLINE void madd_v3_v3v3fl(float r[3], float a[3], float b[3], float f)
+MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
{
r[0] = a[0] + b[0]*f;
r[1] = a[1] + b[1]*f;
r[2] = a[2] + b[2]*f;
}
-MINLINE void madd_v3_v3v3v3(float r[3], float a[3], float b[3], float c[3])
+MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
{
r[0] = a[0] + b[0]*c[0];
r[1] = a[1] + b[1]*c[1];
r[2] = a[2] + b[2]*c[2];
}
-MINLINE void mul_v3_v3v3(float *v, float *v1, float *v2)
+MINLINE void mul_v3_v3v3(float *v, const float *v1, const float *v2)
{
v[0] = v1[0] * v2[0];
v[1] = v1[1] * v2[1];
@@ -391,7 +391,7 @@ MINLINE int compare_v3v3(float *v1, float *v2, float limit)
MINLINE int compare_len_v3v3(float *v1, float *v2, float limit)
{
- float x,y,z;
+ float x,y,z;
x=v1[0]-v2[0];
y=v1[1]-v2[1];
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index d0ce193e0e0..44429eca3b1 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -907,11 +907,11 @@ float g[512+2][3]= {
#define DOT(a,b) (a[0] * b[0] + a[1] * b[1] + a[2] * b[2])
#define setup(i,b0,b1,r0,r1) \
- t = vec[i] + 10000.; \
- b0 = ((int)t) & 255; \
- b1 = (b0+1) & 255; \
- r0 = t - (int)t; \
- r1 = r0 - 1.;
+ t = vec[i] + 10000.; \
+ b0 = ((int)t) & 255; \
+ b1 = (b0+1) & 255; \
+ r0 = t - (int)t; \
+ r1 = r0 - 1.;
static float noise3_perlin(float vec[3])
@@ -1490,7 +1490,7 @@ float mg_fBm(float x, float y, float z, float H, float lacunarity, float octaves
* ``offset'' is the zero offset, which determines multifractality (NOT USED??)
*/
/* this one is in fact rather confusing,
- * there seem to be errors in the original source code (in all three versions of proc.text&mod),
+ * there seem to be errors in the original source code (in all three versions of proc.text&mod),
* I modified it to something that made sense to me, so it might be wrong... */
float mg_MultiFractal(float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
{
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 00cb6764b60..f630ba30a68 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1197,7 +1197,7 @@ void BLI_join_dirfile(char *string, const char *dir, const char *file)
Logic:
- if an image is "below" current .blend file directory, rebuild the
- same dir structure in dest_dir
+ same dir structure in dest_dir
For example //textures/foo/bar.png becomes
[dest_dir]/textures/foo/bar.png.
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index c21f086156e..67b75e95cf4 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -225,7 +225,7 @@ static void update_node_vb(PBVH *bvh, PBVHNode *node)
/* Adapted from BLI_kdopbvh.c */
/* Returns the index of the first element on the right of the partition */
static int partition_indices(int *prim_indices, int lo, int hi, int axis,
- float mid, BBC *prim_bbc)
+ float mid, BBC *prim_bbc)
{
int i=lo, j=hi;
for(;;) {
@@ -241,7 +241,7 @@ static int partition_indices(int *prim_indices, int lo, int hi, int axis,
}
void check_partitioning(int *prim_indices, int lo, int hi, int axis,
- float mid, BBC *prim_bbc, int index_of_2nd_partition)
+ float mid, BBC *prim_bbc, int index_of_2nd_partition)
{
int i;
for(i = lo; i <= hi; ++i) {
@@ -273,8 +273,8 @@ static void grow_nodes(PBVH *bvh, int totnode)
/* Add a vertex to the map, with a positive value for unique vertices and
a negative value for additional vertices */
static int map_insert_vert(PBVH *bvh, GHash *map,
- unsigned int *face_verts,
- unsigned int *uniq_verts, int vertex)
+ unsigned int *face_verts,
+ unsigned int *uniq_verts, int vertex)
{
void *value, *key = SET_INT_IN_POINTER(vertex);
@@ -328,8 +328,8 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
/* Build the vertex list, unique verts first */
for(iter = BLI_ghashIterator_new(map), i = 0;
- !BLI_ghashIterator_isDone(iter);
- BLI_ghashIterator_step(iter), ++i) {
+ !BLI_ghashIterator_isDone(iter);
+ BLI_ghashIterator_step(iter), ++i) {
void *value = BLI_ghashIterator_getValue(iter);
int ndx = GET_INT_FROM_POINTER(value);
@@ -353,6 +353,8 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
node->uniq_verts,
node->uniq_verts + node->face_verts);
+ node->flag |= PBVH_UpdateDrawBuffers;
+
BLI_ghash_free(map, NULL, NULL);
}
@@ -361,6 +363,8 @@ static void build_grids_leaf_node(PBVH *bvh, PBVHNode *node)
node->draw_buffers =
GPU_build_grid_buffers(bvh->grids, node->prim_indices,
node->totprim, bvh->gridsize);
+
+ node->flag |= PBVH_UpdateDrawBuffers;
}
/* Recursively build a node in the tree
@@ -375,7 +379,7 @@ static void build_grids_leaf_node(PBVH *bvh, PBVHNode *node)
*/
void build_sub(PBVH *bvh, int node_index, BB *cb, BBC *prim_bbc,
- int offset, int count)
+ int offset, int count)
{
int i, axis, end;
BB cb_backing;
@@ -746,11 +750,11 @@ static void pbvh_update_normals(PBVH *bvh, PBVHNode **nodes,
/* subtle assumptions:
- We know that for all edited vertices, the nodes with faces
- adjacent to these vertices have been marked with PBVH_UpdateNormals.
+ adjacent to these vertices have been marked with PBVH_UpdateNormals.
This is true because if the vertex is inside the brush radius, the
bounding box of it's adjacent faces will be as well.
- However this is only true for the vertices that have actually been
- edited, not for all vertices in the nodes marked for update, so we
+ edited, not for all vertices in the nodes marked for update, so we
can only update vertices marked with ME_VERT_PBVH_UPDATE.
*/
@@ -855,7 +859,7 @@ static void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes,
}
}
-static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
+static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode, int smooth)
{
PBVHNode *node;
int n;
@@ -870,7 +874,8 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
bvh->grids,
node->prim_indices,
node->totprim,
- bvh->gridsize);
+ bvh->gridsize,
+ smooth);
}
else {
GPU_update_mesh_buffers(node->draw_buffers,
@@ -930,9 +935,6 @@ void BLI_pbvh_update(PBVH *bvh, int flag, float (*face_nors)[3])
if(flag & (PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw))
pbvh_update_BB_redraw(bvh, nodes, totnode, flag);
- if(flag & PBVH_UpdateDrawBuffers)
- pbvh_update_draw_buffers(bvh, nodes, totnode);
-
if(flag & (PBVH_UpdateBB|PBVH_UpdateOriginalBB))
pbvh_flush_bb(bvh, bvh->nodes, flag);
@@ -998,8 +1000,8 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot
faces= MEM_callocN(sizeof(void*)*tot, "PBVH Grid Faces");
for(hiter = BLI_ghashIterator_new(map), i = 0;
- !BLI_ghashIterator_isDone(hiter);
- BLI_ghashIterator_step(hiter), ++i)
+ !BLI_ghashIterator_isDone(hiter);
+ BLI_ghashIterator_step(hiter), ++i)
faces[i]= BLI_ghashIterator_getKey(hiter);
BLI_ghashIterator_free(hiter);
@@ -1124,7 +1126,7 @@ static int ray_aabb_intersect(PBVHNode *node, void *data_v)
}
void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitCallback cb, void *data,
- float ray_start[3], float ray_normal[3], int original)
+ float ray_start[3], float ray_normal[3], int original)
{
RaycastData rcd;
@@ -1297,9 +1299,18 @@ int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
return 1;
}
-void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3])
+void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], int smooth)
{
- BLI_pbvh_update(bvh, PBVH_UpdateNormals|PBVH_UpdateDrawBuffers, face_nors);
+ PBVHNode **nodes;
+ int totnode;
+
+ BLI_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(PBVH_UpdateNormals|PBVH_UpdateDrawBuffers),
+ &nodes, &totnode);
+
+ pbvh_update_normals(bvh, nodes, totnode, face_nors);
+ pbvh_update_draw_buffers(bvh, nodes, totnode, smooth);
+
+ if(nodes) MEM_freeN(nodes);
if(planes) {
BLI_pbvh_search_callback(bvh, BLI_pbvh_node_planes_contain_AABB,
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index 9870951d4d3..3329562f3a2 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -166,7 +166,7 @@ static void *new_mem_element(int size)
if(cur) {
if(size+offs < blocksize) {
adr= (void *) (cur->data+offs);
- offs+= size;
+ offs+= size;
return adr;
}
}
@@ -285,7 +285,7 @@ static short testedgeside(float *v1, float *v2, float *v3)
float inp;
inp= (v2[cox]-v1[cox])*(v1[coy]-v3[coy])
- +(v1[coy]-v2[coy])*(v1[cox]-v3[cox]);
+ +(v1[coy]-v2[coy])*(v1[cox]-v3[cox]);
if(inp<0.0) return 0;
else if(inp==0) {
@@ -362,7 +362,7 @@ static ScFillVert *addedgetoscanlist(EditEdge *eed, int len)
/* find location in list */
scsearch.v1= eed->v1;
sc= (ScFillVert *)bsearch(&scsearch,scdata,len,
- sizeof(ScFillVert), vergscdata);
+ sizeof(ScFillVert), vergscdata);
if(sc==0) printf("Error in search edge: %p\n",eed);
else if(addedgetoscanvert(sc,eed)==0) return sc;
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 086f20b7e21..a2f30ae5b01 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -334,7 +334,7 @@ void BLI_adddirstrings()
strcpy(files[num].owner, pwuser->pw_name);
} else {
sprintf(files[num].owner, "%d", files[num].s.st_uid);
- }
+ }
}
#endif
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index fd0b7e13a66..c344d8c0711 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -220,10 +220,10 @@ int BLI_strcaseeq(const char *a, const char *b)
/* strcasestr not available in MSVC */
char *BLI_strcasestr(const char *s, const char *find)
{
- register char c, sc;
- register size_t len;
+ register char c, sc;
+ register size_t len;
- if ((c = *find++) != 0) {
+ if ((c = *find++) != 0) {
c= tolower(c);
len = strlen(find);
do {
@@ -234,8 +234,8 @@ char *BLI_strcasestr(const char *s, const char *find)
} while (sc != c);
} while (BLI_strncasecmp(s, find, len) != 0);
s--;
- }
- return ((char *) s);
+ }
+ return ((char *) s);
}
diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c
new file mode 100644
index 00000000000..0e7c36886ce
--- /dev/null
+++ b/source/blender/blenlib/intern/uvproject.c
@@ -0,0 +1,184 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_camera_types.h"
+#include "DNA_object_types.h"
+
+#include "BLI_math.h"
+
+typedef struct UvCameraInfo {
+ float camangle;
+ float camsize;
+ float xasp, yasp;
+ float shiftx, shifty;
+ float rotmat[4][4];
+ float caminv[4][4];
+ short do_persp, do_pano, do_rotmat;
+} UvCameraInfo;
+
+void project_from_camera(float target[2], float source[3], UvCameraInfo *uci)
+{
+ float pv4[4];
+
+ copy_v3_v3(pv4, source);
+ pv4[3]= 1.0;
+
+ /* rotmat is the object matrix in this case */
+ if(uci->do_rotmat)
+ mul_m4_v4(uci->rotmat, pv4);
+
+ /* caminv is the inverse camera matrix */
+ mul_m4_v4(uci->caminv, pv4);
+
+ if(uci->do_pano) {
+ float angle= atan2f(pv4[0], -pv4[2]) / (M_PI * 2.0); /* angle around the camera */
+ if (uci->do_persp==0) {
+ target[0]= angle; /* no correct method here, just map to 0-1 */
+ target[1]= pv4[1] / uci->camsize;
+ }
+ else {
+ float vec2d[2]= {pv4[0], pv4[2]}; /* 2D position from the camera */
+ target[0]= angle * (M_PI / uci->camangle);
+ target[1]= pv4[1] / (len_v2(vec2d) * uci->camsize);
+ }
+ }
+ else {
+ if (pv4[2]==0.0f) pv4[2]= 0.00001f; /* don't allow div by 0 */
+
+ if (uci->do_persp==0) {
+ target[0]= (pv4[0]/uci->camsize);
+ target[1]= (pv4[1]/uci->camsize);
+ }
+ else {
+ target[0]= (-pv4[0]*((1.0f/uci->camsize)/pv4[2])) / 2.0f;
+ target[1]= (-pv4[1]*((1.0f/uci->camsize)/pv4[2])) / 2.0f;
+ }
+ }
+
+ target[0] *= uci->xasp;
+ target[1] *= uci->yasp;
+
+ /* adds camera shift + 0.5 */
+ target[0] += uci->shiftx;
+ target[1] += uci->shifty;
+}
+
+/* could rv3d->persmat */
+void project_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy)
+{
+ float pv[3], pv4[4], x= 0.0, y= 0.0;
+
+ mul_v3_m4v3(pv, rotmat, source);
+
+ copy_v3_v3(pv4, source);
+ pv4[3]= 1.0;
+
+ /* rotmat is the object matrix in this case */
+ mul_m4_v4(rotmat, pv4);
+
+ /* almost project_short */
+ mul_m4_v4(persmat, pv4);
+ if(fabs(pv4[3]) > 0.00001) { /* avoid division by zero */
+ target[0] = winx/2.0 + (winx/2.0) * pv4[0] / pv4[3];
+ target[1] = winy/2.0 + (winy/2.0) * pv4[1] / pv4[3];
+ }
+ else {
+ /* scaling is lost but give a valid result */
+ target[0] = winx/2.0 + (winx/2.0) * pv4[0];
+ target[1] = winy/2.0 + (winy/2.0) * pv4[1];
+ }
+
+ /* v3d->persmat seems to do this funky scaling */
+ if(winx > winy) {
+ y= (winx - winy)/2.0;
+ winy = winx;
+ }
+ else {
+ x= (winy - winx)/2.0;
+ winx = winy;
+ }
+
+ target[0]= (x + target[0]) / winx;
+ target[1]= (y + target[1]) / winy;
+}
+
+/* 'rotmat' can be obedit->obmat when uv project is used.
+ * 'winx' and 'winy' can be from scene->r.xsch/ysch */
+UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, float winy)
+{
+ UvCameraInfo uci;
+ Camera *camera= ob->data;
+
+ uci.do_pano = (camera->flag & CAM_PANORAMA);
+ uci.do_persp = (camera->type==CAM_PERSP);
+
+ uci.camangle= DEG2RAD(camera->angle)/2.0f;
+ uci.camsize= uci.do_persp ? uci.camsize= tanf(uci.camangle) : camera->ortho_scale;
+
+ if (invert_m4_m4(uci.caminv, ob->obmat)) {
+ UvCameraInfo *uci_pt;
+
+ /* normal projection */
+ if(rotmat) {
+ copy_m4_m4(uci.rotmat, rotmat);
+ uci.do_rotmat= 1;
+ }
+ else {
+ uci.do_rotmat= 0;
+ }
+
+ /* also make aspect ratio adjustment factors */
+ if (winx > winy) {
+ uci.xasp= 1.0f;
+ uci.yasp= winx / winy;
+ }
+ else {
+ uci.xasp= winy / winx;
+ uci.yasp= 1.0f;
+ }
+
+ /* include 0.5f here to move the UVs into the center */
+ uci.shiftx = 0.5f - camera->shiftx;
+ uci.shifty = 0.5f - camera->shifty;
+
+ uci_pt= MEM_mallocN(sizeof(UvCameraInfo), "UvCameraInfo");
+ *uci_pt= uci;
+ return uci_pt;
+ }
+
+ return NULL;
+}
+
+void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4])
+{
+ float pv[3];
+
+ mul_v3_m4v3(pv, rotmat, source);
+
+ /* ortho projection */
+ target[0] = -pv[0];
+ target[1] = pv[2];
+}
diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c
index 302d721264d..31ed116c40a 100644
--- a/source/blender/blenlib/intern/voxel.c
+++ b/source/blender/blenlib/intern/voxel.c
@@ -93,9 +93,9 @@ float voxel_sample_trilinear(float *data, int *res, float *co)
const float w[2] = {1.f - dz, dz};
return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] ) )
- + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] ) );
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] ) )
+ + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] ) );
}
return 0.f;
@@ -119,14 +119,14 @@ float voxel_sample_triquadratic(float *data, int *res, float *co)
const float w[3] = {dz*(0.5f*dz - 1.f) + 0.5f, dz*(1.f - dz) + 0.5f, 0.5f*dz*dz};
return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] )
- + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] ) )
- + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] )
- + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] ) )
- + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] )
- + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] ) );
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] ) )
+ + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] ) )
+ + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] ) );
}
return 0.f;
@@ -176,21 +176,21 @@ float voxel_sample_tricubic(float *data, int *res, float *co, int bspline)
}
return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] + u[3] * data[xc[3] + yc[0] + zc[0]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] + u[3] * data[xc[3] + yc[1] + zc[0]] )
- + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] + u[3] * data[xc[3] + yc[2] + zc[0]] )
- + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[0]] + u[1] * data[xc[1] + yc[3] + zc[0]] + u[2] * data[xc[2] + yc[3] + zc[0]] + u[3] * data[xc[3] + yc[3] + zc[0]] ) )
- + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] + u[3] * data[xc[3] + yc[0] + zc[1]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] + u[3] * data[xc[3] + yc[1] + zc[1]] )
- + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] + u[3] * data[xc[3] + yc[2] + zc[1]] )
- + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[1]] + u[1] * data[xc[1] + yc[3] + zc[1]] + u[2] * data[xc[2] + yc[3] + zc[1]] + u[3] * data[xc[3] + yc[3] + zc[1]] ) )
- + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] + u[3] * data[xc[3] + yc[0] + zc[2]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] + u[3] * data[xc[3] + yc[1] + zc[2]] )
- + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] + u[3] * data[xc[3] + yc[2] + zc[2]] )
- + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[2]] + u[1] * data[xc[1] + yc[3] + zc[2]] + u[2] * data[xc[2] + yc[3] + zc[2]] + u[3] * data[xc[3] + yc[3] + zc[2]] ) )
- + w[3] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[3]] + u[1] * data[xc[1] + yc[0] + zc[3]] + u[2] * data[xc[2] + yc[0] + zc[3]] + u[3] * data[xc[3] + yc[0] + zc[3]] )
- + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[3]] + u[1] * data[xc[1] + yc[1] + zc[3]] + u[2] * data[xc[2] + yc[1] + zc[3]] + u[3] * data[xc[3] + yc[1] + zc[3]] )
- + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[3]] + u[1] * data[xc[1] + yc[2] + zc[3]] + u[2] * data[xc[2] + yc[2] + zc[3]] + u[3] * data[xc[3] + yc[2] + zc[3]] )
- + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[3]] + u[1] * data[xc[1] + yc[3] + zc[3]] + u[2] * data[xc[2] + yc[3] + zc[3]] + u[3] * data[xc[3] + yc[3] + zc[3]] ) );
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] + u[3] * data[xc[3] + yc[1] + zc[0]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] + u[3] * data[xc[3] + yc[2] + zc[0]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[0]] + u[1] * data[xc[1] + yc[3] + zc[0]] + u[2] * data[xc[2] + yc[3] + zc[0]] + u[3] * data[xc[3] + yc[3] + zc[0]] ) )
+ + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] + u[3] * data[xc[3] + yc[0] + zc[1]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] + u[3] * data[xc[3] + yc[1] + zc[1]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] + u[3] * data[xc[3] + yc[2] + zc[1]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[1]] + u[1] * data[xc[1] + yc[3] + zc[1]] + u[2] * data[xc[2] + yc[3] + zc[1]] + u[3] * data[xc[3] + yc[3] + zc[1]] ) )
+ + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] + u[3] * data[xc[3] + yc[0] + zc[2]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] + u[3] * data[xc[3] + yc[1] + zc[2]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] + u[3] * data[xc[3] + yc[2] + zc[2]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[2]] + u[1] * data[xc[1] + yc[3] + zc[2]] + u[2] * data[xc[2] + yc[3] + zc[2]] + u[3] * data[xc[3] + yc[3] + zc[2]] ) )
+ + w[3] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[3]] + u[1] * data[xc[1] + yc[0] + zc[3]] + u[2] * data[xc[2] + yc[0] + zc[3]] + u[3] * data[xc[3] + yc[0] + zc[3]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[3]] + u[1] * data[xc[1] + yc[1] + zc[3]] + u[2] * data[xc[2] + yc[1] + zc[3]] + u[3] * data[xc[3] + yc[1] + zc[3]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[3]] + u[1] * data[xc[1] + yc[2] + zc[3]] + u[2] * data[xc[2] + yc[2] + zc[3]] + u[3] * data[xc[3] + yc[2] + zc[3]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[3]] + u[1] * data[xc[1] + yc[3] + zc[3]] + u[2] * data[xc[2] + yc[3] + zc[3]] + u[3] * data[xc[3] + yc[3] + zc[3]] ) );
}
return 0.f;
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index 194a164216a..0463e6ea00b 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -225,21 +225,21 @@ int check_file_chars(char *filename)
#include <string.h>
char* dirname(char *path)
{
- char *p;
- if( path == NULL || *path == '\0' )
- return ".";
- p = path + strlen(path) - 1;
- while( *p == '/' ) {
- if( p == path )
- return path;
- *p-- = '\0';
- }
- while( p >= path && *p != '/' )
- p--;
- return
- p < path ? "." :
- p == path ? "/" :
- (*p = '\0', path);
+ char *p;
+ if( path == NULL || *path == '\0' )
+ return ".";
+ p = path + strlen(path) - 1;
+ while( *p == '/' ) {
+ if( p == path )
+ return path;
+ *p-- = '\0';
+ }
+ while( p >= path && *p != '/' )
+ p--;
+ return
+ p < path ? "." :
+ p == path ? "/" :
+ (*p = '\0', path);
}
/* End of copied part */
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 013544acffb..b7321c2c995 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -41,18 +41,12 @@
#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_linklist.h"
#include "DNA_genfile.h"
#include "DNA_sdna_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_ID.h"
-#include "DNA_material_types.h"
-#include "BKE_utildefines.h" // for ENDB
#include "BKE_main.h"
#include "BKE_library.h" // for free_main
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ec378c4d4a7..121fd26f5d6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -38,10 +38,10 @@
#include <math.h> // for fabs
#ifndef WIN32
- #include <unistd.h> // for read close
- #include <sys/param.h> // for MAXPATHLEN
+ #include <unistd.h> // for read close
+ #include <sys/param.h> // for MAXPATHLEN
#else
- #include <io.h> // for open close read
+ #include <io.h> // for open close read
#include "winsock2.h"
#include "BLI_winstuff.h"
#endif
@@ -104,28 +104,21 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "BLI_storage_types.h" // for relname flags
-#include "BKE_animsys.h"
#include "BKE_anim.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_brush.h"
-#include "BKE_cdderivedmesh.h"
-#include "BKE_cloth.h"
#include "BKE_colortools.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_curve.h"
-#include "BKE_customdata.h"
#include "BKE_deform.h"
-#include "BKE_depsgraph.h"
#include "BKE_effect.h" /* give_parteff */
#include "BKE_fcurve.h"
#include "BKE_global.h" // for G
#include "BKE_group.h"
#include "BKE_image.h"
-#include "BKE_ipo.h"
#include "BKE_lattice.h"
#include "BKE_library.h" // for wich_libbase
#include "BKE_main.h" // for Main
@@ -142,12 +135,9 @@
#include "BKE_sca.h" // for init_actuator
#include "BKE_scene.h"
#include "BKE_screen.h"
-#include "BKE_softbody.h" // sbNew()
-#include "BKE_bullet.h" // bsbNew()
#include "BKE_sequencer.h"
#include "BKE_texture.h" // for open_plugin_tex
#include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND
-#include "BKE_idprop.h"
#include "BKE_sound.h"
@@ -204,10 +194,10 @@ READ
- read file
- read SDNA
- per LibBlock
- - read recursive
- - read associated direct data
- - link direct data (internal and to LibBlock)
- - free file
+ - read recursive
+ - read associated direct data
+ - link direct data (internal and to LibBlock)
+ - free file
- join all Mains
- link all LibBlocks and indirect pointers to libblocks
- initialize FileGlobal and copy pointers to Global
@@ -229,12 +219,12 @@ READ
// only used here in readfile.c
#define SWITCH_LONGINT(a) { \
- char s_i, *p_i; \
- p_i= (char *)&(a); \
- s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \
- s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \
- s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \
- s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; }
+ char s_i, *p_i; \
+ p_i= (char *)&(a); \
+ s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \
+ s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \
+ s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \
+ s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; }
/***/
@@ -1223,7 +1213,7 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain)
/* used entries were restored, so we put them to zero */
for (i=0; i<fd->imamap->nentries; i++, entry++) {
- if (entry->nr>0)
+ if (entry->nr>0)
entry->newp= NULL;
}
@@ -1526,6 +1516,7 @@ static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap)
for(a=0; a<CM_TOT; a++) {
cumap->cm[a].curve= newdataadr(fd, cumap->cm[a].curve);
cumap->cm[a].table= NULL;
+ cumap->cm[a].premultable= NULL;
}
}
@@ -3393,7 +3384,7 @@ static void direct_link_latt(FileData *fd, Lattice *lt)
/* ************ READ OBJECT ***************** */
static void lib_link_modifiers__linkModifiers(void *userData, Object *ob,
- ID **idpoin)
+ ID **idpoin)
{
FileData *fd = userData;
@@ -3471,7 +3462,8 @@ static void lib_link_object(FileData *fd, Main *main)
for(a=0; a<ob->totcol; a++) ob->mat[a]= newlibadr_us(fd, ob->id.lib, ob->mat[a]);
ob->gpd= newlibadr_us(fd, ob->id.lib, ob->gpd);
-
+ ob->duplilist= NULL;
+
ob->id.flag -= LIB_NEEDLINK;
/* if id.us==0 a new base will be created later on */
@@ -3502,7 +3494,7 @@ static void lib_link_object(FileData *fd, Main *main)
else if(sens->type==SENS_MESSAGE) {
bMessageSensor *ms= sens->data;
ms->fromObject=
- newlibadr(fd, ob->id.lib, ms->fromObject);
+ newlibadr(fd, ob->id.lib, ms->fromObject);
}
sens= sens->next;
}
@@ -3735,6 +3727,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
fluidmd->fss= newdataadr(fd, fluidmd->fss);
+ fluidmd->fss->fmd= fluidmd;
fluidmd->fss->meshSurfNormals = 0;
}
else if (md->type==eModifierType_Smoke) {
@@ -4806,7 +4799,7 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
sfile->op= NULL;
}
else if(sl->spacetype==SPACE_IMASEL) {
- SpaceImaSel *simasel= (SpaceImaSel *)sl;
+ SpaceImaSel *simasel= (SpaceImaSel *)sl;
if (simasel->files) {
//XXX BIF_filelist_freelib(simasel->files);
}
@@ -6191,10 +6184,10 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->v2d.cur= ar->v2d.tot;
ar->v2d.min[0]= 0.0f;
- ar->v2d.min[1]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
ar->v2d.max[0]= MAXFRAMEF;
- ar->v2d.max[1]= FLT_MAX;
+ ar->v2d.max[1]= FLT_MAX;
ar->v2d.minzoom= 0.01f;
ar->v2d.maxzoom= 50;
@@ -6234,7 +6227,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
break;
}
case SPACE_FILE:
- {
+ {
// SpaceFile *sfile= (SpaceFile *)sl;
ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0;
ar->v2d.tot.xmax = ar->winx;
@@ -6579,8 +6572,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Tex *tex = main->tex.first;
while (tex) {
if ((tex->rfac == 0.0) &&
- (tex->gfac == 0.0) &&
- (tex->bfac == 0.0)) {
+ (tex->gfac == 0.0) &&
+ (tex->bfac == 0.0)) {
tex->rfac = 1.0;
tex->gfac = 1.0;
tex->bfac = 1.0;
@@ -6594,8 +6587,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Tex *tex = main->tex.first;
while (tex) {
if ((tex->rfac == 0.0) &&
- (tex->gfac == 0.0) &&
- (tex->bfac == 0.0)) {
+ (tex->gfac == 0.0) &&
+ (tex->bfac == 0.0)) {
tex->rfac = 1.0;
tex->gfac = 1.0;
tex->bfac = 1.0;
@@ -6785,7 +6778,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob= main->object.first;
while(ob) {
ob->scaflag = ob->gameflag & (64+128+256+512+1024+2048);
- /* 64 is do_fh */
+ /* 64 is do_fh */
ob->gameflag &= ~(128+256+512+1024+2048);
ob = ob->id.next;
}
@@ -6897,8 +6890,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
bRaySensor *rs;
bCollisionSensor *cs;
while(ob) {
- /* Set anisotropic friction off for old objects,
- * values to 1.0. */
+ /* Set anisotropic friction off for old objects,
+ * values to 1.0. */
ob->gameflag &= ~OB_ANISOTROPIC_FRICTION;
ob->anisotropicFriction[0] = 1.0;
ob->anisotropicFriction[1] = 1.0;
@@ -7219,7 +7212,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
/* As of now, this insures that the transition from the old Track system
- to the new full constraint Track is painless for everyone. - theeth
+ to the new full constraint Track is painless for everyone. - theeth
*/
ob = main->object.first;
@@ -7256,7 +7249,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- }
+ }
}
/* Change Ob->Track in real TrackTo constraint */
@@ -7336,7 +7329,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* As of now, this insures that the transition from the old Track system
- to the new full constraint Track is painless for everyone.*/
+ to the new full constraint Track is painless for everyone.*/
ob = main->object.first;
while (ob) {
@@ -7372,7 +7365,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
- }
+ }
}
ob = ob->id.next;
@@ -10655,13 +10648,63 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
} /* sequencer changes */
}
- /* put 2.50 compatibility code here until next subversion bump */
- {
+ if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 1)) {
Brush *brush;
+ Object *ob;
+ Scene *scene;
+ bNodeTree *ntree;
for (brush= main->brush.first; brush; brush= brush->id.next) {
if (brush->curve) brush->curve->preset = CURVE_PRESET_SMOOTH;
}
+
+ /* properly initialise active flag for fluidsim modifiers */
+ for(ob = main->object.first; ob; ob = ob->id.next) {
+ ModifierData *md;
+ for(md= ob->modifiers.first; md; md= md->next) {
+ if (md->type == eModifierType_Fluidsim) {
+ FluidsimModifierData *fmd = (FluidsimModifierData *)md;
+ fmd->fss->flag |= OB_FLUIDSIM_ACTIVE;
+ fmd->fss->flag |= OB_FLUIDSIM_OVERRIDE_TIME;
+ }
+ }
+ }
+
+ /* adjustment to color balance node values */
+ for(scene= main->scene.first; scene; scene= scene->id.next) {
+ if(scene->nodetree) {
+ bNode *node=scene->nodetree->nodes.first;
+
+ while(node) {
+ if (node->type == CMP_NODE_COLORBALANCE) {
+ NodeColorBalance *n= (NodeColorBalance *)node->storage;
+ n->lift[0] += 1.f;
+ n->lift[1] += 1.f;
+ n->lift[2] += 1.f;
+ }
+ node= node->next;
+ }
+ }
+ }
+ /* check inside node groups too */
+ for (ntree= main->nodetree.first; ntree; ntree=ntree->id.next) {
+ bNode *node=ntree->nodes.first;
+
+ while(node) {
+ if (node->type == CMP_NODE_COLORBALANCE) {
+ NodeColorBalance *n= (NodeColorBalance *)node->storage;
+ n->lift[0] += 1.f;
+ n->lift[1] += 1.f;
+ n->lift[2] += 1.f;
+ }
+ node= node->next;
+ }
+ }
+
+ }
+ /* put 2.50 compatibility code here until next subversion bump */
+ {
+
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
@@ -10967,7 +11010,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
/* this is actually only needed on UI call? when ID was already read before, and another append
happens which invokes same ID... in that case the lookup table needs this entry */
oldnewmap_insert(fd->libmap, bhead->old, id, 1);
- // commented because this can print way too much
+ // commented because this can print way too much
// if(G.f & G_DEBUG) printf("expand: already read %s\n", id->name);
}
}
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 15c899c6d8d..4f421e8e84b 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -92,12 +92,12 @@
/* Note: there's a similar function in key.c (ob_get_key) */
Key *actedit_get_shapekeys (bAnimContext *ac, SpaceAction *saction)
{
- Scene *scene= ac->scene;
- Object *ob;
- Key *key;
+ Scene *scene= ac->scene;
+ Object *ob;
+ Key *key;
- ob = OBACT;
- if (ob == NULL)
+ ob = OBACT;
+ if (ob == NULL)
return NULL;
/* XXX pinning is not available in 'ShapeKey' mode... */
@@ -127,7 +127,7 @@ Key *actedit_get_shapekeys (bAnimContext *ac, SpaceAction *saction)
return key;
}
- return NULL;
+ return NULL;
}
/* Get data being edited in Action Editor (depending on current 'mode') */
diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h
index 379b8c27de5..274d33e4833 100644
--- a/source/blender/editors/animation/anim_intern.h
+++ b/source/blender/editors/animation/anim_intern.h
@@ -65,6 +65,9 @@ void ANIM_OT_keying_set_remove(struct wmOperatorType *ot);
void ANIM_OT_keying_set_path_add(struct wmOperatorType *ot);
void ANIM_OT_keying_set_path_remove(struct wmOperatorType *ot);
+/* KeyingSet general operators */
+void ANIM_OT_keying_set_active_set(struct wmOperatorType *ot);
+
/* .......... */
/* Driver management operators for UI buttons (RMB menu) */
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 4ebf03349ec..a9f0f827ee5 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -394,7 +394,7 @@ functions:
exit() cleanup, send notifier
- cancel() to escpae from modal
+ cancel() to escpae from modal
callbacks:
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 348520b60bf..88d6051b23b 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -361,6 +361,8 @@ void ED_operatortypes_anim(void)
WM_operatortype_append(ANIM_OT_keying_set_remove);
WM_operatortype_append(ANIM_OT_keying_set_path_add);
WM_operatortype_append(ANIM_OT_keying_set_path_remove);
+
+ WM_operatortype_append(ANIM_OT_keying_set_active_set);
}
void ED_keymap_anim(wmKeyConfig *keyconf)
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 5cc5deb2eae..c6ee9e4a960 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -52,7 +52,6 @@
#include "RNA_access.h"
-#include "ED_anim_api.h"
#include "UI_interface.h"
#include "UI_resources.h"
@@ -226,14 +225,14 @@ static void draw_modifier__fn_generator(uiLayout *layout, ID *id, FModifier *fcm
/* add the settings */
col= uiLayoutColumn(layout, 1);
- uiItemR(col, "", 0, &ptr, "function_type", 0);
- uiItemR(col, NULL, 0, &ptr, "additive", UI_ITEM_R_TOGGLE);
+ uiItemR(col, &ptr, "function_type", 0, "", 0);
+ uiItemR(col, &ptr, "additive", UI_ITEM_R_TOGGLE, NULL, 0);
col= uiLayoutColumn(layout, 0); // no grouping for now
- uiItemR(col, NULL, 0, &ptr, "amplitude", 0);
- uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0);
- uiItemR(col, NULL, 0, &ptr, "phase_offset", 0);
- uiItemR(col, NULL, 0, &ptr, "value_offset", 0);
+ uiItemR(col, &ptr, "amplitude", 0, NULL, 0);
+ uiItemR(col, &ptr, "phase_multiplier", 0, NULL, 0);
+ uiItemR(col, &ptr, "phase_offset", 0, NULL, 0);
+ uiItemR(col, &ptr, "value_offset", 0, NULL, 0);
}
/* --------------- */
@@ -255,14 +254,14 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor
/* before range */
col= uiLayoutColumn(split, 1);
uiItemL(col, "Before:", 0);
- uiItemR(col, "", 0, &ptr, "before_mode", 0);
- uiItemR(col, NULL, 0, &ptr, "before_cycles", 0);
+ uiItemR(col, &ptr, "before_mode", 0, "", 0);
+ uiItemR(col, &ptr, "before_cycles", 0, NULL, 0);
/* after range */
col= uiLayoutColumn(split, 1);
uiItemL(col, "After:", 0);
- uiItemR(col, "", 0, &ptr, "after_mode", 0);
- uiItemR(col, NULL, 0, &ptr, "after_cycles", 0);
+ uiItemR(col, &ptr, "after_mode", 0, "", 0);
+ uiItemR(col, &ptr, "after_cycles", 0, NULL, 0);
}
/* --------------- */
@@ -277,20 +276,20 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short
RNA_pointer_create(id, &RNA_FModifierNoise, fcm, &ptr);
/* blending mode */
- uiItemR(layout, NULL, 0, &ptr, "modification", 0);
+ uiItemR(layout, &ptr, "modification", 0, NULL, 0);
/* split into 2 columns */
split= uiLayoutSplit(layout, 0.5f, 0);
/* col 1 */
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &ptr, "size", 0);
- uiItemR(col, NULL, 0, &ptr, "strength", 0);
+ uiItemR(col, &ptr, "size", 0, NULL, 0);
+ uiItemR(col, &ptr, "strength", 0, NULL, 0);
/* col 2 */
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &ptr, "phase", 0);
- uiItemR(col, NULL, 0, &ptr, "depth", 0);
+ uiItemR(col, &ptr, "phase", 0, NULL, 0);
+ uiItemR(col, &ptr, "depth", 0, NULL, 0);
}
/* --------------- */
@@ -471,11 +470,11 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
/* general settings */
col= uiLayoutColumn(layout, 1);
uiItemL(col, "Envelope:", 0);
- uiItemR(col, NULL, 0, &ptr, "reference_value", 0);
+ uiItemR(col, &ptr, "reference_value", 0, NULL, 0);
row= uiLayoutRow(col, 1);
- uiItemR(row, "Min", 0, &ptr, "default_minimum", 0);
- uiItemR(row, "Max", 0, &ptr, "default_maximum", 0);
+ uiItemR(row, &ptr, "default_minimum", 0, "Min", 0);
+ uiItemR(row, &ptr, "default_maximum", 0, "Max", 0);
/* control points header */
// TODO: move this control-point control stuff to using the new special widgets for lists
@@ -527,13 +526,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* x-minimum */
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0);
- uiItemR(col, NULL, 0, &ptr, "minimum_x", 0);
+ uiItemR(col, &ptr, "use_minimum_x", 0, NULL, 0);
+ uiItemR(col, &ptr, "minimum_x", 0, NULL, 0);
/* y-minimum*/
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0);
- uiItemR(col, NULL, 0, &ptr, "minimum_y", 0);
+ uiItemR(col, &ptr, "use_minimum_y", 0, NULL, 0);
+ uiItemR(col, &ptr, "minimum_y", 0, NULL, 0);
}
/* row 2: maximum */
@@ -545,13 +544,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* x-minimum */
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0);
- uiItemR(col, NULL, 0, &ptr, "maximum_x", 0);
+ uiItemR(col, &ptr, "use_maximum_x", 0, NULL, 0);
+ uiItemR(col, &ptr, "maximum_x", 0, NULL, 0);
/* y-minimum*/
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0);
- uiItemR(col, NULL, 0, &ptr, "maximum_y", 0);
+ uiItemR(col, &ptr, "use_maximum_y", 0, NULL, 0);
+ uiItemR(col, &ptr, "maximum_y", 0, NULL, 0);
}
}
@@ -568,24 +567,24 @@ static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, sho
/* block 1: "stepping" settings */
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, &ptr, "step_size", 0);
- uiItemR(col, NULL, 0, &ptr, "offset", 0);
+ uiItemR(col, &ptr, "step_size", 0, NULL, 0);
+ uiItemR(col, &ptr, "offset", 0, NULL, 0);
/* block 2: start range settings */
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, &ptr, "use_start_frame", 0);
+ uiItemR(col, &ptr, "use_start_frame", 0, NULL, 0);
subcol = uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_start_frame"));
- uiItemR(subcol, NULL, 0, &ptr, "start_frame", 0);
+ uiItemR(subcol, &ptr, "start_frame", 0, NULL, 0);
/* block 3: end range settings */
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, &ptr, "use_end_frame", 0);
+ uiItemR(col, &ptr, "use_end_frame", 0, NULL, 0);
subcol = uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_end_frame"));
- uiItemR(subcol, NULL, 0, &ptr, "end_frame", 0);
+ uiItemR(subcol, &ptr, "end_frame", 0, NULL, 0);
}
/* --------------- */
@@ -617,10 +616,10 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
uiBlockSetEmboss(block, UI_EMBOSSN);
/* expand */
- uiItemR(subrow, "", 0, &ptr, "expanded", UI_ITEM_R_ICON_ONLY);
+ uiItemR(subrow, &ptr, "expanded", UI_ITEM_R_ICON_ONLY, "", 0);
/* checkbox for 'active' status (for now) */
- uiItemR(subrow, "", 0, &ptr, "active", UI_ITEM_R_ICON_ONLY);
+ uiItemR(subrow, &ptr, "active", UI_ITEM_R_ICON_ONLY, "", 0);
/* name */
if (fmi)
@@ -634,7 +633,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
/* 'mute' button */
- uiItemR(subrow, "", 0, &ptr, "muted", UI_ITEM_R_ICON_ONLY);
+ uiItemR(subrow, &ptr, "muted", UI_ITEM_R_ICON_ONLY, "", 0);
uiBlockSetEmboss(block, UI_EMBOSSN);
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 69f9583ed33..32e5e0b2bdb 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -44,16 +44,11 @@
#include "BLI_math.h"
#include "BLI_dlrbTree.h"
-#include "DNA_listBase.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_mesh_types.h"
@@ -61,11 +56,7 @@
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
#include "DNA_particle_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
-#include "DNA_view2d_types.h"
#include "BKE_action.h"
#include "BKE_depsgraph.h"
@@ -80,8 +71,6 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "UI_interface.h"
-#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "UI_view2d.h"
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 45a0ee295e7..ee3018ce150 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -35,10 +35,8 @@
#include "BLI_math.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_mesh_types.h"
@@ -47,7 +45,6 @@
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
#include "DNA_particle_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
@@ -89,21 +86,21 @@
*/
short ANIM_fcurve_keys_bezier_loop(BeztEditData *bed, FCurve *fcu, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb)
{
- BezTriple *bezt;
- int i;
+ BezTriple *bezt;
+ int i;
/* sanity check */
if (ELEM(NULL, fcu, fcu->bezt))
return 0;
/* set the F-Curve into the editdata so that it can be accessed */
- if (bed) {
- bed->fcu= fcu;
- bed->curIndex= 0;
- }
+ if (bed) {
+ bed->fcu= fcu;
+ bed->curIndex= 0;
+ }
/* if function to apply to bezier curves is set, then loop through executing it on beztriples */
- if (bezt_cb) {
+ if (bezt_cb) {
/* if there's a validation func, include that check in the loop
* (this is should be more efficient than checking for it in every loop)
*/
@@ -133,10 +130,10 @@ short ANIM_fcurve_keys_bezier_loop(BeztEditData *bed, FCurve *fcu, BeztEditFunc
}
/* unset the F-Curve from the editdata now that it's done */
- if (bed) {
- bed->fcu= NULL;
- bed->curIndex= 0;
- }
+ if (bed) {
+ bed->fcu= NULL;
+ bed->curIndex= 0;
+ }
/* if fcu_cb (F-Curve post-editing callback) has been specified then execute it */
if (fcu_cb)
@@ -607,6 +604,7 @@ void bezt_remap_times(BeztEditData *bed, BezTriple *bezt)
/* ******************************************* */
/* Transform */
+/* snaps the keyframe to the nearest frame */
static short snap_bezier_nearest(BeztEditData *bed, BezTriple *bezt)
{
if (bezt->f2 & SELECT)
@@ -614,6 +612,7 @@ static short snap_bezier_nearest(BeztEditData *bed, BezTriple *bezt)
return 0;
}
+/* snaps the keyframe to the neares second */
static short snap_bezier_nearestsec(BeztEditData *bed, BezTriple *bezt)
{
const Scene *scene= bed->scene;
@@ -624,6 +623,7 @@ static short snap_bezier_nearestsec(BeztEditData *bed, BezTriple *bezt)
return 0;
}
+/* snaps the keyframe to the current frame */
static short snap_bezier_cframe(BeztEditData *bed, BezTriple *bezt)
{
const Scene *scene= bed->scene;
@@ -632,6 +632,7 @@ static short snap_bezier_cframe(BeztEditData *bed, BezTriple *bezt)
return 0;
}
+/* snaps the keyframe time to the nearest marker's frame */
static short snap_bezier_nearmarker(BeztEditData *bed, BezTriple *bezt)
{
if (bezt->f2 & SELECT)
@@ -639,20 +640,21 @@ static short snap_bezier_nearmarker(BeztEditData *bed, BezTriple *bezt)
return 0;
}
+/* make the handles have the same value as the key */
static short snap_bezier_horizontal(BeztEditData *bed, BezTriple *bezt)
{
if (bezt->f2 & SELECT) {
- // XXX currently this snaps both handles to the nearest horizontal value, but perhaps user just wants to level out handles instead?
- bezt->vec[0][1]= bezt->vec[2][1]= (float)floor(bezt->vec[1][1] + 0.5f);
+ bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1];
+
if ((bezt->h1==HD_AUTO) || (bezt->h1==HD_VECT)) bezt->h1= HD_ALIGN;
if ((bezt->h2==HD_AUTO) || (bezt->h2==HD_VECT)) bezt->h2= HD_ALIGN;
}
return 0;
}
+/* value to snap to is stored in the custom data -> first float value slot */
static short snap_bezier_value(BeztEditData *bed, BezTriple *bezt)
{
- /* value to snap to is stored in the custom data -> first float value slot */
if (bezt->f2 & SELECT)
bezt->vec[1][1]= bed->f1;
return 0;
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 53a3648713e..91a8b7047c4 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -36,14 +36,9 @@
#include "BLI_math.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_key_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "RNA_access.h"
#include "BKE_action.h"
#include "BKE_fcurve.h"
@@ -100,8 +95,8 @@ void delete_fcurve_keys(FCurve *fcu)
{
int i;
- if(fcu->bezt==NULL) /* ignore baked curves */
- return;
+ if(fcu->bezt==NULL) /* ignore baked curves */
+ return;
/* Delete selected BezTriples */
for (i=0; i < fcu->totvert; i++) {
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index eaebab2efab..8a238566563 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -40,15 +40,11 @@
#include "BLI_dynstr.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_key_types.h"
-#include "DNA_object_types.h"
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
@@ -67,7 +63,6 @@
#include "ED_keyframing.h"
#include "ED_keyframes_edit.h"
#include "ED_screen.h"
-#include "ED_util.h"
#include "UI_interface.h"
@@ -76,7 +71,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "anim_intern.h"
@@ -1150,52 +1144,9 @@ void ANIM_OT_keyframe_insert (wmOperatorType *ot)
/* Insert Key Operator (With Menu) ------------------------ */
/* This operator checks if a menu should be shown for choosing the KeyingSet to use,
- * then calls the
+ * then calls the menu if necessary before
*/
-static void insert_key_menu_prompt (bContext *C)
-{
- Scene *scene= CTX_data_scene(C);
- KeyingSet *ks;
- uiPopupMenu *pup;
- uiLayout *layout;
- int i = 0;
-
- pup= uiPupMenuBegin(C, "Insert Keyframe", 0);
- layout= uiPupMenuLayout(pup);
-
- /* active Keying Set
- * - only include entry if it exists
- */
- if (scene->active_keyingset) {
- uiItemIntO(layout, "Active Keying Set", 0, "ANIM_OT_keyframe_insert_menu", "type", i++);
- uiItemS(layout);
- }
- else
- i++;
-
- /* user-defined Keying Sets
- * - these are listed in the order in which they were defined for the active scene
- */
- if (scene->keyingsets.first) {
- for (ks= scene->keyingsets.first; ks; ks= ks->next) {
- if (ANIM_keyingset_context_ok_poll(C, ks))
- uiItemIntO(layout, ks->name, 0, "ANIM_OT_keyframe_insert_menu", "type", i++);
- }
- uiItemS(layout);
- }
-
- /* builtin Keying Sets */
- i= -1;
- for (ks= builtin_keyingsets.first; ks; ks= ks->next) {
- /* only show KeyingSet if context is suitable */
- if (ANIM_keyingset_context_ok_poll(C, ks))
- uiItemIntO(layout, ks->name, 0, "ANIM_OT_keyframe_insert_menu", "type", i--);
- }
-
- uiPupMenuEnd(C, pup);
-}
-
static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
{
Scene *scene= CTX_data_scene(C);
@@ -1203,7 +1154,7 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
/* if prompting or no active Keying Set, show the menu */
if ((scene->active_keyingset == 0) || RNA_boolean_get(op->ptr, "always_prompt")) {
/* call the menu, which will call this operator again, hence the cancelled */
- insert_key_menu_prompt(C);
+ ANIM_keying_sets_menu_setup(C, op->type->name, "ANIM_OT_keyframe_insert_menu");
return OPERATOR_CANCELLED;
}
else {
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index a93220aeb67..f0f35b852bb 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -40,18 +40,12 @@
#include "BLI_dynstr.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
+#include "BKE_context.h"
#include "BKE_constraint.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
@@ -61,11 +55,8 @@
#include "BKE_key.h"
#include "BKE_material.h"
-#include "ED_anim_api.h"
#include "ED_keyframing.h"
-#include "ED_keyframes_edit.h"
#include "ED_screen.h"
-#include "ED_util.h"
#include "UI_interface.h"
@@ -74,7 +65,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "anim_intern.h"
@@ -462,6 +452,55 @@ void ANIM_OT_keyingset_button_remove (wmOperatorType *ot)
}
/* ******************************************* */
+
+/* Change Active KeyingSet Operator ------------------------ */
+/* This operator checks if a menu should be shown for choosing the KeyingSet to make the active one */
+
+static int keyingset_active_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
+{
+ /* call the menu, which will call this operator again, hence the cancelled */
+ ANIM_keying_sets_menu_setup(C, op->type->name, "ANIM_OT_keying_set_active_set");
+ return OPERATOR_CANCELLED;
+}
+
+static int keyingset_active_menu_exec (bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ int type= RNA_int_get(op->ptr, "type");
+
+ /* simply set the scene's active keying set index, unless the type == 0
+ * (i.e. which happens if we want the current active to be maintained)
+ */
+ if (type)
+ scene->active_keyingset= type;
+
+ /* send notifiers */
+ WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void ANIM_OT_keying_set_active_set (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Set Active Keying Set";
+ ot->idname= "ANIM_OT_keying_set_active_set";
+
+ /* callbacks */
+ ot->invoke= keyingset_active_menu_invoke;
+ ot->exec= keyingset_active_menu_exec;
+ ot->poll= ED_operator_areaactive;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* keyingset to use
+ * - here the type is int not enum, since many of the indicies here are determined dynamically
+ */
+ RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
+}
+
+/* ******************************************* */
/* REGISTERED KEYING SETS */
/* Keying Set Type Info declarations */
@@ -483,7 +522,7 @@ KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[])
/* search by comparing names */
for (ksi = keyingset_type_infos.first; ksi; ksi = ksi->next) {
- if (strcmp(ksi->name, name) == 0)
+ if (strcmp(ksi->idname, name) == 0)
return ksi;
}
@@ -521,23 +560,15 @@ KeyingSet *ANIM_builtin_keyingset_get_named (KeyingSet *prevKS, const char name[
/* Add the given KeyingSetInfo to the list of type infos, and create an appropriate builtin set too */
void ANIM_keyingset_info_register (const bContext *C, KeyingSetInfo *ksi)
{
- Scene *scene = CTX_data_scene(C);
- ListBase *list = NULL;
KeyingSet *ks;
- /* determine the KeyingSet list to include the new KeyingSet in */
- if (ksi->builtin==0 && scene)
- list = &scene->keyingsets;
- else
- list = &builtin_keyingsets;
-
/* create a new KeyingSet
* - inherit name and keyframing settings from the typeinfo
*/
- ks = BKE_keyingset_add(list, ksi->name, ksi->builtin, ksi->keyingflag);
+ ks = BKE_keyingset_add(&builtin_keyingsets, ksi->name, 1, ksi->keyingflag);
/* link this KeyingSet with its typeinfo */
- memcpy(&ks->typeinfo, ksi->name, sizeof(ks->typeinfo));
+ memcpy(&ks->typeinfo, ksi->idname, sizeof(ks->typeinfo));
/* add type-info to the list */
BLI_addtail(&keyingset_type_infos, ksi);
@@ -549,22 +580,19 @@ void ANIM_keyingset_info_unregister (const bContext *C, KeyingSetInfo *ksi)
Scene *scene = CTX_data_scene(C);
KeyingSet *ks, *ksn;
- /* find relevant scene KeyingSets which use this, and remove them */
- for (ks= scene->keyingsets.first; ks; ks= ksn) {
+ /* find relevant builtin KeyingSets which use this, and remove them */
+ // TODO: this isn't done now, since unregister is really only used atm when we
+ // reload the scripts, which kindof defeats the purpose of "builtin"?
+ for (ks= builtin_keyingsets.first; ks; ks= ksn) {
ksn = ks->next;
/* remove if matching typeinfo name */
- if (strcmp(ks->typeinfo, ksi->name) == 0) {
+ if (strcmp(ks->typeinfo, ksi->idname) == 0) {
BKE_keyingset_free(ks);
BLI_freelinkN(&scene->keyingsets, ks);
}
}
- /* do the same with builtin sets? */
- // TODO: this isn't done now, since unregister is really only used atm when we
- // reload the scripts, which kindof defeats the purpose of "builtin"?
-
-
/* free the type info */
BLI_freelinkN(&keyingset_type_infos, ksi);
}
@@ -592,23 +620,107 @@ void ANIM_keyingset_infos_exit ()
/* ******************************************* */
/* KEYING SETS API (for UI) */
+/* Getters for Active/Indices ----------------------------- */
+
/* Get the active Keying Set for the Scene provided */
KeyingSet *ANIM_scene_get_active_keyingset (Scene *scene)
{
- if (ELEM(NULL, scene, scene->keyingsets.first))
+ /* if no scene, we've got no hope of finding the Keying Set */
+ if (scene == NULL)
return NULL;
/* currently, there are several possibilities here:
* - 0: no active keying set
* - > 0: one of the user-defined Keying Sets, but indices start from 0 (hence the -1)
- * - < 0: a builtin keying set (XXX this isn't enabled yet so that we don't get errors on reading back files)
+ * - < 0: a builtin keying set
*/
if (scene->active_keyingset > 0)
return BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
- else // for now...
- return NULL;
+ else
+ return BLI_findlink(&builtin_keyingsets, (-scene->active_keyingset)-1);
+}
+
+/* Get the index of the Keying Set provided, for the given Scene */
+int ANIM_scene_get_keyingset_index (Scene *scene, KeyingSet *ks)
+{
+ int index;
+
+ /* if no KeyingSet provided, have none */
+ if (ks == NULL)
+ return 0;
+
+ /* check if the KeyingSet exists in scene list */
+ if (scene) {
+ /* get index and if valid, return
+ * - (absolute) Scene KeyingSets are from (>= 1)
+ */
+ index = BLI_findindex(&scene->keyingsets, ks);
+ if (index != -1)
+ return (index + 1);
+ }
+
+ /* still here, so try builtins list too
+ * - builtins are from (<= -1)
+ * - none/invalid is (= 0)
+ */
+ index = BLI_findindex(&builtin_keyingsets, ks);
+ if (index != -1)
+ return -(index + 1);
+ else
+ return 0;
}
+/* Menu of All Keying Sets ----------------------------- */
+
+/* Create (and show) a menu containing all the Keying Sets which can be used in the current context */
+void ANIM_keying_sets_menu_setup (bContext *C, char title[], char op_name[])
+{
+ Scene *scene= CTX_data_scene(C);
+ KeyingSet *ks;
+ uiPopupMenu *pup;
+ uiLayout *layout;
+ int i = 0;
+
+ pup= uiPupMenuBegin(C, title, 0);
+ layout= uiPupMenuLayout(pup);
+
+ /* active Keying Set
+ * - only include entry if it exists
+ */
+ if (scene->active_keyingset) {
+ uiItemIntO(layout, "Active Keying Set", 0, op_name, "type", i++);
+ uiItemS(layout);
+ }
+ else
+ i++;
+
+ /* user-defined Keying Sets
+ * - these are listed in the order in which they were defined for the active scene
+ */
+ if (scene->keyingsets.first) {
+ for (ks= scene->keyingsets.first; ks; ks= ks->next) {
+ if (ANIM_keyingset_context_ok_poll(C, ks))
+ uiItemIntO(layout, ks->name, 0, op_name, "type", i++);
+ }
+ uiItemS(layout);
+ }
+
+ /* builtin Keying Sets */
+ i= -1;
+ for (ks= builtin_keyingsets.first; ks; ks= ks->next) {
+ /* only show KeyingSet if context is suitable */
+ if (ANIM_keyingset_context_ok_poll(C, ks))
+ uiItemIntO(layout, ks->name, 0, op_name, "type", i--);
+ }
+
+ uiPupMenuEnd(C, pup);
+}
+
+/* ******************************************* */
+/* KEYFRAME MODIFICATION */
+
+/* Polling API ----------------------------------------------- */
+
/* Check if KeyingSet can be used in the current context */
short ANIM_keyingset_context_ok_poll (bContext *C, KeyingSet *ks)
{
@@ -627,9 +739,6 @@ short ANIM_keyingset_context_ok_poll (bContext *C, KeyingSet *ks)
return 1;
}
-/* ******************************************* */
-/* KEYFRAME MODIFICATION */
-
/* Special 'Overrides' Iterator for Relative KeyingSets ------ */
/* 'Data Sources' for relative Keying Set 'overrides'
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index 508ab19ca17..4384e2c5f98 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -31,13 +31,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -47,14 +40,12 @@
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_screen.h"
-#include "ED_object.h"
#include "ED_transform.h"
#include "armature_intern.h"
@@ -348,6 +339,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
// XXX this should probably be in screen instead... here for testing purposes in the meantime... - Aligorith
WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_insert_menu", IKEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_delete_v3d", IKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_verify_item(keymap, "ANIM_OT_keying_set_active_set", IKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0);
/* Pose -> PoseLib ------------- */
/* only set in posemode, by space_view3d listener */
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 5d9531e6b37..f3b5e49a3ef 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -34,22 +34,10 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_ID.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_curve_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -72,7 +60,6 @@
#include "BKE_subsurf.h"
#include "BKE_utildefines.h"
#include "BKE_modifier.h"
-#include "PIL_time.h"
#include "BIF_gl.h"
#include "BIF_generate.h"
@@ -88,7 +75,6 @@
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
-#include "ED_transform.h"
#include "ED_util.h"
#include "ED_view3d.h"
@@ -1964,7 +1950,7 @@ int mouse_armature(bContext *C, short mval[2], int extend)
ED_armature_deselectall(obedit, 0, 0);
/* by definition the non-root connected bones have no root point drawn,
- so a root selection needs to be delivered to the parent tip */
+ so a root selection needs to be delivered to the parent tip */
if(selmask & BONE_SELECTED) {
if(nearBone->parent && (nearBone->flag & BONE_CONNECTED)) {
@@ -3691,7 +3677,7 @@ static int armature_subdivs_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_subdivs(wmOperatorType *ot)
{
static EnumPropertyItem type_items[]= {
- {0, "SIMPLE", 0, "Simple", ""},
+ {0, "SIMPLE", 0, "Simple", ""},
{1, "MULTI", 0, "Multi", ""},
{0, NULL, 0, NULL, NULL}};
@@ -3958,11 +3944,11 @@ static int armature_parent_set_invoke(bContext *C, wmOperator *op, wmEvent *even
}
CTX_DATA_END;
- uiItemEnumO(layout, NULL, 0, "ARMATURE_OT_parent_set", "type", ARM_PAR_CONNECT);
+ uiItemEnumO(layout, "ARMATURE_OT_parent_set", NULL, 0, "type", ARM_PAR_CONNECT);
/* ob becomes parent, make the associated menus */
if (allchildbones)
- uiItemEnumO(layout, NULL, 0, "ARMATURE_OT_parent_set", "type", ARM_PAR_OFFSET);
+ uiItemEnumO(layout, "ARMATURE_OT_parent_set", NULL, 0, "type", ARM_PAR_OFFSET);
uiPupMenuEnd(C, pup);
@@ -4212,7 +4198,7 @@ void ARMATURE_OT_select_hierarchy(wmOperatorType *ot)
/* props */
RNA_def_enum(ot->srna, "direction", direction_items,
- BONE_SELECT_PARENT, "Direction", "");
+ BONE_SELECT_PARENT, "Direction", "");
RNA_def_boolean(ot->srna, "extend", 0, "Add to Selection", "");
}
@@ -4357,28 +4343,28 @@ void ARMATURE_OT_align(wmOperatorType *ot)
static int bone_looper(Object *ob, Bone *bone, void *data,
int (*bone_func)(Object *, Bone *, void *))
{
- /* We want to apply the function bone_func to every bone
+ /* We want to apply the function bone_func to every bone
* in an armature -- feed bone_looper the first bone and
* a pointer to the bone_func and watch it go!. The int count
* can be useful for counting bones with a certain property
* (e.g. skinnable)
*/
- int count = 0;
+ int count = 0;
- if (bone) {
+ if (bone) {
/* only do bone_func if the bone is non null */
- count += bone_func(ob, bone, data);
+ count += bone_func(ob, bone, data);
/* try to execute bone_func for the first child */
- count += bone_looper(ob, bone->childbase.first, data, bone_func);
+ count += bone_looper(ob, bone->childbase.first, data, bone_func);
/* try to execute bone_func for the next bone at this
* depth of the recursion.
*/
- count += bone_looper(ob, bone->next, data, bone_func);
- }
+ count += bone_looper(ob, bone->next, data, bone_func);
+ }
- return count;
+ return count;
}
/* called from editview.c, for mode-less pose selection */
@@ -4496,28 +4482,28 @@ void ED_pose_deselectall (Object *ob, int test, int doundo)
static int bone_skinnable(Object *ob, Bone *bone, void *datap)
{
- /* Bones that are deforming
- * are regarded to be "skinnable" and are eligible for
- * auto-skinning.
- *
- * This function performs 2 functions:
- *
- * a) It returns 1 if the bone is skinnable.
- * If we loop over all bones with this
- * function, we can count the number of
- * skinnable bones.
- * b) If the pointer data is non null,
- * it is treated like a handle to a
- * bone pointer -- the bone pointer
- * is set to point at this bone, and
- * the pointer the handle points to
- * is incremented to point to the
- * next member of an array of pointers
- * to bones. This way we can loop using
- * this function to construct an array of
- * pointers to bones that point to all
- * skinnable bones.
- */
+ /* Bones that are deforming
+ * are regarded to be "skinnable" and are eligible for
+ * auto-skinning.
+ *
+ * This function performs 2 functions:
+ *
+ * a) It returns 1 if the bone is skinnable.
+ * If we loop over all bones with this
+ * function, we can count the number of
+ * skinnable bones.
+ * b) If the pointer data is non null,
+ * it is treated like a handle to a
+ * bone pointer -- the bone pointer
+ * is set to point at this bone, and
+ * the pointer the handle points to
+ * is incremented to point to the
+ * next member of an array of pointers
+ * to bones. This way we can loop using
+ * this function to construct an array of
+ * pointers to bones that point to all
+ * skinnable bones.
+ */
Bone ***hbone;
int a, segments;
struct { Object *armob; void *list; int heat; } *data = datap;
@@ -4540,50 +4526,50 @@ static int bone_skinnable(Object *ob, Bone *bone, void *datap)
return segments;
}
}
- return 0;
+ return 0;
}
static int ED_vgroup_add_unique_bone(Object *ob, Bone *bone, void *data)
{
- /* This group creates a vertex group to ob that has the
- * same name as bone (provided the bone is skinnable).
+ /* This group creates a vertex group to ob that has the
+ * same name as bone (provided the bone is skinnable).
* If such a vertex group aleady exist the routine exits.
- */
+ */
if (!(bone->flag & BONE_NO_DEFORM)) {
if (!defgroup_find_name(ob,bone->name)) {
ED_vgroup_add_name(ob, bone->name);
return 1;
}
- }
- return 0;
+ }
+ return 0;
}
static int dgroup_skinnable(Object *ob, Bone *bone, void *datap)
{
- /* Bones that are deforming
- * are regarded to be "skinnable" and are eligible for
- * auto-skinning.
- *
- * This function performs 2 functions:
- *
- * a) If the bone is skinnable, it creates
- * a vertex group for ob that has
- * the name of the skinnable bone
- * (if one doesn't exist already).
- * b) If the pointer data is non null,
- * it is treated like a handle to a
- * bDeformGroup pointer -- the
- * bDeformGroup pointer is set to point
- * to the deform group with the bone's
- * name, and the pointer the handle
- * points to is incremented to point to the
- * next member of an array of pointers
- * to bDeformGroups. This way we can loop using
- * this function to construct an array of
- * pointers to bDeformGroups, all with names
- * of skinnable bones.
- */
- bDeformGroup ***hgroup, *defgroup;
+ /* Bones that are deforming
+ * are regarded to be "skinnable" and are eligible for
+ * auto-skinning.
+ *
+ * This function performs 2 functions:
+ *
+ * a) If the bone is skinnable, it creates
+ * a vertex group for ob that has
+ * the name of the skinnable bone
+ * (if one doesn't exist already).
+ * b) If the pointer data is non null,
+ * it is treated like a handle to a
+ * bDeformGroup pointer -- the
+ * bDeformGroup pointer is set to point
+ * to the deform group with the bone's
+ * name, and the pointer the handle
+ * points to is incremented to point to the
+ * next member of an array of pointers
+ * to bDeformGroups. This way we can loop using
+ * this function to construct an array of
+ * pointers to bDeformGroups, all with names
+ * of skinnable bones.
+ */
+ bDeformGroup ***hgroup, *defgroup;
int a, segments;
struct { Object *armob; void *list; int heat; } *data= datap;
@@ -4608,7 +4594,7 @@ static int dgroup_skinnable(Object *ob, Bone *bone, void *datap)
return segments;
}
}
- return 0;
+ return 0;
}
static void add_vgroups__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
@@ -4721,7 +4707,7 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m
selected = MEM_callocN(numbones*sizeof(int), "selected");
for (j=0; j < numbones; ++j) {
- bone = bonelist[j];
+ bone = bonelist[j];
dgroup = dgrouplist[j];
/* handle bbone */
@@ -4786,7 +4772,7 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m
}
/* create verts */
- mesh = (Mesh*)ob->data;
+ mesh = (Mesh*)ob->data;
verts = MEM_callocN(mesh->totvert*sizeof(*verts), "closestboneverts");
if (wpmode) {
@@ -4802,7 +4788,7 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m
}
else if (modifiers_findByType(ob, eModifierType_Subsurf)) {
/* is subsurf on? Lets use the verts on the limit surface then.
- * = same amount of vertices as mesh, but vertices moved to the
+ * = same amount of vertices as mesh, but vertices moved to the
* subsurfed position, like for 'optimal'. */
subsurf_calculate_limit_positions(mesh, verts);
vertsfilled = 1;
@@ -4825,9 +4811,9 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m
dgroupflip, root, tip, selected, mat4_to_scale(par->obmat));
}
- /* free the memory allocated */
- MEM_freeN(bonelist);
- MEM_freeN(dgrouplist);
+ /* free the memory allocated */
+ MEM_freeN(bonelist);
+ MEM_freeN(dgrouplist);
MEM_freeN(dgroupflip);
MEM_freeN(root);
MEM_freeN(tip);
@@ -5625,7 +5611,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op)
void ARMATURE_OT_autoside_names (wmOperatorType *ot)
{
static EnumPropertyItem axis_items[]= {
- {0, "XAXIS", 0, "X-Axis", "Left/Right"},
+ {0, "XAXIS", 0, "X-Axis", "Left/Right"},
{1, "YAXIS", 0, "Y-Axis", "Front/Back"},
{2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
{0, NULL, 0, NULL, NULL}};
@@ -5805,7 +5791,7 @@ EditBone * test_subdivideByCorrelation(Scene *scene, Object *obedit, ReebArc *ar
lastBone = subdivideArcBy(arm, arm->edbo, iter, invmat, tmat, nextAdaptativeSubdivision);
}
- return lastBone;
+ return lastBone;
}
float arcLengthRatio(ReebArc *arc)
diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c
index b92e1652b4e..a7f79bb6ff3 100644
--- a/source/blender/editors/armature/editarmature_generate.c
+++ b/source/blender/editors/armature/editarmature_generate.c
@@ -34,7 +34,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_listBase.h"
#include "DNA_scene_types.h"
#include "DNA_armature_types.h"
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index 6eaa76d6422..57224428476 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -37,15 +37,9 @@
#include "PIL_time.h"
-#include "DNA_ID.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -68,7 +62,6 @@
#include "BIF_retarget.h"
-#include "PIL_time.h"
//#include "mydevice.h"
#include "reeb.h" // FIX ME
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 6d1d26865af..e9ad91c19e3 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -26,14 +26,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_listBase.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
#include "DNA_armature_types.h"
-#include "DNA_userdef_types.h"
#include "RNA_define.h"
#include "RNA_access.h"
@@ -55,7 +49,6 @@
#include "ED_screen.h"
#include "BIF_gl.h"
-#include "UI_resources.h"
//#include "BIF_screen.h"
//#include "BIF_space.h"
//#include "BIF_mywindow.h"
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index af1c00b51b1..136027b1504 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -33,7 +33,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_listBase.h"
#include "DNA_object_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -58,7 +57,6 @@
#include "BLO_sys_types.h" // for intptr_t support
-#include "ED_armature.h"
#include "ED_mesh.h"
#include "meshlaplacian.h"
@@ -390,7 +388,7 @@ float laplacian_system_get_solution(int v)
/************************* Heat Bone Weighting ******************************/
/* From "Automatic Rigging and Animation of 3D Characters"
- Ilya Baran and Jovan Popovic, SIGGRAPH 2007 */
+ Ilya Baran and Jovan Popovic, SIGGRAPH 2007 */
#define C_WEIGHT 1.0f
#define WEIGHT_LIMIT_START 0.05f
@@ -751,7 +749,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
#ifdef RIGID_DEFORM
/********************** As-Rigid-As-Possible Deformation ******************/
/* From "As-Rigid-As-Possible Surface Modeling",
- Olga Sorkine and Marc Alexa, ESGP 2007. */
+ Olga Sorkine and Marc Alexa, ESGP 2007. */
/* investigate:
- transpose R in orthogonal
@@ -1042,7 +1040,7 @@ typedef struct MeshDeformBind {
/* 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];
diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c
index 1aa7ea07078..21b99bc10c0 100644
--- a/source/blender/editors/armature/poseSlide.c
+++ b/source/blender/editors/armature/poseSlide.c
@@ -39,15 +39,10 @@
#include "BLI_dynstr.h"
#include "BLI_dlrbTree.h"
-#include "DNA_listBase.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_object_force.h"
#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
@@ -63,21 +58,15 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "BIF_gl.h"
-#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_keyframes_draw.h"
-#include "ED_keyframing.h"
-#include "ED_keyframes_edit.h"
#include "ED_screen.h"
#include "armature_intern.h"
diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c
index d40f3f30bb2..c9a80318050 100644
--- a/source/blender/editors/armature/poseUtils.c
+++ b/source/blender/editors/armature/poseUtils.c
@@ -39,15 +39,10 @@
#include "BLI_dynstr.h"
#include "BLI_dlrbTree.h"
-#include "DNA_listBase.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_object_force.h"
#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
@@ -62,23 +57,15 @@
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_define.h"
-#include "RNA_types.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "BIF_gl.h"
-#include "ED_anim_api.h"
#include "ED_armature.h"
-#include "ED_keyframes_draw.h"
#include "ED_keyframing.h"
-#include "ED_keyframes_edit.h"
-#include "ED_screen.h"
#include "armature_intern.h"
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 8d38d0530ce..efc76105083 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -39,15 +39,10 @@
#include "BLI_dynstr.h"
#include "BLI_dlrbTree.h"
-#include "DNA_listBase.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_object_force.h"
#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
@@ -63,7 +58,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "WM_api.h"
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index f20c79da17e..102fbe2eafd 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -38,18 +38,9 @@
#include "BLI_dynstr.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_anim.h"
#include "BKE_idprop.h"
@@ -78,13 +69,9 @@
#include "WM_types.h"
#include "ED_armature.h"
-#include "ED_anim_api.h"
#include "ED_keyframing.h"
-#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_screen.h"
-#include "ED_transform.h" /* for autokey TFM_TRANSLATION, etc */
-#include "ED_view3d.h"
#include "UI_interface.h"
@@ -1435,7 +1422,7 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op)
void POSE_OT_autoside_names (wmOperatorType *ot)
{
static EnumPropertyItem axis_items[]= {
- {0, "XAXIS", 0, "X-Axis", "Left/Right"},
+ {0, "XAXIS", 0, "X-Axis", "Left/Right"},
{1, "YAXIS", 0, "Y-Axis", "Front/Back"},
{2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
{0, NULL, 0, NULL, NULL}};
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c
index ef5d566d0e8..04bf5bce553 100644
--- a/source/blender/editors/armature/reeb.c
+++ b/source/blender/editors/armature/reeb.c
@@ -31,14 +31,9 @@
#include <stdlib.h> // for qsort
#include <float.h>
-#include "PIL_time.h"
-#include "DNA_listBase.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
#include "DNA_object_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_armature_types.h"
#include "BKE_context.h"
@@ -53,13 +48,10 @@
//#include "BDR_editobject.h"
-#include "ED_mesh.h"
-#include "ED_armature.h"
//#include "BIF_interface.h"
//#include "BIF_toolbox.h"
//#include "BIF_graphics.h"
#include "BIF_gl.h"
-#include "UI_resources.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h
index 5b24407a53c..b423a53ce35 100644
--- a/source/blender/editors/curve/curve_intern.h
+++ b/source/blender/editors/curve/curve_intern.h
@@ -39,7 +39,7 @@ char *ED_lorem;
enum { DEL_ALL, DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_SELECTION, DEL_NEXT_SEL, DEL_PREV_SEL };
enum { CASE_LOWER, CASE_UPPER };
enum { LINE_BEGIN, LINE_END, PREV_CHAR, NEXT_CHAR, PREV_WORD, NEXT_WORD,
- PREV_LINE, NEXT_LINE, PREV_PAGE, NEXT_PAGE };
+ PREV_LINE, NEXT_LINE, PREV_PAGE, NEXT_PAGE };
void FONT_OT_text_insert(struct wmOperatorType *ot);
void FONT_OT_line_break(struct wmOperatorType *ot);
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index 3f4498e83fe..18652bf3716 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -32,13 +32,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -48,7 +41,6 @@
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -57,7 +49,6 @@
#include "ED_screen.h"
#include "ED_transform.h"
-#include "UI_interface.h"
#include "curve_intern.h"
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index dfc76aff3dd..2d3e1a295fa 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -43,15 +43,9 @@
#include "BLI_dynstr.h"
#include "BLI_rand.h"
-#include "DNA_curve_types.h"
#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_curve.h"
@@ -68,8 +62,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_anim_api.h"
-#include "ED_curve.h"
#include "ED_keyframes_edit.h"
#include "ED_object.h"
#include "ED_screen.h"
@@ -504,8 +496,8 @@ void CURVE_OT_separate(wmOperatorType *ot)
static short isNurbselUV(Nurb *nu, int *u, int *v, int flag)
{
/* return u!=-1: 1 row in u-direction selected. U has value between 0-pntsv
- * return v!=-1: 1 collumn in v-direction selected. V has value between 0-pntsu
- */
+ * return v!=-1: 1 collumn in v-direction selected. V has value between 0-pntsu
+ */
BPoint *bp;
int a, b, sel;
@@ -1882,27 +1874,27 @@ void CURVE_OT_select_inverse(wmOperatorType *ot)
* @param None
*/
-static int subdivide_exec(bContext *C, wmOperator *op)
+static void subdividenurb(Object *obedit, int number_cuts)
{
- Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit);
Nurb *nu;
BezTriple *prevbezt, *bezt, *beztnew, *beztn;
BPoint *bp, *prevbp, *bpnew, *bpn;
float vec[15];
- int a, b, sel, amount, *usel, *vsel;
+ int a, b, sel, amount, *usel, *vsel, i;
+ float factor;
// printf("*** subdivideNurb: entering subdivide\n");
for(nu= editnurb->first; nu; nu= nu->next) {
amount= 0;
if(nu->type == CU_BEZIER) {
- /*
- Insert a point into a 2D Bezier curve.
- Endpoints are preserved. Otherwise, all selected and inserted points are
- newly created. Old points are discarded.
- */
+ /*
+ Insert a point into a 2D Bezier curve.
+ Endpoints are preserved. Otherwise, all selected and inserted points are
+ newly created. Old points are discarded.
+ */
/* count */
if(nu->flagu & CU_NURB_CYCLIC) {
a= nu->pntsu;
@@ -1915,7 +1907,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
bezt= prevbezt+1;
}
while(a--) {
- if( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) amount++;
+ if( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) amount+=number_cuts;
prevbezt= bezt;
bezt++;
}
@@ -1940,30 +1932,39 @@ static int subdivide_exec(bContext *C, wmOperator *op)
beztn++;
if( BEZSELECTED_HIDDENHANDLES(cu, prevbezt) && BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
- memcpy(beztn, bezt, sizeof(BezTriple));
-
- /* midpoint subdividing */
- mid_v3_v3v3(vec, prevbezt->vec[1], prevbezt->vec[2]);
- mid_v3_v3v3(vec+3, prevbezt->vec[2], bezt->vec[0]);
- mid_v3_v3v3(vec+6, bezt->vec[0], bezt->vec[1]);
-
- mid_v3_v3v3(vec+9, vec, vec+3);
- mid_v3_v3v3(vec+12, vec+3, vec+6);
-
- /* change handle of prev beztn */
- VECCOPY((beztn-1)->vec[2], vec);
- /* new point */
- VECCOPY(beztn->vec[0], vec+9);
- mid_v3_v3v3(beztn->vec[1], vec+9, vec+12);
- VECCOPY(beztn->vec[2], vec+12);
- /* handle of next bezt */
- if(a==0 && (nu->flagu & CU_NURB_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);}
- else {VECCOPY(bezt->vec[0], vec+6);}
-
- beztn->radius = (prevbezt->radius + bezt->radius)/2.0f;
- beztn->weight = (prevbezt->weight + bezt->weight)/2.0f;
-
- beztn++;
+ float prevvec[3][3];
+
+ memcpy(prevvec, prevbezt->vec, sizeof(float) * 9);
+
+ for (i = 0; i < number_cuts; i++) {
+ factor = 1.0f / (number_cuts + 1 - i);
+
+ memcpy(beztn, bezt, sizeof(BezTriple));
+
+ /* midpoint subdividing */
+ interp_v3_v3v3(vec, prevvec[1], prevvec[2], factor);
+ interp_v3_v3v3(vec+3, prevvec[2], bezt->vec[0], factor);
+ interp_v3_v3v3(vec+6, bezt->vec[0], bezt->vec[1], factor);
+
+ interp_v3_v3v3(vec+9, vec, vec+3, factor);
+ interp_v3_v3v3(vec+12, vec+3, vec+6, factor);
+
+ /* change handle of prev beztn */
+ VECCOPY((beztn-1)->vec[2], vec);
+ /* new point */
+ VECCOPY(beztn->vec[0], vec+9);
+ interp_v3_v3v3(beztn->vec[1], vec+9, vec+12, factor);
+ VECCOPY(beztn->vec[2], vec+12);
+ /* handle of next bezt */
+ if(a==0 && i == number_cuts - 1 && (nu->flagu & CU_NURB_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);}
+ else {VECCOPY(bezt->vec[0], vec+6);}
+
+ beztn->radius = (prevbezt->radius + bezt->radius)/2;
+ beztn->weight = (prevbezt->weight + bezt->weight)/2;
+
+ memcpy(prevvec, beztn->vec, sizeof(float) * 9);
+ beztn++;
+ }
}
prevbezt= bezt;
@@ -1980,12 +1981,12 @@ static int subdivide_exec(bContext *C, wmOperator *op)
}
} /* End of 'if(nu->type == CU_BEZIER)' */
else if (nu->pntsv==1) {
- /*
- All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves
- are handled together with the regular NURB plane division, as it
- should be. I split it off just now, let's see if it is
- stable... nzc 30-5-'00
- */
+ /*
+ All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves
+ are handled together with the regular NURB plane division, as it
+ should be. I split it off just now, let's see if it is
+ stable... nzc 30-5-'00
+ */
/* count */
if(nu->flagu & CU_NURB_CYCLIC) {
a= nu->pntsu;
@@ -1998,7 +1999,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
bp= prevbp+1;
}
while(a--) {
- if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) amount++;
+ if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) amount+=number_cuts;
prevbp= bp;
bp++;
}
@@ -2024,13 +2025,14 @@ static int subdivide_exec(bContext *C, wmOperator *op)
bpn++;
if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) {
- // printf("*** subdivideNurb: insert 'linear' point\n");
- memcpy(bpn, bp, sizeof(BPoint));
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
+ // printf("*** subdivideNurb: insert 'linear' point\n");
+ for (i = 0; i < number_cuts; i++) {
+ factor = (float)(i + 1) / (number_cuts + 1);
+
+ memcpy(bpn, bp, sizeof(BPoint));
+ interp_v4_v4v4(bpn->vec, prevbp->vec, bp->vec, factor);
+ bpn++;
+ }
}
prevbp= bp;
@@ -2048,54 +2050,54 @@ static int subdivide_exec(bContext *C, wmOperator *op)
}
} /* End of 'else if(nu->pntsv==1)' */
else if(nu->type == CU_NURBS) {
- /* This is a very strange test ... */
- /**
- Subdivide NURB surfaces - nzc 30-5-'00 -
+ /* This is a very strange test ... */
+ /**
+ Subdivide NURB surfaces - nzc 30-5-'00 -
- Subdivision of a NURB curve can be effected by adding a
- control point (insertion of a knot), or by raising the
- degree of the functions used to build the NURB. The
- expression
-
- degree = #knots - #controlpoints + 1 (J Walter piece)
- degree = #knots - #controlpoints (Blender
- implementation)
- ( this is confusing.... what is true? Another concern
- is that the JW piece allows the curve to become
- explicitly 1st order derivative discontinuous, while
- this is not what we want here... )
-
- is an invariant for a single NURB curve. Raising the degree
- of the NURB is done elsewhere; the degree is assumed
- constant during this opration. Degree is a property shared
- by all controlpoints in a curve (even though it is stored
- per control point - this can be misleading).
- Adding a knot is done by searching for the place in the
- knot vector where a certain knot value must be inserted, or
- by picking an appropriate knot value between two existing
- ones. The number of controlpoints that is influenced by the
- insertion depends on the order of the curve. A certain
- minimum number of knots is needed to form high-order
- curves, as can be seen from the equation above. In Blender,
- currently NURBs may be up to 6th order, so we modify at
- most 6 points. One point is added. For an n-degree curve,
- n points are discarded, and n+1 points inserted
- (so effectively, n points are modified). (that holds for
- the JW piece, but it seems not for our NURBs)
- In practice, the knot spacing is copied, but the tail
- (the points following the insertion point) need to be
- offset to keep the knot series ascending. The knot series
- is always a series of monotonically ascending integers in
- Blender. When not enough control points are available to
- fit the order, duplicates of the endpoints are added as
- needed.
- */
+ Subdivision of a NURB curve can be effected by adding a
+ control point (insertion of a knot), or by raising the
+ degree of the functions used to build the NURB. The
+ expression
+
+ degree = #knots - #controlpoints + 1 (J Walter piece)
+ degree = #knots - #controlpoints (Blender
+ implementation)
+ ( this is confusing.... what is true? Another concern
+ is that the JW piece allows the curve to become
+ explicitly 1st order derivative discontinuous, while
+ this is not what we want here... )
+
+ is an invariant for a single NURB curve. Raising the degree
+ of the NURB is done elsewhere; the degree is assumed
+ constant during this opration. Degree is a property shared
+ by all controlpoints in a curve (even though it is stored
+ per control point - this can be misleading).
+ Adding a knot is done by searching for the place in the
+ knot vector where a certain knot value must be inserted, or
+ by picking an appropriate knot value between two existing
+ ones. The number of controlpoints that is influenced by the
+ insertion depends on the order of the curve. A certain
+ minimum number of knots is needed to form high-order
+ curves, as can be seen from the equation above. In Blender,
+ currently NURBs may be up to 6th order, so we modify at
+ most 6 points. One point is added. For an n-degree curve,
+ n points are discarded, and n+1 points inserted
+ (so effectively, n points are modified). (that holds for
+ the JW piece, but it seems not for our NURBs)
+ In practice, the knot spacing is copied, but the tail
+ (the points following the insertion point) need to be
+ offset to keep the knot series ascending. The knot series
+ is always a series of monotonically ascending integers in
+ Blender. When not enough control points are available to
+ fit the order, duplicates of the endpoints are added as
+ needed.
+ */
/* selection-arrays */
usel= MEM_callocN(sizeof(int)*nu->pntsu, "subivideNurb3");
vsel= MEM_callocN(sizeof(int)*nu->pntsv, "subivideNurb3");
sel= 0;
- /* Count the number of selected points. */
+ /* Count the number of selected points. */
bp= nu->bp;
for(a=0; a<nu->pntsv; a++) {
for(b=0; b<nu->pntsu; b++) {
@@ -2108,9 +2110,16 @@ static int subdivide_exec(bContext *C, wmOperator *op)
}
}
if( sel == (nu->pntsu*nu->pntsv) ) { /* subdivide entire nurb */
- /* Global subdivision is a special case of partial
- subdivision. Strange it is considered separately... */
- bpn=bpnew= MEM_mallocN( (2*nu->pntsu-1)*(2*nu->pntsv-1)*sizeof(BPoint), "subdivideNurb4");
+ /* Global subdivision is a special case of partial
+ subdivision. Strange it is considered separately... */
+
+ /* count of nodes (after subdivision) along U axis */
+ int countu= nu->pntsu + (nu->pntsu - 1) * number_cuts;
+
+ /* total count of nodes after subdivision */
+ int tot= ((number_cuts+1)*nu->pntsu-number_cuts)*((number_cuts+1)*nu->pntsv-number_cuts);
+
+ bpn=bpnew= MEM_mallocN( tot*sizeof(BPoint), "subdivideNurb4");
bp= nu->bp;
/* first subdivide rows */
for(a=0; a<nu->pntsv; a++) {
@@ -2119,41 +2128,43 @@ static int subdivide_exec(bContext *C, wmOperator *op)
bpn++;
bp++;
if(b<nu->pntsu-1) {
- *bpn= *bp;
prevbp= bp-1;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
+ for (i = 0; i < number_cuts; i++) {
+ factor = (float)(i + 1) / (number_cuts + 1);
+ *bpn= *bp;
+ interp_v4_v4v4(bpn->vec, prevbp->vec, bp->vec, factor);
+ bpn++;
+ }
}
}
- bpn+= (2*nu->pntsu-1);
+ bpn+= number_cuts * countu;
}
/* now insert new */
- bpn= bpnew+(2*nu->pntsu-1);
- bp= bpnew+(4*nu->pntsu-2);
+ bpn= bpnew+((number_cuts+1)*nu->pntsu - number_cuts);
+ bp= bpnew+(number_cuts+1)*((number_cuts+1)*nu->pntsu-number_cuts);
prevbp= bpnew;
for(a=1; a<nu->pntsv; a++) {
- for(b=0; b<2*nu->pntsu-1; b++) {
- *bpn= *bp;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
+ for(b=0; b<(number_cuts+1)*nu->pntsu-number_cuts; b++) {
+ BPoint *tmp= bpn;
+ for (i = 0; i < number_cuts; i++) {
+ factor = (float)(i + 1) / (number_cuts + 1);
+ *tmp= *bp;
+ interp_v4_v4v4(tmp->vec, prevbp->vec, bp->vec, factor);
+ tmp += countu;
+ }
bp++;
prevbp++;
+ bpn++;
}
- bp+= (2*nu->pntsu-1);
- bpn+= (2*nu->pntsu-1);
- prevbp+= (2*nu->pntsu-1);
+ bp+= number_cuts * countu;
+ bpn+= number_cuts * countu;
+ prevbp+= number_cuts * countu;
}
MEM_freeN(nu->bp);
nu->bp= bpnew;
- nu->pntsu= 2*nu->pntsu-1;
- nu->pntsv= 2*nu->pntsv-1;
+ nu->pntsu= (number_cuts+1)*nu->pntsu-number_cuts;
+ nu->pntsv= (number_cuts+1)*nu->pntsv-number_cuts;
makeknots(nu, 1);
makeknots(nu, 2);
} /* End of 'if(sel== nu->pntsu*nu->pntsv)' (subdivide entire NURB) */
@@ -2161,7 +2172,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
/* subdivide in v direction? */
sel= 0;
for(a=0; a<nu->pntsv-1; a++) {
- if(vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu) sel++;
+ if(vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu) sel+=number_cuts;
}
if(sel) { /* V ! */
@@ -2170,29 +2181,30 @@ static int subdivide_exec(bContext *C, wmOperator *op)
for(a=0; a<nu->pntsv; a++) {
for(b=0; b<nu->pntsu; b++) {
*bpn= *bp;
- bpn++;
+ bpn++;
bp++;
}
if( (a<nu->pntsv-1) && vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu ) {
- prevbp= bp- nu->pntsu;
- for(b=0; b<nu->pntsu; b++) {
- /*
- This simple bisection must be replaces by a
- subtle resampling of a number of points. Our
- task is made slightly easier because each
- point in our curve is a separate data
- node. (is it?)
- */
- *bpn= *prevbp;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
- prevbp++;
- bp++;
+ for (i = 0; i < number_cuts; i++) {
+ factor = (float)(i + 1) / (number_cuts + 1);
+ prevbp= bp- nu->pntsu;
+ for(b=0; b<nu->pntsu; b++) {
+ /*
+ This simple bisection must be replaces by a
+ subtle resampling of a number of points. Our
+ task is made slightly easier because each
+ point in our curve is a separate data
+ node. (is it?)
+ */
+ *bpn= *prevbp;
+ interp_v4_v4v4(bpn->vec, prevbp->vec, bp->vec, factor);
+ bpn++;
+
+ prevbp++;
+ bp++;
+ }
+ bp-= nu->pntsu;
}
- bp-= nu->pntsu;
}
}
MEM_freeN(nu->bp);
@@ -2204,12 +2216,12 @@ static int subdivide_exec(bContext *C, wmOperator *op)
/* or in u direction? */
sel= 0;
for(a=0; a<nu->pntsu-1; a++) {
- if(usel[a]==nu->pntsv && usel[a+1]==nu->pntsv) sel++;
+ if(usel[a]==nu->pntsv && usel[a+1]==nu->pntsv) sel+=number_cuts;
}
if(sel) { /* U ! */
- /* Inserting U points is sort of 'default' Flat curves only get */
- /* U points inserted in them. */
+ /* Inserting U points is sort of 'default' Flat curves only get */
+ /* U points inserted in them. */
bpn=bpnew= MEM_mallocN( (sel+nu->pntsu)*nu->pntsv*sizeof(BPoint), "subdivideNurb4");
bp= nu->bp;
for(a=0; a<nu->pntsv; a++) {
@@ -2218,20 +2230,20 @@ static int subdivide_exec(bContext *C, wmOperator *op)
bpn++;
bp++;
if( (b<nu->pntsu-1) && usel[b]==nu->pntsv && usel[b+1]==nu->pntsv ) {
- /*
- One thing that bugs me here is that the
- orders of things are not the same as in
- the JW piece. Also, this implies that we
- handle at most 3rd order curves? I miss
- some symmetry here...
- */
+ /*
+ One thing that bugs me here is that the
+ orders of things are not the same as in
+ the JW piece. Also, this implies that we
+ handle at most 3rd order curves? I miss
+ some symmetry here...
+ */
+ for (i = 0; i < number_cuts; i++) {
+ factor = (float)(i + 1) / (number_cuts + 1);
prevbp= bp- 1;
*bpn= *prevbp;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
+ interp_v4_v4v4(bpn->vec, prevbp->vec, bp->vec, factor);
bpn++;
+ }
}
}
}
@@ -2239,7 +2251,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
nu->bp= bpnew;
nu->pntsu+= sel;
makeknots(nu, 1); /* shift knots
- forward */
+ forward */
}
}
}
@@ -2248,6 +2260,14 @@ static int subdivide_exec(bContext *C, wmOperator *op)
} /* End of 'if(nu->type == CU_NURBS)' */
}
+}
+
+static int subdivide_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit= CTX_data_edit_object(C);
+ int number_cuts= RNA_int_get(op->ptr, "number_cuts");
+
+ subdividenurb(obedit, number_cuts);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
@@ -2267,6 +2287,8 @@ void CURVE_OT_subdivide(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_int(ot->srna, "number_cuts", 1, 1, 100, "Number of cuts", "", 1, 100);
}
/******************** find nearest ************************/
@@ -2798,6 +2820,10 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
if( is_u_selected(nu1, nu1->pntsu-1) );
else {
+ /* For 2D curves blender uses orderv=0. It doesn't make any sense mathematically. */
+ /* but after rotating orderu=0 will be confusing. */
+ if (nu1->orderv == 0) nu1->orderv= 1;
+
rotate_direction_nurb(nu1);
if( is_u_selected(nu1, nu1->pntsu-1) );
else {
@@ -2818,6 +2844,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
/* 2nd nurbs: u = 0 selected */
if( is_u_selected(nu2, 0) );
else {
+ if (nu2->orderv == 0) nu2->orderv= 1;
rotate_direction_nurb(nu2);
if( is_u_selected(nu2, 0) );
else {
@@ -2863,8 +2890,8 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
/* merge */
origu= nu1->pntsu;
nu1->pntsu+= nu2->pntsu;
- if(nu1->orderu<3) nu1->orderu++;
- if(nu1->orderv<3) nu1->orderv++;
+ if(nu1->orderu<3 && nu1->orderu<nu1->pntsu) nu1->orderu++;
+ if(nu1->orderv<3 && nu1->orderv<nu1->pntsv) nu1->orderv++;
temp= nu1->bp;
nu1->bp= MEM_mallocN(nu1->pntsu*nu1->pntsv*sizeof(BPoint), "mergeBP");
@@ -2939,7 +2966,7 @@ static int merge_nurb(bContext *C, wmOperator *op)
BLI_freelistN(&nsortbase);
return OPERATOR_CANCELLED;
}
-
+
while(nus2) {
merge_2_nurb(op, editnurb, nus1->nu, nus2->nu);
nus2= nus2->next;
@@ -3477,7 +3504,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
ViewContext vc;
- float location[3];
+ float location[3] = {0.0f, 0.0f, 0.0f};
short mval[2];
if(rv3d && !RNA_property_is_set(op->ptr, "location")) {
@@ -4573,8 +4600,8 @@ static int delete_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(obedit->type==OB_SURF) {
pup= uiPupMenuBegin(C, "Delete", 0);
layout= uiPupMenuLayout(pup);
- uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 0);
- uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 2);
+ uiItemEnumO(layout, op->type->idname, NULL, 0, "type", 0);
+ uiItemEnumO(layout, op->type->idname, NULL, 0, "type", 2);
uiPupMenuEnd(C, pup);
}
else {
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 8882624eb9d..37e695cf823 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -46,8 +46,6 @@
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
#include "DNA_text_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_curve.h"
@@ -66,7 +64,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_curve.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_util.h"
@@ -320,7 +317,7 @@ void FONT_OT_insert_lorem(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert Lorem";
- ot->description= "Insert placeholder text";
+ ot->description= "Insert placeholder text";
ot->idname= "FONT_OT_insert_lorem";
/* api callbacks */
@@ -408,7 +405,7 @@ void FONT_OT_file_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste File";
- ot->description= "Paste contents from file";
+ ot->description= "Paste contents from file";
ot->idname= "FONT_OT_file_paste";
/* api callbacks */
@@ -457,7 +454,7 @@ void FONT_OT_buffer_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste Buffer";
- ot->description= "Paste text from OS buffer";
+ ot->description= "Paste text from OS buffer";
ot->idname= "FONT_OT_buffer_paste";
/* api callbacks */
@@ -568,7 +565,7 @@ static short next_word(Curve *cu)
{
short s;
for(s=cu->pos; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
- (cu->str[s]!=1) && (cu->str[s]!='\r'); s++);
+ (cu->str[s]!=1) && (cu->str[s]!='\r'); s++);
if(cu->str[s]) return(s+1); else return(s);
}
@@ -578,7 +575,7 @@ static short prev_word(Curve *cu)
if(cu->pos==0) return(0);
for(s=cu->pos-2; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
- (cu->str[s]!=1) && (cu->str[s]!='\r'); s--);
+ (cu->str[s]!=1) && (cu->str[s]!='\r'); s--);
if(cu->str[s]) return(s+1); else return(s);
}
@@ -656,7 +653,7 @@ void FONT_OT_style_set(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Style";
- ot->description= "Set font style";
+ ot->description= "Set font style";
ot->idname= "FONT_OT_style_set";
/* api callbacks */
@@ -694,7 +691,7 @@ void FONT_OT_style_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Style";
- ot->description= "Toggle font style";
+ ot->description= "Toggle font style";
ot->idname= "FONT_OT_style_toggle";
/* api callbacks */
@@ -737,7 +734,7 @@ void FONT_OT_text_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy Text";
- ot->description= "Copy selected text to clipboard";
+ ot->description= "Copy selected text to clipboard";
ot->idname= "FONT_OT_text_copy";
/* api callbacks */
@@ -768,7 +765,7 @@ void FONT_OT_text_cut(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Cut Text";
- ot->description= "Cut selected text to clipboard";
+ ot->description= "Cut selected text to clipboard";
ot->idname= "FONT_OT_text_cut";
/* api callbacks */
@@ -826,7 +823,7 @@ void FONT_OT_text_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste Text";
- ot->description= "Paste text from clipboard";
+ ot->description= "Paste text from clipboard";
ot->idname= "FONT_OT_text_paste";
/* api callbacks */
@@ -962,7 +959,7 @@ void FONT_OT_move(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Cursor";
- ot->description= "Move cursor to position type";
+ ot->description= "Move cursor to position type";
ot->idname= "FONT_OT_move";
/* api callbacks */
@@ -989,7 +986,7 @@ void FONT_OT_move_select(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Select";
- ot->description= "Make selection from current cursor position to new cursor position type";
+ ot->description= "Make selection from current cursor position to new cursor position type";
ot->idname= "FONT_OT_move_select";
/* api callbacks */
@@ -1031,7 +1028,7 @@ void FONT_OT_change_spacing(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Change Spacing";
- ot->description= "Change font spacing";
+ ot->description= "Change font spacing";
ot->idname= "FONT_OT_change_spacing";
/* api callbacks */
@@ -1076,7 +1073,7 @@ void FONT_OT_change_character(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Change Character";
- ot->description= "Change font character code";
+ ot->description= "Change font character code";
ot->idname= "FONT_OT_change_character";
/* api callbacks */
@@ -1119,7 +1116,7 @@ void FONT_OT_line_break(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Line Break";
- ot->description= "Insert line break at cursor position";
+ ot->description= "Insert line break at cursor position";
ot->idname= "FONT_OT_line_break";
/* api callbacks */
@@ -1209,7 +1206,7 @@ void FONT_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
- ot->description= "Delete text by cursor position";
+ ot->description= "Delete text by cursor position";
ot->idname= "FONT_OT_delete";
/* api callbacks */
@@ -1351,7 +1348,7 @@ void FONT_OT_text_insert(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert Text";
- ot->description= "Insert text at cursor position";
+ ot->description= "Insert text at cursor position";
ot->idname= "FONT_OT_text_insert";
/* api callbacks */
@@ -1487,7 +1484,7 @@ void FONT_OT_case_set(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Case";
- ot->description= "Set font case";
+ ot->description= "Set font case";
ot->idname= "FONT_OT_case_set";
/* api callbacks */
@@ -1530,7 +1527,7 @@ void FONT_OT_case_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Case";
- ot->description= "Toggle font case";
+ ot->description= "Toggle font case";
ot->idname= "FONT_OT_case_toggle";
/* api callbacks */
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index d01a7b7e96f..fca525c0313 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -34,19 +34,15 @@
#include "MEM_guardedalloc.h"
-#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "DNA_gpencil_types.h"
-#include "DNA_listBase.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
#include "BKE_blender.h"
#include "BKE_context.h"
@@ -55,20 +51,15 @@
#include "BKE_sequencer.h"
#include "BKE_utildefines.h"
-#include "PIL_time.h"
#include "WM_api.h"
-#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "ED_gpencil.h"
#include "ED_sequencer.h"
-#include "ED_util.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "gpencil_intern.h"
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index bfe0ba16af5..dff0839b5bd 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -36,14 +36,6 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
-#include "DNA_listBase.h"
-#include "DNA_action_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
@@ -54,15 +46,7 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "PIL_time.h"
-#include "ED_anim_api.h"
-#include "ED_gpencil.h"
-#include "ED_keyframes_edit.h"
-#include "ED_keyframes_draw.h"
-#include "ED_markers.h"
-#include "ED_util.h"
-#include "ED_types.h"
#include "gpencil_intern.h"
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index 789355d2136..cc4a05c3421 100644
--- a/source/blender/editors/gpencil/gpencil_buttons.c
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -36,11 +36,7 @@
#include "BLI_blenlib.h"
#include "DNA_gpencil_types.h"
-#include "DNA_listBase.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -56,12 +52,9 @@
#include "BIF_glutil.h"
#include "ED_gpencil.h"
-#include "ED_sequencer.h"
-#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "gpencil_intern.h"
@@ -129,11 +122,11 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* active */
icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
- uiItemR(subrow, "", icon, &ptr, "active", 0);
+ uiItemR(subrow, &ptr, "active", 0, "", icon);
/* locked */
icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
- uiItemR(subrow, "", icon, &ptr, "locked", 0);
+ uiItemR(subrow, &ptr, "locked", 0, "", icon);
/* when layer is locked or hidden, only draw header */
if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
@@ -141,7 +134,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* visibility button (only if hidden but not locked!) */
if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
- uiItemR(subrow, "", ICON_RESTRICT_VIEW_ON, &ptr, "hide", 0);
+ uiItemR(subrow, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON);
/* name */
@@ -166,17 +159,17 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
else {
/* draw rest of header -------------------------------- */
/* visibility button */
- uiItemR(subrow, "", ICON_RESTRICT_VIEW_OFF, &ptr, "hide", 0);
+ uiItemR(subrow, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF);
/* frame locking */
// TODO: this needs its own icons...
icon= (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
- uiItemR(subrow, "", icon, &ptr, "frame_lock", 0);
+ uiItemR(subrow, &ptr, "frame_lock", 0, "", icon);
uiBlockSetEmboss(block, UI_EMBOSS);
/* name */
- uiItemR(subrow, "", 0, &ptr, "info", 0);
+ uiItemR(subrow, &ptr, "info", 0, "", 0);
/* delete 'button' */
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -200,17 +193,17 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* color */
subcol= uiLayoutColumn(col, 1);
- uiItemR(subcol, "", 0, &ptr, "color", 0);
- uiItemR(subcol, NULL, 0, &ptr, "opacity", UI_ITEM_R_SLIDER);
+ uiItemR(subcol, &ptr, "color", 0, "", 0);
+ uiItemR(subcol, &ptr, "opacity", UI_ITEM_R_SLIDER, NULL, 0);
/* stroke thickness */
subcol= uiLayoutColumn(col, 1);
- uiItemR(subcol, NULL, 0, &ptr, "line_thickness", UI_ITEM_R_SLIDER);
+ uiItemR(subcol, &ptr, "line_thickness", UI_ITEM_R_SLIDER, NULL, 0);
/* debugging options */
if (G.f & G_DEBUG) {
subcol= uiLayoutColumn(col, 1);
- uiItemR(subcol, NULL, 0, &ptr, "show_points", 0);
+ uiItemR(subcol, &ptr, "show_points", 0, NULL, 0);
}
/* right column ................... */
@@ -218,8 +211,8 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
/* onion-skinning */
subcol= uiLayoutColumn(col, 1);
- uiItemR(subcol, "Onion Skinning", 0, &ptr, "use_onion_skinning", 0);
- uiItemR(subcol, "Frames", 0, &ptr, "max_ghost_range", 0); // XXX shorter name here? (i.e. GStep)
+ uiItemR(subcol, &ptr, "use_onion_skinning", 0, "Onion Skinning", 0);
+ uiItemR(subcol, &ptr, "max_ghost_range", 0, "Frames", 0); // XXX shorter name here? i.e. GStep
/* additional options... */
subcol= uiLayoutColumn(col, 1);
@@ -264,15 +257,15 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi
/* 'stick to view' option */
row= uiLayoutRow(col, 1);
- uiItemEnumR_string(row, NULL, 0, &gpd_ptr, "draw_mode", "VIEW");
- uiItemEnumR_string(row, NULL, 0, &gpd_ptr, "draw_mode", "CURSOR");
+ uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "VIEW", NULL, 0);
+ uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "CURSOR", NULL, 0);
row= uiLayoutRow(col, 1);
- uiItemEnumR_string(row, NULL, 0, &gpd_ptr, "draw_mode", "SURFACE");
- uiItemEnumR_string(row, NULL, 0, &gpd_ptr, "draw_mode", "STROKE");
+ uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "SURFACE", NULL, 0);
+ uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "STROKE", NULL, 0);
row= uiLayoutRow(col, 0);
uiLayoutSetActive(row, (gpd->flag & (GP_DATA_DEPTH_STROKE|GP_DATA_DEPTH_VIEW)) ? 1:0);
- uiItemR(row, NULL, 0, &gpd_ptr, "use_stroke_endpoints", 0);
+ uiItemR(row, &gpd_ptr, "use_stroke_endpoints", 0, NULL, 0);
}
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 5c9b939aa1f..9e3ebedba0a 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -34,23 +34,16 @@
#include "MEM_guardedalloc.h"
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
-#include "DNA_listBase.h"
-#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
-#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_node_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
#include "DNA_view3d_types.h"
#include "BKE_armature.h"
@@ -76,9 +69,6 @@
#include "UI_view2d.h"
-#include "ED_armature.h"
-#include "ED_gpencil.h"
-#include "ED_sequencer.h"
#include "ED_view3d.h"
#include "gpencil_intern.h"
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index 5c8594d4016..d9bd43cc851 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -31,14 +31,11 @@
#include "BLI_blenlib.h"
-#include "DNA_windowmanager_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
-#include "RNA_enum_types.h"
#include "gpencil_intern.h"
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index deb8e738ef7..e8c42afe00a 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -42,21 +42,12 @@
#include "BKE_report.h"
#include "BKE_utildefines.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_action_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "UI_view2d.h"
-#include "ED_armature.h"
#include "ED_gpencil.h"
-#include "ED_sequencer.h"
#include "ED_screen.h"
#include "ED_view3d.h"
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index c331702a9ee..23cb697b453 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -326,7 +326,7 @@ typedef enum eAnimChannels_SetFlag {
/* types of settings for AnimChannels */
typedef enum eAnimChannel_Settings {
- ACHANNEL_SETTING_SELECT = 0,
+ ACHANNEL_SETTING_SELECT = 0,
ACHANNEL_SETTING_PROTECT, // warning: for drawing UI's, need to check if this is off (maybe inverse this later)
ACHANNEL_SETTING_MUTE,
ACHANNEL_SETTING_EXPAND,
diff --git a/source/blender/editors/include/ED_fluidsim.h b/source/blender/editors/include/ED_fluidsim.h
index 8a9a294d423..a1ab3ba2fcc 100644
--- a/source/blender/editors/include/ED_fluidsim.h
+++ b/source/blender/editors/include/ED_fluidsim.h
@@ -34,8 +34,6 @@
struct Object;
struct FluidsimSettings;
-extern double fluidsimViscosityPreset[6];
-extern char* fluidsimViscosityPresetString[6];
/* allocates and initializes fluidsim data */
struct FluidsimSettings* fluidsimSettingsNew(struct Object *srcob);
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index c0821b3ff55..86a1f5c4031 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -125,10 +125,10 @@ typedef struct KeyingSetInfo {
/* info */
/* identifier so that user can hook this up to a KeyingSet */
char name[64];
+ /* identifier used for class name, which KeyingSet instances reference as "Typeinfo Name" */
+ char idname[64];
/* keying settings */
short keyingflag;
- /* builtin? */
- short builtin;
/* polling callbacks */
/* callback for polling the context for whether the right data is available */
@@ -190,6 +190,12 @@ void ANIM_keyingset_infos_exit(void);
/* Get the active KeyingSet for the given scene */
struct KeyingSet *ANIM_scene_get_active_keyingset(struct Scene *scene);
+/* Get the index of the Keying Set provided, for the given Scene */
+int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks);
+
+/* Create (and show) a menu containing all the Keying Sets which can be used in the current context */
+void ANIM_keying_sets_menu_setup(struct bContext *C, char title[], char op_name[]);
+
/* Check if KeyingSet can be used in the current context */
short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);
diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h
index 4f3918625d9..7df1f1f28cb 100644
--- a/source/blender/editors/include/ED_numinput.h
+++ b/source/blender/editors/include/ED_numinput.h
@@ -27,13 +27,13 @@
typedef struct NumInput {
- short idx;
- short idx_max;
- short flag; /* Different flags to indicate different behaviors */
- char inv[3]; /* If the value is inverted or not */
- float val[3]; /* Direct value of the input */
- int ctrl[3]; /* Control to indicate what to do with the numbers that are typed */
- float increment;
+ short idx;
+ short idx_max;
+ short flag; /* Different flags to indicate different behaviors */
+ char inv[3]; /* If the value is inverted or not */
+ float val[3]; /* Direct value of the input */
+ int ctrl[3]; /* Control to indicate what to do with the numbers that are typed */
+ float increment;
} NumInput ;
/* NUMINPUT FLAGS */
diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h
index 1167d116df7..db2013fb411 100644
--- a/source/blender/editors/include/ED_sculpt.h
+++ b/source/blender/editors/include/ED_sculpt.h
@@ -38,7 +38,7 @@ struct wmWindowManager;
/* sculpt.c */
void ED_operatortypes_sculpt(void);
void sculpt_get_redraw_planes(float planes[4][4], struct ARegion *ar,
- struct RegionView3D *rv3d, struct Object *ob);
+ struct RegionView3D *rv3d, struct Object *ob);
void ED_sculpt_force_update(struct bContext *C);
/* paint_ops.c */
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index 745073fd235..30560687702 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -540,7 +540,7 @@ DEF_ICON(ICON_MOD_FLUIDSIM)
DEF_ICON(ICON_MOD_MULTIRES)
DEF_ICON(ICON_MOD_SMOKE)
DEF_ICON(ICON_MOD_SOLIDIFY)
-DEF_ICON(ICON_BLANK159)
+DEF_ICON(ICON_MOD_SCREW) // XXX, needs drawing
DEF_ICON(ICON_BLANK160)
DEF_ICON(ICON_BLANK161)
DEF_ICON(ICON_BLANK162)
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 5c6ac272c53..dfc89ea16df 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -680,7 +680,7 @@ void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, char *prop
void uiTemplateColorWheel(uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider, int lock);
void uiTemplateTriColorSet(uiLayout *layout, struct PointerRNA *ptr, char *propname);
void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname,
- PointerRNA *used_ptr, char *used_propname, int active_layer);
+ PointerRNA *used_ptr, char *used_propname, int active_layer);
void uiTemplateImage(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *userptr, int compact);
void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser);
void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
@@ -693,32 +693,32 @@ void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr
/* items */
void uiItemO(uiLayout *layout, char *name, int icon, char *opname);
-void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value);
+void uiItemEnumO(uiLayout *layout, char *opname, char *name, int icon, char *propname, int value);
void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value);
void uiItemsEnumO(uiLayout *layout, char *opname, char *propname);
void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value);
void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value);
void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value);
void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value);
-PointerRNA uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context, int flag);
+PointerRNA uiItemFullO(uiLayout *layout, char *idname, char *name, int icon, struct IDProperty *properties, int context, int flag);
-void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int flag);
-void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag);
+void uiItemR(uiLayout *layout, struct PointerRNA *ptr, char *propname, int flag, char *name, int icon);
+void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, char *name, int icon);
void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value);
-void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value);
+void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon);
void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname);
-void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname);
+void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon);
void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, struct IDProperty *properties, int context, int flag);
void uiItemL(uiLayout *layout, char *name, int icon); /* label */
void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, char *name, int icon); /* label icon for dragging */
-void uiItemM(uiLayout *layout, struct bContext *C, char *name, int icon, char *menuname); /* menu */
+void uiItemM(uiLayout *layout, struct bContext *C, char *menuname, char *name, int icon); /* menu */
void uiItemV(uiLayout *layout, char *name, int icon, int argval); /* value */
void uiItemS(uiLayout *layout); /* separator */
void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg);
-void uiItemMenuEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname);
-void uiItemMenuEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname);
+void uiItemMenuEnumO(uiLayout *layout, char *opname, char *propname, char *name, int icon);
+void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *name, int icon);
/* UI Operators */
void UI_buttons_operatortypes(void);
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 46c8a446a03..273071f94bf 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -49,12 +49,12 @@ typedef enum {
typedef enum {
#define BIFCOLORSHADE_FIRST (COLORSHADE_DARK)
- COLORSHADE_DARK,
- COLORSHADE_GREY,
- COLORSHADE_MEDIUM,
- COLORSHADE_HILITE,
- COLORSHADE_LIGHT,
- COLORSHADE_WHITE
+ COLORSHADE_DARK,
+ COLORSHADE_GREY,
+ COLORSHADE_MEDIUM,
+ COLORSHADE_HILITE,
+ COLORSHADE_LIGHT,
+ COLORSHADE_WHITE
#define BIFCOLORSHADE_LAST (COLORSHADE_WHITE)
#define BIFNCOLORSHADES (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
} BIFColorShade;
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index c1d47f2ec7c..f71b6361c85 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -32,11 +32,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_ID.h"
-#include "DNA_listBase.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
#include "DNA_userdef_types.h"
#include "BLI_math.h"
@@ -58,7 +55,6 @@
#include "UI_interface.h"
-#include "ED_screen.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -66,7 +62,6 @@
#include "wm_window.h"
#include "RNA_access.h"
-#include "RNA_types.h"
#include "BPY_extern.h"
@@ -289,7 +284,7 @@ void ui_bounds_block(uiBlock *block)
if(bt->x1 < block->minx) block->minx= bt->x1;
if(bt->y1 < block->miny) block->miny= bt->y1;
- if(bt->x2 > block->maxx) block->maxx= bt->x2;
+ if(bt->x2 > block->maxx) block->maxx= bt->x2;
if(bt->y2 > block->maxy) block->maxy= bt->y2;
bt= bt->next;
@@ -373,9 +368,9 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_
width= block->maxx - block->minx;
height= block->maxy - block->miny;
- /* avoid divide by zero below, caused by calling with no UI, but better not crash */
- oldwidth= oldwidth > 0 ? oldwidth : MAX2(1, width);
- oldheight= oldheight > 0 ? oldheight : MAX2(1, height);
+ /* avoid divide by zero below, caused by calling with no UI, but better not crash */
+ oldwidth= oldwidth > 0 ? oldwidth : MAX2(1, width);
+ oldheight= oldheight > 0 ? oldheight : MAX2(1, height);
/* offset block based on mouse position, user offset is scaled
along in case we resized the block in ui_text_bounds_block */
@@ -1185,12 +1180,12 @@ void ui_get_but_vectorf(uiBut *but, float *vec)
float *fp= (float *)but->poin;
VECCOPY(vec, fp);
}
- else {
- if (but->editvec==NULL) {
- fprintf(stderr, "ui_get_but_vectorf: can't get color, should never happen\n");
- vec[0]= vec[1]= vec[2]= 0.0f;
- }
- }
+ else {
+ if (but->editvec==NULL) {
+ fprintf(stderr, "ui_get_but_vectorf: can't get color, should never happen\n");
+ vec[0]= vec[1]= vec[2]= 0.0f;
+ }
+ }
}
/* for buttons pointing to color for example */
@@ -1599,7 +1594,7 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
}
else if(but->type == IDPOIN) {
/* ID pointer */
- but->idpoin_func(C, (char*)str, but->idpoin_idpp);
+ but->idpoin_func(C, (char*)str, but->idpoin_idpp);
return 1;
}
else if(but->type == TEX) {
@@ -2308,7 +2303,7 @@ ui_def_but is the function that draws many button types
for float buttons:
"a1" Click Step (how much to change the value each click)
"a2" Number of decimal point values to display. 0 defaults to 3 (0.000) 1,2,3, and a maximum of 4,
- all greater values will be clamped to 4.
+ all greater values will be clamped to 4.
*/
static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 6a7f2b2fcb7..207230a914d 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -16,8 +16,6 @@
#include "BKE_context.h"
#include "BKE_fcurve.h"
-#include "RNA_access.h"
-#include "RNA_types.h"
#include "ED_keyframing.h"
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index f57d7a8367a..b3380d91a44 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -29,11 +29,8 @@
#include <string.h>
#include "DNA_color_types.h"
-#include "DNA_listBase.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BLI_math.h"
@@ -48,7 +45,6 @@
#include "BIF_glutil.h"
#include "UI_interface.h"
-#include "UI_interface_icons.h"
#include "interface_intern.h"
@@ -81,7 +77,7 @@ int uiGetRoundBox(void)
void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad)
{
float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
int a;
/* mult */
@@ -151,7 +147,7 @@ static void round_box_shade_col(float *col1, float *col2, float fac)
void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown)
{
float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
float div= maxy-miny;
float coltop[3], coldown[3], color[4];
int a;
@@ -258,7 +254,7 @@ void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy
void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight)
{
float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
float div= maxx-minx;
float colLeft[3], colRight[3], color[4];
int a;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 4747cf05773..63a3cf78eda 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -30,13 +30,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_color_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -3722,7 +3717,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
- uiItemR(layout, "", 0, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE);
+ uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE, "", 0);
uiPopupBoundsBlock(block, 6, 100, 10);
uiEndBlock(C, block);
@@ -3756,7 +3751,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
- uiItemR(layout, "", 0, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE);
+ uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE, "", 0);
uiPopupBoundsBlock(block, 6, 100, 10);
uiEndBlock(C, block);
@@ -3953,28 +3948,28 @@ static int ui_but_menu(bContext *C, uiBut *but)
WM_operator_properties_create(&ptr_props, "WM_OT_doc_view");
RNA_string_set(&ptr_props, "doc_id", buf);
- uiItemFullO(layout, "View Docs", 0, "WM_OT_doc_view", ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
+ uiItemFullO(layout, "WM_OT_doc_view", "View Docs", 0, ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
WM_operator_properties_create(&ptr_props, "WM_OT_doc_edit");
RNA_string_set(&ptr_props, "doc_id", buf);
RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop));
- uiItemFullO(layout, "Submit Description", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
+ uiItemFullO(layout, "WM_OT_doc_edit", "Submit Description", 0, ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
}
else if (but->optype) {
WM_operator_py_idname(buf, but->optype->idname);
WM_operator_properties_create(&ptr_props, "WM_OT_doc_view");
RNA_string_set(&ptr_props, "doc_id", buf);
- uiItemFullO(layout, "View Docs", 0, "WM_OT_doc_view", ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
+ uiItemFullO(layout, "WM_OT_doc_view", "View Docs", 0, ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
WM_operator_properties_create(&ptr_props, "WM_OT_doc_edit");
RNA_string_set(&ptr_props, "doc_id", buf);
RNA_string_set(&ptr_props, "doc_new", but->optype->description);
- uiItemFullO(layout, "Submit Description", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
+ uiItemFullO(layout, "WM_OT_doc_edit", "Submit Description", 0, ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
}
}
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 457713755fd..d08ec2f92c5 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -44,9 +44,7 @@
#include "BLI_blenlib.h"
#include "BLI_storage_types.h"
-#include "DNA_material_types.h"
#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#include "BKE_context.h"
@@ -66,7 +64,6 @@
#include "UI_interface.h"
#include "UI_interface_icons.h"
-#include "UI_resources.h" /* elubie: should be removed once the enum for the ICONS is in BIF_preview_icons.h */
#include "interface_intern.h"
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index d4a47be11ca..2ae1a549db9 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -29,11 +29,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_ID.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
@@ -48,12 +45,7 @@
#include "RNA_access.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-#include "ED_util.h"
-#include "ED_types.h"
-#include "ED_screen.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -600,7 +592,7 @@ static void ui_item_disabled(uiLayout *layout, char *name)
}
/* operator items */
-PointerRNA uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context, int flag)
+PointerRNA uiItemFullO(uiLayout *layout, char *idname, char *name, int icon, IDProperty *properties, int context, int flag)
{
uiBlock *block= layout->root->block;
wmOperatorType *ot= WM_operatortype_find(idname, 0);
@@ -681,7 +673,7 @@ static char *ui_menu_enumpropname(uiLayout *layout, char *opname, char *propname
return "";
}
-void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value)
+void uiItemEnumO(uiLayout *layout, char *opname, char *name, int icon, char *propname, int value)
{
PointerRNA ptr;
@@ -691,7 +683,7 @@ void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *pro
if(!name)
name= ui_menu_enumpropname(layout, opname, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
+ uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, IDProperty *properties, int context, int flag)
@@ -731,10 +723,10 @@ void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, IDProperty
ptr.data= IDP_CopyProperty(properties);
RNA_enum_set(&ptr, propname, item[i].value);
- uiItemFullO(column, (char*)item[i].name, item[i].icon, opname, ptr.data, context, flag);
+ uiItemFullO(column, opname, (char*)item[i].name, item[i].icon, ptr.data, context, flag);
}
else
- uiItemEnumO(column, (char*)item[i].name, item[i].icon, opname, propname, item[i].value);
+ uiItemEnumO(column, opname, (char*)item[i].name, item[i].icon, propname, item[i].value);
}
else {
if(item[i].name) {
@@ -798,7 +790,7 @@ void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, ch
if(!name)
name= ui_menu_enumpropname(layout, opname, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
+ uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value)
@@ -808,7 +800,7 @@ void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *
WM_operator_properties_create(&ptr, opname);
RNA_boolean_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
+ uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value)
@@ -818,7 +810,7 @@ void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *prop
WM_operator_properties_create(&ptr, opname);
RNA_int_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
+ uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value)
@@ -828,7 +820,7 @@ void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *pr
WM_operator_properties_create(&ptr, opname);
RNA_float_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
+ uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value)
@@ -838,12 +830,12 @@ void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *p
WM_operator_properties_create(&ptr, opname);
RNA_string_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
+ uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
void uiItemO(uiLayout *layout, char *name, int icon, char *opname)
{
- uiItemFullO(layout, name, icon, opname, NULL, layout->root->opcontext, 0);
+ uiItemFullO(layout, opname, name, icon, NULL, layout->root->opcontext, 0);
}
/* RNA property items */
@@ -892,7 +884,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA
*r_h= h;
}
-void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag)
+void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag, char *name, int icon)
{
uiBlock *block= layout->root->block;
uiBut *but;
@@ -975,7 +967,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
uiBlockSetEmboss(block, UI_EMBOSS);
}
-void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int flag)
+void uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, int flag, char *name, int icon)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
@@ -985,7 +977,7 @@ void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *prop
return;
}
- uiItemFullR(layout, name, icon, ptr, prop, RNA_NO_INDEX, 0, flag);
+ uiItemFullR(layout, ptr, prop, RNA_NO_INDEX, 0, flag, name, icon);
}
void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value)
@@ -998,10 +990,10 @@ void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr,
return;
}
- uiItemFullR(layout, name, icon, ptr, prop, RNA_ENUM_VALUE, value, 0);
+ uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, value, 0, name, icon);
}
-void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value)
+void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
EnumPropertyItem *item;
@@ -1024,7 +1016,7 @@ void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRN
for(a=0; item[a].identifier; a++) {
if(item[a].value == ivalue) {
- uiItemFullR(layout, (char*)item[a].name, item[a].icon, ptr, prop, RNA_ENUM_VALUE, ivalue, 0);
+ uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, (char*)item[a].name, item[a].icon);
break;
}
}
@@ -1199,7 +1191,7 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
}
}
-void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname)
+void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon)
{
PropertyRNA *prop, *searchprop;
PropertyType type;
@@ -1301,7 +1293,7 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun
but->type= MENU;
}
-void uiItemM(uiLayout *layout, bContext *C, char *name, int icon, char *menuname)
+void uiItemM(uiLayout *layout, bContext *C, char *menuname, char *name, int icon)
{
MenuType *mt;
@@ -1419,7 +1411,7 @@ static void menu_item_enum_opname_menu(bContext *C, uiLayout *layout, void *arg)
uiItemsEnumO(layout, lvl->opname, lvl->propname);
}
-void uiItemMenuEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname)
+void uiItemMenuEnumO(uiLayout *layout, char *opname, char *propname, char *name, int icon)
{
wmOperatorType *ot= WM_operatortype_find(opname, 0);
MenuItemLevel *lvl;
@@ -1450,7 +1442,7 @@ static void menu_item_enum_rna_menu(bContext *C, uiLayout *layout, void *arg)
uiItemsEnumR(layout, &lvl->rnapoin, lvl->propname);
}
-void uiItemMenuEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname)
+void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *name, int icon)
{
MenuItemLevel *lvl;
PropertyRNA *prop;
@@ -2074,7 +2066,7 @@ uiLayout *uiLayoutBox(uiLayout *layout)
uiLayout *uiLayoutListBox(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *actptr, PropertyRNA *actprop)
{
- uiLayoutItemBx *box= ui_layout_box(layout, LISTBOX);
+ uiLayoutItemBx *box= ui_layout_box(layout, LISTBOX);
uiBut *but= box->roundbox;
but->rnasearchpoin= *ptr;
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index a8478d2dd1f..0b5eb475b95 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -33,11 +33,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_view2d_types.h"
#include "BLI_blenlib.h"
#include "BLI_math_color.h"
@@ -53,10 +48,8 @@
#include "BIF_gl.h"
-#include "ED_screen.h"
#include "UI_interface.h"
-#include "UI_resources.h"
/* ********************************************************** */
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index bf4a2a49fcb..e4088a64a17 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -39,8 +39,6 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "BKE_context.h"
@@ -56,7 +54,6 @@
#include "ED_screen.h"
#include "UI_interface.h"
-#include "UI_view2d.h"
#include "interface_intern.h"
@@ -802,7 +799,7 @@ void uiBeginPanels(const bContext *C, ARegion *ar)
{
Panel *pa;
- /* set all panels as inactive, so that at the end we know
+ /* set all panels as inactive, so that at the end we know
* which ones were used */
for(pa=ar->panels.first; pa; pa=pa->next) {
if(pa->runtime_flag & PNL_ACTIVE)
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index e12db3674d4..5f517267805 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -30,10 +30,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_screen_types.h"
-#include "DNA_view2d_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -1822,7 +1819,7 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
bt= uiDefButR(block, NUMSLI, 0, "B ", 0, -100, butwidth, UI_UNIT_Y, ptr, propname, 2, 0.0, 0.0, 0, 0, "");
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
- // could use uiItemFullR(col, "", 0, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER);
+ // could use uiItemFullR(col, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER, "", 0);
// but need to use uiButSetFunc for updating other fake buttons
/* HSV values */
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 777fb7806ad..ae149cad480 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -30,10 +30,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_ID.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
@@ -50,13 +48,8 @@
#include "BLF_api.h"
#include "UI_interface.h"
-#include "UI_interface_icons.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "ED_datafiles.h"
-#include "ED_util.h"
-#include "ED_types.h"
#include "interface_intern.h"
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index b7761da76c0..c3e691a0864 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -28,9 +28,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_color_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
#include "BLI_string.h"
@@ -52,7 +50,6 @@
#include "WM_types.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "interface_intern.h"
void ui_template_fix_linking()
@@ -82,49 +79,49 @@ void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr)
/* more 'generic' filtering options */
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, ptr, "only_selected", 0);
- uiItemR(row, "", 0, ptr, "display_transforms", 0); // xxx: include in another position instead?
+ uiItemR(row, ptr, "only_selected", 0, "", 0);
+ uiItemR(row, ptr, "display_transforms", 0, "", 0); // xxx: include in another position instead?
if (nlaActive)
- uiItemR(row, "", 0, ptr, "include_missing_nla", 0);
+ uiItemR(row, ptr, "include_missing_nla", 0, "", 0);
/* datatype based - only available datatypes are shown */
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, ptr, "display_scene", 0);
- uiItemR(row, "", 0, ptr, "display_world", 0);
- uiItemR(row, "", 0, ptr, "display_node", 0);
+ uiItemR(row, ptr, "display_scene", 0, "", 0);
+ uiItemR(row, ptr, "display_world", 0, "", 0);
+ uiItemR(row, ptr, "display_node", 0, "", 0);
if (mainptr && mainptr->mesh.first)
- uiItemR(row, "", 0, ptr, "display_mesh", 0);
+ uiItemR(row, ptr, "display_mesh", 0, "", 0);
if (mainptr && mainptr->key.first)
- uiItemR(row, "", 0, ptr, "display_shapekeys", 0);
+ uiItemR(row, ptr, "display_shapekeys", 0, "", 0);
if (mainptr && mainptr->mat.first)
- uiItemR(row, "", 0, ptr, "display_material", 0);
+ uiItemR(row, ptr, "display_material", 0, "", 0);
if (mainptr && mainptr->lamp.first)
- uiItemR(row, "", 0, ptr, "display_lamp", 0);
+ uiItemR(row, ptr, "display_lamp", 0, "", 0);
if (mainptr && mainptr->tex.first)
- uiItemR(row, "", 0, ptr, "display_texture", 0);
+ uiItemR(row, ptr, "display_texture", 0, "", 0);
if (mainptr && mainptr->camera.first)
- uiItemR(row, "", 0, ptr, "display_camera", 0);
+ uiItemR(row, ptr, "display_camera", 0, "", 0);
if (mainptr && mainptr->curve.first)
- uiItemR(row, "", 0, ptr, "display_curve", 0);
+ uiItemR(row, ptr, "display_curve", 0, "", 0);
if (mainptr && mainptr->mball.first)
- uiItemR(row, "", 0, ptr, "display_metaball", 0);
+ uiItemR(row, ptr, "display_metaball", 0, "", 0);
if (mainptr && mainptr->armature.first)
- uiItemR(row, "", 0, ptr, "display_armature", 0);
+ uiItemR(row, ptr, "display_armature", 0, "", 0);
if (mainptr && mainptr->particle.first)
- uiItemR(row, "", 0, ptr, "display_particle", 0);
+ uiItemR(row, ptr, "display_particle", 0, "", 0);
/* group-based filtering (only when groups are available */
if (mainptr && mainptr->group.first) {
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, ptr, "only_group_objects", 0);
+ uiItemR(row, ptr, "only_group_objects", 0, "", 0);
/* if enabled, show the group selection field too */
if (RNA_boolean_get(ptr, "only_group_objects"))
- uiItemR(row, "", 0, ptr, "filtering_group", 0);
+ uiItemR(row, ptr, "filtering_group", 0, "", 0);
}
}
@@ -168,8 +165,8 @@ static void id_search_cb(const bContext *C, void *arg_template, char *str, uiSea
/* hide dot-datablocks */
if(U.uiflag & USER_HIDE_DOT)
- if ((id->name[2]=='.') && (str[0] != '.'))
- continue;
+ if ((id->name[2]=='.') && (str[0] != '.'))
+ continue;
if(BLI_strcasestr(id->name+2, str)) {
iconid= ui_id_icon_get((bContext*)C, id, 0);
@@ -565,10 +562,10 @@ void uiTemplateAnyID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
/* ID-Type Selector - just have a menu of icons */
// FIXME: the icon-only setting doesn't work when we supply a blank name
- uiItemFullR(row, "", 0, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY);
+ uiItemFullR(row, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY, "", 0);
/* ID-Block Selector - just use pointer widget... */
- uiItemFullR(row, "", 0, ptr, propID, 0, 0, 0);
+ uiItemFullR(row, ptr, propID, 0, 0, 0, "", 0);
}
/********************* RNA Path Builder Template ********************/
@@ -597,7 +594,7 @@ void uiTemplatePathBuilder(uiLayout *layout, bContext *C, PointerRNA *ptr, char
row= uiLayoutRow(layout, 1);
/* Path (existing string) Widget */
- uiItemR(row, text, ICON_RNA, ptr, propname, 0);
+ uiItemR(row, ptr, propname, 0, text, ICON_RNA);
// TODO: attach something to this to make allow searching of nested properties to 'build' the path
}
@@ -609,9 +606,6 @@ void uiTemplatePathBuilder(uiLayout *layout, bContext *C, PointerRNA *ptr, char
#include <string.h>
#include "DNA_object_force.h"
-#include "DNA_object_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_scene_types.h"
#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
@@ -621,7 +615,6 @@ void uiTemplatePathBuilder(uiLayout *layout, bContext *C, PointerRNA *ptr, char
#include "BKE_particle.h"
#include "BKE_report.h"
-#include "UI_resources.h"
#include "ED_util.h"
#include "BLI_math.h"
@@ -728,7 +721,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
uiBlockSetEmboss(block, UI_EMBOSSN);
/* Open/Close ................................. */
- uiItemR(row, "", 0, &ptr, "expanded", 0);
+ uiItemR(row, &ptr, "expanded", 0, "", 0);
/* modifier-type icon */
uiItemL(row, "", RNA_struct_ui_icon(ptr.type));
@@ -748,7 +741,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
block = uiLayoutGetBlock(row);
/* modifier name */
- uiItemR(row, "", 0, &ptr, "name", 0);
+ uiItemR(row, &ptr, "name", 0, "", 0);
if (compact) {
/* insert delete button at end of top row before splitting to second line */
@@ -770,11 +763,11 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
if ( ((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect))
&& (md->type!=eModifierType_Surface) )
{
- uiItemR(row, "", 0, &ptr, "render", 0);
- uiItemR(row, "", 0, &ptr, "realtime", 0);
+ uiItemR(row, &ptr, "render", 0, "", 0);
+ uiItemR(row, &ptr, "realtime", 0, "", 0);
if (mti->flags & eModifierTypeFlag_SupportsEditmode)
- uiItemR(row, "", 0, &ptr, "editmode", 0);
+ uiItemR(row, &ptr, "editmode", 0, "", 0);
}
if ((ob->type==OB_MESH) && modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
{
@@ -812,9 +805,9 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
uiBlockSetButLock(block, object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
if (md->type==eModifierType_ParticleSystem) {
- ParticleSystem *psys= ((ParticleSystemModifierData *)md)->psys;
+ ParticleSystem *psys= ((ParticleSystemModifierData *)md)->psys;
- if (!(ob->mode & OB_MODE_PARTICLE_EDIT) && psys->pathcache) {
+ if (!(ob->mode & OB_MODE_PARTICLE_EDIT) && psys->pathcache) {
if(ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB))
uiItemO(row, "Convert", 0, "OBJECT_OT_duplicates_make_real");
else if(psys->part->ren_as == PART_DRAW_PATH)
@@ -822,10 +815,10 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
}
}
else {
- uiItemEnumO(row, "Apply", 0, "OBJECT_OT_modifier_apply", "apply_as", MODIFIER_APPLY_DATA);
+ uiItemEnumO(row, "OBJECT_OT_modifier_apply", "Apply", 0, "apply_as", MODIFIER_APPLY_DATA);
if (modifier_sameTopology(md))
- uiItemEnumO(row, "Apply as Shape", 0, "OBJECT_OT_modifier_apply", "apply_as", MODIFIER_APPLY_SHAPE);
+ uiItemEnumO(row, "OBJECT_OT_modifier_apply", "Apply as Shape", 0, "apply_as", MODIFIER_APPLY_SHAPE);
}
uiBlockClearButLock(block);
@@ -891,7 +884,6 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr, int
/************************ Constraint Template *************************/
-#include "DNA_action_types.h"
#include "DNA_constraint_types.h"
#include "BKE_action.h"
@@ -1074,7 +1066,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20;
/* open/close */
- uiItemR(subrow, "", 0, &ptr, "expanded", UI_ITEM_R_ICON_ONLY);
+ uiItemR(subrow, &ptr, "expanded", UI_ITEM_R_ICON_ONLY, "", 0);
/* name */
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -1085,7 +1077,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
if(proxy_protected == 0) {
- uiItemR(subrow, "", 0, &ptr, "name", 0);
+ uiItemR(subrow, &ptr, "name", 0, "", 0);
}
else
uiItemL(subrow, con->name, 0);
@@ -1176,8 +1168,8 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
/* do the scripts menu */
/* XXX menustr = buildmenu_pyconstraints(data->text, &pyconindex);
but2 = uiDefButI(block, MENU, B_CONSTRAINT_TEST, menustr,
- xco+120, yco-24, 150, 20, &pyconindex,
- 0, 0, 0, 0, "Set the Script Constraint to use");
+ xco+120, yco-24, 150, 20, &pyconindex,
+ 0, 0, 0, 0, "Set the Script Constraint to use");
uiButSetFunc(but2, validate_pyconstraint_cb, data, &pyconindex);
MEM_freeN(menustr); */
@@ -1494,8 +1486,8 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
PointerRNA ptr;
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
row= uiLayoutRow(layout, 0);
- uiItemR(row, "Pos", 0, &ptr, "position", 0);
- uiItemR(row, "", 0, &ptr, "color", 0);
+ uiItemR(row, &ptr, "position", 0, "Pos", 0);
+ uiItemR(row, &ptr, "color", 0, "", 0);
}
}
@@ -1517,7 +1509,7 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
CBData *cbd= coba->data + coba->cur;
PointerRNA ptr;
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
- uiItemR(layout, "", 0, &ptr, "color", 0);
+ uiItemR(layout, &ptr, "color", 0, "", 0);
}
bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
@@ -1922,8 +1914,8 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
/* black/white levels */
if(levels) {
split= uiLayoutSplit(layout, 0, 0);
- uiItemR(uiLayoutColumn(split, 0), NULL, 0, ptr, "black_level", UI_ITEM_R_EXPAND);
- uiItemR(uiLayoutColumn(split, 0), NULL, 0, ptr, "white_level", UI_ITEM_R_EXPAND);
+ uiItemR(uiLayoutColumn(split, 0), ptr, "black_level", UI_ITEM_R_EXPAND, NULL, 0);
+ uiItemR(uiLayoutColumn(split, 0), ptr, "white_level", UI_ITEM_R_EXPAND, NULL, 0);
uiLayoutRow(layout, 0);
bt=uiDefBut(block, BUT, 0, "Reset", 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Reset Black/White point and curves");
@@ -2012,9 +2004,9 @@ void uiTemplateTriColorSet(uiLayout *layout, PointerRNA *ptr, char *propname)
/* nselected, selected, active color swatches */
csPtr= RNA_property_pointer_get(ptr, prop);
- uiItemR(row, "", 0, &csPtr, "normal", 0);
- uiItemR(row, "", 0, &csPtr, "selected", 0);
- uiItemR(row, "", 0, &csPtr, "active", 0);
+ uiItemR(row, &csPtr, "normal", 0, "", 0);
+ uiItemR(row, &csPtr, "selected", 0, "", 0);
+ uiItemR(row, &csPtr, "active", 0, "", 0);
}
/********************* Layer Buttons Template ************************/
@@ -2043,7 +2035,7 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
// the array of layer bitflags
void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname,
- PointerRNA *used_ptr, char *used_propname, int active_layer)
+ PointerRNA *used_ptr, char *used_propname, int active_layer)
{
uiLayout *uRow, *uCol;
PropertyRNA *prop, *used_prop= NULL;
@@ -2205,11 +2197,11 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
uiBlockSetEmboss(block, UI_EMBOSSN);
row= uiLayoutRow(split, 1);
if(i == 0) uiItemL(row, "", 0);
- else uiItemR(row, "", 0, itemptr, "value", 0);
+ else uiItemR(row, itemptr, "value", 0, "", 0);
if(ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH))
uiLayoutSetActive(row, 0);
- //uiItemR(row, "", ICON_MUTE_IPO_OFF, itemptr, "mute", 0);
+ //uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
uiBlockSetEmboss(block, UI_EMBOSS);
}
else
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index c9024704b5e..37278340275 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -37,8 +37,6 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "WM_api.h"
-#include "WM_types.h"
/*************************** RNA Utilities ******************************/
@@ -159,7 +157,7 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int
else
col= NULL;
- uiItemFullR(col, "", 0, ptr, prop, -1, 0, 0);
+ uiItemFullR(col, ptr, prop, -1, 0, 0, "", 0);
}
RNA_STRUCT_END;
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index e02a8f53a4e..465a58fe5b8 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -30,10 +30,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_ID.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
@@ -53,26 +51,22 @@
#include "UI_interface.h"
#include "UI_interface_icons.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-#include "ED_util.h"
-#include "ED_types.h"
#include "interface_intern.h"
/* ************** widget base functions ************** */
/*
- - in: roundbox codes for corner types and radius
- - return: array of [size][2][x,y] points, the edges of the roundbox, + UV coords
+ - in: roundbox codes for corner types and radius
+ - return: array of [size][2][x,y] points, the edges of the roundbox, + UV coords
- - draw black box with alpha 0 on exact button boundbox
- - for ever AA step:
- - draw the inner part for a round filled box, with color blend codes or texture coords
- - draw outline in outline color
- - draw outer part, bottom half, extruded 1 pixel to bottom, for emboss shadow
- - draw extra decorations
- - draw background color box with alpha 1 on exact button boundbox
+ - draw black box with alpha 0 on exact button boundbox
+ - for ever AA step:
+ - draw the inner part for a round filled box, with color blend codes or texture coords
+ - draw outline in outline color
+ - draw outer part, bottom half, extruded 1 pixel to bottom, for emboss shadow
+ - draw extra decorations
+ - draw background color box with alpha 1 on exact button boundbox
*/
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index fb44685ceff..aa26517ea25 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -42,7 +42,6 @@
#include "DNA_curve_types.h"
-#include "DNA_listBase.h"
#include "DNA_userdef_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@@ -50,8 +49,6 @@
#include "BLI_blenlib.h"
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
@@ -62,7 +59,6 @@
#include "BIF_gl.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_interface_icons.h"
#include "interface_intern.h"
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 2bdf1ea4c88..d41317f7078 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -33,10 +33,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_view2d_types.h"
#include "BLI_blenlib.h"
@@ -55,7 +52,6 @@
#include "ED_screen.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
#include "interface_intern.h"
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 1dc4f52a696..135ace39581 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -29,12 +29,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_view2d_types.h"
#include "BLI_blenlib.h"
@@ -51,7 +46,6 @@
#include "ED_screen.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
static int view2d_poll(bContext *C)
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index e83be1f4f1d..7d47473e739 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -40,14 +40,9 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
#include "BKE_brush.h"
#include "BKE_customdata.h"
@@ -65,7 +60,6 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "GPU_draw.h"
#ifndef DISABLE_PYTHON
//#include "BPY_extern.h"
@@ -74,7 +68,6 @@
#include "ED_mesh.h"
#include "ED_screen.h"
-#include "ED_object.h"
#include "ED_view3d.h"
#include "WM_api.h"
@@ -744,7 +737,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
for (a=0, med=me->medge; a<me->totedge; a++, med++)
if (BLI_edgehash_haskey(ehash1, med->v1, med->v2) &&
- BLI_edgehash_haskey(ehash2, med->v1, med->v2))
+ BLI_edgehash_haskey(ehash2, med->v1, med->v2))
med->flag |= ME_SEAM;
BLI_edgehash_free(ehash1, NULL);
diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c
index ce65529e3dd..74558d13a52 100644
--- a/source/blender/editors/mesh/editmesh.c
+++ b/source/blender/editors/mesh/editmesh.c
@@ -32,21 +32,8 @@
#include "MEM_guardedalloc.h"
-#include "PIL_time.h"
-
-#include "DNA_customdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_screen_types.h"
+
#include "DNA_key_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_material_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index de4230b8891..e059145393a 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -34,17 +34,10 @@
#include "MEM_guardedalloc.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
-#include "RNA_types.h"
#include "RNA_define.h"
#include "RNA_access.h"
@@ -65,10 +58,8 @@
#include "WM_types.h"
#include "ED_mesh.h"
-#include "ED_retopo.h"
#include "ED_screen.h"
#include "ED_transform.h"
-#include "ED_util.h"
#include "ED_view3d.h"
#include "ED_object.h"
diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c
index 06d9301072e..90d720e9c18 100644
--- a/source/blender/editors/mesh/editmesh_lib.c
+++ b/source/blender/editors/mesh/editmesh_lib.c
@@ -39,12 +39,10 @@ editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data
#include "MEM_guardedalloc.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -522,9 +520,9 @@ void EM_set_flag_all(EditMesh *em, int flag)
void EM_set_flag_all_selectmode(EditMesh *em, int flag)
{
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
+ EditVert *eve;
+ EditEdge *eed;
+ EditFace *efa;
int selvert= 0, seledge= 0, selface= 0;
@@ -582,7 +580,7 @@ void EM_set_flag_all_selectmode(EditMesh *em, int flag)
em->totvertsel= selvert;
em->totedgesel= seledge;
em->totfacesel= selface;
- }
+ }
}
/* flush for changes in vertices only */
void EM_deselect_flush(EditMesh *em)
@@ -1655,7 +1653,7 @@ short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float *nor, int
/* if del_old==1 then extrude is in partial geometry, to keep it manifold.
verts with f1==0 and (eve->f & 128)==0) are removed
- edges with eed->f2>2 are removed
+ edges with eed->f2>2 are removed
faces with efa->f1 are removed
if del_old==0 the extrude creates a volume.
*/
diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c
index f2a099ca6a5..05ce7d8c5cb 100644
--- a/source/blender/editors/mesh/editmesh_loop.c
+++ b/source/blender/editors/mesh/editmesh_loop.c
@@ -40,13 +40,9 @@ editmesh_loop: tools with own drawing subloops, select, knife, subdiv
#include "MEM_guardedalloc.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -74,7 +70,6 @@ editmesh_loop: tools with own drawing subloops, select, knife, subdiv
#include "WM_types.h"
#include "ED_mesh.h"
-#include "ED_screen.h"
#include "ED_view3d.h"
#include "mesh_intern.h"
@@ -231,7 +226,7 @@ void CutEdgeloop(Object *obedit, wmOperator *op, EditMesh *em, int numcuts)
// scrarea_do_windraw(curarea); // after findnearestedge, backbuf!
sprintf(msg,"Number of Cuts: %d (S)mooth: ",numcuts);
- strcat(msg, smooth ? "on":"off");
+ strcat(msg, smooth ? "on":"off");
// headerprint(msg);
/* Need to figure preview */
@@ -444,10 +439,10 @@ typedef struct CutCurve {
Contributed by Robert Wenzlaff (Det. Thorn).
- 2.5 revamp:
- - non modal (no menu before cutting)
- - exit on mouse release
- - polygon/segment drawing can become handled by WM cb later
+ 2.5 revamp:
+ - non modal (no menu before cutting)
+ - exit on mouse release
+ - polygon/segment drawing can become handled by WM cb later
*/
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index d0201f1c6ab..06e8b118495 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -41,16 +41,11 @@ editmesh_mods.c, UI level access, no geometry changes
-#include "DNA_mesh_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
-#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -78,11 +73,9 @@ editmesh_mods.c, UI level access, no geometry changes
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_enum_types.h"
#include "ED_mesh.h"
#include "ED_screen.h"
@@ -292,7 +285,7 @@ int EM_mask_init_backbuf_border(ViewContext *vc, short mcords[][2], short tot, s
/* yah, opengl doesn't do concave... tsk! */
ED_region_pixelspace(vc->ar);
- draw_triangulated(mcords, tot);
+ draw_triangulated(mcords, tot);
glBegin(GL_LINE_LOOP); /* for zero sized masks, lines */
for(a=0; a<tot; a++) glVertex2s(mcords[a][0], mcords[a][1]);
@@ -794,7 +787,7 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode)
MTFace *tf, *base_tf;
base_tf = (MTFace*)CustomData_em_get(&em->fdata, base_efa->data,
- CD_MTFACE);
+ CD_MTFACE);
if(!base_tf)
return selcount;
@@ -802,7 +795,7 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode)
for(efa= em->faces.first; efa; efa= efa->next) {
if (!(efa->f & SELECT) && !efa->h) {
tf = (MTFace*)CustomData_em_get(&em->fdata, efa->data,
- CD_MTFACE);
+ CD_MTFACE);
if(base_tf->tpage == tf->tpage) {
EM_select_face(efa, 1);
@@ -1318,7 +1311,7 @@ void MESH_OT_select_similar(wmOperatorType *ot)
int mesh_layers_menu_charlen(CustomData *data, int type)
{
- int i, len = 0;
+ int i, len = 0;
/* see if there is a duplicate */
for(i=0; i<data->totlayer; i++) {
if((&data->layers[i])->type == type) {
@@ -1972,7 +1965,7 @@ static void edgering_select(EditMesh *em, EditEdge *startedge, int select)
/* (de)select the edges */
for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f2) EM_select_edge(eed, select);
+ if(eed->f2) EM_select_edge(eed, select);
}
}
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 2fa6acf8d00..a4a25a6ad52 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -38,22 +38,15 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise
#include <float.h>
#include "MEM_guardedalloc.h"
-#include "PIL_time.h"
#include "BLO_sys_types.h" // for intptr_t support
-#include "DNA_mesh_types.h"
-#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
#include "DNA_key_types.h"
-#include "DNA_windowmanager_types.h"
-#include "RNA_types.h"
#include "RNA_define.h"
#include "RNA_access.h"
@@ -86,10 +79,8 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise
#include "ED_mesh.h"
#include "ED_screen.h"
#include "ED_transform.h"
-#include "ED_util.h"
#include "ED_view3d.h"
-#include "UI_interface.h"
#include "mesh_intern.h"
@@ -1599,16 +1590,16 @@ static void fill_quad_single(EditMesh *em, EditFace *efa, struct GHash *gh, int
hold = addfacelist(em, verts[i],verts[i+1],v[right],NULL,NULL,NULL);
facecopy(em, efa,hold);
if(i+1 != (vertsize-1)/2) {
- if(seltype == SUBDIV_SELECT_INNER) {
- hold->e2->f2 |= EDGEINNER;
- }
+ if(seltype == SUBDIV_SELECT_INNER) {
+ hold->e2->f2 |= EDGEINNER;
+ }
}
hold = addfacelist(em, verts[vertsize-2-i],verts[vertsize-1-i],v[left],NULL,NULL,NULL);
facecopy(em, efa,hold);
if(i+1 != (vertsize-1)/2) {
- if(seltype == SUBDIV_SELECT_INNER) {
- hold->e3->f2 |= EDGEINNER;
- }
+ if(seltype == SUBDIV_SELECT_INNER) {
+ hold->e3->f2 |= EDGEINNER;
+ }
}
}
}
@@ -1675,9 +1666,9 @@ static void fill_tri_single(EditMesh *em, EditFace *efa, struct GHash *gh, int n
for(i=0;i<(vertsize-1);i++) {
hold = addfacelist(em, verts[i],verts[i+1],v[op],NULL,NULL,NULL);
if(i+1 != vertsize-1) {
- if(seltype == SUBDIV_SELECT_INNER) {
- hold->e2->f2 |= EDGEINNER;
- }
+ if(seltype == SUBDIV_SELECT_INNER) {
+ hold->e2->f2 |= EDGEINNER;
+ }
}
facecopy(em, efa,hold);
}
@@ -2265,7 +2256,7 @@ static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, i
0|---*---*---|0
| |
1* *1
- 2 | | 4
+ 2 | | 4
2* *2
| |
3|---*---*---|3
@@ -3587,7 +3578,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir)
return;
/* how many edges does each face have */
- if(face[0]->e4) fac1= 4;
+ if(face[0]->e4) fac1= 4;
else fac1= 3;
if(face[1]->e4) fac2= 4;
@@ -3641,11 +3632,11 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir)
hiddenedges = MEM_mallocN(sizeof(EditVert*)*numhidden+1, "RotateEdgeHiddenVerts");
if(!hiddenedges) {
- BKE_report(op->reports, RPT_ERROR, "Memory allocation failed");
- return;
- }
+ BKE_report(op->reports, RPT_ERROR, "Memory allocation failed");
+ return;
+ }
- numhidden = 0;
+ numhidden = 0;
for(srchedge=em->edges.first; srchedge; srchedge=srchedge->next)
if(srchedge->h && (srchedge->v1->f & SELECT || srchedge->v2->f & SELECT))
hiddenedges[numhidden++] = srchedge;
@@ -4609,7 +4600,7 @@ useless:
mvalo[0] = -1;
} else if(ELEM(event, RIGHTARROWKEY, WHEELUPMOUSE)) { // Scroll through Control Edges
look = vertlist;
- while(look) {
+ while(look) {
if(nearest == (EditVert*)look->link) {
if(look->next == NULL) {
nearest = (EditVert*)vertlist->link;
@@ -4623,7 +4614,7 @@ useless:
}
} else if(ELEM(event, LEFTARROWKEY, WHEELDOWNMOUSE)) { // Scroll through Control Edges
look = vertlist;
- while(look) {
+ while(look) {
if(look->next) {
if(look->next->link == nearest) {
nearest = (EditVert*)look->link;
@@ -4761,7 +4752,7 @@ void mesh_set_face_flags(EditMesh *em, short mode)
add_numbut(12, TOG|SHO, "Sort", 0, 0, &m_sort, NULL);
if (!do_clever_numbuts((mode ? "Set Flags" : "Clear Flags"), 13, REDRAW))
- return;
+ return;
/* these 2 cant both be on */
if (mode) /* are we seeting*/
@@ -5970,7 +5961,7 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op)
PathNode *currpn;
PathNode *Q;
int v, *previous, pathvert, pnindex; /*pnindex redundant?*/
- int unbalanced, totnodes;
+ int unbalanced, totnodes;
short physical;
float *cost;
Heap *heap; /*binary heap for sorting pointers to PathNodes based upon a 'cost'*/
diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c
index 1a37832d0cd..8e9e55dbd92 100644
--- a/source/blender/editors/mesh/loopcut.c
+++ b/source/blender/editors/mesh/loopcut.c
@@ -69,7 +69,6 @@
#include "RNA_define.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 2db229e8325..70352e9399f 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -32,14 +32,11 @@
#include "MEM_guardedalloc.h"
-#include "DNA_customdata_types.h"
#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
@@ -202,7 +199,7 @@ int ED_mesh_uv_texture_remove(bContext *C, Object *ob, Mesh *me)
CustomDataLayer *cdl;
int index;
- index= CustomData_get_active_layer_index(data, CD_MTFACE);
+ index= CustomData_get_active_layer_index(data, CD_MTFACE);
cdl= (index == -1) ? NULL: &data->layers[index];
if(!cdl)
@@ -262,7 +259,7 @@ int ED_mesh_color_remove(bContext *C, Object *ob, Mesh *me)
CustomDataLayer *cdl;
int index;
- index= CustomData_get_active_layer_index(data, CD_MCOL);
+ index= CustomData_get_active_layer_index(data, CD_MCOL);
cdl= (index == -1)? NULL: &data->layers[index];
if(!cdl)
@@ -569,7 +566,7 @@ static void mesh_calc_edges(Mesh *mesh, int update)
ehi = BLI_edgehashIterator_new(eh);
med = CustomData_get_layer(&edata, CD_MEDGE);
for(i = 0; !BLI_edgehashIterator_isDone(ehi);
- BLI_edgehashIterator_step(ehi), ++i, ++med) {
+ BLI_edgehashIterator_step(ehi), ++i, ++med) {
if(update && (med_orig=BLI_edgehashIterator_getValue(ehi))) {
*med= *med_orig; /* copy from the original */
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index 34577b7349e..5b187b10b7d 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -33,11 +33,6 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -49,18 +44,14 @@
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
-#include "ED_transform.h"
#include "ED_view3d.h"
-#include "UI_interface.h"
#include "mesh_intern.h"
@@ -274,8 +265,8 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0);
- WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_SHIFT, 0);
- WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index df67868d2ad..3d09880de8f 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -39,18 +39,12 @@
#include "MEM_guardedalloc.h"
-#include "DNA_image_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
-#include "DNA_world_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -684,7 +678,7 @@ void sort_faces(Scene *scene, View3D *v3d)
/* sort index list instead of faces itself
and apply this permutation to all face layers */
- if (event == 5) {
+ if (event == 5) {
/* Random */
for(i=0; i<me->totface; i++) {
face_sort_floats[i] = BLI_frand();
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index 69de645e4be..961968959ff 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -43,9 +43,6 @@
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
-#include "DNA_userdef_types.h"
#include "RNA_define.h"
#include "RNA_access.h"
@@ -206,7 +203,7 @@ void MBALL_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select/Deselect All";
- ot->description= "Change selection of all meta elements";
+ ot->description= "Change selection of all meta elements";
ot->idname= "MBALL_OT_select_all";
/* callback functions */
@@ -247,7 +244,7 @@ void MBALL_OT_select_inverse_metaelems(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Inverse";
- ot->description= "Select inverse of (un)selected metaelements";
+ ot->description= "Select inverse of (un)selected metaelements";
ot->idname= "MBALL_OT_select_inverse_metaelems";
/* callback functions */
@@ -293,7 +290,7 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot)
{
/* identifiers */
ot->name= "Random...";
- ot->description= "Randomly select metaelements";
+ ot->description= "Randomly select metaelements";
ot->idname= "MBALL_OT_select_random_metaelems";
/* callback functions */
@@ -352,7 +349,7 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Duplicate";
- ot->description= "Delete selected metaelement(s)";
+ ot->description= "Delete selected metaelement(s)";
ot->idname= "MBALL_OT_duplicate_metaelems";
/* callback functions */
@@ -398,7 +395,7 @@ void MBALL_OT_delete_metaelems(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
- ot->description= "Delete selected metaelement(s)";
+ ot->description= "Delete selected metaelement(s)";
ot->idname= "MBALL_OT_delete_metaelems";
/* callback functions */
@@ -448,7 +445,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Hide";
- ot->description= "Hide (un)selected metaelement(s)";
+ ot->description= "Hide (un)selected metaelement(s)";
ot->idname= "MBALL_OT_hide_metaelems";
/* callback functions */
@@ -489,7 +486,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Reveal";
- ot->description= "Reveal all hidden metaelements";
+ ot->description= "Reveal all hidden metaelements";
ot->idname= "MBALL_OT_reveal_metaelems";
/* callback functions */
diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c
index 9b8cccbbfce..14402d7dae6 100644
--- a/source/blender/editors/metaball/mball_ops.c
+++ b/source/blender/editors/metaball/mball_ops.c
@@ -31,8 +31,6 @@
#include "RNA_access.h"
-#include "DNA_listBase.h"
-#include "DNA_windowmanager_types.h"
#include "ED_screen.h"
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 484a67b94db..921a56142d4 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -30,7 +30,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_curve_types.h"
#include "DNA_group_types.h"
#include "DNA_lamp_types.h"
@@ -38,12 +37,8 @@
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_object_fluidsim.h"
-#include "DNA_object_types.h"
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
#include "DNA_vfont_types.h"
#include "BLI_math.h"
@@ -83,7 +78,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_mball.h"
@@ -968,7 +962,7 @@ void OBJECT_OT_delete(wmOperatorType *ot)
/**************************** Copy Utilities ******************************/
static void copy_object__forwardModifierLinks(void *userData, Object *ob,
- ID **idpoin)
+ ID **idpoin)
{
/* this is copied from ID_NEW; it might be better to have a macro */
if(*idpoin && (*idpoin)->newid) *idpoin = (*idpoin)->newid;
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 1c8b71f5e44..8d5268bcb79 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -35,7 +35,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_image_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 045ff3d5620..38d560c5c8e 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -36,15 +36,10 @@
#include "BLI_math.h"
#include "BLI_dynstr.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "DNA_text_types.h"
-#include "DNA_view3d_types.h"
#include "BKE_action.h"
#include "BKE_armature.h"
@@ -68,9 +63,7 @@
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
-#include "RNA_types.h"
-#include "ED_object.h"
#include "ED_screen.h"
#include "UI_interface.h"
@@ -644,7 +637,7 @@ void ED_object_constraint_dependency_update(Scene *scene, Object *ob)
ED_object_constraint_update(ob);
if(ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
- DAG_scene_sort(scene);
+ DAG_scene_sort(scene);
}
static int constraint_poll(bContext *C)
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 65e8fbeeb8f..976990deda8 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -35,36 +35,14 @@
#include "IMB_imbuf_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_constraint_types.h"
#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
#include "DNA_group_types.h"
-#include "DNA_image_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_meta_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_object_force.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_particle_types.h"
#include "DNA_property_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
#include "DNA_vfont_types.h"
-#include "DNA_world_types.h"
-#include "DNA_modifier_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -113,28 +91,20 @@
#include "BKE_utildefines.h"
#include "BKE_modifier.h"
-#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_curve.h"
-#include "ED_particle.h"
#include "ED_mesh.h"
#include "ED_mball.h"
#include "ED_object.h"
#include "ED_screen.h"
-#include "ED_transform.h"
-#include "ED_types.h"
#include "ED_util.h"
-#include "ED_view3d.h"
-#include "UI_interface.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
/* for menu/popup icons etc etc*/
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -418,7 +388,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
else if(ob->type==OB_FONT) {
scene->obedit= ob; // XXX for context
ok= 1;
- make_editText(ob);
+ make_editText(ob);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_TEXT, scene);
}
@@ -476,9 +446,9 @@ static int editmode_toggle_poll(bContext *C)
return 0;
return ob && (ob->type == OB_MESH || ob->type == OB_ARMATURE ||
- ob->type == OB_FONT || ob->type == OB_MBALL ||
- ob->type == OB_LATTICE || ob->type == OB_SURF ||
- ob->type == OB_CURVE);
+ ob->type == OB_FONT || ob->type == OB_MBALL ||
+ ob->type == OB_LATTICE || ob->type == OB_SURF ||
+ ob->type == OB_CURVE);
}
void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
@@ -1932,12 +1902,12 @@ static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *ptr, in
ob = CTX_data_active_object(C);
while(ob && input->identifier) {
if((input->value == OB_MODE_EDIT && ((ob->type == OB_MESH) || (ob->type == OB_ARMATURE) ||
- (ob->type == OB_CURVE) || (ob->type == OB_SURF) ||
- (ob->type == OB_FONT) || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) ||
+ (ob->type == OB_CURVE) || (ob->type == OB_SURF) ||
+ (ob->type == OB_FONT) || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) ||
(input->value == OB_MODE_POSE && (ob->type == OB_ARMATURE)) ||
(input->value == OB_MODE_PARTICLE_EDIT && ob->particlesystem.first) ||
((input->value == OB_MODE_SCULPT || input->value == OB_MODE_VERTEX_PAINT ||
- input->value == OB_MODE_WEIGHT_PAINT || input->value == OB_MODE_TEXTURE_PAINT) && (ob->type == OB_MESH)) ||
+ input->value == OB_MODE_WEIGHT_PAINT || input->value == OB_MODE_TEXTURE_PAINT) && (ob->type == OB_MESH)) ||
(input->value == OB_MODE_OBJECT))
RNA_enum_item_add(&item, &totitem, input);
++input;
@@ -2119,16 +2089,16 @@ static int game_property_remove(bContext *C, wmOperator *op)
index = RNA_int_get(op->ptr, "index");
- prop= BLI_findlink(&ob->prop, index);
+ prop= BLI_findlink(&ob->prop, index);
- if(prop) {
+ if(prop) {
BLI_remlink(&ob->prop, prop);
free_property(prop);
return OPERATOR_FINISHED;
- }
- else {
- return OPERATOR_CANCELLED;
- }
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
}
void OBJECT_OT_game_property_remove(wmOperatorType *ot)
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index fef292ee794..37a04471ec5 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -35,16 +35,11 @@
#include "BLI_listbase.h"
#include "BLI_string.h"
-#include "DNA_action_types.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_action.h"
#include "BKE_context.h"
@@ -62,14 +57,11 @@
#include "ED_curve.h"
#include "ED_mesh.h"
-#include "ED_object.h"
-#include "ED_view3d.h"
#include "ED_screen.h"
#include "WM_types.h"
#include "WM_api.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "object_intern.h"
diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c
index 80c0e7e557b..52f779748fa 100644
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@ -47,7 +47,6 @@
#include "BKE_mesh.h"
#include "BKE_utildefines.h"
-#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_util.h"
@@ -228,7 +227,7 @@ void LATTICE_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select or Deselect All";
- ot->description= "Change selection of all UVW control points";
+ ot->description= "Change selection of all UVW control points";
ot->idname= "LATTICE_OT_select_all";
/* api callbacks */
@@ -276,7 +275,7 @@ void LATTICE_OT_make_regular(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Make Regular";
- ot->description= "Set UVW control points a uniform distance apart";
+ ot->description= "Set UVW control points a uniform distance apart";
ot->idname= "LATTICE_OT_make_regular";
/* api callbacks */
@@ -389,8 +388,8 @@ static int validate_undoLatt(void *data, void *edata)
Lattice *editlatt= (Lattice *)edata;
return (ult->pntsu == editlatt->pntsu &&
- ult->pntsv == editlatt->pntsv &&
- ult->pntsw == editlatt->pntsw);
+ ult->pntsv == editlatt->pntsv &&
+ ult->pntsw == editlatt->pntsw);
}
static void *get_editlatt(bContext *C)
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 8f7f3806bbd..8150bd9b84f 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -31,13 +31,10 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
@@ -178,13 +175,13 @@ int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, Mod
if(ob->pd)
ob->pd->deflect= 0;
- DAG_scene_sort(scene);
+ DAG_scene_sort(scene);
}
else if(md->type == eModifierType_Surface) {
if(ob->pd && ob->pd->shape == PFIELD_SHAPE_SURFACE)
ob->pd->shape = PFIELD_SHAPE_PLANE;
- DAG_scene_sort(scene);
+ DAG_scene_sort(scene);
}
else if(md->type == eModifierType_Smoke) {
ob->dt = OB_TEXTURE;
@@ -502,7 +499,7 @@ static int modifier_poll(bContext *C)
static int modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- Object *ob = CTX_data_active_object(C);
+ Object *ob = CTX_data_active_object(C);
int type= RNA_enum_get(op->ptr, "type");
if(!ED_object_modifier_add(op->reports, scene, ob, NULL, type))
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index bbc5bcd8035..8ec33f676ca 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -33,11 +33,6 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -342,6 +337,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
// XXX this should probably be in screen instead... here for testing purposes in the meantime... - Aligorith
WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_insert_menu", IKEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_delete_v3d", IKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_verify_item(keymap, "ANIM_OT_keying_set_active_set", IKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0);
WM_keymap_verify_item(keymap, "GROUP_OT_create", GKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_verify_item(keymap, "GROUP_OT_objects_remove", GKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 94eae2a7ab9..e89bde00ce7 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -32,20 +32,14 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
#include "DNA_group_types.h"
#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
#include "BLI_math.h"
@@ -86,7 +80,6 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
-#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_object.h"
@@ -286,7 +279,7 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt)
PointerRNA props_ptr;
/* create operator menu item with relevant properties filled in */
- props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+ props_ptr= uiItemFullO(layout, op->idname, op->type->name, 0, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
/* present the menu and be done... */
uiPupMenuEnd(C, pup);
@@ -679,23 +672,23 @@ static int parent_set_invoke(bContext *C, wmOperator *op, wmEvent *event)
uiLayout *layout= uiPupMenuLayout(pup);
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_OBJECT);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_OBJECT);
/* ob becomes parent, make the associated menus */
if(ob->type==OB_ARMATURE) {
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_ARMATURE);
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_ARMATURE_NAME);
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_ARMATURE_ENVELOPE);
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_ARMATURE_AUTO);
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_BONE);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE_NAME);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE_ENVELOPE);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_ARMATURE_AUTO);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_BONE);
}
else if(ob->type==OB_CURVE) {
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_CURVE);
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_FOLLOW);
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_PATH_CONST);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_CURVE);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_FOLLOW);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_PATH_CONST);
}
else if(ob->type == OB_LATTICE) {
- uiItemEnumO(layout, NULL, 0, "OBJECT_OT_parent_set", "type", PAR_LATTICE);
+ uiItemEnumO(layout, "OBJECT_OT_parent_set", NULL, 0, "type", PAR_LATTICE);
}
uiPupMenuEnd(C, pup);
@@ -1681,13 +1674,13 @@ static void single_mat_users_expand(void)
/* used for copying scenes */
void ED_object_single_users(Scene *scene, int full)
{
- single_object_users(scene, NULL, 0);
+ single_object_users(scene, NULL, 0);
- if(full) {
- single_obdata_users(scene, 0);
- single_mat_users_expand();
- single_tex_users_expand();
- }
+ if(full) {
+ single_obdata_users(scene, 0);
+ single_mat_users_expand();
+ single_tex_users_expand();
+ }
clear_id_newpoins();
}
@@ -1827,7 +1820,7 @@ static int make_single_user_exec(bContext *C, wmOperator *op)
int flag= RNA_enum_get(op->ptr, "type"); /* 0==ALL, SELECTED==selected objecs */
if(RNA_boolean_get(op->ptr, "object"))
- single_object_users(scene, v3d, flag);
+ single_object_users(scene, v3d, flag);
if(RNA_boolean_get(op->ptr, "obdata"))
single_obdata_users(scene, flag);
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index b3c104dcb56..a5a9bbdffdd 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -35,10 +35,8 @@
#include "DNA_group_types.h"
#include "DNA_material_types.h"
#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
#include "DNA_property_types.h"
#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
@@ -60,7 +58,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_object.h"
#include "ED_screen.h"
#include "RNA_access.h"
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index 3cf29cd3eaf..6735d07b591 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -39,19 +39,12 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "DNA_action_types.h"
#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view2d_types.h"
#include "BKE_action.h"
#include "BKE_anim.h"
@@ -69,7 +62,6 @@
#include "BLO_sys_types.h" // for intptr_t support
-#include "ED_object.h"
#include "ED_mesh.h"
#include "RNA_access.h"
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index ca6feabdf80..13b7f883922 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -29,16 +29,11 @@
#include <string.h>
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
#include "BLI_math.h"
#include "BLI_editVert.h"
@@ -60,12 +55,10 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_keyframing.h"
#include "ED_mesh.h"
-#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 8cdd57d2293..6c9b45a63cd 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -36,14 +36,12 @@
#include "DNA_cloth_types.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
#include "DNA_particle_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
@@ -68,9 +66,7 @@
#include "WM_types.h"
#include "ED_mesh.h"
-#include "ED_view3d.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "object_intern.h"
@@ -1285,7 +1281,7 @@ static void vgroup_assign_verts(Object *ob, float weight)
done=1;
break;
}
- }
+ }
/* If not: Add the group and set its weight */
if(!done){
newdw = MEM_callocN(sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight");
diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c
index 7fa35d8c8ee..37de0d8f873 100644
--- a/source/blender/editors/physics/particle_boids.c
+++ b/source/blender/editors/physics/particle_boids.c
@@ -29,9 +29,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_boid_types.h"
#include "DNA_particle_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_boids.h"
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 744ef285179..43fc4985d3d 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -36,15 +36,9 @@
#include "DNA_scene_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_force.h"
-#include "DNA_object_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_depsgraph.h"
@@ -66,7 +60,6 @@
#include "BLI_kdtree.h"
#include "BLI_rand.h"
-#include "PIL_time.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -75,7 +68,6 @@
#include "ED_particle.h"
#include "ED_view3d.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
@@ -2386,7 +2378,7 @@ static int weight_set_exec(bContext *C, wmOperator *op)
ParticleBrushData *brush= &pset->brush[pset->brushtype];
edit= psys->edit;
- weight= (float)(brush->strength / 100.0f);
+ weight= brush->strength;
LOOP_SELECTED_POINTS {
ParticleData *pa= psys->particles + p;
@@ -2510,6 +2502,8 @@ static int brush_radial_control_exec(bContext *C, wmOperator *op)
else if(mode == WM_RADIALCONTROL_STRENGTH)
brush->strength= new_value;
+ WM_event_add_notifier(C, NC_WINDOW, NULL);
+
return OPERATOR_FINISHED;
}
@@ -2944,7 +2938,7 @@ static void brush_puff(PEData *data, int point_index)
VECCOPY(co, key->co);
mul_m4_v3(mat, co);
length += len_v3v3(lastco, co);
- if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE)) {
+ if((data->select==0 || (key->flag & PEK_SELECT)) && !(key->flag & PEK_HIDE)) {
VECADDFAC(kco, rootco, nor, length);
/* blend between the current and straight position */
@@ -3359,7 +3353,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
data.mval= mval;
data.rad= (float)brush->size;
- data.combfac= (float)(brush->strength - 50) / 50.0f;
+ data.combfac= (brush->strength - 0.5f) * 2.0f;
if(data.combfac < 0.0f)
data.combfac= 1.0f - 9.0f * data.combfac;
else
@@ -3381,7 +3375,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
PE_set_view3d_data(C, &data);
data.mval= mval;
data.rad= (float)brush->size;
- data.cutfac= (float)(brush->strength / 100.0f);
+ data.cutfac= brush->strength;
if(selected)
foreach_selected_point(&data, brush_cut);
@@ -3405,7 +3399,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
data.mval= mval;
data.rad= (float)brush->size;
- data.growfac= (float)brush->strength / 5000.0f;
+ data.growfac= brush->strength / 50.0f;
if(brush->invert ^ flip)
data.growfac= 1.0f - data.growfac;
@@ -3427,8 +3421,9 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
data.dm= psmd->dm;
data.mval= mval;
data.rad= (float)brush->size;
+ data.select= selected;
- data.pufffac= (float)(brush->strength - 50) / 50.0f;
+ data.pufffac= (brush->strength - 0.5f) * 2.0f;
if(data.pufffac < 0.0f)
data.pufffac= 1.0f - 9.0f * data.pufffac;
else
@@ -3449,7 +3444,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
PE_set_view3d_data(C, &data);
data.mval= mval;
- added= brush_add(&data, brush->strength);
+ added= brush_add(&data, brush->count);
if(pset->flag & PE_KEEP_LENGTHS)
recalc_lengths(edit);
@@ -3469,7 +3464,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
data.vec[0]= data.vec[1]= data.vec[2]= 0.0f;
data.tot= 0;
- data.smoothfac= (float)(brush->strength / 100.0f);
+ data.smoothfac= brush->strength;
invert_m4_m4(ob->imat, ob->obmat);
@@ -3492,7 +3487,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
data.mval= mval;
data.rad= (float)brush->size;
- data.weightfac = (float)(brush->strength / 100.0f); /* note that this will never be zero */
+ data.weightfac = brush->strength; /* note that this will never be zero */
foreach_mouse_hit_key(&data, brush_weight, selected);
}
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 049f09f9901..d8ca65fa8c9 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -32,10 +32,7 @@
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 191fe2bd388..6f5b8924a13 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -45,25 +45,17 @@
#include "MEM_guardedalloc.h"
/* types */
-#include "DNA_curve_types.h"
+#include "DNA_anim_types.h"
+#include "DNA_action_types.h"
#include "DNA_object_types.h"
#include "DNA_object_fluidsim.h"
-#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
#include "BLI_blenlib.h"
#include "BLI_threads.h"
#include "BLI_math.h"
+#include "BKE_animsys.h"
+#include "BKE_armature.h"
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
@@ -80,17 +72,15 @@
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_softbody.h"
+#include "BKE_unit.h"
-#include "PIL_time.h"
#include "LBM_fluidsim.h"
#include "BIF_gl.h"
-#include "ED_fluidsim.h"
#include "ED_screen.h"
-#include "WM_api.h"
#include "WM_types.h"
#include "physics_intern.h" // own include
@@ -98,77 +88,110 @@
/* enable/disable overall compilation */
#ifndef DISABLE_ELBEEM
-/* XXX */
-/* from header info.c */
-static int start_progress_bar(void) {return 0;};
-static void end_progress_bar(wmWindow *win) {WM_cursor_restore(win);};
-static void waitcursor(int val) {};
-static int progress_bar(wmWindow *win, float done, char *busy_info) { WM_timecursor(win,done*100); return 0;}
-static int pupmenu() {return 0;}
-/* XXX */
-
-
-double fluidsimViscosityPreset[6] = {
- -1.0, /* unused */
- -1.0, /* manual */
- 1.0e-6, /* water */
- 5.0e-5, /* some (thick) oil */
- 2.0e-3, /* ca. honey */
- -1.0 /* end */
-};
-
-char* fluidsimViscosityPresetString[6] = {
- "UNUSED", /* unused */
- "UNUSED", /* manual */
- " = 1.0 * 10^-6", /* water */
- " = 5.0 * 10^-5", /* some (thick) oil */
- " = 2.0 * 10^-3", /* ca. honey */
- "INVALID" /* end */
-};
+#include "WM_api.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_ipo_types.h"
+#include "DNA_mesh_types.h"
+
+#include "PIL_time.h"
+
+
+static float get_fluid_viscosity(FluidsimSettings *settings)
+{
+ switch (settings->viscosityMode) {
+ case 0: /* unused */
+ return -1.0;
+ case 2: /* water */
+ return 1.0e-6;
+ case 3: /* some (thick) oil */
+ return 5.0e-5;
+ case 4: /* ca. honey */
+ return 2.0e-3;
+ case 1: /* manual */
+ default:
+ return (1.0/pow(10.0, settings->viscosityExponent)) * settings->viscosityValue;
+ }
+}
+
+static void get_fluid_gravity(float *gravity, Scene *scene, FluidsimSettings *fss)
+{
+ if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
+ copy_v3_v3(gravity, scene->physics_settings.gravity);
+ } else {
+ copy_v3_v3(gravity, &fss->gravx);
+ }
+}
+
+static float get_fluid_size_m(Scene *scene, Object *domainob, FluidsimSettings *fss)
+{
+ if (!scene->unit.system) {
+ return fss->realsize;
+ } else {
+ float dim[3];
+ float longest_axis;
+
+ object_get_dimensions(domainob, dim);
+ longest_axis = MAX3(dim[0], dim[1], dim[2]);
+
+ return longest_axis * scene->unit.scale_length;
+ }
+}
+
+static int fluid_is_animated_mesh(FluidsimSettings *fss)
+{
+ return ((fss->type == OB_FLUIDSIM_CONTROL) || fss->domainNovecgen);
+}
/* ********************** fluid sim settings struct functions ********************** */
+#if 0
/* helper function */
void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname) {
//snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name);
snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name);
}
+#endif
-
-
-/* ******************************************************************************** */
/* ********************** fluid sim channel helper functions ********************** */
-/* ******************************************************************************** */
+
+typedef struct FluidAnimChannels {
+ int length;
+
+ double aniFrameTime;
+
+ float *timeAtFrame;
+ float *DomainTime;
+ float *DomainGravity;
+ float *DomainViscosity;
+} FluidAnimChannels;
+
+typedef struct FluidObject {
+ struct FluidObject *next, *prev;
+
+ struct Object *object;
+
+ float *Translation;
+ float *Rotation;
+ float *Scale;
+ float *Active;
+
+ float *InitialVelocity;
+
+ float *AttractforceStrength;
+ float *AttractforceRadius;
+ float *VelocityforceStrength;
+ float *VelocityforceRadius;
+
+ float *VertexCache;
+ int numVerts, numTris;
+} FluidObject;
// no. of entries for the two channel sizes
#define CHANNEL_FLOAT 1
#define CHANNEL_VEC 3
-#define FS_FREE_ONECHANNEL(c,str) { \
- if(c){ MEM_freeN(c); c=NULL; } \
-} // end ONE CHANN, debug: fprintf(stderr,"freeing " str " \n");
-
-#define FS_FREE_CHANNELS { \
- FS_FREE_ONECHANNEL(timeAtIndex,"timeAtIndex");\
- FS_FREE_ONECHANNEL(timeAtFrame,"timeAtFrame");\
- FS_FREE_ONECHANNEL(channelDomainTime,"channelDomainTime"); \
- FS_FREE_ONECHANNEL(channelDomainGravity,"channelDomainGravity");\
- FS_FREE_ONECHANNEL(channelDomainViscosity,"channelDomainViscosity");\
- for(i=0;i<256;i++) { \
- FS_FREE_ONECHANNEL(channelObjMove[i][0],"channelObjMove0"); \
- FS_FREE_ONECHANNEL(channelObjMove[i][1],"channelObjMove1"); \
- FS_FREE_ONECHANNEL(channelObjMove[i][2],"channelObjMove2"); \
- FS_FREE_ONECHANNEL(channelObjInivel[i],"channelObjInivel"); \
- FS_FREE_ONECHANNEL(channelObjActive[i],"channelObjActive"); \
- FS_FREE_ONECHANNEL(channelAttractforceStrength[i],"channelAttractforceStrength"); \
- FS_FREE_ONECHANNEL(channelAttractforceRadius[i],"channelAttractforceRadius"); \
- FS_FREE_ONECHANNEL(channelVelocityforceStrength[i],"channelVelocityforceStrength"); \
- FS_FREE_ONECHANNEL(channelVelocityforceRadius[i],"channelVelocityforceRadius"); \
- } \
-} // end FS FREE CHANNELS
-
-
// simplify channels before printing
// for API this is done anyway upon init
#if 0
@@ -199,336 +222,616 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
}
#endif
-static void fluidsimInitChannel(Scene *scene, float **setchannel, int size, float *time,
- int *icuIds, float *defaults, Ipo* ipo, int entries)
+
+/* Note: fluid anim channel data layout
+ * ------------------------------------
+ * CHANNEL_FLOAT:
+ * frame 1 |frame 2
+ * [dataF][time][dataF][time]
+ *
+ * CHANNEL_VEC:
+ * frame 1 |frame 2
+ * [dataX][dataY][dataZ][time][dataX][dataY][dataZ][time]
+ *
+ */
+
+static void init_time(FluidsimSettings *domainSettings, FluidAnimChannels *channels)
+{
+ int i;
+
+ channels->timeAtFrame = MEM_callocN( (channels->length+1)*sizeof(float), "timeAtFrame channel");
+
+ channels->timeAtFrame[0] = channels->timeAtFrame[1] = domainSettings->animStart; // start at index 1
+
+ for(i=2; i<=channels->length; i++) {
+ channels->timeAtFrame[i] = channels->timeAtFrame[i-1] + channels->aniFrameTime;
+ }
+}
+
+/* if this is slow, can replace with faster, less readable code */
+static void set_channel(float *channel, float time, float *value, int i, int size)
{
+ if (size == CHANNEL_FLOAT) {
+ channel[(i * 2) + 0] = value[0];
+ channel[(i * 2) + 1] = time;
+ }
+ else if (size == CHANNEL_VEC) {
+ channel[(i * 4) + 0] = value[0];
+ channel[(i * 4) + 1] = value[1];
+ channel[(i * 4) + 2] = value[2];
+ channel[(i * 4) + 3] = time;
+ }
+}
- int i, j;
- char *cstr = NULL;
- float *channel = NULL;
+static void set_vertex_channel(float *channel, float time, struct Scene *scene, struct FluidObject *fobj, int i)
+{
+ Object *ob = fobj->object;
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+ float *verts;
+ int *tris=NULL, numVerts=0, numTris=0;
+ int modifierIndex = modifiers_indexInObject(ob, (ModifierData *)fluidmd);
+ int framesize = (3*fobj->numVerts) + 1;
+ int j;
+
+ if (channel == NULL)
+ return;
- cstr = "fluidsiminit_channelfloat";
- if(entries>1) cstr = "fluidsiminit_channelvec";
- channel = MEM_callocN( size* (entries+1)* sizeof(float), cstr );
+ initElbeemMesh(scene, ob, &numVerts, &verts, &numTris, &tris, 1, modifierIndex);
- /* defaults for now */
- for(j=0; j<entries; j++) {
- for(i=1; i<=size; i++) {
- channel[(i-1)*(entries+1) + j] = defaults[j];
- }
+ /* don't allow mesh to change number of verts in anim sequence */
+ if (numVerts != fobj->numVerts) {
+ MEM_freeN(channel);
+ channel = NULL;
+ return;
}
- for(i=1; i<=size; i++) {
- channel[(i-1)*(entries+1) + entries] = time[i];
+ /* fill frame of channel with vertex locations */
+ for(j=0; j < (3*numVerts); j++) {
+ channel[i*framesize + j] = verts[j];
}
+ channel[i*framesize + framesize-1] = time;
+
+ MEM_freeN(verts);
+ MEM_freeN(tris);
+}
- *setchannel = channel;
+static void free_domain_channels(FluidAnimChannels *channels)
+{
+ MEM_freeN(channels->timeAtFrame);
+ channels->timeAtFrame = NULL;
+ MEM_freeN(channels->DomainGravity);
+ channels->DomainGravity = NULL;
+ MEM_freeN(channels->DomainViscosity);
+ channels->DomainViscosity = NULL;
+}
-#if 0
- /* goes away completely */
- int i,j;
- IpoCurve* icus[3];
- char *cstr = NULL;
- float *channel = NULL;
- float aniFrlen = scene->r.framelen;
- int current_frame = scene->r.cfra;
- if((entries<1) || (entries>3)) {
- printf("fluidsimInitChannel::Error - invalid no. of entries: %d\n",entries);
- entries = 1;
+static void free_all_fluidobject_channels(ListBase *fobjects)
+{
+ FluidObject *fobj;
+
+ for (fobj=fobjects->first; fobj; fobj=fobj->next) {
+ if (fobj->Translation) {
+ MEM_freeN(fobj->Translation);
+ fobj->Translation = NULL;
+ MEM_freeN(fobj->Rotation);
+ fobj->Rotation = NULL;
+ MEM_freeN(fobj->Scale);
+ fobj->Scale = NULL;
+ MEM_freeN(fobj->Active);
+ fobj->Active = NULL;
+ MEM_freeN(fobj->InitialVelocity);
+ fobj->InitialVelocity = NULL;
+ }
+
+ if (fobj->AttractforceStrength) {
+ MEM_freeN(fobj->AttractforceStrength);
+ fobj->AttractforceStrength = NULL;
+ MEM_freeN(fobj->AttractforceRadius);
+ fobj->AttractforceRadius = NULL;
+ MEM_freeN(fobj->VelocityforceStrength);
+ fobj->VelocityforceStrength = NULL;
+ MEM_freeN(fobj->VelocityforceRadius);
+ fobj->VelocityforceRadius = NULL;
+ }
+
+ if (fobj->VertexCache) {
+ MEM_freeN(fobj->VertexCache);
+ fobj->VertexCache = NULL;
+ }
}
+}
- cstr = "fluidsiminit_channelfloat";
- if(entries>1) cstr = "fluidsiminit_channelvec";
- channel = MEM_callocN( size* (entries+1)* sizeof(float), cstr );
+static void fluid_init_all_channels(bContext *C, Object *fsDomain, FluidsimSettings *domainSettings, FluidAnimChannels *channels, ListBase *fobjects)
+{
+ Scene *scene = CTX_data_scene(C);
+ Base *base;
+ int i;
+ int length = channels->length;
+ float eval_time;
- if(ipo) {
- for(j=0; j<entries; j++) icus[j] = find_ipocurve(ipo, icuIds[j] );
- } else {
- for(j=0; j<entries; j++) icus[j] = NULL;
- }
+ /* XXX: first init time channel - temporary for now */
+ /* init time values (should be done after evaluating animated time curve) */
+ init_time(domainSettings, channels);
+
+ /* allocate domain animation channels */
+ channels->DomainGravity = MEM_callocN( length * (CHANNEL_VEC+1) * sizeof(float), "channel DomainGravity");
+ channels->DomainViscosity = MEM_callocN( length * (CHANNEL_FLOAT+1) * sizeof(float), "channel DomainViscosity");
+ //channels->DomainTime = MEM_callocN( length * (CHANNEL_FLOAT+1) * sizeof(float), "channel DomainTime");
- for(j=0; j<entries; j++) {
- if(icus[j]) {
- for(i=1; i<=size; i++) {
- /* Bugfix to make python drivers working
- // which uses Blender.get("curframe")
- */
- scene->r.cfra = floor(aniFrlen*((float)i));
+ /* allocate fluid objects */
+ for (base=scene->base.first; base; base= base->next) {
+ Object *ob = base->object;
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+
+ if (fluidmd) {
+ FluidObject *fobj = MEM_callocN(sizeof(FluidObject), "Fluid Object");
+ fobj->object = ob;
+
+ if (ELEM(fluidmd->fss->type, OB_FLUIDSIM_DOMAIN, OB_FLUIDSIM_PARTICLE)) {
+ BLI_addtail(fobjects, fobj);
+ continue;
+ }
+
+ fobj->Translation = MEM_callocN( length * (CHANNEL_VEC+1) * sizeof(float), "fluidobject Translation");
+ fobj->Rotation = MEM_callocN( length * (CHANNEL_VEC+1) * sizeof(float), "fluidobject Rotation");
+ fobj->Scale = MEM_callocN( length * (CHANNEL_VEC+1) * sizeof(float), "fluidobject Scale");
+ fobj->Active = MEM_callocN( length * (CHANNEL_FLOAT+1) * sizeof(float), "fluidobject Active");
+ fobj->InitialVelocity = MEM_callocN( length * (CHANNEL_VEC+1) * sizeof(float), "fluidobject InitialVelocity");
+
+ if (fluidmd->fss->type == OB_FLUIDSIM_CONTROL) {
+ fobj->AttractforceStrength = MEM_callocN( length * (CHANNEL_FLOAT+1) * sizeof(float), "fluidobject AttractforceStrength");
+ fobj->AttractforceRadius = MEM_callocN( length * (CHANNEL_FLOAT+1) * sizeof(float), "fluidobject AttractforceRadius");
+ fobj->VelocityforceStrength = MEM_callocN( length * (CHANNEL_FLOAT+1) * sizeof(float), "fluidobject VelocityforceStrength");
+ fobj->VelocityforceRadius = MEM_callocN( length * (CHANNEL_FLOAT+1) * sizeof(float), "fluidobject VelocityforceRadius");
+ }
+
+ if (fluid_is_animated_mesh(fluidmd->fss)) {
+ float *verts=NULL;
+ int *tris=NULL, modifierIndex = modifiers_indexInObject(ob, (ModifierData *)fluidmd);
+
+ initElbeemMesh(scene, ob, &fobj->numVerts, &verts, &fobj->numTris, &tris, 0, modifierIndex);
+ fobj->VertexCache = MEM_callocN( length *((fobj->numVerts*CHANNEL_VEC)+1) * sizeof(float), "fluidobject VertexCache");
- // XXX calc_icu(icus[j], aniFrlen*((float)i) );
- channel[(i-1)*(entries+1) + j] = icus[j]->curval;
+ MEM_freeN(verts);
+ MEM_freeN(tris);
}
- } else {
- for(i=1; i<=size; i++) { channel[(i-1)*(entries+1) + j] = defaults[j]; }
+
+ BLI_addtail(fobjects, fobj);
}
- //printf("fluidsimInitChannel entry:%d , ",j); for(i=1; i<=size; i++) { printf(" val%d:%f ",i, channel[(i-1)*(entries+1) + j] ); } printf(" \n"); // DEBUG
}
- // set time values
- for(i=1; i<=size; i++) {
- channel[(i-1)*(entries+1) + entries] = time[i];
+
+ /* now we loop over the frames and fill the allocated channels with data */
+ for (i=0; i<channels->length; i++) {
+ FluidObject *fobj;
+ float viscosity, gravity[3];
+ float timeAtFrame;
+
+ eval_time = domainSettings->bakeStart + i;
+ timeAtFrame = channels->timeAtFrame[i+1];
+
+ /* XXX: This can't be used due to an anim sys optimisation that ignores recalc object animation,
+ * leaving it for the depgraph (this ignores object animation such as modifier properties though... :/ )
+ * --> BKE_animsys_evaluate_all_animation(G.main, eval_time);
+ * This doesn't work with drivers:
+ * --> BKE_animsys_evaluate_animdata(&fsDomain->id, fsDomain->adt, eval_time, ADT_RECALC_ALL);
+ */
+
+ /* Modifying the global scene isn't nice, but we can do it in
+ * this part of the process before a threaded job is created */
+ scene->r.cfra = (int)eval_time;
+ ED_update_for_newframe(C, 1);
+
+ /* now scene data should be current according to animation system, so we fill the channels */
+
+ /* Domain properties - gravity/viscosity/time */
+ get_fluid_gravity(gravity, scene, domainSettings);
+ set_channel(channels->DomainGravity, timeAtFrame, gravity, i, CHANNEL_VEC);
+ viscosity = get_fluid_viscosity(domainSettings);
+ set_channel(channels->DomainViscosity, timeAtFrame, &viscosity, i, CHANNEL_FLOAT);
+ // XXX : set_channel(channels->DomainTime, timeAtFrame, &time, i, CHANNEL_VEC);
+
+ /* object movement */
+ for (fobj=fobjects->first; fobj; fobj=fobj->next) {
+ Object *ob = fobj->object;
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+ float active= (float)(fluidmd->fss->flag & OB_FLUIDSIM_ACTIVE);
+ float rot_d[3], rot_360[3] = {360.f, 360.f, 360.f};
+
+ if (ELEM(fluidmd->fss->type, OB_FLUIDSIM_DOMAIN, OB_FLUIDSIM_PARTICLE))
+ continue;
+
+ /* init euler rotation values and convert to elbeem format */
+ BKE_rotMode_change_values(ob->quat, ob->rot, ob->rotAxis, &ob->rotAngle, ob->rotmode, ROT_MODE_EUL);
+ mul_v3_v3fl(rot_d, ob->rot, 180.f/M_PI);
+ sub_v3_v3v3(rot_d, rot_360, rot_d);
+
+ set_channel(fobj->Translation, timeAtFrame, ob->loc, i, CHANNEL_VEC);
+ set_channel(fobj->Rotation, timeAtFrame, rot_d, i, CHANNEL_VEC);
+ set_channel(fobj->Scale, timeAtFrame, ob->size, i, CHANNEL_VEC);
+ set_channel(fobj->Active, timeAtFrame, &active, i, CHANNEL_FLOAT);
+ set_channel(fobj->InitialVelocity, timeAtFrame, &fluidmd->fss->iniVelx, i, CHANNEL_VEC);
+
+ if (fluidmd->fss->type == OB_FLUIDSIM_CONTROL) {
+ set_channel(fobj->AttractforceStrength, timeAtFrame, &fluidmd->fss->attractforceStrength, i, CHANNEL_FLOAT);
+ set_channel(fobj->AttractforceRadius, timeAtFrame, &fluidmd->fss->attractforceRadius, i, CHANNEL_FLOAT);
+ set_channel(fobj->VelocityforceStrength, timeAtFrame, &fluidmd->fss->velocityforceStrength, i, CHANNEL_FLOAT);
+ set_channel(fobj->VelocityforceRadius, timeAtFrame, &fluidmd->fss->velocityforceRadius, i, CHANNEL_FLOAT);
+ }
+
+ if (fluid_is_animated_mesh(fluidmd->fss)) {
+ set_vertex_channel(fobj->VertexCache, timeAtFrame, scene, fobj, i);
+ }
+ }
}
- scene->r.cfra = current_frame;
- *setchannel = channel;
-#endif
}
-static void fluidsimInitMeshChannel(bContext *C, float **setchannel, int size, Object *obm, int vertices,
- float *time, int modifierIndex)
+static void export_fluid_objects(ListBase *fobjects, Scene *scene, int length)
{
- Scene *scene= CTX_data_scene(C);
- float *channel = NULL;
- int mallsize = size* (3*vertices+1);
- int frame,i;
- int numVerts=0, numTris=0;
- int setsize = 3*vertices+1;
-
- channel = MEM_callocN( mallsize* sizeof(float), "fluidsim_meshchannel" );
-
- //fprintf(stderr,"\n\nfluidsimInitMeshChannel size%d verts%d mallsize%d \n\n\n",size,vertices,mallsize);
- for(frame=1; frame<=size; frame++) {
+ FluidObject *fobj;
+
+ for (fobj=fobjects->first; fobj; fobj=fobj->next) {
+ Object *ob = fobj->object;
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+ int modifierIndex = modifiers_indexInObject(ob, (ModifierData *)fluidmd);
+
float *verts=NULL;
int *tris=NULL;
- scene->r.cfra = frame;
- ED_update_for_newframe(C, 1);
+ int numVerts=0, numTris=0;
+ int deform = fluid_is_animated_mesh(fluidmd->fss);
+
+ elbeemMesh fsmesh;
+
+ if (ELEM(fluidmd->fss->type, OB_FLUIDSIM_DOMAIN, OB_FLUIDSIM_PARTICLE))
+ continue;
+
+ elbeemResetMesh( &fsmesh );
+
+ fsmesh.type = fluidmd->fss->type;
+ fsmesh.name = ob->id.name;
+
+ initElbeemMesh(scene, ob, &numVerts, &verts, &numTris, &tris, 0, modifierIndex);
+
+ fsmesh.numVertices = numVerts;
+ fsmesh.numTriangles = numTris;
+ fsmesh.vertices = verts;
+ fsmesh.triangles = tris;
+
+ fsmesh.channelSizeTranslation =
+ fsmesh.channelSizeRotation =
+ fsmesh.channelSizeScale =
+ fsmesh.channelSizeInitialVel =
+ fsmesh.channelSizeActive = length;
+
+ fsmesh.channelTranslation = fobj->Translation;
+ fsmesh.channelRotation = fobj->Rotation;
+ fsmesh.channelScale = fobj->Scale;
+ fsmesh.channelActive = fobj->Active;
+
+ if( ELEM(fsmesh.type, OB_FLUIDSIM_FLUID, OB_FLUIDSIM_INFLOW)) {
+ fsmesh.channelInitialVel = fobj->InitialVelocity;
+ fsmesh.localInivelCoords = ((fluidmd->fss->typeFlags & OB_FSINFLOW_LOCALCOORD)?1:0);
+ }
+
+ if(fluidmd->fss->typeFlags & OB_FSBND_NOSLIP)
+ fsmesh.obstacleType = FLUIDSIM_OBSTACLE_NOSLIP;
+ else if(fluidmd->fss->typeFlags & OB_FSBND_PARTSLIP)
+ fsmesh.obstacleType = FLUIDSIM_OBSTACLE_PARTSLIP;
+ else if(fluidmd->fss->typeFlags & OB_FSBND_FREESLIP)
+ fsmesh.obstacleType = FLUIDSIM_OBSTACLE_FREESLIP;
+
+ fsmesh.obstaclePartslip = fluidmd->fss->partSlipValue;
+ fsmesh.volumeInitType = fluidmd->fss->volumeInitType;
+ fsmesh.obstacleImpactFactor = fluidmd->fss->surfaceSmoothing; // misused value
+
+ if (fsmesh.type == OB_FLUIDSIM_CONTROL) {
+ fsmesh.cpsTimeStart = fluidmd->fss->cpsTimeStart;
+ fsmesh.cpsTimeEnd = fluidmd->fss->cpsTimeEnd;
+ fsmesh.cpsQuality = fluidmd->fss->cpsQuality;
+ fsmesh.obstacleType = (fluidmd->fss->flag & OB_FLUIDSIM_REVERSE);
+
+ fsmesh.channelSizeAttractforceRadius =
+ fsmesh.channelSizeVelocityforceStrength =
+ fsmesh.channelSizeVelocityforceRadius =
+ fsmesh.channelSizeAttractforceStrength = length;
+
+ fsmesh.channelAttractforceStrength = fobj->AttractforceStrength;
+ fsmesh.channelAttractforceRadius = fobj->AttractforceRadius;
+ fsmesh.channelVelocityforceStrength = fobj->VelocityforceStrength;
+ fsmesh.channelVelocityforceRadius = fobj->VelocityforceRadius;
+ }
+ else {
+ fsmesh.channelAttractforceStrength =
+ fsmesh.channelAttractforceRadius =
+ fsmesh.channelVelocityforceStrength =
+ fsmesh.channelVelocityforceRadius = NULL;
+ }
+
+ /* animated meshes */
+ if(deform) {
+ fsmesh.channelSizeVertices = length;
+ fsmesh.channelVertices = fobj->VertexCache;
+
+ // remove channels
+ fsmesh.channelTranslation =
+ fsmesh.channelRotation =
+ fsmesh.channelScale = NULL;
+ }
+
+ elbeemAddMesh(&fsmesh);
+
+ if(verts) MEM_freeN(verts);
+ if(tris) MEM_freeN(tris);
+ if(fsmesh.channelVertices) MEM_freeN(fsmesh.channelVertices);
+ }
+}
+
+static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDomain)
+{
+ Base *base;
+ Object *newdomain = NULL;
+ int channelObjCount = 0;
+ int fluidInputCount = 0;
- initElbeemMesh(scene, obm, &numVerts, &verts, &numTris, &tris, 1, modifierIndex);
- //fprintf(stderr,"\nfluidsimInitMeshChannel frame%d verts%d/%d \n\n",frame,vertices,numVerts);
- for(i=0; i<3*vertices;i++) {
- channel[(frame-1)*setsize + i] = verts[i];
- //fprintf(stdout," frame%d vert%d=%f \n",frame,i,verts[i]);
- //if(i%3==2) fprintf(stdout,"\n");
+ for(base=scene->base.first; base; base= base->next)
+ {
+ Object *ob = base->object;
+ FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+
+ /* only find objects with fluid modifiers */
+ if (!fluidmdtmp || ob->type != OB_MESH) continue;
+
+ if(fluidmdtmp->fss->type == OB_FLUIDSIM_DOMAIN) {
+ /* if no initial domain object given, find another potential domain */
+ if (!fsDomain) {
+ newdomain = ob;
+ }
+ /* if there's more than one domain, cancel */
+ else if (fsDomain && ob != fsDomain) {
+ BKE_report(reports, RPT_ERROR, "There should be only one domain object.");
+ return 0;
+ }
}
- channel[(frame-1)*setsize + setsize-1] = time[frame];
+
+ /* count number of objects needed for animation channels */
+ if ( !ELEM(fluidmdtmp->fss->type, OB_FLUIDSIM_DOMAIN, OB_FLUIDSIM_PARTICLE) )
+ channelObjCount++;
+
+ /* count number of fluid input objects */
+ if (ELEM(fluidmdtmp->fss->type, OB_FLUIDSIM_FLUID, OB_FLUIDSIM_INFLOW))
+ fluidInputCount++;
+ }
- MEM_freeN(verts);
- MEM_freeN(tris);
+ if (newdomain)
+ fsDomain = newdomain;
+
+ if (!fsDomain) {
+ BKE_report(reports, RPT_ERROR, "No domain object found.");
+ return 0;
+ }
+
+ if (channelObjCount>=255) {
+ BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects.");
+ return 0;
}
- *setchannel = channel;
+
+ if (fluidInputCount == 0) {
+ BKE_report(reports, RPT_ERROR, "No fluid input objects in the scene.");
+ return 0;
+ }
+
+ return 1;
}
-/* ******************************************************************************** */
-/* ********************** simulation thread ************************* */
-/* ******************************************************************************** */
+#define FLUID_SUFFIX_CONFIG "fluidsim.cfg"
+#define FLUID_SUFFIX_SURFACE "fluidsurface"
-static volatile int globalBakeState = 0; // 0 everything ok, -1 abort simulation, -2 sim error, 1 sim done
-static volatile int globalBakeFrame = 0;
-static volatile int g_break= 0;
-
-// run simulation in seperate thread
-static void *fluidsimSimulateThread(void *unused) { // *ptr) {
- //char* fnameCfgPath = (char*)(ptr);
- int ret=0;
-
- ret = elbeemSimulate();
- BLI_lock_thread(LOCK_CUSTOM1);
- if(globalBakeState==0) {
- if(ret==0) {
- // if no error, set to normal exit
- globalBakeState = 1;
- } else {
- // simulation failed, display error
- globalBakeState = -2;
+static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetFile, char *debugStrBuffer)
+{
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(fsDomain, eModifierType_Fluidsim);
+ FluidsimSettings *domainSettings= fluidmd->fss;
+ FILE *fileCfg;
+ int dirExist = 0;
+ char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings
+ char *suffixConfig = FLUID_SUFFIX_CONFIG;
+ int outStringsChanged = 0;
+
+ // prepare names...
+ strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR);
+ strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR);
+ BLI_path_abs(targetDir, G.sce); // fixed #frame-no
+
+ strcpy(targetFile, targetDir);
+ strcat(targetFile, suffixConfig);
+ strcat(targetFile,".tmp"); // dont overwrite/delete original file
+ // make sure all directories exist
+ // as the bobjs use the same dir, this only needs to be checked
+ // for the cfg output
+ BLI_make_existing_file(targetFile);
+
+ // check selected directory
+ // simply try to open cfg file for writing to test validity of settings
+ fileCfg = fopen(targetFile, "w");
+ if(fileCfg) {
+ dirExist = 1; fclose(fileCfg);
+ // remove cfg dummy from directory test
+ BLI_delete(targetFile, 0,0);
+ }
+
+ if((strlen(targetDir)<1) || (!dirExist)) {
+ char blendDir[FILE_MAXDIR+FILE_MAXFILE];
+ char blendFile[FILE_MAXDIR+FILE_MAXFILE];
+
+ // invalid dir, reset to current/previous
+ strcpy(blendDir, G.sce);
+ BLI_splitdirstring(blendDir, blendFile);
+ if(strlen(blendFile)>6){
+ int len = strlen(blendFile);
+ if( (blendFile[len-6]=='.')&& (blendFile[len-5]=='b')&& (blendFile[len-4]=='l')&&
+ (blendFile[len-3]=='e')&& (blendFile[len-2]=='n')&& (blendFile[len-1]=='d') ){
+ blendFile[len-6] = '\0';
+ }
}
+ // todo... strip .blend ?
+ snprintf(newSurfdataPath,FILE_MAXFILE+FILE_MAXDIR,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
+
+ snprintf(debugStrBuffer,256,"fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath);
+ elbeemDebugOut(debugStrBuffer);
+ outStringsChanged=1;
}
- BLI_unlock_thread(LOCK_CUSTOM1);
- return NULL;
+
+ // check if modified output dir is ok
+#if 0
+ if(outStringsChanged) {
+ char dispmsg[FILE_MAXDIR+FILE_MAXFILE+256];
+ int selection=0;
+ strcpy(dispmsg,"Output settings set to: '");
+ strcat(dispmsg, newSurfdataPath);
+ strcat(dispmsg, "'%t|Continue with changed settings%x1|Discard and abort%x0");
+
+ // ask user if thats what he/she wants...
+ selection = pupmenu(dispmsg);
+ if(selection<1) return 0; // 0 from menu, or -1 aborted
+ strcpy(targetDir, newSurfdataPath);
+ strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR);
+ BLI_path_abs(targetDir, G.sce); // fixed #frame-no
+ }
+#endif
+ return outStringsChanged;
}
+/* ******************************************************************************** */
+/* ********************** write fluidsim config to file ************************* */
+/* ******************************************************************************** */
+
+typedef struct FluidBakeJob {
+ /* from wmJob */
+ void *owner;
+ short *stop, *do_update;
+
+ int current_frame;
+ elbeemSimulationSettings *settings;
+} FluidBakeJob;
+
+static void fluidbake_free(void *customdata)
+{
+ FluidBakeJob *fb= customdata;
+ MEM_freeN(fb);
+}
+
+/* called by fluidbake, only to check job 'stop' value */
+static int fluidbake_breakjob(void *customdata)
+{
+ //FluidBakeJob *fb= (FluidBakeJob *)customdata;
+ //return *(fb->stop);
+
+ /* this is not nice yet, need to make the jobs list template better
+ * for identifying/acting upon various different jobs */
+ /* but for now we'll reuse the render break... */
+ return (G.afbreek);
+}
+
+/* called by fluidbake, wmJob sends notifier */
+static void fluidbake_updatejob(void *customdata, char *str)
+{
+ FluidBakeJob *fb= customdata;
+
+ *(fb->do_update)= 1;
+}
+
+static void fluidbake_startjob(void *customdata, short *stop, short *do_update)
+{
+ FluidBakeJob *fb= customdata;
+
+ fb->stop= stop;
+ fb->do_update = do_update;
+
+ G.afbreek= 0; /* XXX shared with render - replace with job 'stop' switch */
+
+ elbeemSimulate();
+ *do_update= 1;
+ *stop = 0;
+}
int runSimulationCallback(void *data, int status, int frame) {
- //elbeemSimulationSettings *settings = (elbeemSimulationSettings*)data;
+ FluidBakeJob *fb = (FluidBakeJob *)data;
+
+ //elbeemSimulationSettings *settings = fb->settings;
//printf("elbeem blender cb s%d, f%d, domainid:%d \n", status,frame, settings->domainId ); // DEBUG
- int state = 0;
- if(status==FLUIDSIM_CBSTATUS_NEWFRAME) {
- BLI_lock_thread(LOCK_CUSTOM1);
- globalBakeFrame = frame-1;
- BLI_unlock_thread(LOCK_CUSTOM1);
- }
- //if((frameCounter==3) && (!frameStop)) { frameStop=1; return 1; }
-
- BLI_lock_thread(LOCK_CUSTOM1);
- state = globalBakeState;
- BLI_unlock_thread(LOCK_CUSTOM1);
+ if (status == FLUIDSIM_CBSTATUS_NEWFRAME)
+ fluidbake_updatejob(fb, "");
- if(state!=0) {
+ if (fluidbake_breakjob(fb)) {
return FLUIDSIM_CBRET_ABORT;
}
return FLUIDSIM_CBRET_CONTINUE;
}
-
-/* ******************************************************************************** */
-/* ********************** write fluidsim config to file ************************* */
-/* ******************************************************************************** */
-
-int fluidsimBake(bContext *C, ReportList *reports, Object *ob)
+int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
{
Scene *scene= CTX_data_scene(C);
- FILE *fileCfg;
int i;
- Object *fsDomain = NULL;
FluidsimSettings *domainSettings;
- Object *obit = NULL; /* object iterator */
- Base *base;
- int origFrame = scene->r.cfra;
+
char debugStrBuffer[256];
- int dirExist = 0;
+
int gridlevels = 0;
- int simAborted = 0; // was the simulation aborted by user?
- int doExportOnly = 0;
- char *exportEnvStr = "BLENDER_ELBEEMEXPORTONLY";
const char *strEnvName = "BLENDER_ELBEEMDEBUG"; // from blendercall.cpp
- //char *channelNames[3] = { "translation","rotation","scale" };
+ char *suffixConfig = FLUID_SUFFIX_CONFIG;
+ char *suffixSurface = FLUID_SUFFIX_SURFACE;
- char *suffixConfig = "fluidsim.cfg";
- char *suffixSurface = "fluidsurface";
- char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings
char targetDir[FILE_MAXDIR+FILE_MAXFILE]; // store & modify output settings
char targetFile[FILE_MAXDIR+FILE_MAXFILE]; // temp. store filename from targetDir for access
int outStringsChanged = 0; // modified? copy back before baking
- int haveSomeFluid = 0; // check if any fluid objects are set
- // config vars, inited before either export or run...
- double calcViscosity = 0.0;
- int noFrames;
- double aniFrameTime;
- float aniFrlen;
- int channelObjCount;
- float *bbStart = NULL;
- float *bbSize = NULL;
float domainMat[4][4];
float invDomMat[4][4];
- // channel data
- int allchannelSize; // fixed by no. of frames
- int startFrame = 1; // dont use scene->r.sfra here, always start with frame 1
- // easy frame -> sim time calc
- float *timeAtFrame=NULL, *timeAtIndex=NULL;
- // domain
- float *channelDomainTime = NULL;
- float *channelDomainViscosity = NULL;
- float *channelDomainGravity = NULL;
- // objects (currently max. 256 objs)
- float *channelObjMove[256][3]; // object movments , 0=trans, 1=rot, 2=scale
- float *channelObjInivel[256]; // initial velocities
- float *channelObjActive[256]; // obj active channel
-
- /* fluid control channels */
- float *channelAttractforceStrength[256];
- float *channelAttractforceRadius[256];
- float *channelVelocityforceStrength[256];
- float *channelVelocityforceRadius[256];
+
+ int noFrames;
+ int origFrame = scene->r.cfra;
+
+ FluidAnimChannels *channels = MEM_callocN(sizeof(FluidAnimChannels), "fluid domain animation channels");
+ ListBase *fobjects = MEM_callocN(sizeof(ListBase), "fluid objects");
FluidsimModifierData *fluidmd = NULL;
Mesh *mesh = NULL;
+ wmJob *steve;
+ FluidBakeJob *fb;
+ elbeemSimulationSettings fsset;
+
+ steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, 0);
+ fb= MEM_callocN(sizeof(FluidBakeJob), "fluid bake job");
+
if(getenv(strEnvName)) {
int dlevel = atoi(getenv(strEnvName));
elbeemSetDebugLevel(dlevel);
snprintf(debugStrBuffer,256,"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName);
elbeemDebugOut(debugStrBuffer);
}
- if(getenv(exportEnvStr)) {
- doExportOnly = atoi(getenv(exportEnvStr));
- snprintf(debugStrBuffer,256,"fluidsimBake::msg: Exporting mode set to '%d' due to envvar '%s'\n",doExportOnly, exportEnvStr);
- elbeemDebugOut(debugStrBuffer);
- }
-
- // make sure it corresponds to startFrame setting
- // old: noFrames = scene->r.efra - scene->r.sfra +1;
+
+ /* make sure it corresponds to startFrame setting (old: noFrames = scene->r.efra - scene->r.sfra +1) */;
noFrames = scene->r.efra - 0;
if(noFrames<=0) {
BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings.");
return 0;
}
-
- /* no object pointer, find in selected ones.. */
- if(!ob) {
- for(base=scene->base.first; base; base= base->next) {
- if ((base)->flag & SELECT)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
-
- if(fluidmdtmp && (base->object->type==OB_MESH))
- {
- if(fluidmdtmp->fss->type == OB_FLUIDSIM_DOMAIN)
- {
- ob = base->object;
- break;
- }
- }
- }
- }
- // no domains found?
- if(!ob) return 0;
- }
- channelObjCount = 0;
- for(base=scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- if( fluidmdtmp &&
- (obit->type==OB_MESH) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN) && // if has to match 3 places! // CHECKMATCH
- (fluidmdtmp->fss->type != OB_FLUIDSIM_PARTICLE) )
- {
- channelObjCount++;
- }
- }
-
- if (channelObjCount>=255) {
- BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects.");
+ /* check scene for sane object/modifier settings */
+ if (!fluid_validate_scene(reports, scene, fsDomain)) {
return 0;
}
- /* check if there's another domain... */
- for(base=scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- if( fluidmdtmp &&(obit->type==OB_MESH))
- {
- if(fluidmdtmp->fss->type == OB_FLUIDSIM_DOMAIN)
- {
- if(obit != ob)
- {
- BKE_report(reports, RPT_ERROR, "There should be only one domain object.");
- return 0;
- }
- }
- }
- }
-
- // check if theres any fluid
- // abort baking if not...
- for(base=scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- if( fluidmdtmp &&
- (obit->type==OB_MESH) &&
- ((fluidmdtmp->fss->type == OB_FLUIDSIM_FLUID) ||
- (fluidmdtmp->fss->type == OB_FLUIDSIM_INFLOW) ))
- {
- haveSomeFluid = 1;
- break;
- }
- }
- if(!haveSomeFluid) {
- BKE_report(reports, RPT_ERROR, "No fluid objects in scene.");
- return 0;
- }
/* these both have to be valid, otherwise we wouldnt be here */
- /* dont use ob here after...*/
- fsDomain = ob;
- fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+ fluidmd = (FluidsimModifierData *)modifiers_findByType(fsDomain, eModifierType_Fluidsim);
domainSettings = fluidmd->fss;
- ob = NULL;
mesh = fsDomain->data;
+ domainSettings->bakeStart = 1;
+ domainSettings->bakeEnd = scene->r.efra;
+
// calculate bounding box
fluid_get_bb(mesh->mvert, mesh->totvert, fsDomain->obmat, domainSettings->bbStart, domainSettings->bbSize);
@@ -559,107 +862,26 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob)
}
snprintf(debugStrBuffer,256,"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels );
elbeemDebugOut(debugStrBuffer);
-
- // prepare names...
- strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR);
- strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR);
- BLI_path_abs(targetDir, G.sce); // fixed #frame-no
-
- strcpy(targetFile, targetDir);
- strcat(targetFile, suffixConfig);
- if(!doExportOnly) { strcat(targetFile,".tmp"); } // dont overwrite/delete original file
- // make sure all directories exist
- // as the bobjs use the same dir, this only needs to be checked
- // for the cfg output
- BLI_make_existing_file(targetFile);
-
- // check selected directory
- // simply try to open cfg file for writing to test validity of settings
- fileCfg = fopen(targetFile, "w");
- if(fileCfg) {
- dirExist = 1; fclose(fileCfg);
- // remove cfg dummy from directory test
- if(!doExportOnly) { BLI_delete(targetFile, 0,0); }
- }
-
- if((strlen(targetDir)<1) || (!dirExist)) {
- char blendDir[FILE_MAXDIR+FILE_MAXFILE], blendFile[FILE_MAXDIR+FILE_MAXFILE];
- // invalid dir, reset to current/previous
- strcpy(blendDir, G.sce);
- BLI_splitdirstring(blendDir, blendFile);
- if(strlen(blendFile)>6){
- int len = strlen(blendFile);
- if( (blendFile[len-6]=='.')&& (blendFile[len-5]=='b')&& (blendFile[len-4]=='l')&&
- (blendFile[len-3]=='e')&& (blendFile[len-2]=='n')&& (blendFile[len-1]=='d') ){
- blendFile[len-6] = '\0';
- }
- }
- // todo... strip .blend ?
- snprintf(newSurfdataPath,FILE_MAXFILE+FILE_MAXDIR,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
-
- snprintf(debugStrBuffer,256,"fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath);
- elbeemDebugOut(debugStrBuffer);
- outStringsChanged=1;
- }
-
- // check if modified output dir is ok
- if(outStringsChanged) {
- char dispmsg[FILE_MAXDIR+FILE_MAXFILE+256];
- int selection=0;
- strcpy(dispmsg,"Output settings set to: '");
- strcat(dispmsg, newSurfdataPath);
- strcat(dispmsg, "'%t|Continue with changed settings%x1|Discard and abort%x0");
-
- // ask user if thats what he/she wants...
- selection = pupmenu(dispmsg);
- if(selection<1) return 0; // 0 from menu, or -1 aborted
- strcpy(targetDir, newSurfdataPath);
- strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR);
- BLI_path_abs(targetDir, G.sce); // fixed #frame-no
- }
- // --------------------------------------------------------------------------------------------
- // dump data for start frame
- // CHECK more reasonable to number frames according to blender?
- // dump data for frame 0
- scene->r.cfra = startFrame;
- ED_update_for_newframe(C, 1);
- // init common export vars for both file export and run
- for(i=0; i<256; i++) {
- channelObjMove[i][0] = channelObjMove[i][1] = channelObjMove[i][2] = NULL;
- channelObjInivel[i] = NULL;
- channelObjActive[i] = NULL;
- channelAttractforceStrength[i] = NULL;
- channelAttractforceRadius[i] = NULL;
- channelVelocityforceStrength[i] = NULL;
- channelVelocityforceRadius[i] = NULL;
- }
- allchannelSize = scene->r.efra; // always use till last frame
- aniFrameTime = (domainSettings->animEnd - domainSettings->animStart)/(double)noFrames;
- // blender specific - scale according to map old/new settings in anim panel:
- aniFrlen = scene->r.framelen;
- if(domainSettings->viscosityMode==1) {
- /* manual mode, visc=value/(10^-vexp) */
- calcViscosity = (1.0/pow(10.0,domainSettings->viscosityExponent)) * domainSettings->viscosityValue;
- } else {
- calcViscosity = fluidsimViscosityPreset[ domainSettings->viscosityMode ];
- }
-
- bbStart = domainSettings->bbStart;
- bbSize = domainSettings->bbSize;
+
+ /* ******** prepare output file paths ******** */
+ outStringsChanged = fluid_init_filepaths(fsDomain, targetDir, targetFile, debugStrBuffer);
+ channels->length = scene->r.efra;
+ channels->aniFrameTime = (domainSettings->animEnd - domainSettings->animStart)/(double)noFrames;
+
+ /* ******** initialise and allocate animation channels ******** */
+ fluid_init_all_channels(C, fsDomain, domainSettings, channels, fobjects);
- // always init
+ /* reset to original current frame */
+ scene->r.cfra = origFrame;
+ ED_update_for_newframe(C, 1);
+
+
+ /* ---- XXX: No Time animation curve for now, leaving this code here for reference
+
{ int timeIcu[1] = { FLUIDSIM_TIME };
float timeDef[1] = { 1. };
- int gravIcu[3] = { FLUIDSIM_GRAV_X, FLUIDSIM_GRAV_Y, FLUIDSIM_GRAV_Z };
- float gravDef[3];
- int viscIcu[1] = { FLUIDSIM_VISC };
- float viscDef[1] = { 1. };
-
- gravDef[0] = domainSettings->gravx;
- gravDef[1] = domainSettings->gravy;
- gravDef[2] = domainSettings->gravz;
// time channel is a bit special, init by hand...
timeAtIndex = MEM_callocN( (allchannelSize+1)*1*sizeof(float), "fluidsiminit_timeatindex");
@@ -667,7 +889,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob)
timeAtIndex[i] = (float)(i-startFrame);
}
fluidsimInitChannel(scene, &channelDomainTime, allchannelSize, timeAtIndex, timeIcu,timeDef, domainSettings->ipo, CHANNEL_FLOAT ); // NDEB
- // time channel is a multiplicator for aniFrameTime
+ // time channel is a multiplicator for
if(channelDomainTime) {
for(i=0; i<allchannelSize; i++) {
channelDomainTime[i*2+0] = aniFrameTime * channelDomainTime[i*2+0];
@@ -684,466 +906,117 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob)
for(i=2; i<=allchannelSize; i++) { timeAtFrame[i] = timeAtFrame[i-1]+aniFrameTime; }
}
- fluidsimInitChannel(scene, &channelDomainViscosity, allchannelSize, timeAtFrame, viscIcu,viscDef, domainSettings->ipo, CHANNEL_FLOAT ); // NDEB
- if(channelDomainViscosity) {
- for(i=0; i<allchannelSize; i++) { channelDomainViscosity[i*2+0] = calcViscosity * channelDomainViscosity[i*2+0]; }
- }
- fluidsimInitChannel(scene, &channelDomainGravity, allchannelSize, timeAtFrame, gravIcu,gravDef, domainSettings->ipo, CHANNEL_VEC );
} // domain channel init
-
- // init obj movement channels
- channelObjCount=0;
- for(base=scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
+ */
- if( fluidmdtmp &&
- (obit->type==OB_MESH) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN) && // if has to match 3 places! // CHECKMATCH
- (fluidmdtmp->fss->type != OB_FLUIDSIM_PARTICLE) ) {
-
- // cant use fluidsimInitChannel for obj channels right now, due
- // to the special DXXX channels, and the rotation specialities
- IpoCurve *icuex[3][3];
- //IpoCurve *par_icuex[3][3];
-#if 0
- int icuIds[3][3] = {
- {OB_LOC_X, OB_LOC_Y, OB_LOC_Z},
- {OB_ROT_X, OB_ROT_Y, OB_ROT_Z},
- {OB_SIZE_X, OB_SIZE_Y, OB_SIZE_Z}
- };
- int icudIds[3][3] = {
- {OB_DLOC_X, OB_DLOC_Y, OB_DLOC_Z},
- {OB_DROT_X, OB_DROT_Y, OB_DROT_Z},
- {OB_DSIZE_X, OB_DSIZE_Y, OB_DSIZE_Z}
- };
-#endif
- // relative ipos
- IpoCurve *icudex[3][3];
- //IpoCurve *par_icudex[3][3];
- int j,k;
- float vals[3] = {0.0,0.0,0.0};
- int o = channelObjCount;
- int inivelIcu[3] = { FLUIDSIM_VEL_X, FLUIDSIM_VEL_Y, FLUIDSIM_VEL_Z };
- float inivelDefs[3];
- int activeIcu[1] = { FLUIDSIM_ACTIVE };
- float activeDefs[1] = { 1 }; // default to on
-
- inivelDefs[0] = fluidmdtmp->fss->iniVelx;
- inivelDefs[1] = fluidmdtmp->fss->iniVely;
- inivelDefs[2] = fluidmdtmp->fss->iniVelz;
-
- // check & init loc,rot,size
- for(j=0; j<3; j++) {
- for(k=0; k<3; k++) {
- // XXX prevent invalid memory access until this works
- icuex[j][k]= NULL;
- icudex[j][k]= NULL;
-
- // XXX icuex[j][k] = find_ipocurve(obit->ipo, icuIds[j][k] );
- // XXX icudex[j][k] = find_ipocurve(obit->ipo, icudIds[j][k] );
- // XXX lines below were already disabled!
- //if(obit->parent) {
- //par_icuex[j][k] = find_ipocurve(obit->parent->ipo, icuIds[j][k] );
- //par_icudex[j][k] = find_ipocurve(obit->parent->ipo, icudIds[j][k] );
- //}
- }
- }
-
- for(j=0; j<3; j++) {
- channelObjMove[o][j] = MEM_callocN( allchannelSize*4*sizeof(float), "fluidsiminit_objmovchannel");
- for(i=1; i<=allchannelSize; i++) {
-
- for(k=0; k<3; k++) {
- if(icuex[j][k]) {
- // IPO exists, use it ...
- // XXX calc_icu(icuex[j][k], aniFrlen*((float)i) );
- vals[k] = icuex[j][k]->curval;
- if(obit->parent) {
- // add parent transform, multiply scaling, add trafo&rot
- //calc_icu(par_icuex[j][k], aniFrlen*((float)i) );
- //if(j==2) { vals[k] *= par_icuex[j][k]->curval; }
- //else { vals[k] += par_icuex[j][k]->curval; }
- }
- } else {
- // use defaults from static values
- float setval=0.0;
- if(j==0) {
- setval = obit->loc[k];
- if(obit->parent){ setval += obit->parent->loc[k]; }
- } else if(j==1) {
- setval = ( 180.0*obit->rot[k] )/( 10.0*M_PI );
- if(obit->parent){ setval = ( 180.0*(obit->rot[k]+obit->parent->rot[k]) )/( 10.0*M_PI ); }
- } else {
- setval = obit->size[k];
- if(obit->parent){ setval *= obit->parent->size[k]; }
- }
- vals[k] = setval;
- }
- if(icudex[j][k]) {
- // XXX calc_icu(icudex[j][k], aniFrlen*((float)i) );
- //vals[k] += icudex[j][k]->curval;
- // add transform, multiply scaling, add trafo&rot
- if(j==2) { vals[k] *= icudex[j][k]->curval; }
- else { vals[k] += icudex[j][k]->curval; }
- if(obit->parent) {
- // add parent transform, multiply scaling, add trafo&rot
- //calc_icu(par_icuex[j][k], aniFrlen*((float)i) );
- //if(j==2) { vals[k] *= par_icudex[j][k]->curval; }
- //else { vals[k] += par_icudex[j][k]->curval; }
- }
- }
- } // k
-
- for(k=0; k<3; k++) {
- float set = vals[k];
- if(j==1) { // rot is downscaled by 10 for ipo !?
- set = 360.0 - (10.0*set);
- }
- channelObjMove[o][j][(i-1)*4 + k] = set;
- } // k
- channelObjMove[o][j][(i-1)*4 + 3] = timeAtFrame[i];
- }
- }
-
- {
- int attrFSIcu[1] = { FLUIDSIM_ATTR_FORCE_STR };
- int attrFRIcu[1] = { FLUIDSIM_ATTR_FORCE_RADIUS };
- int velFSIcu[1] = { FLUIDSIM_VEL_FORCE_STR };
- int velFRIcu[1] = { FLUIDSIM_VEL_FORCE_RADIUS };
-
- float attrFSDefs[1];
- float attrFRDefs[1];
- float velFSDefs[1];
- float velFRDefs[1];
-
- attrFSDefs[0] = fluidmdtmp->fss->attractforceStrength;
- attrFRDefs[0] = fluidmdtmp->fss->attractforceRadius;
- velFSDefs[0] = fluidmdtmp->fss->velocityforceStrength;
- velFRDefs[0] = fluidmdtmp->fss->velocityforceRadius;
-
- fluidsimInitChannel(scene, &channelAttractforceStrength[o], allchannelSize, timeAtFrame, attrFSIcu,attrFSDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- fluidsimInitChannel(scene, &channelAttractforceRadius[o], allchannelSize, timeAtFrame, attrFRIcu,attrFRDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- fluidsimInitChannel(scene, &channelVelocityforceStrength[o], allchannelSize, timeAtFrame, velFSIcu,velFSDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- fluidsimInitChannel(scene, &channelVelocityforceRadius[o], allchannelSize, timeAtFrame, velFRIcu,velFRDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- }
-
- fluidsimInitChannel(scene, &channelObjInivel[o], allchannelSize, timeAtFrame, inivelIcu,inivelDefs, fluidmdtmp->fss->ipo, CHANNEL_VEC );
- fluidsimInitChannel(scene, &channelObjActive[o], allchannelSize, timeAtFrame, activeIcu,activeDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
-
-
- channelObjCount++;
-
- }
- }
-
- // init trafo matrix
+ /* ******** init domain object's matrix ******** */
copy_m4_m4(domainMat, fsDomain->obmat);
if(!invert_m4_m4(invDomMat, domainMat)) {
snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n");
elbeemDebugOut(debugStrBuffer);
BKE_report(reports, RPT_ERROR, "Invalid object matrix.");
- // FIXME add fatal msg
- FS_FREE_CHANNELS;
+
+ free_domain_channels(channels);
+ MEM_freeN(channels);
+
+ free_all_fluidobject_channels(fobjects);
+ BLI_freelistN(fobjects);
+ MEM_freeN(fobjects);
return 0;
}
- // --------------------------------------------------------------------------------------------
- // start writing / exporting
+ /* ******** start writing / exporting ******** */
strcpy(targetFile, targetDir);
strcat(targetFile, suffixConfig);
- if(!doExportOnly) { strcat(targetFile,".tmp"); } // dont overwrite/delete original file
+ strcat(targetFile,".tmp"); // dont overwrite/delete original file
+
// make sure these directories exist as well
if(outStringsChanged) {
BLI_make_existing_file(targetFile);
}
- if(!doExportOnly) {
- ListBase threads;
-
- // perform simulation with El'Beem api and threads
- elbeemSimulationSettings fsset;
- elbeemResetSettings(&fsset);
- fsset.version = 1;
+ /* ******** export domain to elbeem ******** */
+ elbeemResetSettings(&fsset);
+ fsset.version = 1;
- // setup global settings
- for(i=0 ; i<3; i++) fsset.geoStart[i] = bbStart[i];
- for(i=0 ; i<3; i++) fsset.geoSize[i] = bbSize[i];
-
- // simulate with 50^3
- fsset.resolutionxyz = (int)domainSettings->resolutionxyz;
- fsset.previewresxyz = (int)domainSettings->previewresxyz;
- // 10cm water domain
- fsset.realsize = domainSettings->realsize;
- fsset.viscosity = calcViscosity;
- // earth gravity
- fsset.gravity[0] = domainSettings->gravx;
- fsset.gravity[1] = domainSettings->gravy;
- fsset.gravity[2] = domainSettings->gravz;
- // simulate 5 frames, each 0.03 seconds, output to ./apitest_XXX.bobj.gz
- fsset.animStart = domainSettings->animStart;
- fsset.aniFrameTime = aniFrameTime;
- fsset.noOfFrames = noFrames; // is otherwise subtracted in parser
- strcpy(targetFile, targetDir);
- strcat(targetFile, suffixSurface);
- // defaults for compressibility and adaptive grids
- fsset.gstar = domainSettings->gstar;
- fsset.maxRefine = domainSettings->maxRefine; // check <-> gridlevels
- fsset.generateParticles = domainSettings->generateParticles;
- fsset.numTracerParticles = domainSettings->generateTracers;
- fsset.surfaceSmoothing = domainSettings->surfaceSmoothing;
- fsset.surfaceSubdivs = domainSettings->surfaceSubdivs;
- fsset.farFieldSize = domainSettings->farFieldSize;
- strcpy( fsset.outputPath, targetFile);
-
- // domain channels
- fsset.channelSizeFrameTime =
- fsset.channelSizeViscosity =
- fsset.channelSizeGravity = allchannelSize;
- fsset.channelFrameTime = channelDomainTime;
- fsset.channelViscosity = channelDomainViscosity;
- fsset.channelGravity = channelDomainGravity;
-
- fsset.runsimCallback = &runSimulationCallback;
- fsset.runsimUserData = &fsset;
-
- if( (domainSettings->typeFlags&OB_FSBND_NOSLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_NOSLIP;
- else if((domainSettings->typeFlags&OB_FSBND_PARTSLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_PARTSLIP;
- else if((domainSettings->typeFlags&OB_FSBND_FREESLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_FREESLIP;
- fsset.domainobsPartslip = domainSettings->partSlipValue;
- fsset.generateVertexVectors = (domainSettings->domainNovecgen==0);
-
- // init blender trafo matrix
- // fprintf(stderr,"elbeemInit - mpTrafo:\n");
- { int j;
- for(i=0; i<4; i++) {
- for(j=0; j<4; j++) {
- fsset.surfaceTrafo[i*4+j] = invDomMat[j][i];
- // fprintf(stderr,"elbeemInit - mpTrafo %d %d = %f (%d) \n", i,j, fsset.surfaceTrafo[i*4+j] , (i*4+j) );
- }
- } }
-
- // init solver with settings
- elbeemInit();
- elbeemAddDomain(&fsset);
-
- // init objects
- channelObjCount = 0;
- for(base=scene->base.first; base; base= base->next) {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- //{ snprintf(debugStrBuffer,256,"DEBUG object name=%s, type=%d ...\n", obit->id.name, obit->type); elbeemDebugOut(debugStrBuffer); } // DEBUG
- if( fluidmdtmp && // if has to match 3 places! // CHECKMATCH
- (obit->type==OB_MESH) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_PARTICLE))
- {
- float *verts=NULL;
- int *tris=NULL;
- int numVerts=0, numTris=0;
- int o = channelObjCount;
- int deform = (fluidmdtmp->fss->domainNovecgen); // misused value
- // todo - use blenderInitElbeemMesh
- int modifierIndex = modifiers_indexInObject(obit, (ModifierData *)fluidmdtmp);
-
- elbeemMesh fsmesh;
- elbeemResetMesh( &fsmesh );
- fsmesh.type = fluidmdtmp->fss->type;
- // get name of object for debugging solver
- fsmesh.name = obit->id.name;
-
- initElbeemMesh(scene, obit, &numVerts, &verts, &numTris, &tris, 0, modifierIndex);
- fsmesh.numVertices = numVerts;
- fsmesh.numTriangles = numTris;
- fsmesh.vertices = verts;
- fsmesh.triangles = tris;
-
- fsmesh.channelSizeTranslation =
- fsmesh.channelSizeRotation =
- fsmesh.channelSizeScale =
- fsmesh.channelSizeInitialVel =
- fsmesh.channelSizeActive = allchannelSize;
-
- fsmesh.channelTranslation = channelObjMove[o][0];
- fsmesh.channelRotation = channelObjMove[o][1];
- fsmesh.channelScale = channelObjMove[o][2];
- fsmesh.channelActive = channelObjActive[o];
- if( (fsmesh.type == OB_FLUIDSIM_FLUID) ||
- (fsmesh.type == OB_FLUIDSIM_INFLOW)) {
- fsmesh.channelInitialVel = channelObjInivel[o];
- fsmesh.localInivelCoords = ((fluidmdtmp->fss->typeFlags&OB_FSINFLOW_LOCALCOORD)?1:0);
- }
-
- if( (fluidmdtmp->fss->typeFlags&OB_FSBND_NOSLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_NOSLIP;
- else if((fluidmdtmp->fss->typeFlags&OB_FSBND_PARTSLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_PARTSLIP;
- else if((fluidmdtmp->fss->typeFlags&OB_FSBND_FREESLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_FREESLIP;
- fsmesh.obstaclePartslip = fluidmdtmp->fss->partSlipValue;
- fsmesh.volumeInitType = fluidmdtmp->fss->volumeInitType;
- fsmesh.obstacleImpactFactor = fluidmdtmp->fss->surfaceSmoothing; // misused value
-
- if(fsmesh.type == OB_FLUIDSIM_CONTROL)
- {
- // control fluids will get exported as whole
- deform = 1;
-
- fsmesh.cpsTimeStart = fluidmdtmp->fss->cpsTimeStart;
- fsmesh.cpsTimeEnd = fluidmdtmp->fss->cpsTimeEnd;
- fsmesh.cpsQuality = fluidmdtmp->fss->cpsQuality;
- fsmesh.obstacleType = (fluidmdtmp->fss->flag & OB_FLUIDSIM_REVERSE);
-
- fsmesh.channelSizeAttractforceRadius =
- fsmesh.channelSizeVelocityforceStrength =
- fsmesh.channelSizeVelocityforceRadius =
- fsmesh.channelSizeAttractforceStrength = allchannelSize;
-
- fsmesh.channelAttractforceStrength = channelAttractforceStrength[o];
- fsmesh.channelAttractforceRadius = channelAttractforceRadius[o];
- fsmesh.channelVelocityforceStrength = channelVelocityforceStrength[o];
- fsmesh.channelVelocityforceRadius = channelVelocityforceRadius[o];
- }
- else
- {
- // set channels to 0
- fsmesh.channelAttractforceStrength =
- fsmesh.channelAttractforceRadius =
- fsmesh.channelVelocityforceStrength =
- fsmesh.channelVelocityforceRadius = NULL;
- }
-
- // animated meshes
- if(deform) {
- fsmesh.channelSizeVertices = allchannelSize;
- fluidsimInitMeshChannel(C, &fsmesh.channelVertices, allchannelSize, obit, numVerts, timeAtFrame, modifierIndex);
- scene->r.cfra = startFrame;
- ED_update_for_newframe(C, 1);
- // remove channels
- fsmesh.channelTranslation =
- fsmesh.channelRotation =
- fsmesh.channelScale = NULL;
- }
-
- elbeemAddMesh(&fsmesh);
-
- if(verts) MEM_freeN(verts);
- if(tris) MEM_freeN(tris);
- if(fsmesh.channelVertices) MEM_freeN(fsmesh.channelVertices);
- channelObjCount++;
- } // valid mesh
- } // objects
- //domainSettings->type = OB_FLUIDSIM_DOMAIN; // enable for bake display again
-
- // set to neutral, -1 means user abort, -2 means init error
- globalBakeState = 0;
- globalBakeFrame = 0;
-
- BLI_init_threads(&threads, fluidsimSimulateThread, 1);
- BLI_insert_thread(&threads, targetFile);
-
- {
- int done = 0;
- float noFramesf = (float)noFrames;
- float percentdone = 0.0, oldpercentdone = -1.0;
- int lastRedraw = -1;
-
- g_break= 0;
- G.afbreek= 0; /* blender_test_break uses this global */
-
- start_progress_bar();
-
- while(done==0) {
- char busy_mess[80];
-
- waitcursor(1);
-
- // lukep we add progress bar as an interim mesure
- percentdone = globalBakeFrame / noFramesf;
- if (percentdone != oldpercentdone) {
- sprintf(busy_mess, "baking fluids %d / %d |||", globalBakeFrame, (int) noFramesf);
- percentdone = percentdone < 0.0 ? 0.0:percentdone;
- progress_bar(CTX_wm_window(C), percentdone, busy_mess );
- oldpercentdone = percentdone;
- }
-
- //XXX no more need for longer delay to prevent frequent redrawing
- PIL_sleep_ms(200);
-
- BLI_lock_thread(LOCK_CUSTOM1);
- if(globalBakeState != 0) done = 1; // 1=ok, <0=error/abort
- BLI_unlock_thread(LOCK_CUSTOM1);
-
- if (!G.background) {
- g_break= blender_test_break();
-
- if(g_break)
- {
- // abort...
- BLI_lock_thread(LOCK_CUSTOM1);
-
- if(domainSettings)
- domainSettings->lastgoodframe = startFrame+globalBakeFrame;
-
- done = -1;
- globalBakeFrame = 0;
- globalBakeState = -1;
- simAborted = 1;
- BLI_unlock_thread(LOCK_CUSTOM1);
- break;
- }
- }
-
- // redraw the 3D for showing progress once in a while...
- if(lastRedraw!=globalBakeFrame) {
-#if 0
- ScrArea *sa;
- scene->r.cfra = startFrame+globalBakeFrame;
- lastRedraw = globalBakeFrame;
- ED_update_for_newframe(C, 1);
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype == SPACE_VIEW3D) { scrarea_do_windraw(sa); }
- sa= sa->next;
- }
- screen_swapbuffers();
-#endif
- } // redraw
- }
- end_progress_bar(CTX_wm_window(C));
+ // setup global settings
+ copy_v3_v3(fsset.geoStart, domainSettings->bbStart);
+ copy_v3_v3(fsset.geoSize, domainSettings->bbSize);
+
+ // simulate with 50^3
+ fsset.resolutionxyz = (int)domainSettings->resolutionxyz;
+ fsset.previewresxyz = (int)domainSettings->previewresxyz;
+
+ fsset.realsize = get_fluid_size_m(scene, fsDomain, domainSettings);
+ fsset.viscosity = get_fluid_viscosity(domainSettings);
+ get_fluid_gravity(fsset.gravity, scene, domainSettings);
+
+ // simulate 5 frames, each 0.03 seconds, output to ./apitest_XXX.bobj.gz
+ fsset.animStart = domainSettings->animStart;
+ fsset.aniFrameTime = channels->aniFrameTime;
+ fsset.noOfFrames = noFrames; // is otherwise subtracted in parser
+ strcpy(targetFile, targetDir);
+ strcat(targetFile, suffixSurface);
+ // defaults for compressibility and adaptive grids
+ fsset.gstar = domainSettings->gstar;
+ fsset.maxRefine = domainSettings->maxRefine; // check <-> gridlevels
+ fsset.generateParticles = domainSettings->generateParticles;
+ fsset.numTracerParticles = domainSettings->generateTracers;
+ fsset.surfaceSmoothing = domainSettings->surfaceSmoothing;
+ fsset.surfaceSubdivs = domainSettings->surfaceSubdivs;
+ fsset.farFieldSize = domainSettings->farFieldSize;
+ strcpy( fsset.outputPath, targetFile);
+
+ // domain channels
+ fsset.channelSizeFrameTime =
+ fsset.channelSizeViscosity =
+ fsset.channelSizeGravity = channels->length;
+ fsset.channelFrameTime = channels->DomainTime;
+ fsset.channelViscosity = channels->DomainViscosity;
+ fsset.channelGravity = channels->DomainGravity;
+
+ fsset.runsimCallback = &runSimulationCallback;
+ fsset.runsimUserData = fb;
+
+ if (domainSettings->typeFlags & OB_FSBND_NOSLIP) fsset.domainobsType = FLUIDSIM_OBSTACLE_NOSLIP;
+ else if (domainSettings->typeFlags&OB_FSBND_PARTSLIP) fsset.domainobsType = FLUIDSIM_OBSTACLE_PARTSLIP;
+ else if (domainSettings->typeFlags&OB_FSBND_FREESLIP) fsset.domainobsType = FLUIDSIM_OBSTACLE_FREESLIP;
+ fsset.domainobsPartslip = domainSettings->partSlipValue;
+ fsset.generateVertexVectors = (domainSettings->domainNovecgen==0);
+
+ // init blender domain transform matrix
+ { int j;
+ for(i=0; i<4; i++) {
+ for(j=0; j<4; j++) {
+ fsset.surfaceTrafo[i*4+j] = invDomMat[j][i];
}
- BLI_end_threads(&threads);
- } // El'Beem API init, thread creation
- // --------------------------------------------------------------------------------------------
- else
- { // write config file to be run with command line simulator
- BKE_report(reports, RPT_WARNING, "Config file export not supported.");
- } // config file export done!
-
- // --------------------------------------------------------------------------------------------
- FS_FREE_CHANNELS;
+ } }
- // go back to "current" blender time
- waitcursor(0);
+ /* ******** init solver with settings ******** */
+ elbeemInit();
+ elbeemAddDomain(&fsset);
- if(globalBakeState >= 0)
- {
- if(domainSettings)
- domainSettings->lastgoodframe = startFrame+globalBakeFrame;
- }
+ /* ******** export all fluid objects to elbeem ******** */
+ export_fluid_objects(fobjects, scene, channels->length);
- scene->r.cfra = origFrame;
- ED_update_for_newframe(C, 1);
-
- if(!simAborted) {
- char elbeemerr[256];
+ /* custom data for fluid bake job */
+ fb->settings = &fsset;
+
+ /* setup job */
+ WM_jobs_customdata(steve, fb, fluidbake_free);
+ WM_jobs_timer(steve, 0.1, NC_SCENE|ND_FRAME, NC_SCENE|ND_FRAME);
+ WM_jobs_callbacks(steve, fluidbake_startjob, NULL, NULL);
+
+ WM_jobs_start(CTX_wm_manager(C), steve);
- // check if some error occurred
- if(globalBakeState==-2) {
- elbeemGetErrorString(elbeemerr);
- BKE_reportf(reports, RPT_ERROR, "Failed to initialize [Msg: %s]", elbeemerr);
- return 0;
- } // init error
- }
+ /* ******** free stored animation data ******** */
+ free_domain_channels(channels);
+ MEM_freeN(channels);
+ free_all_fluidobject_channels(fobjects);
+ BLI_freelistN(fobjects);
+ MEM_freeN(fobjects);
+
// elbeemFree();
return 1;
}
@@ -1189,7 +1062,6 @@ static int fluid_bake_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
- // XXX TODO redraw, escape, non-blocking, ..
if(!fluidsimBake(C, op->reports, ob))
return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c
index 1425fdc10cf..4bdac8ff3e8 100644
--- a/source/blender/editors/physics/physics_ops.c
+++ b/source/blender/editors/physics/physics_ops.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index 1359af5377f..19f4d8457c1 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -32,8 +32,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
-#include "DNA_object_force.h"
-#include "DNA_modifier_types.h"
#include "BKE_context.h"
#include "BKE_particle.h"
@@ -46,12 +44,8 @@
#include "BLI_blenlib.h"
-#include "ED_screen.h"
-#include "ED_physics.h"
#include "ED_particle.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 44d3b2bec7f..678de91e1b4 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -35,14 +35,7 @@
#include "BLI_editVert.h"
#include "BLI_dlrbTree.h"
-#include "DNA_armature_types.h"
-#include "DNA_image_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
-#include "DNA_meta_types.h"
#include "BKE_blender.h"
#include "BKE_colortools.h"
@@ -65,12 +58,8 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_util.h"
#include "ED_screen.h"
-#include "ED_mesh.h"
#include "ED_object.h"
-#include "ED_screen_types.h"
-#include "ED_keyframes_draw.h"
#include "RE_pipeline.h"
#include "IMB_imbuf.h"
@@ -79,8 +68,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "wm_window.h"
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 196c6aa87e4..1b1e3114fd8 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -37,9 +37,7 @@
#include "BLI_editVert.h"
#include "BLI_dlrbTree.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
#include "BKE_blender.h"
#include "BKE_object.h"
@@ -59,23 +57,15 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_util.h"
#include "ED_screen.h"
-#include "ED_mesh.h"
-#include "ED_object.h"
-#include "ED_screen_types.h"
-#include "ED_keyframes_draw.h"
#include "ED_view3d.h"
#include "RE_pipeline.h"
-#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "GPU_extensions.h"
diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c
index 61157ab74dc..a5177be0aee 100644
--- a/source/blender/editors/render/render_ops.c
+++ b/source/blender/editors/render/render_ops.c
@@ -27,10 +27,8 @@
#include <stdlib.h>
-#include "DNA_windowmanager_types.h"
#include "WM_api.h"
-#include "WM_types.h"
#include "render_intern.h" // own include
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 1eac01a1fa1..2b9526ef635 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -46,12 +46,9 @@
#include "BLI_blenlib.h"
#include "BLI_threads.h"
-#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "DNA_camera_types.h"
-#include "DNA_image_types.h"
#include "DNA_material_types.h"
-#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_lamp_types.h"
#include "DNA_space_types.h"
@@ -83,7 +80,6 @@
#include "RE_pipeline.h"
-#include "GPU_material.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index ce72a5c7f2f..b0ffcb69b1f 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -32,10 +32,8 @@
#include "DNA_curve_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
-#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_world_types.h"
@@ -70,20 +68,16 @@
#include "FRS_freestyle.h"
#include "RNA_access.h"
-#include "RNA_enum_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_curve.h"
#include "ED_mesh.h"
-#include "ED_render.h"
-#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "render_intern.h" // own include
@@ -313,7 +307,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *op)
}
else if(ob->type == OB_FONT) {
EditFont *ef= ((Curve*)ob->data)->editfont;
- int i, selstart, selend;
+ int i, selstart, selend;
if(ef && BKE_font_getselection(ob, &selstart, &selend)) {
for(i=selstart; i<=selend; i++)
@@ -322,8 +316,8 @@ static int material_slot_assign_exec(bContext *C, wmOperator *op)
}
}
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
return OPERATOR_FINISHED;
}
@@ -402,7 +396,7 @@ static int material_slot_de_select(bContext *C, int select)
}
}
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 45a64af6dbd..61aa7a63da9 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -31,8 +31,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h" // for stopping filebrowser thread on space change
#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
@@ -375,7 +373,7 @@ void ED_region_tag_redraw(ARegion *ar)
{
if(ar) {
/* zero region means full region redraw */
- ar->do_draw= 1;
+ ar->do_draw= RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
}
}
@@ -385,7 +383,7 @@ void ED_region_tag_redraw_partial(ARegion *ar, rcti *rct)
if(ar) {
if(!ar->do_draw) {
/* no redraw set yet, set partial region */
- ar->do_draw= 1;
+ ar->do_draw= RGN_DRAW_PARTIAL;
ar->drawrct= *rct;
}
else if(ar->drawrct.xmin != ar->drawrct.xmax) {
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 4223a401b0e..06da91c3e37 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -32,7 +32,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_vec_types.h"
-#include "DNA_listBase.h"
#include "BKE_utildefines.h"
#include "BKE_colortools.h"
@@ -541,7 +540,7 @@ void glaDrawPixelsSafe_to32(float fx, float fy, int img_w, int img_h, int row_w,
floatbuf_to_srgb_byte(rectf, rect32, 0, img_w, 0, img_h, img_w);
} else {
floatbuf_to_byte(rectf, rect32, 0, img_w, 0, img_h, img_w);
- }
+ }
glaDrawPixelsSafe(fx, fy, img_w, img_h, img_w, GL_RGBA, GL_UNSIGNED_BYTE, rect32);
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index 902570f8717..38f0778ea0c 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -29,7 +29,6 @@
#include "DNA_object_types.h"
#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 6dbde4cf73c..4ec63c3c481 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -28,10 +28,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_vec_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
@@ -1547,7 +1544,7 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
printf("something wrong in areafullscreen\n");
return NULL;
}
- // old feature described below (ton)
+ // old feature described below (ton)
// in autoplay screens the headers are disabled by
// default. So use the old headertype instead
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 11a7ac119a4..afdad624c1e 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -37,7 +37,6 @@
#include "DNA_armature_types.h"
#include "DNA_lattice_types.h"
#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
#include "DNA_meta_types.h"
@@ -63,7 +62,6 @@
#include "ED_util.h"
#include "ED_screen.h"
-#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen_types.h"
#include "ED_keyframes_draw.h"
@@ -72,7 +70,6 @@
#include "RNA_define.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "wm_window.h"
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 585a600c579..b6cb6978dc1 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -57,8 +57,6 @@
#include "PIL_time.h"
-#include "ED_fileselect.h"
-#include "ED_screen.h"
#include "ED_screen_types.h"
#include "screen_intern.h"
@@ -275,7 +273,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update)
BKE_reportf(&sj->reports, RPT_INFO, "Saved file: %s", name);
}
- /* imbuf knows which rects are not part of ibuf */
+ /* imbuf knows which rects are not part of ibuf */
IMB_freeImBuf(ibuf);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 9fc858a191f..df2e4032257 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -50,18 +50,10 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_image_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
@@ -82,11 +74,9 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "UI_interface.h"
#include "UI_view2d.h"
#include "ED_image.h"
-#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_view3d.h"
@@ -422,7 +412,7 @@ static void image_undo_restore(bContext *C, ListBase *lb)
UndoImageTile *tile;
tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
- IB_rectfloat|IB_rect, 0);
+ IB_rectfloat|IB_rect, 0);
for(tile=lb->first; tile; tile=tile->next) {
/* find image based on name, pointer becomes invalid with global undo */
@@ -498,14 +488,14 @@ static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4],
wtot = w[0]+w[1]+w[2];
if (wtot != 0.0f) {
- wtot_inv = 1.0f/wtot;
+ wtot_inv = 1.0f/wtot;
- w[0] = w[0]*wtot_inv;
- w[1] = w[1]*wtot_inv;
- w[2] = w[2]*wtot_inv;
+ w[0] = w[0]*wtot_inv;
+ w[1] = w[1]*wtot_inv;
+ w[2] = w[2]*wtot_inv;
}
else /* dummy values for zero area face */
- w[0] = w[1] = w[2] = 1.0f/3.0f;
+ w[0] = w[1] = w[2] = 1.0f/3.0f;
}
static float VecZDepthOrtho(float pt[2], float v1[3], float v2[3], float v3[3], float w[3])
@@ -691,7 +681,7 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
* 0 : no occlusion
* -1 : no occlusion but 2D intersection is true (avoid testing the other half of a quad)
* 1 : occluded
- 2 : occluded with w[3] weights set (need to know in some cases) */
+ 2 : occluded with w[3] weights set (need to know in some cases) */
static int project_paint_occlude_ptv(float pt[3], float v1[3], float v2[3], float v3[3], float w[3], int is_ortho)
{
@@ -2871,7 +2861,7 @@ static void project_paint_begin(ProjPaintState *ps)
if (ps->dm_mtface_clone==NULL || ps->dm_mtface_clone==ps->dm_mtface) {
ps->do_layer_clone = 0;
ps->dm_mtface_clone= NULL;
- printf("ACK!\n");
+ printf("ACK!\n");
}
}
@@ -4992,7 +4982,7 @@ static int paint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *even
ToolSettings *ts = CTX_data_scene(C)->toolsettings;
int ret = WM_radial_control_modal(C, op, event);
if(ret != OPERATOR_RUNNING_MODAL)
- toggle_paint_cursor(C, !ts->imapaint.paintcursor);
+ toggle_paint_cursor(C, !ts->imapaint.paintcursor);
return ret;
}
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 2b94ce01c6d..b25eec70311 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -50,8 +50,8 @@ typedef void (*StrokeUpdateStep)(struct bContext *C, struct PaintStroke *stroke,
typedef void (*StrokeDone)(struct bContext *C, struct PaintStroke *stroke);
struct PaintStroke *paint_stroke_new(struct bContext *C,
- StrokeGetLocation get_location, StrokeTestStart test_start,
- StrokeUpdateStep update_step, StrokeDone done);
+ StrokeGetLocation get_location, StrokeTestStart test_start,
+ StrokeUpdateStep update_step, StrokeDone done);
void paint_stroke_free(struct PaintStroke *stroke);
int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 16734f28cb2..abd56babd8d 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -19,7 +19,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
@@ -27,7 +26,6 @@
#include "BKE_context.h"
#include "BKE_paint.h"
-#include "ED_sculpt.h"
#include "ED_screen.h"
#include "UI_resources.h"
@@ -36,7 +34,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_enum_types.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
@@ -68,7 +65,7 @@ void BRUSH_OT_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Brush";
- ot->description= "Add brush by mode type";
+ ot->description= "Add brush by mode type";
ot->idname= "BRUSH_OT_add";
/* api callbacks */
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 2adda475866..c25b5685844 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -28,10 +28,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "RNA_access.h"
@@ -43,7 +41,6 @@
#include "BLI_math.h"
-#include "PIL_time.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -218,10 +215,10 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const
/**** Public API ****/
PaintStroke *paint_stroke_new(bContext *C,
- StrokeGetLocation get_location,
- StrokeTestStart test_start,
- StrokeUpdateStep update_step,
- StrokeDone done)
+ StrokeGetLocation get_location,
+ StrokeTestStart test_start,
+ StrokeUpdateStep update_step,
+ StrokeDone done)
{
PaintStroke *stroke = MEM_callocN(sizeof(PaintStroke), "PaintStroke");
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index a853e5c0524..85fbd5954e8 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -7,8 +7,6 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -221,7 +219,7 @@ void BRUSH_OT_curve_preset(wmOperatorType *ot)
{0, NULL, 0, NULL, NULL}};
ot->name= "Preset";
- ot->description= "Set brush shape";
+ ot->description= "Set brush shape";
ot->idname= "BRUSH_OT_curve_preset";
ot->exec= brush_curve_preset_exec;
@@ -244,7 +242,7 @@ static int paint_select_linked_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_linked(wmOperatorType *ot)
{
ot->name= "Select Linked";
- ot->description= "Select linked faces";
+ ot->description= "Select linked faces";
ot->idname= "PAINT_OT_face_select_linked";
ot->exec= paint_select_linked_exec;
@@ -264,7 +262,7 @@ static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent
void PAINT_OT_face_select_linked_pick(wmOperatorType *ot)
{
ot->name= "Select Linked Pick";
- ot->description= "Select linked faces";
+ ot->description= "Select linked faces";
ot->idname= "PAINT_OT_face_select_linked_pick";
ot->invoke= paint_select_linked_pick_invoke;
@@ -287,7 +285,7 @@ static int face_select_all_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_all(wmOperatorType *ot)
{
ot->name= "Face Selection";
- ot->description= "Change selection for all faces";
+ ot->description= "Change selection for all faces";
ot->idname= "PAINT_OT_face_select_all";
ot->exec= face_select_all_exec;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 9ba67845371..d1274cdac8b 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -45,22 +45,9 @@
#include "BLI_math.h"
#include "BLI_ghash.h"
-#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_cloth_types.h"
#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -90,9 +77,7 @@
#include "ED_armature.h"
#include "ED_mesh.h"
-#include "ED_object.h"
#include "ED_screen.h"
-#include "ED_util.h"
#include "ED_view3d.h"
#include "paint_intern.h"
@@ -1778,7 +1763,7 @@ Operator->invoke()
Operator->modal()
- for every mousemove, apply vertex paint
- exit on mouse release, free customdata
- (return OPERATOR_FINISHED also removes handler and operator)
+ (return OPERATOR_FINISHED also removes handler and operator)
For future:
- implement a stroke event (or mousemove with past positons)
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index d2c4e386fe7..0b11c1a25f6 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -39,20 +39,11 @@
#include "BLI_pbvh.h"
#include "BLI_threads.h"
-#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_image_types.h"
#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_color_types.h"
#include "BKE_brush.h"
#include "BKE_cdderivedmesh.h"
@@ -79,11 +70,8 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
-#include "ED_space_api.h"
-#include "ED_util.h"
#include "ED_view3d.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
@@ -91,12 +79,9 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "IMB_imbuf_types.h"
#include "RE_render_ext.h"
-#include "RE_shader_ext.h" /*for multitex_ext*/
-#include "GPU_draw.h"
#include "gpu_buffers.h"
#include <math.h>
@@ -133,6 +118,7 @@ typedef struct StrokeCache {
float radius;
float true_location[3];
float location[3];
+
float flip;
float pressure;
float mouse[2];
@@ -191,20 +177,18 @@ static void projectf(bglMats *mats, const float v[3], float p[2])
/* Get a screen-space rectangle of the modified area */
int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
- Object *ob, rcti *rect)
+ Object *ob, rcti *rect)
{
- /* can't use ob->sculpt->tree, only valid during sculpt */
- DerivedMesh *dm= ob->derivedFinal;
- PBVH *tree= (dm)? dm->getPBVH(ob, dm): NULL;
+ PBVH *pbvh= ob->sculpt->pbvh;
float bb_min[3], bb_max[3], pmat[4][4];
int i, j, k;
view3d_get_object_project_mat(rv3d, ob, pmat);
- if(!tree)
+ if(!pbvh)
return 0;
- BLI_pbvh_redraw_BB(tree, bb_min, bb_max);
+ BLI_pbvh_redraw_BB(pbvh, bb_min, bb_max);
rect->xmin = rect->ymin = INT_MAX;
rect->xmax = rect->ymax = INT_MIN;
@@ -232,10 +216,9 @@ int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
}
void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
- RegionView3D *rv3d, Object *ob)
+ RegionView3D *rv3d, Object *ob)
{
- DerivedMesh *dm= ob->derivedFinal;
- PBVH *tree= (dm)? dm->getPBVH(ob, dm): NULL;
+ PBVH *pbvh= ob->sculpt->pbvh;
BoundBox *bb = MEM_callocN(sizeof(BoundBox), "sculpt boundbox");
bglMats mats;
rcti rect;
@@ -264,8 +247,8 @@ void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
MEM_freeN(bb);
/* clear redraw flag from nodes */
- if(tree)
- BLI_pbvh_update(tree, PBVH_UpdateRedraw, NULL);
+ if(pbvh)
+ BLI_pbvh_update(pbvh, PBVH_UpdateRedraw, NULL);
}
/************************** Undo *************************/
@@ -289,6 +272,9 @@ typedef struct SculptUndoNode {
int gridsize; /* same for grid */
int totgrid; /* to restore into right location */
int *grids; /* to restore into right location */
+
+ /* layer brush */
+ float *layer_disp;
} SculptUndoNode;
static void update_cb(PBVHNode *node, void *data)
@@ -296,6 +282,20 @@ static void update_cb(PBVHNode *node, void *data)
BLI_pbvh_node_mark_update(node);
}
+/* Checks whether full update mode (slower) needs to be used to work with modifiers */
+static int sculpt_modifiers_active(Scene *scene, Object *ob)
+{
+ ModifierData *md;
+
+ for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) {
+ if(modifier_isEnabled(scene, md, eModifierMode_Realtime))
+ if(!ELEM(md->type, eModifierType_Multires, eModifierType_ShapeKey))
+ return 1;
+ }
+
+ return 0;
+}
+
static void sculpt_undo_restore(bContext *C, ListBase *lb)
{
Scene *scene = CTX_data_scene(C);
@@ -327,7 +327,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
}
- else if(unode->maxgrid) {
+ else if(unode->maxgrid && dm->getGridData) {
/* multires restore */
DMGridData **grids, *grid;
float (*co)[3];
@@ -360,11 +360,14 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
/* we update all nodes still, should be more clever, but also
needs to work correct when exiting/entering sculpt mode and
the nodes get recreated, though in that case it could do all */
- BLI_pbvh_search_callback(ss->tree, NULL, NULL, update_cb, NULL);
- BLI_pbvh_update(ss->tree, PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw, NULL);
+ BLI_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb, NULL);
+ BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw, NULL);
if((mmd=sculpt_multires_active(ob)))
multires_mark_as_modified(ob);
+
+ if(sculpt_modifiers_active(scene, ob))
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
}
@@ -381,6 +384,8 @@ static void sculpt_undo_free(ListBase *lb)
MEM_freeN(unode->index);
if(unode->grids)
MEM_freeN(unode->grids);
+ if(unode->layer_disp)
+ MEM_freeN(unode->layer_disp);
}
}
@@ -418,8 +423,8 @@ static SculptUndoNode *sculpt_undo_push_node(SculptSession *ss, PBVHNode *node)
strcpy(unode->idname, ob->id.name);
unode->node= node;
- BLI_pbvh_node_num_verts(ss->tree, node, &totvert, &allvert);
- BLI_pbvh_node_get_grids(ss->tree, node, &grids, &totgrid,
+ BLI_pbvh_node_num_verts(ss->pbvh, node, &totvert, &allvert);
+ BLI_pbvh_node_get_grids(ss->pbvh, node, &grids, &totgrid,
&maxgrid, &gridsize, NULL, NULL);
unode->totvert= totvert;
@@ -448,7 +453,7 @@ static SculptUndoNode *sculpt_undo_push_node(SculptSession *ss, PBVHNode *node)
{
PBVHVertexIter vd;
- BLI_pbvh_vertex_iter_begin(ss->tree, node, vd, PBVH_ITER_ALL) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_ALL) {
copy_v3_v3(unode->co[vd.i], vd.co);
if(vd.no) VECCOPY(unode->no[vd.i], vd.no)
else normal_float_to_short_v3(unode->no[vd.i], vd.fno);
@@ -480,6 +485,11 @@ static void sculpt_undo_push_end(SculptSession *ss)
MEM_freeN(unode->no);
unode->no= NULL;
}
+
+ if(unode->layer_disp) {
+ MEM_freeN(unode->layer_disp);
+ unode->layer_disp= NULL;
+ }
}
undo_paint_push_end(UNDO_PAINT_MESH);
@@ -708,7 +718,7 @@ static int sculpt_search_sphere_cb(PBVHNode *node, void *data_v)
BLI_pbvh_node_get_original_BB(node, bb_min, bb_max);
else
BLI_pbvh_node_get_BB(node, bb_min, bb_max);
-
+
for(i = 0; i < 3; ++i) {
if(bb_min[i] > center[i])
nearest[i] = bb_min[i];
@@ -751,7 +761,7 @@ static void add_norm_if(float view_vec[3], float out[3], float out_flip[3], floa
/* For draw/layer/flatten; finds average normal for all active vertices */
static void calc_area_normal(Sculpt *sd, SculptSession *ss, float area_normal[3], PBVHNode **nodes, int totnode)
{
- PBVH *bvh= ss->tree;
+ PBVH *bvh= ss->pbvh;
StrokeCache *cache = ss->cache;
const int view = 0; /* XXX: should probably be a flag, not number: brush_type==SCULPT_TOOL_DRAW ? sculptmode_brush()->view : 0; */
float out[3] = {0.0f, 0.0f, 0.0f};
@@ -845,7 +855,7 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t
sculpt_undo_push_node(ss, nodes[n]);
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
/* offset vertex */
float fade = tex_strength(ss, brush, vd.co, test.dist);
@@ -886,9 +896,9 @@ static void neighbor_average(SculptSession *ss, float avg[3], const int vert)
if(f->v4) {
skip= (f->v1==vert?2:
- f->v2==vert?3:
- f->v3==vert?0:
- f->v4==vert?1:-1);
+ f->v2==vert?3:
+ f->v3==vert?0:
+ f->v4==vert?1:-1);
}
for(i=0; i<(f->v4?4:3); ++i) {
@@ -916,7 +926,7 @@ static void do_mesh_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *node)
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, node, vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
float fade = tex_strength(ss, brush, vd.co, test.dist)*bstrength;
float avg[3], val[3];
@@ -948,7 +958,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_node_get_grids(ss->tree, node, &grid_indices, &totgrid,
+ BLI_pbvh_node_get_grids(ss->pbvh, node, &grid_indices, &totgrid,
NULL, &gridsize, &griddata, &gridadj);
#pragma omp critical
@@ -1050,13 +1060,13 @@ static void do_pinch_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int
sculpt_undo_push_node(ss, nodes[n]);
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
float fade = tex_strength(ss, brush, vd.co, test.dist)*bstrength;
float val[3]= {vd.co[0]+(test.location[0]-vd.co[0])*fade,
vd.co[1]+(test.location[1]-vd.co[1])*fade,
vd.co[2]+(test.location[2]-vd.co[2])*fade};
-
+
sculpt_clip(sd, ss, vd.co, val);
if(vd.mvert) vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
}
@@ -1085,7 +1095,7 @@ static void do_grab_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t
origco= sculpt_undo_push_node(ss, nodes[n])->co;
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, origco[vd.i])) {
float fade = tex_strength(ss, brush, origco[vd.i], test.dist)*bstrength;
float add[3]= {vd.co[0]+fade*grab_delta[0],
@@ -1110,10 +1120,6 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int
float lim= ss->cache->radius / 4;
int n;
- /* XXX not working yet for multires */
- if(ss->multires)
- return;
-
if(ss->cache->flip)
lim = -lim;
@@ -1127,16 +1133,21 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
- float (*origco)[3];
+ SculptUndoNode *unode;
+ float (*origco)[3], *layer_disp;
- origco= sculpt_undo_push_node(ss, nodes[n])->co;
+ unode= sculpt_undo_push_node(ss, nodes[n]);
+ origco=unode->co;
+ if(!unode->layer_disp)
+ unode->layer_disp= MEM_callocN(sizeof(float)*unode->totvert, "layer disp");
+ layer_disp= unode->layer_disp;
+
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
float fade = tex_strength(ss, brush, vd.co, test.dist)*bstrength;
- int index= vd.vert_indices[vd.i];
- float *disp= &ss->layer_disps[index];
+ float *disp= &layer_disp[vd.i];
float val[3];
*disp+= fade;
@@ -1146,6 +1157,8 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int
*disp = lim;
if(ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) {
+ int index= vd.vert_indices[vd.i];
+
/* persistent base */
val[0] = ss->layer_co[index][0] + (*disp)*offset[0];
val[1] = ss->layer_co[index][1] + (*disp)*offset[1];
@@ -1181,7 +1194,7 @@ static void do_inflate_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, in
sculpt_undo_push_node(ss, nodes[n]);
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
float fade = tex_strength(ss, brush, vd.co, test.dist)*bstrength;
float add[3];
@@ -1225,7 +1238,7 @@ static void calc_flatten_center(Sculpt *sd, SculptSession *ss, PBVHNode **nodes,
sculpt_undo_push_node(ss, nodes[n]);
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
for(j = 0; j < FLATTEN_SAMPLE_SIZE; ++j) {
if(test.dist > outer_dist[j]) {
@@ -1297,7 +1310,7 @@ static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, PBVHNode **node
flip = bstr < 0;
}
- #pragma omp parallel for private(n) schedule(static)
+ //#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
PBVHVertexIter vd;
SculptBrushTest test;
@@ -1305,7 +1318,7 @@ static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, PBVHNode **node
sculpt_undo_push_node(ss, nodes[n]);
sculpt_brush_test_init(ss, &test);
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
float intr[3], val[3];
@@ -1358,7 +1371,7 @@ static void do_brush_action(Sculpt *sd, SculptSession *ss, StrokeCache *cache)
area of influence */
if(brush->sculpt_tool == SCULPT_TOOL_GRAB) {
data.original= 1;
- BLI_pbvh_search_gather(ss->tree, sculpt_search_sphere_cb, &data,
+ BLI_pbvh_search_gather(ss->pbvh, sculpt_search_sphere_cb, &data,
&nodes, &totnode);
if(cache->first_time)
@@ -1367,7 +1380,7 @@ static void do_brush_action(Sculpt *sd, SculptSession *ss, StrokeCache *cache)
copy_v3_v3(ss->cache->location, ss->cache->grab_active_location[ss->cache->symmetry]);
}
else {
- BLI_pbvh_search_gather(ss->tree, sculpt_search_sphere_cb, &data,
+ BLI_pbvh_search_gather(ss->pbvh, sculpt_search_sphere_cb, &data,
&nodes, &totnode);
}
@@ -1458,20 +1471,6 @@ static void sculpt_update_tex(Sculpt *sd, SculptSession *ss)
}
}
-/* Checks whether full update mode (slower) needs to be used to work with modifiers */
-static int sculpt_modifiers_active(Scene *scene, Object *ob)
-{
- ModifierData *md;
-
- for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) {
- if(modifier_isEnabled(scene, md, eModifierMode_Realtime))
- if(!ELEM(md->type, eModifierType_Multires, eModifierType_ShapeKey))
- return 1;
- }
-
- return 0;
-}
-
/* Sculpt mode handles multires differently from regular meshes, but only if
it's the last modifier on the stack and it is not on the first level */
struct MultiresModifierData *sculpt_multires_active(Object *ob)
@@ -1546,7 +1545,7 @@ void sculpt_update_mesh_elements(Scene *scene, Object *ob, int need_fmap)
ss->face_normals = NULL;
}
- ss->tree = dm->getPBVH(ob, dm);
+ ss->pbvh = dm->getPBVH(ob, dm);
ss->fmap = (need_fmap && dm->getFaceMap)? dm->getFaceMap(ob, dm): NULL;
}
@@ -1579,7 +1578,7 @@ static char *sculpt_tool_name(Sculpt *sd)
case SCULPT_TOOL_LAYER:
return "Layer Brush"; break;
case SCULPT_TOOL_FLATTEN:
- return "Flatten Brush"; break;
+ return "Flatten Brush"; break;
default:
return "Sculpting"; break;
}
@@ -1631,7 +1630,7 @@ static void SCULPT_OT_radial_control(wmOperatorType *ot)
}
/**** Operator for applying a stroke (various attributes including mouse path)
- using the current brush. ****/
+ using the current brush. ****/
static float unproject_brush_radius(Object *ob, ViewContext *vc, float center[3], float offset)
{
@@ -1684,16 +1683,13 @@ static void sculpt_update_cache_invariants(Sculpt *sd, SculptSession *ss, bConte
view3d_get_transformation(vc->ar, vc->rv3d, vc->obact, cache->mats);
/* Initialize layer brush displacements and persistent coords */
- if(brush->sculpt_tool == SCULPT_TOOL_LAYER && !ss->multires) {
- if(!ss->layer_disps || !(brush->flag & BRUSH_PERSISTENT)) {
- if(ss->layer_disps)
- MEM_freeN(ss->layer_disps);
- ss->layer_disps = MEM_callocN(sizeof(float) * ss->totvert, "layer brush displacements");
- }
- if(!ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) {
+ if(brush->sculpt_tool == SCULPT_TOOL_LAYER) {
+ /* not supported yet for multires */
+ if(!ss->multires && !ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) {
if(!ss->layer_co)
ss->layer_co= MEM_mallocN(sizeof(float) * 3 * ss->totvert,
- "sculpt mesh vertices copy");
+ "sculpt mesh vertices copy");
+
for(i = 0; i < ss->totvert; ++i)
copy_v3_v3(ss->layer_co[i], ss->mvert[i].co);
}
@@ -1756,7 +1752,7 @@ static void sculpt_update_cache_variants(Sculpt *sd, SculptSession *ss, struct P
dy = cache->mouse[1] - cache->initial_mouse[1];
cache->pixel_radius = sqrt(dx*dx + dy*dy);
cache->radius = unproject_brush_radius(ss->ob, paint_stroke_view_context(stroke),
- cache->true_location, cache->pixel_radius);
+ cache->true_location, cache->pixel_radius);
cache->rotation = atan2(dy, dx);
}
else if(brush->flag & BRUSH_RAKE) {
@@ -1779,17 +1775,27 @@ static void sculpt_update_cache_variants(Sculpt *sd, SculptSession *ss, struct P
/* Find the grab delta */
if(brush->sculpt_tool == SCULPT_TOOL_GRAB) {
- float grab_location[3];
+ float grab_location[3], imat[4][4];
if(cache->first_time)
copy_v3_v3(cache->orig_grab_location, cache->true_location);
- initgrabz(cache->vc->rv3d, cache->orig_grab_location[0], cache->orig_grab_location[1], cache->orig_grab_location[2]);
+ /* compute 3d coordinate at same z from original location + mouse */
+ initgrabz(cache->vc->rv3d, cache->orig_grab_location[0],
+ cache->orig_grab_location[1], cache->orig_grab_location[2]);
window_to_3d_delta(cache->vc->ar, grab_location, cache->mouse[0], cache->mouse[1]);
- if(!cache->first_time)
+ /* compute delta to move verts by */
+ if(!cache->first_time) {
sub_v3_v3v3(cache->grab_delta, grab_location, cache->old_grab_location);
+ invert_m4_m4(imat, ss->ob->obmat);
+ mul_mat3_m4_v3(imat, cache->grab_delta);
+ }
+
copy_v3_v3(cache->old_grab_location, grab_location);
+
+ /* location stays the same for finding vertices in brush radius */
+ copy_v3_v3(cache->true_location, cache->orig_grab_location);
}
}
@@ -1824,7 +1830,7 @@ void sculpt_raycast_cb(PBVHNode *node, void *data_v)
origco= (unode)? unode->co: NULL;
}
- srd->hit |= BLI_pbvh_node_raycast(srd->ss->tree, node, origco,
+ srd->hit |= BLI_pbvh_node_raycast(srd->ss->pbvh, node, origco,
srd->ray_start, srd->ray_normal, &srd->dist);
}
@@ -1860,8 +1866,8 @@ int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float ou
srd.dist = dist;
srd.hit = 0;
srd.original = (cache)? cache->original: 0;
- BLI_pbvh_raycast(ss->tree, sculpt_raycast_cb, &srd,
- ray_start, ray_normal, srd.original);
+ BLI_pbvh_raycast(ss->pbvh, sculpt_raycast_cb, &srd,
+ ray_start, ray_normal, srd.original);
copy_v3_v3(out, ray_normal);
mul_v3_fl(out, srd.dist);
@@ -1943,7 +1949,7 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
PBVHNode **nodes;
int n, totnode;
- BLI_pbvh_search_gather(ss->tree, NULL, NULL, &nodes, &totnode);
+ BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode);
#pragma omp parallel for private(n) schedule(static)
for(n=0; n<totnode; n++) {
@@ -1953,7 +1959,7 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
if(unode) {
PBVHVertexIter vd;
- BLI_pbvh_vertex_iter_begin(ss->tree, nodes[n], vd, PBVH_ITER_UNIQUE) {
+ BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
copy_v3_v3(vd.co, unode->co[vd.i]);
if(vd.no) VECCOPY(vd.no, unode->no[vd.i])
else normal_short_to_float_v3(vd.fno, unode->no[vd.i]);
@@ -1968,8 +1974,8 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
copy_v3_v3(fn, cache->face_norms[i]);
}
- if(brush->sculpt_tool == SCULPT_TOOL_LAYER && !ss->multires)
- memset(ss->layer_disps, 0, sizeof(float) * ss->totvert);
+ if(nodes)
+ MEM_freeN(nodes);
}
}
@@ -1992,7 +1998,7 @@ static void sculpt_flush_update(bContext *C)
else {
rcti r;
- BLI_pbvh_update(ss->tree, PBVH_UpdateBB, NULL);
+ BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB, NULL);
redraw = sculpt_get_redraw_rect(ar, CTX_wm_region_view3d(C), ob, &r);
if(redraw) {
@@ -2017,7 +2023,7 @@ static int over_mesh(bContext *C, struct wmOperator *op, float x, float y)
}
static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op,
- wmEvent *event)
+ wmEvent *event)
{
/* Don't start the stroke until mouse goes over the mesh */
if(over_mesh(C, op, event->x, event->y)) {
@@ -2067,7 +2073,7 @@ static void sculpt_stroke_done(bContext *C, struct PaintStroke *stroke)
sculpt_undo_push_end(ss);
- BLI_pbvh_update(ss->tree, PBVH_UpdateOriginalBB, NULL);
+ BLI_pbvh_update(ss->pbvh, PBVH_UpdateOriginalBB, NULL);
if(ss->refkb) sculpt_key_to_mesh(ss->refkb, ob);
@@ -2177,10 +2183,6 @@ static int sculpt_set_persistent_base(bContext *C, wmOperator *op)
SculptSession *ss = CTX_data_active_object(C)->sculpt;
if(ss) {
- if(ss->layer_disps)
- MEM_freeN(ss->layer_disps);
- ss->layer_disps = NULL;
-
if(ss->layer_co)
MEM_freeN(ss->layer_co);
ss->layer_co = NULL;
@@ -2231,7 +2233,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
/* Leave sculptmode */
ob->mode &= ~OB_MODE_SCULPT;
- free_sculptsession(&ob->sculpt);
+ free_sculptsession(ob);
}
else {
/* Enter sculptmode */
@@ -2246,7 +2248,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
/* Create sculpt mode session data */
if(ob->sculpt)
- free_sculptsession(&ob->sculpt);
+ free_sculptsession(ob);
sculpt_init_session(scene, ob);
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index 39717273278..376db0d3d58 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -33,9 +33,7 @@
#include "DNA_packedFile_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
-#include "DNA_sound_types.h"
#include "DNA_sequence_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -47,7 +45,6 @@
#include "BLI_blenlib.h"
-#include "ED_sound.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -182,23 +179,23 @@ static void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder,
pup= uiPupMenuBegin(C, "Unpack file", 0);
layout= uiPupMenuLayout(pup);
- uiItemEnumO(layout, "Remove Pack", 0, opname, "method", PF_REMOVE);
+ uiItemEnumO(layout, opname, "Remove Pack", 0, "method", PF_REMOVE);
if(strcmp(abs_name, local_name)) {
switch(checkPackedFile(local_name, pf)) {
case PF_NOFILE:
sprintf(line, "Create %s", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL);
break;
case PF_EQUAL:
sprintf(line, "Use %s (identical)", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
break;
case PF_DIFFERS:
sprintf(line, "Use %s (differs)", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
sprintf(line, "Overwrite %s", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL);
break;
}
}
@@ -206,17 +203,17 @@ static void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder,
switch(checkPackedFile(abs_name, pf)) {
case PF_NOFILE:
sprintf(line, "Create %s", abs_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
break;
case PF_EQUAL:
sprintf(line, "Use %s (identical)", abs_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
break;
case PF_DIFFERS:
sprintf(line, "Use %s (differs)", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
sprintf(line, "Overwrite %s", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
break;
}
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index 9c394f51d43..d486bff9b6f 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -45,26 +45,8 @@
/* Types --------------------------------------------------------------- */
-#include "DNA_listBase.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_windowmanager_types.h"
-#include "DNA_world_types.h"
#include "BKE_action.h"
#include "BKE_depsgraph.h"
@@ -82,15 +64,11 @@
#include "BIF_glutil.h"
#include "UI_interface.h"
-#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "ED_anim_api.h"
-#include "ED_keyframing.h"
#include "ED_keyframes_draw.h"
-#include "ED_screen.h"
-#include "ED_space_api.h"
/* ************************************************************************* */
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index ba8e49e3789..b71781f18e5 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -42,21 +42,8 @@
#include "BLI_math.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -77,10 +64,8 @@
#include "ED_anim_api.h"
#include "ED_keyframing.h"
-#include "ED_keyframes_draw.h"
#include "ED_keyframes_edit.h"
#include "ED_screen.h"
-#include "ED_space_api.h"
#include "ED_transform.h"
#include "WM_api.h"
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index d570da2fd62..f65bd67dcf8 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -31,28 +31,19 @@
#include "MEM_guardedalloc.h"
-#include "DNA_listBase.h"
-#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BKE_context.h"
#include "BKE_utildefines.h"
-#include "UI_interface.h"
-#include "UI_view2d.h"
#include "ED_transform.h"
#include "action_intern.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index e8e44fa3ebf..257d22e17b6 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -40,22 +40,8 @@
#include "BLI_dlrbTree.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_windowmanager_types.h"
-#include "DNA_world_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -73,12 +59,10 @@
#include "UI_view2d.h"
#include "ED_anim_api.h"
-#include "ED_keyframing.h"
#include "ED_keyframes_draw.h"
#include "ED_keyframes_edit.h"
#include "ED_markers.h"
#include "ED_screen.h"
-#include "ED_space_api.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index beca03b1625..7e02454254b 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -29,12 +29,8 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_listBase.h"
#include "DNA_action_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -47,7 +43,6 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -55,12 +50,10 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "ED_anim_api.h"
-#include "ED_keyframes_draw.h"
#include "ED_markers.h"
#include "action_intern.h" // own include
@@ -110,10 +103,10 @@ static SpaceLink *action_new(const bContext *C)
ar->v2d.cur = ar->v2d.tot;
ar->v2d.min[0]= 0.0f;
- ar->v2d.min[1]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
ar->v2d.max[0]= MAXFRAMEF;
- ar->v2d.max[1]= FLT_MAX;
+ ar->v2d.max[1]= FLT_MAX;
ar->v2d.minzoom= 0.01f;
ar->v2d.maxzoom= 50;
diff --git a/source/blender/editors/space_api/space.c b/source/blender/editors/space_api/space.c
index 89436c37a0a..66cb88ebf70 100644
--- a/source/blender/editors/space_api/space.c
+++ b/source/blender/editors/space_api/space.c
@@ -37,7 +37,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_screen.h"
/* */
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index b81fd384a6a..ba7172b0da8 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -28,7 +28,6 @@
#include "BLI_blenlib.h"
#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
#include "DNA_windowmanager_types.h"
#include "BKE_context.h"
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index c0195fa71fb..e1df3b9f18f 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -31,17 +31,10 @@
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
-#include "DNA_modifier_types.h"
#include "DNA_node_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "BLI_listbase.h"
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c
index 18f266f85c6..d8cbbb0cbae 100644
--- a/source/blender/editors/space_buttons/buttons_header.c
+++ b/source/blender/editors/space_buttons/buttons_header.c
@@ -29,11 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -45,10 +40,7 @@
#include "ED_screen.h"
#include "ED_types.h"
-#include "ED_util.h"
-#include "WM_api.h"
-#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index 3ef111144de..9261e28cd6a 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -30,8 +30,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "BKE_context.h"
@@ -41,10 +39,8 @@
#include "ED_screen.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "buttons_intern.h" // own include
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index dff11c62b4d..fa9308111b0 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -29,11 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -45,7 +40,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -53,7 +47,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
@@ -181,7 +174,7 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
else if(sbuts->mainb == BCONTEXT_BONE_CONSTRAINT)
ED_region_panels(C, ar, vertical, "bone_constraint", sbuts->mainb);
- sbuts->re_align= 0;
+ sbuts->re_align= 0;
sbuts->mainbo= sbuts->mainb;
}
@@ -265,6 +258,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
buttons_area_redraw(sa, BCONTEXT_TEXTURE);
buttons_area_redraw(sa, BCONTEXT_WORLD);
buttons_area_redraw(sa, BCONTEXT_DATA);
+ buttons_area_redraw(sa, BCONTEXT_PHYSICS);
sbuts->preview= 1;
break;
case ND_OB_ACTIVE:
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index 708089f8f4c..db7bb8419e8 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -41,7 +41,6 @@
#include "DNA_space_types.h"
#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_global.h"
#include "BKE_main.h"
@@ -56,7 +55,6 @@
#include "ED_datafiles.h"
#include "ED_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "console_intern.h"
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 763436dd05f..089e769e0d9 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -34,15 +34,10 @@
#include "MEM_guardedalloc.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
-#include "PIL_time.h"
#include "BKE_utildefines.h"
#include "BKE_context.h"
@@ -57,9 +52,6 @@
#include "WM_types.h"
#include "ED_screen.h"
-#include "ED_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -362,7 +354,7 @@ void CONSOLE_OT_move(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Cursor";
- ot->description= "Move cursor position";
+ ot->description= "Move cursor position";
ot->idname= "CONSOLE_OT_move";
/* api callbacks */
@@ -404,7 +396,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert";
- ot->description= "Insert text at cursor position";
+ ot->description= "Insert text at cursor position";
ot->idname= "CONSOLE_OT_insert";
/* api callbacks */
@@ -469,7 +461,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
- ot->description= "Delete text by cursor position";
+ ot->description= "Delete text by cursor position";
ot->idname= "CONSOLE_OT_delete";
/* api callbacks */
@@ -510,7 +502,7 @@ void CONSOLE_OT_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear";
- ot->description= "Clear text by type";
+ ot->description= "Clear text by type";
ot->idname= "CONSOLE_OT_clear";
/* api callbacks */
@@ -569,7 +561,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "History Cycle";
- ot->description= "Cycle through history";
+ ot->description= "Cycle through history";
ot->idname= "CONSOLE_OT_history_cycle";
/* api callbacks */
@@ -614,7 +606,7 @@ void CONSOLE_OT_history_append(wmOperatorType *ot)
{
/* identifiers */
ot->name= "History Append";
- ot->description= "Append history at cursor position";
+ ot->description= "Append history at cursor position";
ot->idname= "CONSOLE_OT_history_append";
/* api callbacks */
@@ -659,7 +651,7 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
/* identifiers */
ot->name= "Scrollback Append";
- ot->description= "Append scrollback text by type";
+ ot->description= "Append scrollback text by type";
ot->idname= "CONSOLE_OT_scrollback_append";
/* api callbacks */
@@ -756,7 +748,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy to Clipboard";
- ot->description= "Copy selected text to clipboard";
+ ot->description= "Copy selected text to clipboard";
ot->idname= "CONSOLE_OT_copy";
/* api callbacks */
@@ -805,7 +797,7 @@ void CONSOLE_OT_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste from Clipboard";
- ot->description= "Paste text from clipboard";
+ ot->description= "Paste text from clipboard";
ot->idname= "CONSOLE_OT_paste";
/* api callbacks */
diff --git a/source/blender/editors/space_console/console_report.c b/source/blender/editors/space_console/console_report.c
index 76eec4d0932..50829e4365c 100644
--- a/source/blender/editors/space_console/console_report.c
+++ b/source/blender/editors/space_console/console_report.c
@@ -32,14 +32,9 @@
#include "MEM_guardedalloc.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
-#include "PIL_time.h"
#include "BKE_utildefines.h"
#include "BKE_context.h"
@@ -54,8 +49,6 @@
#include "ED_screen.h"
#include "ED_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -114,7 +107,7 @@ void CONSOLE_OT_report_replay(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replay Operators";
- ot->description= "Replay selected reports";
+ ot->description= "Replay selected reports";
ot->idname= "CONSOLE_OT_report_replay";
/* api callbacks */
@@ -161,7 +154,7 @@ void CONSOLE_OT_select_pick(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select report";
- ot->description= "Select reports by index";
+ ot->description= "Select reports by index";
ot->idname= "CONSOLE_OT_select_pick";
/* api callbacks */
@@ -215,7 +208,7 @@ void CONSOLE_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "(De)Select All";
- ot->description= "(de)select all reports";
+ ot->description= "(de)select all reports";
ot->idname= "CONSOLE_OT_select_all_toggle";
/* api callbacks */
@@ -308,7 +301,7 @@ void CONSOLE_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Border Select";
- ot->description= "Toggle border selection";
+ ot->description= "Toggle border selection";
ot->idname= "CONSOLE_OT_select_border";
/* api callbacks */
@@ -358,7 +351,7 @@ void CONSOLE_OT_report_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete Reports";
- ot->description= "Delete selected reports";
+ ot->description= "Delete selected reports";
ot->idname= "CONSOLE_OT_report_delete";
/* api callbacks */
@@ -403,7 +396,7 @@ void CONSOLE_OT_report_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy Reports to Clipboard";
- ot->description= "Copy selected reports to Clipboard";
+ ot->description= "Copy selected reports to Clipboard";
ot->idname= "CONSOLE_OT_report_copy";
/* api callbacks */
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index beabc033d7e..97e1403e435 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -29,9 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -42,19 +39,16 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 1359b5125fa..92994b3de53 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -46,20 +46,12 @@
#include "BLF_api.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
-#include "ED_datafiles.h"
#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
#include "MEM_guardedalloc.h"
-#include "PIL_time.h"
#include "RNA_access.h"
@@ -71,7 +63,6 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "WM_api.h"
#include "WM_types.h"
#include "fsmenu.h"
@@ -169,7 +160,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
loadbutton = UI_GetStringWidth(sfile->params->title) + btn_margin;
if (loadbutton < btn_minw) {
loadbutton = MAX2(btn_minw,
- btn_margin + UI_GetStringWidth(params->title));
+ btn_margin + UI_GetStringWidth(params->title));
}
if (available_w <= loadbutton + separator + input_minw
@@ -191,29 +182,29 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
/* Text input fields for directory and file. */
if (available_w > 0) {
but = uiDefBut(block, TEX, B_FS_DIRNAME, "",
- min_x, line1_y, line1_w, btn_h,
- params->dir, 0.0, (float)FILE_MAX-1, 0, 0,
- "File path.");
+ min_x, line1_y, line1_w, btn_h,
+ params->dir, 0.0, (float)FILE_MAX-1, 0, 0,
+ "File path.");
uiButSetCompleteFunc(but, autocomplete_directory, NULL);
uiDefBut(block, TEX, B_FS_FILENAME, "",
- min_x, line2_y, line2_w, btn_h,
- params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0,
- "File name.");
+ min_x, line2_y, line2_w, btn_h,
+ params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0,
+ "File name.");
}
/* Filename number increment / decrement buttons. */
if (fnumbuttons) {
uiBlockBeginAlign(block);
but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT,
- min_x + line2_w + separator, line2_y,
- btn_fn_w, btn_h,
- "Decrement the filename number");
+ min_x + line2_w + separator, line2_y,
+ btn_fn_w, btn_h,
+ "Decrement the filename number");
RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1);
but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN,
- min_x + line2_w + separator + btn_fn_w, line2_y,
- btn_fn_w, btn_h,
- "Increment the filename number");
+ min_x + line2_w + separator + btn_fn_w, line2_y,
+ btn_fn_w, btn_h,
+ "Increment the filename number");
RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1);
uiBlockEndAlign(block);
}
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 1e9a7e1a706..ecbac050712 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -36,10 +36,7 @@
#ifdef WIN32
#include "BLI_winstuff.h"
#endif
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_fileselect.h"
@@ -48,7 +45,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "UI_interface.h"
#include "UI_view2d.h"
#include "WM_api.h"
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index b6152f26947..637e56459d7 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -33,8 +33,6 @@
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -42,7 +40,6 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -192,7 +189,7 @@ static void file_panel_operator(const bContext *C, Panel *pa)
if(strcmp(RNA_property_identifier(prop), "filename") == 0)
continue;
- uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0);
+ uiItemFullR(pa->layout, op->ptr, prop, -1, 0, 0, NULL, 0);
empty= 0;
}
RNA_STRUCT_END;
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 226cd50669a..bc12d45b2d6 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -84,7 +84,6 @@
#include "PIL_time.h"
-#include "UI_interface.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -136,7 +135,7 @@ typedef struct FileList
short hide_parent;
void (*readf)(struct FileList *);
- int (*filterf)(struct FileList *, struct direntry* file, unsigned int filter, short hide_dot);
+ int (*filterf)(struct direntry* file, const char* dir, unsigned int filter, short hide_dot);
} FileList;
@@ -873,7 +872,7 @@ void filelist_setfiletypes(struct FileList* filelist, short has_quicktime)
#ifdef WITH_OPENEXR
|| BLI_testextensie(file->relname, ".exr")
#endif
- ) {
+ ) {
file->flags |= IMAGEFILE;
}
else if(BLI_testextensie(file->relname, ".avi")
@@ -1310,7 +1309,11 @@ static void thumbnails_update(void *tjv)
while (limg) {
if (!limg->done && limg->img) {
tj->filelist->filelist[limg->index].image = limg->img;
- tj->filelist->filelist[limg->index].flags = limg->flags;
+ /* update flag for movie files where thumbnail can't be created */
+ if (limg->flags & MOVIEFILE_ICON) {
+ tj->filelist->filelist[limg->index].flags &= ~MOVIEFILE;
+ tj->filelist->filelist[limg->index].flags |= MOVIEFILE_ICON;
+ }
limg->done=1;
}
limg = limg->next;
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index cce821f3f21..e025d6d2b9a 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -43,10 +43,8 @@
#endif
#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -63,10 +61,7 @@
#include "BLF_api.h"
-#include "DNA_userdef_types.h"
-#include "ED_screen.h"
-#include "ED_util.h"
#include "ED_fileselect.h"
#include "WM_api.h"
@@ -78,8 +73,6 @@
#include "RNA_access.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "file_intern.h"
#include "filelist.h"
diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h
index d685a844cde..8304b104a4f 100644
--- a/source/blender/editors/space_file/fsmenu.h
+++ b/source/blender/editors/space_file/fsmenu.h
@@ -48,7 +48,7 @@ struct FSMenu* fsmenu_get (void);
int fsmenu_get_nentries (struct FSMenu* fsmenu, FSMenuCategory category);
/** Returns the fsmenu entry at @a index (or NULL if a bad index)
- * or a separator.
+ * or a separator.
*/
char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index);
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index de3b016988d..6cef78d4bee 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -29,10 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "RNA_access.h"
@@ -51,7 +47,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_fileselect.h"
@@ -61,13 +56,10 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "ED_markers.h"
-#include "ED_fileselect.h"
#include "file_intern.h" // own include
#include "fsmenu.h"
@@ -227,7 +219,7 @@ static void file_refresh(const bContext *C, ScrArea *sa)
static void file_listener(ScrArea *sa, wmNotifier *wmn)
{
- /* SpaceFile* sfile = (SpaceFile*)sa->spacedata.first; */
+ /* SpaceFile* sfile = (SpaceFile*)sa->spacedata.first; */
/* context changes */
switch(wmn->category) {
diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c
index 5045bfb21bf..39a986aca32 100644
--- a/source/blender/editors/space_file/writeimage.c
+++ b/source/blender/editors/space_file/writeimage.c
@@ -36,11 +36,9 @@
#include "BLI_blenlib.h"
-#include "DNA_image_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index c2cf3233f67..ac3b91e275c 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -32,12 +32,8 @@
#include <float.h>
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -66,17 +62,13 @@
#include "WM_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "ED_anim_api.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "graph_intern.h" // own include
@@ -155,7 +147,7 @@ static void graph_panel_view(const bContext *C, Panel *pa)
/* 2D-Cursor */
col= uiLayoutColumn(pa->layout, 0);
- uiItemR(col, NULL, 0, &spaceptr, "show_cursor", 0);
+ uiItemR(col, &spaceptr, "show_cursor", 0, NULL, 0);
subcol= uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor"));
@@ -164,11 +156,11 @@ static void graph_panel_view(const bContext *C, Panel *pa)
subcol= uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor"));
row= uiLayoutSplit(subcol, 0.7, 1);
- uiItemR(row, "Cursor X", 0, &sceneptr, "current_frame", 0);
- uiItemEnumO(row, "To Keys", 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_CFRA);
+ uiItemR(row, &sceneptr, "current_frame", 0, "Cursor X", 0);
+ uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_CFRA);
row= uiLayoutSplit(subcol, 0.7, 1);
- uiItemR(row, "Cursor Y", 0, &spaceptr, "cursor_value", 0);
- uiItemEnumO(row, "To Keys", 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_VALUE);
+ uiItemR(row, &spaceptr, "cursor_value", 0, "Cursor Y", 0);
+ uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_VALUE);
}
/* ******************* active F-Curve ************** */
@@ -202,19 +194,19 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
/* RNA-Path Editing - only really should be enabled when things aren't working */
col= uiLayoutColumn(layout, 1);
uiLayoutSetEnabled(col, (fcu->flag & FCURVE_DISABLED));
- uiItemR(col, "", ICON_RNA, &fcu_ptr, "data_path", 0);
- uiItemR(col, NULL, 0, &fcu_ptr, "array_index", 0);
+ uiItemR(col, &fcu_ptr, "data_path", 0, "", ICON_RNA);
+ uiItemR(col, &fcu_ptr, "array_index", 0, NULL, 0);
/* color settings */
col= uiLayoutColumn(layout, 1);
uiItemL(col, "Display Color:", 0);
row= uiLayoutRow(col, 1);
- uiItemR(row, "", 0, &fcu_ptr, "color_mode", 0);
+ uiItemR(row, &fcu_ptr, "color_mode", 0, "", 0);
subrow= uiLayoutRow(row, 1);
uiLayoutSetEnabled(subrow, (fcu->color_mode==FCURVE_COLOR_CUSTOM));
- uiItemR(subrow, "", 0, &fcu_ptr, "color", 0);
+ uiItemR(subrow, &fcu_ptr, "color", 0, "", 0);
/* TODO: the following settings could be added here
* - Access details (ID-block + RNA-Path + Array Index)
@@ -357,7 +349,7 @@ static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout,
PointerRNA tar_ptr;
RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose, &tar_ptr);
- uiItemPointerR(col, "", ICON_BONE_DATA, &dtar_ptr, "bone_target", &tar_ptr, "bones");
+ uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
}
col= uiLayoutColumn(layout, 1);
@@ -367,7 +359,7 @@ static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout,
PointerRNA tar_ptr;
RNA_pointer_create(dtar2->id, &RNA_Pose, ob2->pose, &tar_ptr);
- uiItemPointerR(col, "", ICON_BONE_DATA, &dtar2_ptr, "bone_target", &tar_ptr, "bones");
+ uiItemPointerR(col, &dtar2_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
}
}
@@ -393,10 +385,10 @@ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout,
PointerRNA tar_ptr;
RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose, &tar_ptr);
- uiItemPointerR(col, "", ICON_BONE_DATA, &dtar_ptr, "bone_target", &tar_ptr, "bones");
+ uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
}
- uiItemR(col, NULL, 0, &dtar_ptr, "use_local_space_transforms", 0);
+ uiItemR(col, &dtar_ptr, "use_local_space_transforms", 0, NULL, 0);
col= uiLayoutColumn(layout, 1);
uiTemplateAnyID(col, (bContext *)C, &dtar2_ptr, "id", "id_type", "Ob/Bone 2:");
@@ -405,10 +397,10 @@ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout,
PointerRNA tar_ptr;
RNA_pointer_create(dtar2->id, &RNA_Pose, ob2->pose, &tar_ptr);
- uiItemPointerR(col, "", ICON_BONE_DATA, &dtar2_ptr, "bone_target", &tar_ptr, "bones");
+ uiItemPointerR(col, &dtar2_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
}
- uiItemR(col, NULL, 0, &dtar2_ptr, "use_local_space_transforms", 0);
+ uiItemR(col, &dtar2_ptr, "use_local_space_transforms", 0, NULL, 0);
}
/* settings for 'transform channel' driver variable type */
@@ -430,12 +422,12 @@ static void graph_panel_driverVar__transChan(const bContext *C, uiLayout *layout
PointerRNA tar_ptr;
RNA_pointer_create(dtar->id, &RNA_Pose, ob->pose, &tar_ptr);
- uiItemPointerR(col, "", ICON_BONE_DATA, &dtar_ptr, "bone_target", &tar_ptr, "bones");
+ uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
}
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, &dtar_ptr, "transform_type", 0);
- uiItemR(row, NULL, 0, &dtar_ptr, "use_local_space_transforms", 0);
+ uiItemR(row, &dtar_ptr, "transform_type", 0, "", 0);
+ uiItemR(row, &dtar_ptr, "use_local_space_transforms", 0, NULL, 0);
}
/* driver settings for active F-Curve (only for 'Drivers' mode) */
@@ -474,12 +466,12 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
col= uiLayoutColumn(pa->layout, 1);
block= uiLayoutGetBlock(col);
- uiItemR(col, NULL, 0, &driver_ptr, "type", 0);
+ uiItemR(col, &driver_ptr, "type", 0, NULL, 0);
/* show expression box if doing scripted drivers, and/or error messages when invalid drivers exist */
if (driver->type == DRIVER_TYPE_PYTHON) {
/* expression */
- uiItemR(col, "Expr", 0, &driver_ptr, "expression", 0);
+ uiItemR(col, &driver_ptr, "expression", 0, "Expr", 0);
/* errors? */
if (driver->flag & DRIVER_FLAG_INVALID)
@@ -493,7 +485,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
col= uiLayoutColumn(pa->layout, 1);
/* debug setting */
- uiItemR(col, NULL, 0, &driver_ptr, "show_debug_info", 0);
+ uiItemR(col, &driver_ptr, "show_debug_info", 0, NULL, 0);
/* value of driver */
if (driver->flag & DRIVER_FLAG_SHOWDEBUG) {
@@ -528,7 +520,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
row= uiLayoutRow(box, 0);
block= uiLayoutGetBlock(row);
/* variable name */
- uiItemR(row, "", 0, &dvar_ptr, "name", 0);
+ uiItemR(row, &dvar_ptr, "name", 0, "", 0);
/* remove button */
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -538,7 +530,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* variable type */
row= uiLayoutRow(box, 0);
- uiItemR(row, "", 0, &dvar_ptr, "type", 0);
+ uiItemR(row, &dvar_ptr, "type", 0, "", 0);
/* variable type settings */
box= uiLayoutBox(col);
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 8315ee740cd..84df407109d 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -45,23 +45,10 @@
#include "BLI_math.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meta_types.h"
#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view2d_types.h"
#include "DNA_windowmanager_types.h"
-#include "DNA_world_types.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
@@ -78,12 +65,10 @@
#include "BIF_glutil.h"
#include "ED_anim_api.h"
-#include "ED_util.h"
#include "graph_intern.h"
#include "UI_interface.h"
-#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "UI_view2d.h"
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index d23bafbc001..fe7168240f8 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -44,21 +44,8 @@
#include "BLI_math.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -80,10 +67,8 @@
#include "ED_anim_api.h"
#include "ED_keyframing.h"
-#include "ED_keyframes_draw.h"
#include "ED_keyframes_edit.h"
#include "ED_screen.h"
-#include "ED_space_api.h"
#include "ED_transform.h"
#include "WM_api.h"
@@ -1935,7 +1920,7 @@ static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *eve
continue;
/* create operator menu item with relevant properties filled in */
- props_ptr= uiItemFullO(layout, fmi->name, 0, "GRAPH_OT_fmodifier_add", NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+ props_ptr= uiItemFullO(layout, "GRAPH_OT_fmodifier_add", fmi->name, 0, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
/* the only thing that gets set from the menu is the type of F-Modifier to add */
RNA_enum_set(&props_ptr, "type", i);
/* the following properties are just repeats of existing ones... */
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index e56a758f2b0..b8b3dc97edf 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -31,12 +31,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_listBase.h"
-#include "DNA_action_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
@@ -44,7 +39,6 @@
#include "BKE_sound.h"
#include "BKE_utildefines.h"
-#include "UI_interface.h"
#include "UI_view2d.h"
#include "ED_screen.h"
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 00d9d032840..8cb124422cb 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -39,21 +39,10 @@
#include "BLI_math.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -71,12 +60,8 @@
#include "UI_view2d.h"
#include "ED_anim_api.h"
-#include "ED_keyframing.h"
-#include "ED_keyframes_draw.h"
#include "ED_keyframes_edit.h"
#include "ED_markers.h"
-#include "ED_screen.h"
-#include "ED_space_api.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c
index b0280e682cc..ad96370e4fa 100644
--- a/source/blender/editors/space_graph/graph_utils.c
+++ b/source/blender/editors/space_graph/graph_utils.c
@@ -32,12 +32,8 @@
#include <float.h>
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_object_types.h"
#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -62,20 +58,10 @@
#include "BIF_gl.h"
#include "WM_api.h"
-#include "WM_types.h"
-#include "RNA_access.h"
-#include "RNA_define.h"
#include "ED_anim_api.h"
-#include "ED_keyframing.h"
-#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "graph_intern.h" // own include
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 7d34a91d6fa..2c66cb51fba 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -30,10 +30,7 @@
#include <stdio.h>
#include "DNA_anim_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -48,7 +45,6 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_anim_api.h"
#include "ED_markers.h"
@@ -58,7 +54,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 01c53961f66..5f96c4a2324 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -29,17 +29,10 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_color_types.h"
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_packedFile_types.h"
#include "DNA_node_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -69,11 +62,8 @@
#include "ED_gpencil.h"
#include "ED_image.h"
-#include "ED_mesh.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_uvedit.h"
-#include "ED_util.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -85,7 +75,6 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "image_intern.h"
@@ -161,7 +150,7 @@ static void image_info(Image *ima, ImBuf *ibuf, char *str)
ofs+= sprintf(str+ofs, "%d frs", IMB_anim_get_duration(ima->anim));
}
else
- ofs= sprintf(str, "Image");
+ ofs= sprintf(str, "Image");
ofs+= sprintf(str+ofs, ": size %d x %d,", ibuf->x, ibuf->y);
@@ -894,11 +883,11 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
}
else {
row= uiLayoutRow(layout, 0);
- uiItemR(row, NULL, 0, &imaptr, "source", (compact)? 0: UI_ITEM_R_EXPAND);
+ uiItemR(row, &imaptr, "source", (compact)? 0: UI_ITEM_R_EXPAND, NULL, 0);
if(ima->source != IMA_SRC_GENERATED) {
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, &imaptr, "filename", 0);
+ uiItemR(row, &imaptr, "filename", 0, "", 0);
uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
}
@@ -933,14 +922,14 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
split= uiLayoutSplit(layout, 0, 0);
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &imaptr, "fields", 0);
+ uiItemR(col, &imaptr, "fields", 0, NULL, 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &imaptr, "field_order", UI_ITEM_R_EXPAND);
+ uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, 0);
uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "fields"));
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &imaptr, "antialias", 0);
- uiItemR(col, NULL, 0, &imaptr, "premultiply", 0);
+ uiItemR(col, &imaptr, "antialias", 0, NULL, 0);
+ uiItemR(col, &imaptr, "premultiply", 0, NULL, 0);
}
}
@@ -953,30 +942,30 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
sprintf(str, "(%d) Frames", iuser->framenr);
row= uiLayoutRow(col, 1);
- uiItemR(col, str, 0, userptr, "frames", 0);
+ uiItemR(col, userptr, "frames", 0, str, 0);
if(ima->anim) {
block= uiLayoutGetBlock(row);
but= uiDefBut(block, BUT, 0, "<", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, 0, 0, 0, 0, 0, "Set the number of frames from the movie or sequence.");
uiButSetFunc(but, set_frames_cb, ima, iuser);
}
- uiItemR(col, "Start", 0, userptr, "start_frame", 0);
- uiItemR(col, NULL, 0, userptr, "offset", 0);
+ uiItemR(col, userptr, "start_frame", 0, "Start", 0);
+ uiItemR(col, userptr, "offset", 0, NULL, 0);
col= uiLayoutColumn(split, 0);
- uiItemR(col, "Fields", 0, userptr, "fields_per_frame", 0);
- uiItemR(col, NULL, 0, userptr, "auto_refresh", 0);
- uiItemR(col, NULL, 0, userptr, "cyclic", 0);
+ uiItemR(col, userptr, "fields_per_frame", 0, "Fields", 0);
+ uiItemR(col, userptr, "auto_refresh", 0, NULL, 0);
+ uiItemR(col, userptr, "cyclic", 0, NULL, 0);
}
else if(ima->source==IMA_SRC_GENERATED) {
split= uiLayoutSplit(layout, 0, 0);
col= uiLayoutColumn(split, 1);
- uiItemR(col, "X", 0, &imaptr, "generated_width", 0);
- uiItemR(col, "Y", 0, &imaptr, "generated_height", 0);
+ uiItemR(col, &imaptr, "generated_width", 0, "X", 0);
+ uiItemR(col, &imaptr, "generated_height", 0, "Y", 0);
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &imaptr, "generated_type", UI_ITEM_R_EXPAND);
+ uiItemR(col, &imaptr, "generated_type", UI_ITEM_R_EXPAND, NULL, 0);
}
}
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 797bb20ddf9..33dfc99602e 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -31,9 +31,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_brush_types.h"
#include "DNA_camera_types.h"
-#include "DNA_image_types.h"
#include "DNA_object_types.h"
#include "DNA_space_types.h"
#include "DNA_scene_types.h"
@@ -56,13 +54,11 @@
#include "ED_gpencil.h"
#include "ED_image.h"
-#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "WM_api.h"
#include "image_intern.h"
@@ -158,6 +154,17 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
UI_DrawString(10, 10, str);
}
+void draw_image_line(struct ARegion *ar, int x1, int y1, int x2, int y2)
+{
+ glColor3ub(0,0,0);
+ glBegin(GL_LINES);
+
+ glVertex2i(x1, y1);
+ glVertex2i(x2, y2);
+
+ glEnd();
+}
+
/* image drawing */
static void draw_image_grid(ARegion *ar, float zoomx, float zoomy)
diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c
index c851aa442eb..25208b61c28 100644
--- a/source/blender/editors/space_image/image_header.c
+++ b/source/blender/editors/space_image/image_header.c
@@ -30,11 +30,7 @@
#include <stdio.h>
#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_customdata_types.h"
#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -49,29 +45,17 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
#include "ED_image.h"
-#include "ED_mesh.h"
-#include "ED_screen.h"
-#include "ED_transform.h"
-#include "ED_types.h"
-#include "ED_util.h"
-#include "WM_api.h"
#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-#include "RNA_access.h"
-#include "RE_pipeline.h"
#include "image_intern.h"
@@ -90,10 +74,10 @@ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event)
pup= uiPupMenuBegin(C, "Toolbox", 0);
layout= uiPupMenuLayout(pup);
- uiItemM(layout, C, NULL, 0, "IMAGE_MT_view");
- if(show_uvedit) uiItemM(layout, C, NULL, 0, "IMAGE_MT_select");
- uiItemM(layout, C, NULL, 0, "IMAGE_MT_image");
- if(show_uvedit) uiItemM(layout, C, NULL, 0, "IMAGE_MT_uvs");
+ uiItemM(layout, C, "IMAGE_MT_view", NULL, 0);
+ if(show_uvedit) uiItemM(layout, C, "IMAGE_MT_select", NULL, 0);
+ uiItemM(layout, C, "IMAGE_MT_image", NULL, 0);
+ if(show_uvedit) uiItemM(layout, C, "IMAGE_MT_uvs", NULL, 0);
uiPupMenuEnd(C, pup);
diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h
index 09bd9edc86d..8c8a8f76710 100644
--- a/source/blender/editors/space_image/image_intern.h
+++ b/source/blender/editors/space_image/image_intern.h
@@ -55,6 +55,7 @@ void IMAGE_OT_toolbox(struct wmOperatorType *ot);
void draw_image_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene);
void draw_image_info(struct ARegion *ar, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf);
void draw_image_grease_pencil(struct bContext *C, short onlyv2d);
+void draw_image_line(struct ARegion *ar, int x1, int y1, int x2, int y2);
/* image_ops.c */
int space_image_main_area_poll(struct bContext *C);
@@ -80,6 +81,7 @@ void IMAGE_OT_unpack(struct wmOperatorType *ot);
void IMAGE_OT_cycle_render_slot(struct wmOperatorType *ot);
void IMAGE_OT_sample(struct wmOperatorType *ot);
+void IMAGE_OT_sample_line(struct wmOperatorType *ot);
void IMAGE_OT_curves_point_set(struct wmOperatorType *ot);
void IMAGE_OT_record_composite(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 3aa766c32d0..671bbe5f8cd 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -20,7 +20,7 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * Contributor(s): Blender Foundation, 2002-2009
+ * Contributor(s): Blender Foundation, 2002-2009, Xavier Thomas
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -30,16 +30,9 @@
#include "MEM_guardedalloc.h"
-#include "DNA_image_types.h"
-#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_packedFile_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
@@ -63,7 +56,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "ED_image.h"
@@ -1334,23 +1326,23 @@ void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, Packed
pup= uiPupMenuBegin(C, "Unpack file", 0);
layout= uiPupMenuLayout(pup);
- uiItemEnumO(layout, "Remove Pack", 0, opname, "method", PF_REMOVE);
+ uiItemEnumO(layout, opname, "Remove Pack", 0, "method", PF_REMOVE);
if(strcmp(abs_name, local_name)) {
switch(checkPackedFile(local_name, pf)) {
case PF_NOFILE:
sprintf(line, "Create %s", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL);
break;
case PF_EQUAL:
sprintf(line, "Use %s (identical)", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
break;
case PF_DIFFERS:
sprintf(line, "Use %s (differs)", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
sprintf(line, "Overwrite %s", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL);
break;
}
}
@@ -1358,17 +1350,17 @@ void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, Packed
switch(checkPackedFile(abs_name, pf)) {
case PF_NOFILE:
sprintf(line, "Create %s", abs_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
break;
case PF_EQUAL:
sprintf(line, "Use %s (identical)", abs_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
break;
case PF_DIFFERS:
sprintf(line, "Use %s (differs)", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
sprintf(line, "Overwrite %s", local_name);
- uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL);
+ uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
break;
}
@@ -1641,6 +1633,166 @@ void IMAGE_OT_sample(wmOperatorType *ot)
ot->flag= OPTYPE_BLOCKING;
}
+/******************** sample line operator ********************/
+typedef struct ImageSampleLineInfo {
+ ARegionType *art;
+ void *draw_handle;
+ int started;
+ int x_start, y_start, x_stop, y_stop;
+} ImageSampleLineInfo;
+
+static void sample_line_draw(const bContext *C, ARegion *ar, void *arg_info)
+{
+ ImageSampleLineInfo *info= arg_info;
+ draw_image_line(ar, info->x_start, info->y_start, info->x_stop, info->y_stop);
+}
+
+static void sample_line_apply(bContext *C, wmOperator *op)
+{
+ SpaceImage *sima= CTX_wm_space_image(C);
+ ImageSampleLineInfo *info= op->customdata;
+ ARegion *ar= CTX_wm_region(C);
+ void *lock;
+ ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ Histogram *hist= &sima->sample_line_hist;
+ float x1f, y1f, x2f, y2f;
+ int x1, y1, x2, y2;
+ int i, x, y;
+ float *fp;
+ unsigned char *cp;
+
+ if (ibuf == NULL) {
+ ED_space_image_release_buffer(sima, lock);
+ return;
+ }
+ /* hmmmm */
+ if (ibuf->channels < 3) {
+ ED_space_image_release_buffer(sima, lock);
+ return;
+ }
+
+ UI_view2d_region_to_view(&ar->v2d, info->x_start, info->y_start, &x1f, &y1f);
+ UI_view2d_region_to_view(&ar->v2d, info->x_stop, info->y_stop, &x2f, &y2f);
+ x1= 0.5f+ x1f*ibuf->x;
+ x2= 0.5f+ x2f*ibuf->x;
+ y1= 0.5f+ y1f*ibuf->y;
+ y2= 0.5f+ y2f*ibuf->y;
+
+ hist->channels = 3;
+ hist->x_resolution = 256;
+ hist->xmax = 1.0f;
+ hist->ymax = 1.0f;
+
+ for (i=0; i<256; i++) {
+ x= (int)(0.5f + x1 + (float)i*(x2-x1)/255.0f);
+ y= (int)(0.5f + y1 + (float)i*(y2-y1)/255.0f);
+
+ if (x<0 || y<0 || x>=ibuf->x || y>=ibuf->y) {
+ hist->data_r[i] = hist->data_g[i]= hist->data_b[i] = 0.0f;
+ } else {
+ if (ibuf->rect_float) {
+ fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x));
+ hist->data_r[i] = fp[0];
+ hist->data_g[i] = fp[1];
+ hist->data_b[i] = fp[2];
+ }
+ else if (ibuf->rect) {
+ cp= (unsigned char *)(ibuf->rect + y*ibuf->x + x);
+ hist->data_r[i] = (float)cp[0]/255.0f;
+ hist->data_g[i] = (float)cp[1]/255.0f;
+ hist->data_b[i] = (float)cp[2]/255.0f;
+ }
+ }
+ }
+ hist->ok=1;
+
+ ED_space_image_release_buffer(sima, lock);
+}
+
+static void sample_line_exit(bContext *C, wmOperator *op)
+{
+ ImageSampleLineInfo *info= op->customdata;
+
+ ED_region_draw_cb_exit(info->art, info->draw_handle);
+ ED_area_tag_redraw(CTX_wm_area(C));
+ MEM_freeN(info);
+}
+
+static int sample_line_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ SpaceImage *sima= CTX_wm_space_image(C);
+ ImageSampleLineInfo *info;
+
+ if(!ED_space_image_has_buffer(sima))
+ return OPERATOR_CANCELLED;
+
+ info= MEM_callocN(sizeof(ImageSampleLineInfo), "ImageSampleLineInfo");
+ info->started= 0;
+ op->customdata= info;
+
+ WM_event_add_modal_handler(C, op);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int sample_line_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ ImageSampleLineInfo *info= op->customdata;
+ ARegion *ar= CTX_wm_region(C);
+
+ switch(event->type) {
+ case LEFTMOUSE:
+ if (info->started == 0) {
+ info->x_start = event->mval[0];
+ info->y_start = event->mval[1];
+ info->art= ar->type;
+ info->draw_handle = ED_region_draw_cb_activate(ar->type, sample_line_draw, info, REGION_DRAW_POST_PIXEL);
+ info->started = 1;
+ } else {
+ sample_line_apply(C, op);
+ sample_line_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+ case RIGHTMOUSE: // XXX hardcoded
+ case ESCKEY:
+ sample_line_exit(C, op);
+ return OPERATOR_CANCELLED;
+ case MOUSEMOVE:
+ if (info->started == 1) {
+ info->x_stop = event->mval[0];
+ info->y_stop = event->mval[1];
+ ED_area_tag_redraw(CTX_wm_area(C));
+ sample_line_apply(C, op);
+ }
+ break;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int sample_line_cancel(bContext *C, wmOperator *op)
+{
+ sample_line_exit(C, op);
+ return OPERATOR_CANCELLED;
+}
+
+void IMAGE_OT_sample_line(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Sample Line";
+ ot->idname= "IMAGE_OT_sample_line";
+
+ /* api callbacks */
+ ot->invoke= sample_line_invoke;
+ ot->modal= sample_line_modal;
+ ot->cancel= sample_line_cancel;
+ ot->poll= space_image_main_area_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_BLOCKING;
+}
+
/******************** set curve point operator ********************/
void IMAGE_OT_curves_point_set(wmOperatorType *ot)
diff --git a/source/blender/editors/space_image/image_render.c b/source/blender/editors/space_image/image_render.c
index 97b5f9847ff..18e42ce8797 100644
--- a/source/blender/editors/space_image/image_render.c
+++ b/source/blender/editors/space_image/image_render.c
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <stdio.h>
-#include "DNA_image_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@@ -40,11 +39,9 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "ED_screen.h"
#include "RE_pipeline.h"
-#include "WM_api.h"
#define HEADER_HEIGHT 18
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 6cb369a72f2..30f173bd149 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -29,13 +29,9 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -51,11 +47,8 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
-#include "ED_gpencil.h"
-#include "ED_image.h"
#include "ED_mesh.h"
#include "ED_space_api.h"
#include "ED_screen.h"
@@ -69,7 +62,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
@@ -475,6 +467,7 @@ void image_operatortypes(void)
WM_operatortype_append(IMAGE_OT_cycle_render_slot);
WM_operatortype_append(IMAGE_OT_sample);
+ WM_operatortype_append(IMAGE_OT_sample_line);
WM_operatortype_append(IMAGE_OT_curves_point_set);
WM_operatortype_append(IMAGE_OT_record_composite);
@@ -825,7 +818,7 @@ static void image_scope_area_draw(const bContext *C, ARegion *ar)
void *lock;
ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock);
if(ibuf)
- histogram_update(&sima->hist, ibuf);
+ histogram_update(&sima->hist, ibuf);
ED_space_image_release_buffer(sima, lock);
ED_region_panels(C, ar, 1, NULL, -1);
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index 072c5bf1573..e2baeb9abac 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -31,9 +31,6 @@
#include "DNA_packedFile_types.h"
#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -49,9 +46,6 @@
#include "BKE_report.h"
#include "BKE_screen.h"
-#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -60,14 +54,12 @@
#include "BIF_glutil.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "IMB_imbuf_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
-#include "WM_types.h"
#include "info_intern.h"
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index e3aa0e2e3e7..cf23c488960 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -27,15 +27,11 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
#include "DNA_group_types.h"
#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "BKE_anim.h"
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index f6cc25e9074..6c172c13138 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -29,10 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -45,7 +41,6 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -53,12 +48,8 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
-#include "ED_markers.h"
-#include "ED_object.h"
#include "info_intern.h" // own include
diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c
index 3d7624a25dc..fc0955bf9d1 100644
--- a/source/blender/editors/space_logic/logic_buttons.c
+++ b/source/blender/editors/space_logic/logic_buttons.c
@@ -28,11 +28,6 @@
#include <stdio.h>
#include "DNA_object_types.h"
-#include "DNA_node_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -48,9 +43,7 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
-#include "ED_util.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -62,7 +55,6 @@
#include "WM_types.h"
#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
#include "interface_intern.h"
diff --git a/source/blender/editors/space_logic/logic_header.c b/source/blender/editors/space_logic/logic_header.c
index 789c00a6aa5..3e38eb815fb 100644
--- a/source/blender/editors/space_logic/logic_header.c
+++ b/source/blender/editors/space_logic/logic_header.c
@@ -29,10 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -46,8 +42,6 @@
#include "ED_types.h"
#include "ED_util.h"
-#include "WM_api.h"
-#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 7539f721883..39d3feafc19 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -33,16 +33,12 @@
#include "DNA_actuator_types.h"
#include "DNA_controller_types.h"
-#include "DNA_object_types.h"
#include "DNA_property_types.h"
#include "DNA_space_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sensor_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_action_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -58,19 +54,14 @@
#include "BKE_sca.h"
#include "BKE_utildefines.h"
-#include "ED_screen.h"
-#include "ED_types.h"
#include "ED_util.h"
-#include "WM_api.h"
#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
/* XXX BAD BAD */
#include "../interface/interface_intern.h"
@@ -731,21 +722,21 @@ static char *actuator_pup(Object *owner)
case OB_ARMATURE:
return "Actuators %t|Action %x15|Armature %x23|Motion %x0|Constraint %x9|Ipo %x1"
"|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
"|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
break;
case OB_MESH:
return "Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1"
"|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
"|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
break;
default:
return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1"
"|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
"|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
}
}
@@ -2125,7 +2116,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
break;
}
- case ACT_SOUND:
+ case ACT_SOUND:
{
sa = act->data;
sa->sndnr = 0;
@@ -2177,27 +2168,27 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
}
case ACT_CAMERA:
- ysize= 48;
+ ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- ca= act->data;
+ ca= act->data;
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object");
- uiDefButF(block, NUM, 0, "Height:", xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, "");
+ uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object");
+ uiDefButF(block, NUM, 0, "Height:", xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, "");
- uiDefButF(block, NUM, 0, "Min:", xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, "");
+ uiDefButF(block, NUM, 0, "Min:", xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, "");
- if(ca->axis==0) ca->axis= 'x';
- uiDefButS(block, ROW, 0, "X", xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis");
- uiDefButS(block, ROW, 0, "Y", xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis");
+ if(ca->axis==0) ca->axis= 'x';
+ uiDefButS(block, ROW, 0, "X", xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis");
+ uiDefButS(block, ROW, 0, "Y", xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis");
- uiDefButF(block, NUM, 0, "Max:", xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, "");
+ uiDefButF(block, NUM, 0, "Max:", xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, "");
- yco-= ysize;
+ yco-= ysize;
- break;
+ break;
case ACT_EDIT_OBJECT:
@@ -2288,11 +2279,11 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3|Dynamics %x4";
uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &eoa->type, 0.0, 0.0, 0, 0, "");
- yco-= ysize;
+ yco-= ysize;
- break;
+ break;
- case ACT_CONSTRAINT:
+ case ACT_CONSTRAINT:
coa= act->data;
if (coa->type == ACT_CONST_TYPE_LOC) {
@@ -2425,79 +2416,79 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
}
str= "Constraint Type %t|Location %x0|Distance %x1|Orientation %x2|Force field %x3";
but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &coa->type, 0.0, 0.0, 0, 0, "");
- yco-= ysize;
- break;
+ yco-= ysize;
+ break;
case ACT_SCENE:
- sca= act->data;
+ sca= act->data;
- if(sca->type==ACT_SCENE_RESTART) {
- ysize= 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
- else if(sca->type==ACT_SCENE_CAMERA) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ if(sca->type==ACT_SCENE_RESTART) {
+ ysize= 28;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ }
+ else if(sca->type==ACT_SCENE_CAMERA) {
+
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object");
- }
- else if(sca->type==ACT_SCENE_SET) {
+ uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object");
+ }
+ else if(sca->type==ACT_SCENE_SET) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene");
- }
+ uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene");
+ }
else if(sca->type==ACT_SCENE_ADD_FRONT) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene");
- }
+ uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene");
+ }
else if(sca->type==ACT_SCENE_ADD_BACK) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene");
- }
+ uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene");
+ }
else if(sca->type==ACT_SCENE_REMOVE) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene");
- }
+ uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene");
+ }
else if(sca->type==ACT_SCENE_SUSPEND) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene");
- }
+ uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene");
+ }
else if(sca->type==ACT_SCENE_RESUME) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene");
- }
+ uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene");
+ }
str= "Scene %t|Restart %x0|Set Scene %x1|Set Camera %x2|Add OverlayScene %x3|Add BackgroundScene %x4|Remove Scene %x5|Suspend Scene %x6|Resume Scene %x7";
uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &sca->type, 0.0, 0.0, 0, 0, "");
- yco-= ysize;
- break;
+ yco-= ysize;
+ break;
case ACT_GAME:
{
gma = act->data;
@@ -2507,7 +2498,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
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, 63, 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
+ uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 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, 63, 0, 0, "Use this loadinganimation");
}
/* else if (gma->type == ACT_GAME_START)
@@ -2516,7 +2507,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
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, 63, 0, 0, "Load this file");
+ uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file");
uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation");
}
*/ else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG))
@@ -2759,16 +2750,16 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
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,
- &ma->body, 0, 31, 0, 0,
- "Optional message body Text");
+ /* line 3: Message Body */
+ uiDefBut(block, TEX, 1, "Body: ",
+ (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
+ &ma->body, 0, 31, 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, 31, 0, 0,
"The message body will be set by the Property Value");
}
@@ -2783,7 +2774,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
{
ysize +=20;
}
- glRects( xco, yco-ysize, xco+width, yco );
+ glRects( xco, yco-ysize, xco+width, yco );
uiEmboss( (float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1 );
switch(tdfa->type)
@@ -2826,16 +2817,16 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
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;
+ break;
case ACT_PARENT:
- parAct = act->data;
+ parAct = act->data;
- if(parAct->type==ACT_PARENT_SET) {
+ if(parAct->type==ACT_PARENT_SET) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+95, yco-24, (width-100), 19, &(parAct->ob), "Set this object as parent");
+ ysize= 48;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+95, yco-24, (width-100), 19, &(parAct->ob), "Set this object as parent");
uiBlockBeginAlign(block);
uiDefButBitS(block, TOGN, ACT_PARENT_COMPOUND, B_REDR,
"Compound",
@@ -2848,21 +2839,21 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
0.0, 0.0, 0, 0,
"Make this object ghost while parented (only if not compound)");
uiBlockEndAlign(block);
- }
- else if(parAct->type==ACT_PARENT_REMOVE) {
+ }
+ else if(parAct->type==ACT_PARENT_REMOVE) {
- ysize= 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
+ ysize= 28;
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+ }
str= "Parent %t|Set Parent %x0|Remove Parent %x1";
uiDefButI(block, MENU, B_REDR, str, xco+5, yco-24, parAct->type==1?(width-80):90, 19, &parAct->type, 0.0, 0.0, 0, 0, "");
- yco-= ysize;
- break;
+ yco-= ysize;
+ break;
case ACT_ARMATURE:
- armAct = act->data;
+ armAct = act->data;
if (ob->type == OB_ARMATURE) {
str= "Constraint %t|Run armature %x0|Enable %x1|Disable %x2|Set target %x3|Set weight %x4";
@@ -2897,13 +2888,13 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
break;
}
}
- }
+ }
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- yco-= ysize;
- break;
+ yco-= ysize;
+ break;
- default:
+ default:
ysize= 4;
glRects(xco, yco-ysize, xco+width, yco);
diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c
index 8c5ccdd9a5d..e15d68b36a5 100644
--- a/source/blender/editors/space_logic/space_logic.c
+++ b/source/blender/editors/space_logic/space_logic.c
@@ -29,13 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -46,18 +39,15 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "RNA_access.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index 957529942c0..ceee7fc9971 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -32,12 +32,6 @@
#include <float.h>
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -66,17 +60,12 @@
#include "WM_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "ED_anim_api.h"
-#include "ED_keyframing.h"
#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "nla_intern.h" // own include
@@ -252,15 +241,15 @@ static void nla_panel_animdata (const bContext *C, Panel *pa)
/* extrapolation */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, 0, &adt_ptr, "action_extrapolation", 0);
+ uiItemR(row, &adt_ptr, "action_extrapolation", 0, NULL, 0);
/* blending */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, 0, &adt_ptr, "action_blending", 0);
+ uiItemR(row, &adt_ptr, "action_blending", 0, NULL, 0);
/* influence */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, 0, &adt_ptr, "action_influence", 0);
+ uiItemR(row, &adt_ptr, "action_influence", 0, NULL, 0);
}
/* active NLA-Track */
@@ -280,7 +269,7 @@ static void nla_panel_track (const bContext *C, Panel *pa)
/* Info - Active NLA-Context:Track ---------------------- */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, ICON_NLA, &nlt_ptr, "name", 0);
+ uiItemR(row, &nlt_ptr, "name", 0, NULL, ICON_NLA);
}
/* generic settings for active NLA-Strip */
@@ -300,41 +289,41 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
/* Strip Properties ------------------------------------- */
/* strip type */
row= uiLayoutColumn(layout, 1);
- uiItemR(row, NULL, ICON_NLA, &strip_ptr, "name", 0); // XXX icon?
- uiItemR(row, NULL, 0, &strip_ptr, "type", 0);
+ uiItemR(row, &strip_ptr, "name", 0, NULL, ICON_NLA); // XXX icon?
+ uiItemR(row, &strip_ptr, "type", 0, NULL, 0);
/* strip extents */
column= uiLayoutColumn(layout, 1);
uiItemL(column, "Strip Extents:", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "start_frame", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "end_frame", 0);
+ uiItemR(column, &strip_ptr, "start_frame", 0, NULL, 0);
+ uiItemR(column, &strip_ptr, "end_frame", 0, NULL, 0);
/* extrapolation */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, 0, &strip_ptr, "extrapolation", 0);
+ uiItemR(row, &strip_ptr, "extrapolation", 0, NULL, 0);
/* blending */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, 0, &strip_ptr, "blending", 0);
+ uiItemR(row, &strip_ptr, "blending", 0, NULL, 0);
/* blend in/out + autoblending
* - blend in/out can only be set when autoblending is off
*/
column= uiLayoutColumn(layout, 1);
uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_influence")==0);
- uiItemR(column, NULL, 0, &strip_ptr, "auto_blending", 0); // XXX as toggle?
+ uiItemR(column, &strip_ptr, "auto_blending", 0, NULL, 0); // XXX as toggle?
subcol= uiLayoutColumn(column, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "auto_blending")==0);
- uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0);
- uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0);
+ uiItemR(subcol, &strip_ptr, "blend_in", 0, NULL, 0);
+ uiItemR(subcol, &strip_ptr, "blend_out", 0, NULL, 0);
/* settings */
column= uiLayoutColumn(layout, 1);
uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "animated_influence") || RNA_boolean_get(&strip_ptr, "animated_time")));
uiItemL(column, "Playback Settings:", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "muted", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "reversed", 0);
+ uiItemR(column, &strip_ptr, "muted", 0, NULL, 0);
+ uiItemR(column, &strip_ptr, "reversed", 0, NULL, 0);
}
@@ -356,22 +345,22 @@ static void nla_panel_actclip(const bContext *C, Panel *pa)
/* Strip Properties ------------------------------------- */
/* action pointer */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, ICON_ACTION, &strip_ptr, "action", 0);
+ uiItemR(row, &strip_ptr, "action", 0, NULL, ICON_ACTION);
/* action extents */
// XXX custom names were used here (to avoid the prefixes)... probably not necessary in future?
column= uiLayoutColumn(layout, 1);
uiItemL(column, "Action Extents:", 0);
- uiItemR(column, "Start Frame", 0, &strip_ptr, "action_start_frame", 0);
- uiItemR(column, "End Frame", 0, &strip_ptr, "action_end_frame", 0);
+ uiItemR(column, &strip_ptr, "action_start_frame", 0, "Start Frame", 0);
+ uiItemR(column, &strip_ptr, "action_end_frame", 0, "End Frame", 0);
uiItemO(column, NULL, 0, "NLA_OT_action_sync_length");
/* action usage */
column= uiLayoutColumn(layout, 1);
uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_time")==0);
uiItemL(column, "Playback Settings:", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "scale", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "repeat", 0);
+ uiItemR(column, &strip_ptr, "scale", 0, NULL, 0);
+ uiItemR(column, &strip_ptr, "repeat", 0, NULL, 0);
}
/* evaluation settings for active NLA-Strip */
@@ -390,22 +379,22 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
column= uiLayoutColumn(layout, 1);
- uiItemR(column, NULL, 0, &strip_ptr, "animated_influence", 0);
+ uiItemR(column, &strip_ptr, "animated_influence", 0, NULL, 0);
subcolumn= uiLayoutColumn(column, 1);
uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_influence"));
- uiItemR(subcolumn, NULL, 0, &strip_ptr, "influence", 0);
+ uiItemR(subcolumn, &strip_ptr, "influence", 0, NULL, 0);
column= uiLayoutColumn(layout, 1);
subrow= uiLayoutRow(column, 0);
- uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time", 0);
- uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time_cyclic", 0);
+ uiItemR(subrow, &strip_ptr, "animated_time", 0, NULL, 0);
+ uiItemR(subrow, &strip_ptr, "animated_time_cyclic", 0, NULL, 0);
subcolumn= uiLayoutColumn(column, 1);
subrow= uiLayoutRow(subcolumn, 0);
uiLayoutSetEnabled(subrow, RNA_boolean_get(&strip_ptr, "animated_time"));
- uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0);
+ uiItemR(subcolumn, &strip_ptr, "strip_time", 0, NULL, 0);
}
/* F-Modifiers for active NLA-Strip */
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 1bc07811bf8..4deab9d82ab 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -31,24 +31,9 @@
#include <stdlib.h>
#include <math.h>
-#include "DNA_listBase.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
-#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -65,8 +50,6 @@
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
-#include "ED_markers.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "RNA_access.h"
@@ -75,9 +58,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
-#include "UI_interface_icons.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
#include "nla_intern.h" // own include
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 5b9b5331223..2ec88ba852f 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -32,26 +32,10 @@
#include <math.h>
#include <float.h>
-#include "DNA_listBase.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
#include "DNA_space_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
-#include "DNA_world_types.h"
-#include "DNA_vec_types.h"
#include "MEM_guardedalloc.h"
@@ -69,13 +53,10 @@
#include "ED_anim_api.h"
#include "ED_keyframes_draw.h"
-#include "ED_space_api.h"
-#include "ED_screen.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
@@ -83,7 +64,6 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "ED_markers.h"
#include "nla_intern.h" // own include
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index a26d6b84e08..37961ea4f03 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -31,13 +31,7 @@
#include <math.h>
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -59,7 +53,6 @@
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
#include "ED_markers.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_transform.h"
@@ -71,8 +64,6 @@
#include "WM_types.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "nla_intern.h" // own include
#include "nla_private.h" // FIXME... maybe this shouldn't be included?
@@ -923,7 +914,16 @@ static int nlaedit_bake_exec (bContext *C, wmOperator *op)
/* for each AnimData block, bake strips to animdata... */
for (ale= anim_data.first; ale; ale= ale->next) {
- // FIXME
+ AnimData *adt = (AnimData *)ale->data;
+
+ /* if animdata currently has an action, 'push down' this onto the stack first */
+ BKE_nla_action_pushdown(adt);
+
+ /* temporarily mute the action, and start keying to it */
+
+ /* start keying... */
+
+ /* unmute the action */
}
/* free temp data */
@@ -1575,7 +1575,7 @@ static int nla_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *event
continue;
/* add entry to add this type of modifier */
- uiItemEnumO(layout, fmi->name, 0, "NLA_OT_fmodifier_add", "type", i);
+ uiItemEnumO(layout, "NLA_OT_fmodifier_add", fmi->name, 0, "type", i);
}
uiItemS(layout);
diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c
index 0880c71059e..71701048e2f 100644
--- a/source/blender/editors/space_nla/nla_ops.c
+++ b/source/blender/editors/space_nla/nla_ops.c
@@ -29,14 +29,7 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -51,7 +44,6 @@
#include "BKE_screen.h"
#include "ED_anim_api.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_transform.h"
@@ -60,9 +52,6 @@
#include "RNA_access.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "nla_intern.h" // own include
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index deb7fd5cd79..b76d90bd0f9 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -30,13 +30,7 @@
#include <stdio.h>
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -52,8 +46,6 @@
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
-#include "ED_markers.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "RNA_access.h"
@@ -62,8 +54,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
#include "nla_intern.h" // own include
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 4b3dc72a089..46fec4015ea 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -30,11 +30,7 @@
#include <stdio.h>
#include "DNA_anim_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -54,7 +50,6 @@
#include "ED_anim_api.h"
#include "ED_markers.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -62,7 +57,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
@@ -159,10 +153,10 @@ static SpaceLink *nla_new(const bContext *C)
ar->v2d.cur = ar->v2d.tot;
ar->v2d.min[0]= 0.0f;
- ar->v2d.min[1]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
ar->v2d.max[0]= MAXFRAMEF;
- ar->v2d.max[1]= 10000.0f;
+ ar->v2d.max[1]= 10000.0f;
ar->v2d.minzoom= 0.01f;
ar->v2d.maxzoom= 50;
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 88cb9f6e81a..3a91b5c7210 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -34,23 +34,12 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "DNA_ID.h"
#include "DNA_node_types.h"
-#include "DNA_image_types.h"
#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_action_types.h"
-#include "DNA_color_types.h"
-#include "DNA_customdata_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_text_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_curve.h"
@@ -73,22 +62,15 @@
#include "MEM_guardedalloc.h"
-#include "ED_node.h"
-#include "ED_space_api.h"
-#include "ED_screen.h"
-#include "ED_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_view2d.h"
#include "UI_interface.h"
#include "UI_resources.h"
-#include "RE_pipeline.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@@ -111,7 +93,7 @@ static void node_buts_value(uiLayout *layout, bContext *C, PointerRNA *ptr)
prop = RNA_struct_find_property(ptr, "outputs");
RNA_property_collection_lookup_int(ptr, prop, 0, &sockptr);
- uiItemR(layout, "", 0, &sockptr, "default_value", 0);
+ uiItemR(layout, &sockptr, "default_value", 0, "", 0);
}
static void node_buts_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -126,7 +108,7 @@ static void node_buts_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr)
col = uiLayoutColumn(layout, 0);
uiTemplateColorWheel(col, &sockptr, "default_value", 1, 0);
- uiItemR(col, "", 0, &sockptr, "default_value", 0);
+ uiItemR(col, &sockptr, "default_value", 0, "", 0);
}
static void node_buts_mix_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -136,9 +118,9 @@ static void node_buts_mix_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr)
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, ptr, "blend_type", 0);
+ uiItemR(row, ptr, "blend_type", 0, "", 0);
if(ntree->type == NTREE_COMPOSIT)
- uiItemR(row, "", ICON_IMAGE_RGB_ALPHA, ptr, "alpha", 0);
+ uiItemR(row, ptr, "alpha", 0, "", ICON_IMAGE_RGB_ALPHA);
}
static void node_buts_time(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -159,8 +141,8 @@ static void node_buts_time(uiLayout *layout, bContext *C, PointerRNA *ptr)
uiTemplateCurveMapping(layout, ptr, "curve", 's', 0, 0);
row= uiLayoutRow(layout, 1);
- uiItemR(row, "Sta", 0, ptr, "start", 0);
- uiItemR(row, "End", 0, ptr, "end", 0);
+ uiItemR(row, ptr, "start", 0, "Sta", 0);
+ uiItemR(row, ptr, "end", 0, "End", 0);
}
static void node_buts_colorramp(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -278,17 +260,17 @@ static void node_buts_texture(uiLayout *layout, bContext *C, PointerRNA *ptr)
(node->type != TEX_NODE_TEXTURE)
);
- uiItemR(layout, "", 0, ptr, "texture", 0);
+ uiItemR(layout, ptr, "texture", 0, "", 0);
if(multi) {
/* Number Drawing not optimal here, better have a list*/
- uiItemR(layout, "", 0, ptr, "node_output", 0);
+ uiItemR(layout, ptr, "node_output", 0, "", 0);
}
}
static void node_buts_math(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "operation", 0);
+ uiItemR(layout, ptr, "operation", 0, "", 0);
}
/* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */
@@ -329,9 +311,9 @@ static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA
if(!node->id) return;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "diffuse", 0);
- uiItemR(col, NULL, 0, ptr, "specular", 0);
- uiItemR(col, NULL, 0, ptr, "invert_normal", 0);
+ uiItemR(col, ptr, "diffuse", 0, NULL, 0);
+ uiItemR(col, ptr, "specular", 0, NULL, 0);
+ uiItemR(col, ptr, "invert_normal", 0, NULL, 0);
}
static void node_shader_buts_mapping(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -340,29 +322,29 @@ static void node_shader_buts_mapping(uiLayout *layout, bContext *C, PointerRNA *
uiItemL(layout, "Location:", 0);
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, ptr, "location", 0);
+ uiItemR(row, ptr, "location", 0, "", 0);
uiItemL(layout, "Rotation:", 0);
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, ptr, "rotation", 0);
+ uiItemR(row, ptr, "rotation", 0, "", 0);
uiItemL(layout, "Scale:", 0);
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, ptr, "scale", 0);
+ uiItemR(row, ptr, "scale", 0, "", 0);
row= uiLayoutRow(layout, 1);
- uiItemR(row, "Min", 0, ptr, "clamp_minimum", 0);
- uiItemR(row, "", 0, ptr, "minimum", 0);
+ uiItemR(row, ptr, "clamp_minimum", 0, "Min", 0);
+ uiItemR(row, ptr, "minimum", 0, "", 0);
row= uiLayoutRow(layout, 1);
- uiItemR(row, "Max", 0, ptr, "clamp_maximum", 0);
- uiItemR(row, "", 0, ptr, "maximum", 0);
+ uiItemR(row, ptr, "clamp_maximum", 0, "Max", 0);
+ uiItemR(row, ptr, "maximum", 0, "", 0);
}
static void node_shader_buts_vect_math(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "operation", 0);
+ uiItemR(layout, ptr, "operation", 0, "", 0);
}
static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -370,8 +352,8 @@ static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA
uiLayout *col;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, "UV", 0, ptr, "uv_layer", 0);
- uiItemR(col, "VCol", 0, ptr, "color_layer", 0);
+ uiItemR(col, ptr, "uv_layer", 0, "UV", 0);
+ uiItemR(col, ptr, "color_layer", 0, "VCol", 0);
}
static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -485,21 +467,21 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, &imaptr, "source", 0);
+ uiItemR(col, &imaptr, "source", 0, NULL, 0);
if (ELEM(RNA_enum_get(&imaptr, "source"), IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "frames", 0);
- uiItemR(col, NULL, 0, ptr, "start", 0);
- uiItemR(col, NULL, 0, ptr, "offset", 0);
- uiItemR(col, NULL, 0, ptr, "cyclic", 0);
- uiItemR(col, NULL, 0, ptr, "auto_refresh", UI_ITEM_R_ICON_ONLY);
+ uiItemR(col, ptr, "frames", 0, NULL, 0);
+ uiItemR(col, ptr, "start", 0, NULL, 0);
+ uiItemR(col, ptr, "offset", 0, NULL, 0);
+ uiItemR(col, ptr, "cyclic", 0, NULL, 0);
+ uiItemR(col, ptr, "auto_refresh", UI_ITEM_R_ICON_ONLY, NULL, 0);
}
col= uiLayoutColumn(layout, 0);
if (RNA_enum_get(&imaptr, "type")== IMA_TYPE_MULTILAYER)
- uiItemR(col, NULL, 0, ptr, "layer", 0);
+ uiItemR(col, ptr, "layer", 0, NULL, 0);
}
static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -518,7 +500,7 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point
col= uiLayoutColumn(layout, 0);
row = uiLayoutRow(col, 0);
- uiItemR(row, "", 0, ptr, "layer", 0);
+ uiItemR(row, ptr, "layer", 0, "", 0);
prop = RNA_struct_find_property(ptr, "layer");
if (!(RNA_property_enum_identifier(C, ptr, prop, RNA_property_enum_get(ptr, prop), &layer_name)))
@@ -530,7 +512,7 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point
WM_operator_properties_create(&op_ptr, "RENDER_OT_render");
RNA_string_set(&op_ptr, "layer", layer_name);
RNA_string_set(&op_ptr, "scene", scene_name);
- uiItemFullO(row, "", ICON_RENDER_STILL, "RENDER_OT_render", op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
+ uiItemFullO(row, "RENDER_OT_render", "", ICON_RENDER_STILL, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
}
@@ -541,21 +523,21 @@ static void node_composit_buts_blur(uiLayout *layout, bContext *C, PointerRNA *p
col= uiLayoutColumn(layout, 0);
- uiItemR(col, "", 0, ptr, "filter_type", 0);
+ uiItemR(col, ptr, "filter_type", 0, "", 0);
if (RNA_enum_get(ptr, "filter_type")!= R_FILTER_FAST_GAUSS) {
- uiItemR(col, NULL, 0, ptr, "bokeh", 0);
- uiItemR(col, NULL, 0, ptr, "gamma", 0);
+ uiItemR(col, ptr, "bokeh", 0, NULL, 0);
+ uiItemR(col, ptr, "gamma", 0, NULL, 0);
}
- uiItemR(col, NULL, 0, ptr, "relative", 0);
+ uiItemR(col, ptr, "relative", 0, NULL, 0);
col= uiLayoutColumn(layout, 1);
if (RNA_boolean_get(ptr, "relative")) {
- uiItemR(col, "X", 0, ptr, "factor_x", 0);
- uiItemR(col, "Y", 0, ptr, "factor_y", 0);
+ uiItemR(col, ptr, "factor_x", 0, "X", 0);
+ uiItemR(col, ptr, "factor_y", 0, "Y", 0);
}
else {
- uiItemR(col, "X", 0, ptr, "sizex", 0);
- uiItemR(col, "Y", 0, ptr, "sizey", 0);
+ uiItemR(col, ptr, "sizex", 0, "X", 0);
+ uiItemR(col, ptr, "sizey", 0, "Y", 0);
}
}
@@ -563,24 +545,24 @@ static void node_composit_buts_dblur(uiLayout *layout, bContext *C, PointerRNA *
{
uiLayout *col;
- uiItemR(layout, NULL, 0, ptr, "iterations", 0);
- uiItemR(layout, NULL, 0, ptr, "wrap", 0);
+ uiItemR(layout, ptr, "iterations", 0, NULL, 0);
+ uiItemR(layout, ptr, "wrap", 0, NULL, 0);
col= uiLayoutColumn(layout, 1);
uiItemL(col, "Center:", 0);
- uiItemR(col, "X", 0, ptr, "center_x", 0);
- uiItemR(col, "Y", 0, ptr, "center_y", 0);
+ uiItemR(col, ptr, "center_x", 0, "X", 0);
+ uiItemR(col, ptr, "center_y", 0, "Y", 0);
uiItemS(layout);
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "distance", 0);
- uiItemR(col, NULL, 0, ptr, "angle", 0);
+ uiItemR(col, ptr, "distance", 0, NULL, 0);
+ uiItemR(col, ptr, "angle", 0, NULL, 0);
uiItemS(layout);
- uiItemR(layout, NULL, 0, ptr, "spin", 0);
- uiItemR(layout, NULL, 0, ptr, "zoom", 0);
+ uiItemR(layout, ptr, "spin", 0, NULL, 0);
+ uiItemR(layout, ptr, "zoom", 0, NULL, 0);
}
static void node_composit_buts_bilateralblur(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -588,9 +570,9 @@ static void node_composit_buts_bilateralblur(uiLayout *layout, bContext *C, Poin
uiLayout *col;
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "iterations", 0);
- uiItemR(col, NULL, 0, ptr, "sigma_color", 0);
- uiItemR(col, NULL, 0, ptr, "sigma_space", 0);
+ uiItemR(col, ptr, "iterations", 0, NULL, 0);
+ uiItemR(col, ptr, "sigma_color", 0, NULL, 0);
+ uiItemR(col, ptr, "sigma_space", 0, NULL, 0);
}
static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -599,59 +581,59 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA
col= uiLayoutColumn(layout, 0);
uiItemL(col, "Bokeh Type:", 0);
- uiItemR(col, "", 0, ptr, "bokeh", 0);
- uiItemR(col, NULL, 0, ptr, "angle", 0);
+ uiItemR(col, ptr, "bokeh", 0, "", 0);
+ uiItemR(col, ptr, "angle", 0, NULL, 0);
- uiItemR(layout, NULL, 0, ptr, "gamma_correction", 0);
+ uiItemR(layout, ptr, "gamma_correction", 0, NULL, 0);
col = uiLayoutColumn(layout, 0);
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer")==1);
- uiItemR(col, NULL, 0, ptr, "f_stop", 0);
+ uiItemR(col, ptr, "f_stop", 0, NULL, 0);
- uiItemR(layout, NULL, 0, ptr, "max_blur", 0);
- uiItemR(layout, NULL, 0, ptr, "threshold", 0);
+ uiItemR(layout, ptr, "max_blur", 0, NULL, 0);
+ uiItemR(layout, ptr, "threshold", 0, NULL, 0);
col = uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "preview", 0);
+ uiItemR(col, ptr, "preview", 0, NULL, 0);
sub = uiLayoutColumn(col, 0);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "preview"));
- uiItemR(sub, NULL, 0, ptr, "samples", 0);
+ uiItemR(sub, ptr, "samples", 0, NULL, 0);
col = uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "use_zbuffer", 0);
+ uiItemR(col, ptr, "use_zbuffer", 0, NULL, 0);
sub = uiLayoutColumn(col, 0);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer")==0);
- uiItemR(sub, NULL, 0, ptr, "z_scale", 0);
+ uiItemR(sub, ptr, "z_scale", 0, NULL, 0);
}
/* qdn: glare node */
static void node_composit_buts_glare(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "glare_type", 0);
- uiItemR(layout, "", 0, ptr, "quality", 0);
+ uiItemR(layout, ptr, "glare_type", 0, "", 0);
+ uiItemR(layout, ptr, "quality", 0, "", 0);
if (RNA_enum_get(ptr, "glare_type")!= 1) {
- uiItemR(layout, NULL, 0, ptr, "iterations", 0);
+ uiItemR(layout, ptr, "iterations", 0, NULL, 0);
if (RNA_enum_get(ptr, "glare_type")!= 0)
- uiItemR(layout, NULL, 0, ptr, "color_modulation", UI_ITEM_R_SLIDER);
+ uiItemR(layout, ptr, "color_modulation", UI_ITEM_R_SLIDER, NULL, 0);
}
- uiItemR(layout, NULL, 0, ptr, "mix", 0);
- uiItemR(layout, NULL, 0, ptr, "threshold", 0);
+ uiItemR(layout, ptr, "mix", 0, NULL, 0);
+ uiItemR(layout, ptr, "threshold", 0, NULL, 0);
if (RNA_enum_get(ptr, "glare_type")== 2) {
- uiItemR(layout, NULL, 0, ptr, "streaks", 0);
- uiItemR(layout, NULL, 0, ptr, "angle_offset", 0);
+ uiItemR(layout, ptr, "streaks", 0, NULL, 0);
+ uiItemR(layout, ptr, "angle_offset", 0, NULL, 0);
}
if (RNA_enum_get(ptr, "glare_type")== 0 || RNA_enum_get(ptr, "glare_type")== 2) {
- uiItemR(layout, NULL, 0, ptr, "fade", UI_ITEM_R_SLIDER);
+ uiItemR(layout, ptr, "fade", UI_ITEM_R_SLIDER, NULL, 0);
if (RNA_enum_get(ptr, "glare_type")== 0)
- uiItemR(layout, NULL, 0, ptr, "rotate_45", 0);
+ uiItemR(layout, ptr, "rotate_45", 0, NULL, 0);
}
if (RNA_enum_get(ptr, "glare_type")== 1) {
- uiItemR(layout, NULL, 0, ptr, "size", 0);
+ uiItemR(layout, ptr, "size", 0, NULL, 0);
}
}
@@ -660,17 +642,17 @@ static void node_composit_buts_tonemap(uiLayout *layout, bContext *C, PointerRNA
uiLayout *col;
col = uiLayoutColumn(layout, 0);
- uiItemR(col, "", 0, ptr, "tonemap_type", 0);
+ uiItemR(col, ptr, "tonemap_type", 0, "", 0);
if (RNA_enum_get(ptr, "tonemap_type")== 0) {
- uiItemR(col, NULL, 0, ptr, "key", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "offset", 0);
- uiItemR(col, NULL, 0, ptr, "gamma", 0);
+ uiItemR(col, ptr, "key", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "offset", 0, NULL, 0);
+ uiItemR(col, ptr, "gamma", 0, NULL, 0);
}
else {
- uiItemR(col, NULL, 0, ptr, "intensity", 0);
- uiItemR(col, NULL, 0, ptr, "contrast", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "adaptation", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "correction", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "intensity", 0, NULL, 0);
+ uiItemR(col, ptr, "contrast", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "adaptation", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "correction", UI_ITEM_R_SLIDER, NULL, 0);
}
}
@@ -679,12 +661,12 @@ static void node_composit_buts_lensdist(uiLayout *layout, bContext *C, PointerRN
uiLayout *col;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "projector", 0);
+ uiItemR(col, ptr, "projector", 0, NULL, 0);
col = uiLayoutColumn(col, 0);
uiLayoutSetActive(col, RNA_boolean_get(ptr, "projector")==0);
- uiItemR(col, NULL, 0, ptr, "jitter", 0);
- uiItemR(col, NULL, 0, ptr, "fit", 0);
+ uiItemR(col, ptr, "jitter", 0, NULL, 0);
+ uiItemR(col, ptr, "fit", 0, NULL, 0);
}
static void node_composit_buts_vecblur(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -692,38 +674,38 @@ static void node_composit_buts_vecblur(uiLayout *layout, bContext *C, PointerRNA
uiLayout *col;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "samples", 0);
- uiItemR(col, "Blur", 0, ptr, "factor", 0);
+ uiItemR(col, ptr, "samples", 0, NULL, 0);
+ uiItemR(col, ptr, "factor", 0, "Blur", 0);
col= uiLayoutColumn(layout, 1);
uiItemL(col, "Speed:", 0);
- uiItemR(col, "Min", 0, ptr, "min_speed", 0);
- uiItemR(col, "Max", 0, ptr, "max_speed", 0);
+ uiItemR(col, ptr, "min_speed", 0, "Min", 0);
+ uiItemR(col, ptr, "max_speed", 0, "Max", 0);
- uiItemR(layout, NULL, 0, ptr, "curved", 0);
+ uiItemR(layout, ptr, "curved", 0, NULL, 0);
}
static void node_composit_buts_filter(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "filter_type", 0);
+ uiItemR(layout, ptr, "filter_type", 0, "", 0);
}
static void node_composit_buts_flip(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "axis", 0);
+ uiItemR(layout, ptr, "axis", 0, "", 0);
}
static void node_composit_buts_crop(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
uiLayout *col;
- uiItemR(layout, NULL, 0, ptr, "crop_size", 0);
+ uiItemR(layout, ptr, "crop_size", 0, NULL, 0);
col= uiLayoutColumn(layout, 1);
- uiItemR(col, "Left", 0, ptr, "x1", 0);
- uiItemR(col, "Right", 0, ptr, "x2", 0);
- uiItemR(col, "Up", 0, ptr, "y1", 0);
- uiItemR(col, "Down", 0, ptr, "y2", 0);
+ uiItemR(col, ptr, "x1", 0, "Left", 0);
+ uiItemR(col, ptr, "x2", 0, "Right", 0);
+ uiItemR(col, ptr, "y1", 0, "Up", 0);
+ uiItemR(col, ptr, "y2", 0, "Down", 0);
}
static void node_composit_buts_splitviewer(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -732,8 +714,8 @@ static void node_composit_buts_splitviewer(uiLayout *layout, bContext *C, Pointe
col= uiLayoutColumn(layout, 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "axis", UI_ITEM_R_EXPAND);
- uiItemR(col, NULL, 0, ptr, "factor", 0);
+ uiItemR(row, ptr, "axis", UI_ITEM_R_EXPAND, NULL, 0);
+ uiItemR(col, ptr, "factor", 0, NULL, 0);
}
static void node_composit_buts_map_value(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -741,20 +723,20 @@ static void node_composit_buts_map_value(uiLayout *layout, bContext *C, PointerR
uiLayout *sub, *col;
col =uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "offset", 0);
- uiItemR(col, NULL, 0, ptr, "size", 0);
+ uiItemR(col, ptr, "offset", 0, NULL, 0);
+ uiItemR(col, ptr, "size", 0, NULL, 0);
col =uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "use_min", 0);
+ uiItemR(col, ptr, "use_min", 0, NULL, 0);
sub =uiLayoutColumn(col, 0);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min"));
- uiItemR(sub, "", 0, ptr, "min", 0);
+ uiItemR(sub, ptr, "min", 0, "", 0);
col =uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "use_max", 0);
+ uiItemR(col, ptr, "use_max", 0, NULL, 0);
sub =uiLayoutColumn(col, 0);
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max"));
- uiItemR(sub, "", 0, ptr, "max", 0);
+ uiItemR(sub, ptr, "max", 0, "", 0);
}
static void node_composit_buts_alphaover(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -762,8 +744,8 @@ static void node_composit_buts_alphaover(uiLayout *layout, bContext *C, PointerR
uiLayout *col;
col =uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "convert_premul", 0);
- uiItemR(col, NULL, 0, ptr, "premul", 0);
+ uiItemR(col, ptr, "convert_premul", 0, NULL, 0);
+ uiItemR(col, ptr, "premul", 0, NULL, 0);
}
static void node_composit_buts_hue_sat(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -771,14 +753,14 @@ static void node_composit_buts_hue_sat(uiLayout *layout, bContext *C, PointerRNA
uiLayout *col;
col =uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "hue", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "sat", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "val", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "hue", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "sat", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "val", UI_ITEM_R_SLIDER, NULL, 0);
}
static void node_composit_buts_dilateerode(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, NULL, 0, ptr, "distance", 0);
+ uiItemR(layout, ptr, "distance", 0, NULL, 0);
}
static void node_composit_buts_diff_matte(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -786,8 +768,8 @@ static void node_composit_buts_diff_matte(uiLayout *layout, bContext *C, Pointer
uiLayout *col;
col =uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "tolerance", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "falloff", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "tolerance", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, 0);
}
static void node_composit_buts_distance_matte(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -795,8 +777,8 @@ static void node_composit_buts_distance_matte(uiLayout *layout, bContext *C, Poi
uiLayout *col;
col =uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "tolerance", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "falloff", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "tolerance", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, 0);
}
static void node_composit_buts_color_spill(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -805,23 +787,23 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *C, Pointe
uiItemL(layout, "Despill Channel:", 0);
row =uiLayoutRow(layout,0);
- uiItemR(row, NULL, 0, ptr, "channel", UI_ITEM_R_EXPAND);
+ uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, 0);
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "algorithm", 0);
+ uiItemR(col, ptr, "algorithm", 0, NULL, 0);
if(RNA_enum_get(ptr, "algorithm")==0) {
- uiItemL(col, "Limiting Channel:", 0);
- row=uiLayoutRow(col,0);
- uiItemR(row, NULL, 0, ptr, "limit_channel", UI_ITEM_R_EXPAND);
+ uiItemL(col, "Limiting Channel:", 0);
+ row=uiLayoutRow(col,0);
+ uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, 0);
}
- uiItemR(col, NULL, 0, ptr, "ratio", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "unspill", 0);
+ uiItemR(col, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "unspill", 0, NULL, 0);
if (RNA_enum_get(ptr, "unspill")== 1) {
- uiItemR(col, NULL, 0, ptr, "unspill_red", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "unspill_green", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "unspill_blue", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "unspill_red", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "unspill_green", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "unspill_blue", UI_ITEM_R_SLIDER, NULL, 0);
}
}
@@ -830,13 +812,13 @@ static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *C, Point
uiLayout *col;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "acceptance", 0);
- uiItemR(col, NULL, 0, ptr, "cutoff", 0);
+ uiItemR(col, ptr, "acceptance", 0, NULL, 0);
+ uiItemR(col, ptr, "cutoff", 0, NULL, 0);
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "lift", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "gain", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "shadow_adjust", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "lift", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "gain", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, NULL, 0);
}
static void node_composit_buts_color_matte(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -844,9 +826,9 @@ static void node_composit_buts_color_matte(uiLayout *layout, bContext *C, Pointe
uiLayout *col;
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "h", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "s", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "v", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "h", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "s", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "v", UI_ITEM_R_SLIDER, NULL, 0);
}
static void node_composit_buts_channel_matte(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -855,24 +837,24 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *C, Poin
uiItemL(layout, "Color Space:", 0);
row= uiLayoutRow(layout, 0);
- uiItemR(row, NULL, 0, ptr, "color_space", UI_ITEM_R_EXPAND);
+ uiItemR(row, ptr, "color_space", UI_ITEM_R_EXPAND, NULL, 0);
col=uiLayoutColumn(layout, 0);
uiItemL(col, "Key Channel:", 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "channel", UI_ITEM_R_EXPAND);
+ uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, 0);
col =uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "algorithm", 0);
+ uiItemR(col, ptr, "algorithm", 0, NULL, 0);
if(RNA_enum_get(ptr, "algorithm")==0) {
- uiItemL(col, "Limiting Channel:", 0);
- row=uiLayoutRow(col,0);
- uiItemR(row, NULL, 0, ptr, "limit_channel", UI_ITEM_R_EXPAND);
+ uiItemL(col, "Limiting Channel:", 0);
+ row=uiLayoutRow(col,0);
+ uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, 0);
}
- uiItemR(col, NULL, 0, ptr, "high", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "low", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "high", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "low", UI_ITEM_R_SLIDER, NULL, 0);
}
static void node_composit_buts_luma_matte(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -880,18 +862,18 @@ static void node_composit_buts_luma_matte(uiLayout *layout, bContext *C, Pointer
uiLayout *col;
col= uiLayoutColumn(layout, 1);
- uiItemR(col, NULL, 0, ptr, "high", UI_ITEM_R_SLIDER);
- uiItemR(col, NULL, 0, ptr, "low", UI_ITEM_R_SLIDER);
+ uiItemR(col, ptr, "high", UI_ITEM_R_SLIDER, NULL, 0);
+ uiItemR(col, ptr, "low", UI_ITEM_R_SLIDER, NULL, 0);
}
static void node_composit_buts_map_uv(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, NULL, 0, ptr, "alpha", 0);
+ uiItemR(layout, ptr, "alpha", 0, NULL, 0);
}
static void node_composit_buts_id_mask(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, NULL, 0, ptr, "index", 0);
+ uiItemR(layout, ptr, "index", 0, NULL, 0);
}
static void node_composit_buts_file_output(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -899,31 +881,31 @@ static void node_composit_buts_file_output(uiLayout *layout, bContext *C, Pointe
uiLayout *col, *row;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, "", 0, ptr, "filename", 0);
- uiItemR(col, "", 0, ptr, "image_type", 0);
+ uiItemR(col, ptr, "filename", 0, "", 0);
+ uiItemR(col, ptr, "image_type", 0, "", 0);
row= uiLayoutRow(layout, 0);
if (RNA_enum_get(ptr, "image_type")== R_OPENEXR) {
- uiItemR(row, NULL, 0, ptr, "exr_half", 0);
- uiItemR(row, "", 0, ptr, "exr_codec", 0);
+ uiItemR(row, ptr, "exr_half", 0, NULL, 0);
+ uiItemR(row, ptr, "exr_codec", 0, "", 0);
}
else if (RNA_enum_get(ptr, "image_type")== R_JPEG90) {
- uiItemR(row, NULL, 0, ptr, "quality", UI_ITEM_R_SLIDER);
+ uiItemR(row, ptr, "quality", UI_ITEM_R_SLIDER, NULL, 0);
}
row= uiLayoutRow(layout, 1);
- uiItemR(row, "Start", 0, ptr, "start_frame", 0);
- uiItemR(row, "End", 0, ptr, "end_frame", 0);
+ uiItemR(row, ptr, "start_frame", 0, "Start", 0);
+ uiItemR(row, ptr, "end_frame", 0, "End", 0);
}
static void node_composit_buts_scale(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "space", 0);
+ uiItemR(layout, ptr, "space", 0, "", 0);
}
static void node_composit_buts_rotate(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "filter", 0);
+ uiItemR(layout, ptr, "filter", 0, "", 0);
}
static void node_composit_buts_invert(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -931,25 +913,25 @@ static void node_composit_buts_invert(uiLayout *layout, bContext *C, PointerRNA
uiLayout *col;
col= uiLayoutColumn(layout, 0);
- uiItemR(col, NULL, 0, ptr, "rgb", 0);
- uiItemR(col, NULL, 0, ptr, "alpha", 0);
+ uiItemR(col, ptr, "rgb", 0, NULL, 0);
+ uiItemR(col, ptr, "alpha", 0, NULL, 0);
}
static void node_composit_buts_premulkey(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "mapping", 0);
+ uiItemR(layout, ptr, "mapping", 0, "", 0);
}
static void node_composit_buts_view_levels(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, NULL, 0, ptr, "channel", UI_ITEM_R_EXPAND);
+ uiItemR(layout, ptr, "channel", UI_ITEM_R_EXPAND, NULL, 0);
}
static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
uiLayout *split, *col, *row;
- uiItemR(layout, NULL, 0, ptr, "correction_formula", 0);
+ uiItemR(layout, ptr, "correction_formula", 0, NULL, 0);
if (RNA_enum_get(ptr, "correction_formula")== 0) {
@@ -957,17 +939,17 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, Point
col = uiLayoutColumn(split, 0);
uiTemplateColorWheel(col, ptr, "lift", 1, 1);
row = uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "lift", 0);
+ uiItemR(row, ptr, "lift", 0, NULL, 0);
col = uiLayoutColumn(split, 0);
uiTemplateColorWheel(col, ptr, "gamma", 1, 1);
row = uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "gamma", 0);
+ uiItemR(row, ptr, "gamma", 0, NULL, 0);
col = uiLayoutColumn(split, 0);
uiTemplateColorWheel(col, ptr, "gain", 1, 1);
row = uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "gain", 0);
+ uiItemR(row, ptr, "gain", 0, NULL, 0);
} else {
@@ -975,17 +957,17 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, Point
col = uiLayoutColumn(split, 0);
uiTemplateColorWheel(col, ptr, "offset", 1, 1);
row = uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "offset", 0);
+ uiItemR(row, ptr, "offset", 0, NULL, 0);
col = uiLayoutColumn(split, 0);
uiTemplateColorWheel(col, ptr, "power", 1, 1);
row = uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "power", 0);
+ uiItemR(row, ptr, "power", 0, NULL, 0);
col = uiLayoutColumn(split, 0);
uiTemplateColorWheel(col, ptr, "slope", 1, 1);
row = uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, ptr, "slope", 0);
+ uiItemR(row, ptr, "slope", 0, NULL, 0);
}
}
@@ -1103,9 +1085,9 @@ static void node_composit_set_butfunc(bNodeType *ntype)
case CMP_NODE_SCALE:
ntype->uifunc= node_composit_buts_scale;
break;
- case CMP_NODE_ROTATE:
- ntype->uifunc=node_composit_buts_rotate;
- break;
+ case CMP_NODE_ROTATE:
+ ntype->uifunc=node_composit_buts_rotate;
+ break;
case CMP_NODE_CHANNEL_MATTE:
ntype->uifunc= node_composit_buts_channel_matte;
break;
@@ -1129,13 +1111,13 @@ static void node_composit_set_butfunc(bNodeType *ntype)
break;
case CMP_NODE_VIEW_LEVELS:
ntype->uifunc=node_composit_buts_view_levels;
- break;
+ break;
case CMP_NODE_COLORBALANCE:
ntype->uifunc=node_composit_buts_colorbalance;
- break;
+ break;
case CMP_NODE_HUECORRECT:
ntype->uifunc=node_composit_buts_huecorrect;
- break;
+ break;
default:
ntype->uifunc= NULL;
}
@@ -1148,12 +1130,12 @@ static void node_texture_buts_bricks(uiLayout *layout, bContext *C, PointerRNA *
uiLayout *col;
col= uiLayoutColumn(layout, 1);
- uiItemR(col, "Offset", 0, ptr, "offset", 0);
- uiItemR(col, "Frequency", 0, ptr, "offset_frequency", 0);
+ uiItemR(col, ptr, "offset", 0, "Offset", 0);
+ uiItemR(col, ptr, "offset_frequency", 0, "Frequency", 0);
col= uiLayoutColumn(layout, 1);
- uiItemR(col, "Squash", 0, ptr, "squash", 0);
- uiItemR(col, "Frequency", 0, ptr, "squash_frequency", 0);
+ uiItemR(col, ptr, "squash", 0, "Squash", 0);
+ uiItemR(col, ptr, "squash_frequency", 0, "Frequency", 0);
}
static void node_texture_buts_proc(uiLayout *layout, bContext *C, PointerRNA *ptr)
@@ -1170,42 +1152,42 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *C, PointerRNA *pt
switch( tex->type ) {
case TEX_BLEND:
- uiItemR(col, "", 0, &tex_ptr, "progression", 0);
+ uiItemR(col, &tex_ptr, "progression", 0, "", 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &tex_ptr, "flip_axis", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "flip_axis", UI_ITEM_R_EXPAND, NULL, 0);
break;
case TEX_MARBLE:
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &tex_ptr, "stype", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "stype", UI_ITEM_R_EXPAND, NULL, 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &tex_ptr, "noisebasis2", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "noisebasis2", UI_ITEM_R_EXPAND, NULL, 0);
break;
case TEX_WOOD:
- uiItemR(col, "", 0, &tex_ptr, "noise_basis", 0);
- uiItemR(col, "", 0, &tex_ptr, "stype", 0);
+ uiItemR(col, &tex_ptr, "noise_basis", 0, "", 0);
+ uiItemR(col, &tex_ptr, "stype", 0, "", 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &tex_ptr, "noisebasis2", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "noisebasis2", UI_ITEM_R_EXPAND, NULL, 0);
row= uiLayoutRow(col, 0);
uiLayoutSetActive(row, !(RNA_enum_get(&tex_ptr, "stype")==TEX_BAND || RNA_enum_get(&tex_ptr, "stype")==TEX_RING));
- uiItemR(row, NULL, 0, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, 0);
break;
case TEX_CLOUDS:
- uiItemR(col, "", 0, &tex_ptr, "noise_basis", 0);
+ uiItemR(col, &tex_ptr, "noise_basis", 0, "", 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &tex_ptr, "stype", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "stype", UI_ITEM_R_EXPAND, NULL, 0);
row= uiLayoutRow(col, 0);
- uiItemR(row, NULL, 0, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND);
- uiItemR(col, "Depth", 0, &tex_ptr, "noise_depth", UI_ITEM_R_EXPAND);
+ uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, 0);
+ uiItemR(col, &tex_ptr, "noise_depth", UI_ITEM_R_EXPAND, "Depth", 0);
break;
case TEX_DISTNOISE:
- uiItemR(col, "", 0, &tex_ptr, "noise_basis", 0);
- uiItemR(col, "", 0, &tex_ptr, "noise_distortion", 0);
+ uiItemR(col, &tex_ptr, "noise_basis", 0, "", 0);
+ uiItemR(col, &tex_ptr, "noise_distortion", 0, "", 0);
break;
}
}
@@ -1217,7 +1199,7 @@ static void node_texture_buts_image(uiLayout *layout, bContext *C, PointerRNA *p
static void node_texture_buts_output(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- uiItemR(layout, "", 0, ptr, "output_name", 0);
+ uiItemR(layout, ptr, "output_name", 0, "", 0);
}
/* only once called */
diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c
index 317bce16f07..41cf689407b 100644
--- a/source/blender/editors/space_node/node_buttons.c
+++ b/source/blender/editors/space_node/node_buttons.c
@@ -31,13 +31,8 @@
#include <math.h>
#include <float.h>
-#include "DNA_ID.h"
-#include "DNA_gpencil_types.h"
#include "DNA_node_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -61,16 +56,12 @@
#include "WM_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "node_intern.h" // own include
@@ -123,7 +114,7 @@ static void active_node_panel(const bContext *C, Panel *pa)
uiBlockSetHandleFunc(block, do_node_region_buttons, NULL);
/* draw this node's name, etc. */
- uiItemR(layout, NULL, ICON_NODE, &ptr, "name", 0);
+ uiItemR(layout, &ptr, "name", 0, NULL, ICON_NODE);
// TODO: a separator would be nice...
/* draw this node's settings */
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 3f53b80bd22..50f9d84ce71 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -30,23 +30,12 @@
#include <stdio.h>
#include <string.h>
-#include "DNA_ID.h"
#include "DNA_node_types.h"
-#include "DNA_image_types.h"
#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_action_types.h"
-#include "DNA_color_types.h"
-#include "DNA_customdata_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_text_types.h"
-#include "DNA_userdef_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -73,9 +62,6 @@
#include "WM_types.h"
#include "ED_gpencil.h"
-#include "ED_screen.h"
-#include "ED_util.h"
-#include "ED_types.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
@@ -597,7 +583,7 @@ static uiBlock *socket_vector_menu(bContext *C, ARegion *ar, void *socket_v)
layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, sock->locx, sock->locy-8, 140, 20, U.uistyles.first), 0);
- uiItemR(layout, "", 0, &ptr, "default_value", UI_ITEM_R_EXPAND);
+ uiItemR(layout, &ptr, "default_value", UI_ITEM_R_EXPAND, "", 0);
return block;
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index ce0b3f3fd59..eeab6a7f31e 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -34,19 +34,10 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_color_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_object_types.h"
#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
#include "DNA_node_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_colortools.h"
@@ -70,14 +61,9 @@
#include "RE_pipeline.h"
-#include "IMB_imbuf_types.h"
#include "ED_node.h"
-#include "ED_render.h"
#include "ED_screen.h"
-#include "ED_space_api.h"
-#include "ED_transform.h"
-#include "ED_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c
index 168d2524995..3ed719eccc0 100644
--- a/source/blender/editors/space_node/node_header.c
+++ b/source/blender/editors/space_node/node_header.c
@@ -31,11 +31,8 @@
#include "DNA_space_types.h"
#include "DNA_node_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -47,9 +44,6 @@
#include "BKE_main.h"
#include "BKE_utildefines.h"
-#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -58,8 +52,6 @@
#include "BIF_glutil.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "node_intern.h"
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index 171333946d1..dd09260ad97 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -27,20 +27,15 @@
*/
#include "DNA_node_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
#include "BKE_context.h"
#include "BKE_node.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_transform.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 9235a0547ca..b690059fc12 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -29,11 +29,7 @@
#include <stdio.h>
#include "DNA_node_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "BKE_context.h"
#include "BKE_node.h"
@@ -42,7 +38,6 @@
#include "BLI_rect.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_types.h"
@@ -127,7 +122,7 @@ static int node_select_exec(bContext *C, wmOperator *op)
}
}
- /* send notifiers */
+ /* send notifiers */
WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
/* allow tweak event to work too */
diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c
index 0d7c182bc9e..43c80f693b1 100644
--- a/source/blender/editors/space_node/node_state.c
+++ b/source/blender/editors/space_node/node_state.c
@@ -29,11 +29,7 @@
#include <stdio.h>
#include "DNA_node_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "BKE_context.h"
#include "BKE_node.h"
@@ -41,9 +37,7 @@
#include "BLI_rect.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
-#include "ED_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 112a2bc49b6..afb2ec04f55 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -32,10 +32,7 @@
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -49,7 +46,6 @@
#include "BKE_node.h"
#include "ED_render.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -57,8 +53,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
#include "RNA_access.h"
@@ -297,7 +291,7 @@ static void node_header_area_draw(const bContext *C, ARegion *ar)
SpaceNode *snode= CTX_wm_space_node(C);
Scene *scene= CTX_data_scene(C);
- /* find and set the context */
+ /* find and set the context */
snode_set_context(snode, scene);
ED_region_header(C, ar);
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 797efefd669..d833e86f80e 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -34,29 +34,17 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
#include "DNA_camera_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_group_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_outliner_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_text_types.h"
#include "DNA_world_types.h"
#include "DNA_sequence_types.h"
@@ -87,7 +75,6 @@
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_util.h"
-#include "ED_types.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -103,16 +90,10 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "ED_armature.h"
#include "ED_keyframing.h"
-#include "ED_object.h"
-#include "ED_particle.h"
-#include "ED_screen.h"
-#include "ED_view3d.h"
#include "outliner_intern.h"
-#include "PIL_time.h"
#define OL_H 19
@@ -4219,6 +4200,8 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
UI_icon_draw(x, y, ICON_MOD_SMOKE); break;
case eModifierType_Solidify:
UI_icon_draw(x, y, ICON_MOD_SOLIDIFY); break;
+ case eModifierType_Screw:
+ UI_icon_draw(x, y, ICON_MOD_SCREW); break;
default:
UI_icon_draw(x, y, ICON_DOT); break;
}
diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c
index adcacbe55c8..fcd6e272390 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -29,15 +29,12 @@
#include <stdlib.h>
#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
-#include "ED_screen.h"
#include "outliner_intern.h"
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 27d6c83cdb8..63508725b05 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -29,16 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_color_types.h"
-#include "DNA_object_types.h"
-#include "DNA_outliner_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -52,7 +42,6 @@
#include "BKE_texture.h"
#include "BKE_utildefines.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "WM_api.h"
@@ -61,12 +50,9 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "RNA_access.h"
-#include "RNA_types.h"
#include "outliner_intern.h"
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index 5a1ca49e79d..6ef9a96b478 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -29,9 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -49,10 +46,7 @@
#include "RNA_define.h"
#include "ED_screen.h"
-#include "ED_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "script_intern.h" // own include
diff --git a/source/blender/editors/space_script/script_header.c b/source/blender/editors/space_script/script_header.c
index 2c08fd97bac..9c23d1b8131 100644
--- a/source/blender/editors/space_script/script_header.c
+++ b/source/blender/editors/space_script/script_header.c
@@ -29,10 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -45,8 +41,6 @@
#include "ED_types.h"
#include "ED_util.h"
-#include "WM_api.h"
-#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c
index b3b0c40df07..353d80f1921 100644
--- a/source/blender/editors/space_script/script_ops.c
+++ b/source/blender/editors/space_script/script_ops.c
@@ -31,11 +31,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -45,12 +42,10 @@
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_screen.h"
#include "script_intern.h"
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c
index cca9e0efbd1..3629c980a25 100644
--- a/source/blender/editors/space_script/space_script.c
+++ b/source/blender/editors/space_script/space_script.c
@@ -29,10 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -44,7 +40,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -52,11 +47,9 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "ED_markers.h"
#include "BPY_extern.h"
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 439fd6c13d1..22d94621673 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -41,18 +41,8 @@
#include "BLI_math.h"
#include "BLI_storage_types.h"
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-#include "DNA_ipo_types.h"
-#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_sound_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -71,23 +61,13 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
/* for menu/popup icons etc etc*/
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "ED_anim_api.h"
-#include "ED_space_api.h"
-#include "ED_types.h"
#include "ED_screen.h"
-#include "ED_util.h"
-#include "ED_fileselect.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
#include "BKE_sound.h"
diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c
index d6b52e83090..a2aa7e649b9 100644
--- a/source/blender/editors/space_sequencer/sequencer_buttons.c
+++ b/source/blender/editors/space_sequencer/sequencer_buttons.c
@@ -27,11 +27,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -43,21 +38,14 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
#include "ED_screen.h"
-#include "ED_sequencer.h"
-#include "ED_util.h"
-#include "RNA_access.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "sequencer_intern.h"
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 0d7239015c9..d725c5c81b4 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -35,12 +35,9 @@
#include "IMB_imbuf_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_sequence_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
#include "DNA_userdef_types.h"
#include "BKE_context.h"
@@ -51,7 +48,6 @@
#include "BKE_utildefines.h"
#include "BKE_sound.h"
-#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "BIF_gl.h"
@@ -59,8 +55,6 @@
#include "ED_anim_api.h"
#include "ED_markers.h"
-#include "ED_space_api.h"
-#include "ED_sequencer.h"
#include "ED_types.h"
#include "UI_interface.h"
@@ -793,7 +787,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
/* safety border */
if (sseq->mainb == SEQ_DRAW_IMG_IMBUF &&
- (sseq->flag & SEQ_DRAW_SAFE_MARGINS) != 0) {
+ (sseq->flag & SEQ_DRAW_SAFE_MARGINS) != 0) {
float fac= 0.1;
float x1 = v2d->tot.xmin;
float y1 = v2d->tot.ymin;
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index dfc78eedf2a..de0b048e9d5 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -42,18 +42,10 @@
#include "BLI_math.h"
#include "BLI_storage_types.h"
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
#include "DNA_ipo_types.h"
-#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_view2d_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_sound_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -70,23 +62,14 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "RNA_access.h"
#include "RNA_define.h"
/* for menu/popup icons etc etc*/
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "ED_anim_api.h"
-#include "ED_space_api.h"
-#include "ED_types.h"
#include "ED_screen.h"
#include "ED_transform.h"
-#include "ED_util.h"
#include "ED_sequencer.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
/* own include */
@@ -573,17 +556,17 @@ void change_sequence(Scene *scene)
U.plugseqdir, change_plugin_seq);
}
else if(event==12);
- /* recalculate: only new_stripdata */
+ /* recalculate: only new_stripdata */
else {
/* free previous effect and init new effect */
struct SeqEffectHandle sh;
if (get_sequence_effect_num_inputs(
- last_seq->type)
- < get_sequence_effect_num_inputs(
- event_to_efftype(event))) {
+ last_seq->type)
+ < get_sequence_effect_num_inputs(
+ event_to_efftype(event))) {
error("New effect needs more "
- "input strips!");
+ "input strips!");
} else {
sh = get_sequence_effect(last_seq);
sh.free(last_seq);
@@ -602,9 +585,9 @@ void change_sequence(Scene *scene)
else if(last_seq->type == SEQ_IMAGE) {
if(okee("Change images")) {
activate_fileselect(FILE_SPECIAL,
- "Select Images",
- ed->act_imagedir,
- reload_image_strip);
+ "Select Images",
+ ed->act_imagedir,
+ reload_image_strip);
}
}
else if(last_seq->type == SEQ_MOVIE) {
@@ -646,13 +629,13 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
return 0;
}
if((seq != activeseq) && (seq != seq2)) {
- if(seq2==0) seq2= seq;
- else if(seq1==0) seq1= seq;
- else if(seq3==0) seq3= seq;
- else {
+ if(seq2==0) seq2= seq;
+ else if(seq1==0) seq1= seq;
+ else if(seq3==0) seq3= seq;
+ else {
*error_str= "Can't apply effect to more than 3 sequence strips";
return 0;
- }
+ }
}
}
}
@@ -716,7 +699,7 @@ void reassign_inputs_seq_effect(Scene *scene)
seq_is_predecessor(seq3, last_seq)
) {
//BKE_report(op->reports, RPT_ERROR, "Can't reassign inputs: no cycles allowed"); // XXX operatorify
- return;
+ return;
}
last_seq->seq1 = seq1;
@@ -1305,7 +1288,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
/* also check metas */
SEQP_BEGIN(ed, seq) {
if (seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK) &&
- seq_tx_test(seq)) {
+ seq_tx_test(seq)) {
if((seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0) {
seq->start= snap_frame-seq->startofs+seq->startstill;
} else {
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 557402ded92..f591afa1e34 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -127,17 +127,17 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot);
/* RNA enums, just to be more readable */
enum {
SEQ_SIDE_NONE=0,
- SEQ_SIDE_LEFT,
- SEQ_SIDE_RIGHT,
+ SEQ_SIDE_LEFT,
+ SEQ_SIDE_RIGHT,
SEQ_SIDE_BOTH,
};
enum {
- SEQ_CUT_SOFT,
- SEQ_CUT_HARD,
+ SEQ_CUT_SOFT,
+ SEQ_CUT_HARD,
};
enum {
- SEQ_SELECTED,
- SEQ_UNSELECTED,
+ SEQ_SELECTED,
+ SEQ_UNSELECTED,
};
/* defines used internally */
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index b09dd1a9a1e..1d1ee43f400 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -32,11 +32,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -45,13 +41,10 @@
#include "BKE_global.h"
#include "BKE_utildefines.h"
-#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_screen.h"
#include "ED_transform.h" /* transform keymap */
#include "sequencer_intern.h"
diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c
index 0257ea5d9ca..d9d027823bc 100644
--- a/source/blender/editors/space_sequencer/sequencer_scopes.c
+++ b/source/blender/editors/space_sequencer/sequencer_scopes.c
@@ -35,16 +35,16 @@
static void rgb_to_yuv(float rgb[3], float yuv[3])
{
- yuv[0]= 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
- yuv[1]= 0.492*(rgb[2] - yuv[0]);
- yuv[2]= 0.877*(rgb[0] - yuv[0]);
+ yuv[0]= 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
+ yuv[1]= 0.492*(rgb[2] - yuv[0]);
+ yuv[2]= 0.877*(rgb[0] - yuv[0]);
- /* Normalize */
- yuv[1]*= 255.0/(122*2.0);
- yuv[1]+= 0.5;
+ /* Normalize */
+ yuv[1]*= 255.0/(122*2.0);
+ yuv[1]+= 0.5;
- yuv[2]*= 255.0/(157*2.0);
- yuv[2]+= 0.5;
+ yuv[2]*= 255.0/(157*2.0);
+ yuv[2]+= 0.5;
}
static void scope_put_pixel(unsigned char* table, unsigned char * pos)
@@ -580,7 +580,7 @@ static void vectorscope_put_cross(unsigned char r, unsigned char g,
rgb_to_yuv(rgb, yuv);
p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
+ + (int) ((yuv[1] * (w - 3) + 1)));
if (r == 0 && g == 0 && b == 0) {
r = 255;
@@ -631,7 +631,7 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf)
rgb_to_yuv(rgb, yuv);
p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
+ + (int) ((yuv[1] * (w - 3) + 1)));
scope_put_pixel(wtable, (unsigned char*)p);
}
}
@@ -681,7 +681,7 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf)
rgb_to_yuv(rgb, yuv);
p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
+ + (int) ((yuv[1] * (w - 3) + 1)));
scope_put_pixel(wtable, (unsigned char*)p);
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 437871c7fe8..14e519b125d 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -40,13 +40,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -59,21 +53,13 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "RNA_access.h"
#include "RNA_define.h"
/* for menu/popup icons etc etc*/
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "ED_anim_api.h"
-#include "ED_space_api.h"
#include "ED_types.h"
#include "ED_screen.h"
-#include "ED_util.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "UI_view2d.h"
/* own include */
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index b6a099807dd..073743976e8 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -29,7 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
@@ -42,7 +41,6 @@
#include "BKE_sequencer.h"
#include "BKE_global.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_view3d.h" /* only for sequencer view3d drawing callback */
@@ -188,15 +186,15 @@ static SpaceLink *sequencer_new(const bContext *C)
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM;
ar->v2d.minzoom= 0.00001f;
- ar->v2d.maxzoom= 100000.0f;
- ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */
- ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */
- ar->v2d.tot.xmax= 960.0f;
- ar->v2d.tot.ymax= 540.0f;
- ar->v2d.min[0]= 0.0f;
- ar->v2d.min[1]= 0.0f;
- ar->v2d.max[0]= 12000.0f;
- ar->v2d.max[1]= 12000.0f;
+ ar->v2d.maxzoom= 100000.0f;
+ ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */
+ ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */
+ ar->v2d.tot.xmax= 960.0f;
+ ar->v2d.tot.ymax= 540.0f;
+ ar->v2d.min[0]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
+ ar->v2d.max[0]= 12000.0f;
+ ar->v2d.max[1]= 12000.0f;
ar->v2d.cur= ar->v2d.tot;
ar->v2d.align= V2D_ALIGN_FREE;
ar->v2d.keeptot= V2D_KEEPTOT_FREE;
diff --git a/source/blender/editors/space_sound/sound_header.c b/source/blender/editors/space_sound/sound_header.c
index 2e6bf599692..acc9645af9d 100644
--- a/source/blender/editors/space_sound/sound_header.c
+++ b/source/blender/editors/space_sound/sound_header.c
@@ -29,10 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -45,8 +41,6 @@
#include "ED_types.h"
#include "ED_util.h"
-#include "WM_api.h"
-#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c
index c64ea7c6693..8c84002a625 100644
--- a/source/blender/editors/space_sound/space_sound.c
+++ b/source/blender/editors/space_sound/space_sound.c
@@ -30,10 +30,7 @@
#include <stdio.h>
#include "DNA_sound_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -45,7 +42,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -53,11 +49,9 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "ED_markers.h"
#include "sound_intern.h" // own include
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 43849fda7f8..e4f488fb5c1 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -31,10 +31,6 @@
#include "DNA_text_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "MEM_guardedalloc.h"
@@ -46,7 +42,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -60,7 +55,6 @@
#include "RNA_access.h"
-#include "ED_markers.h"
#include "text_intern.h" // own include
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 8f9f475b9c8..4a73340d719 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -249,14 +249,14 @@ int text_check_format_len(TextLine *line, unsigned int len)
/* Formats the specified line. If do_next is set, the process will move on to
the succeeding line if it is affected (eg. multiline strings). Format strings
may contain any of the following characters:
- '_' Whitespace
- '#' Comment text
- '!' Punctuation and other symbols
- 'n' Numerals
- 'l' String letters
- 'v' Special variables (class, def)
- 'b' Built-in names (print, for, etc.)
- 'q' Other text (identifiers, etc.)
+ '_' Whitespace
+ '#' Comment text
+ '!' Punctuation and other symbols
+ 'n' Numerals
+ 'l' String letters
+ 'v' Special variables (class, def)
+ 'b' Built-in names (print, for, etc.)
+ 'q' Other text (identifiers, etc.)
It is terminated with a null-terminator '\0' followed by a continuation
flag indicating whether the line is part of a multi-line string. */
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c
index f9b11022cd1..3b1c882ff2f 100644
--- a/source/blender/editors/space_text/text_header.c
+++ b/source/blender/editors/space_text/text_header.c
@@ -42,10 +42,6 @@
#include "BLI_winstuff.h"
#endif
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_text_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -61,20 +57,13 @@
#include "BKE_text.h"
#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
-#include "WM_api.h"
#include "WM_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-#include "RNA_access.h"
#ifndef DISABLE_PYTHON
#include "BPY_extern.h"
@@ -136,7 +125,7 @@ void TEXT_OT_properties(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Properties";
- ot->description= "Toggle text properties panel";
+ ot->description= "Toggle text properties panel";
ot->idname= "TEXT_OT_properties";
/* api callbacks */
@@ -214,10 +203,10 @@ void TEXT_OT_properties(wmOperatorType *ot)
uiPopupMenu *pup;
pup= uiPupMenuBegin(C, "Text", 0);
- uiItemEnumO(layout, "Top of File", 0, "TEXT_OT_move", "type", FILE_TOP);
- uiItemEnumO(layout, "Bottom of File", 0, "TEXT_OT_move", "type", FILE_BOTTOM);
- uiItemEnumO(layout, "Page Up", 0, "TEXT_OT_move", "type", PREV_PAGE);
- uiItemEnumO(layout, "Page Down", 0, "TEXT_OT_move", "type", NEXT_PAGE);
+ uiItemEnumO(layout, "TEXT_OT_move", "Top of File", 0, "type", FILE_TOP);
+ uiItemEnumO(layout, "TEXT_OT_move", "Bottom of File", 0, "type", FILE_BOTTOM);
+ uiItemEnumO(layout, "TEXT_OT_move", "Page Up", 0, "type", PREV_PAGE);
+ uiItemEnumO(layout, "TEXT_OT_move", "Page Down", 0, "type", NEXT_PAGE);
uiPupMenuEnd(C, pup);
}
#endif
diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h
index 46820a54e36..a93f30ac62a 100644
--- a/source/blender/editors/space_text/text_intern.h
+++ b/source/blender/editors/space_text/text_intern.h
@@ -99,7 +99,7 @@ void text_pop_suggest_list();
/* text_ops.c */
enum { LINE_BEGIN, LINE_END, FILE_TOP, FILE_BOTTOM, PREV_CHAR, NEXT_CHAR,
- PREV_WORD, NEXT_WORD, PREV_LINE, NEXT_LINE, PREV_PAGE, NEXT_PAGE };
+ PREV_WORD, NEXT_WORD, PREV_LINE, NEXT_LINE, PREV_PAGE, NEXT_PAGE };
enum { DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_NEXT_WORD, DEL_PREV_WORD };
void TEXT_OT_new(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index daf0a070619..0f3b54a7b4b 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -35,13 +35,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_constraint_types.h"
-#include "DNA_object_types.h"
-#include "DNA_action_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_text_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "PIL_time.h"
@@ -1699,7 +1693,7 @@ static void screen_skip(SpaceText *st, int lines)
{
int last;
- st->top += lines;
+ st->top += lines;
last= txt_get_span(st->text->lines.first, st->text->lines.last);
last= last - (st->viewlines/2);
@@ -1849,9 +1843,9 @@ void TEXT_OT_scroll(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll";
- /*don't really see the difference between this and
- scroll_bar. Both do basically the same thing (aside
- from keymaps).*/
+ /*don't really see the difference between this and
+ scroll_bar. Both do basically the same thing (aside
+ from keymaps).*/
ot->idname= "TEXT_OT_scroll";
ot->description= "Scroll text screen";
@@ -1902,9 +1896,9 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scrollbar";
- /*don't really see the difference between this and
- scroll. Both do basically the same thing (aside
- from keymaps).*/
+ /*don't really see the difference between this and
+ scroll. Both do basically the same thing (aside
+ from keymaps).*/
ot->idname= "TEXT_OT_scroll_bar";
ot->description= "Scroll text screen";
@@ -2614,25 +2608,25 @@ static int resolve_conflict_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* modified locally and externally, ahhh. offer more possibilites. */
pup= uiPupMenuBegin(C, "File Modified Outside and Inside Blender", 0);
layout= uiPupMenuLayout(pup);
- uiItemEnumO(layout, "Reload from disk (ignore local changes)", 0, op->type->idname, "resolution", RESOLVE_RELOAD);
- uiItemEnumO(layout, "Save to disk (ignore outside changes)", 0, op->type->idname, "resolution", RESOLVE_SAVE);
- uiItemEnumO(layout, "Make text internal (separate copy)", 0, op->type->idname, "resolution", RESOLVE_MAKE_INTERNAL);
+ uiItemEnumO(layout, op->type->idname, "Reload from disk (ignore local changes)", 0, "resolution", RESOLVE_RELOAD);
+ uiItemEnumO(layout, op->type->idname, "Save to disk (ignore outside changes)", 0, "resolution", RESOLVE_SAVE);
+ uiItemEnumO(layout, op->type->idname, "Make text internal (separate copy)", 0, "resolution", RESOLVE_MAKE_INTERNAL);
uiPupMenuEnd(C, pup);
}
else {
pup= uiPupMenuBegin(C, "File Modified Outside Blender", 0);
layout= uiPupMenuLayout(pup);
- uiItemEnumO(layout, "Reload from disk", 0, op->type->idname, "resolution", RESOLVE_RELOAD);
- uiItemEnumO(layout, "Make text internal (separate copy)", 0, op->type->idname, "resolution", RESOLVE_MAKE_INTERNAL);
- uiItemEnumO(layout, "Ignore", 0, op->type->idname, "resolution", RESOLVE_IGNORE);
+ uiItemEnumO(layout, op->type->idname, "Reload from disk", 0, "resolution", RESOLVE_RELOAD);
+ uiItemEnumO(layout, op->type->idname, "Make text internal (separate copy)", 0, "resolution", RESOLVE_MAKE_INTERNAL);
+ uiItemEnumO(layout, op->type->idname, "Ignore", 0, "resolution", RESOLVE_IGNORE);
uiPupMenuEnd(C, pup);
}
break;
case 2:
pup= uiPupMenuBegin(C, "File Deleted Outside Blender", 0);
layout= uiPupMenuLayout(pup);
- uiItemEnumO(layout, "Make text internal", 0, op->type->idname, "resolution", RESOLVE_MAKE_INTERNAL);
- uiItemEnumO(layout, "Recreate file", 0, op->type->idname, "resolution", RESOLVE_SAVE);
+ uiItemEnumO(layout, op->type->idname, "Make text internal", 0, "resolution", RESOLVE_MAKE_INTERNAL);
+ uiItemEnumO(layout, op->type->idname, "Recreate file", 0, "resolution", RESOLVE_SAVE);
uiPupMenuEnd(C, pup);
break;
}
diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c
index c5d56408b1e..aee1a7ecfd6 100644
--- a/source/blender/editors/space_text/text_python.c
+++ b/source/blender/editors/space_text/text_python.c
@@ -39,7 +39,6 @@
#include "BLI_blenlib.h"
-#include "WM_api.h"
#include "WM_types.h"
#include "text_intern.h"
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 0dc4bff0ebf..31b76e6d5fa 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -30,10 +30,7 @@
#include <stdio.h>
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
@@ -47,9 +44,7 @@
#include "ED_anim_api.h"
#include "ED_keyframes_draw.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
-#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -57,7 +52,6 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c
index 9b391db0086..68036d0ea33 100644
--- a/source/blender/editors/space_time/time_ops.c
+++ b/source/blender/editors/space_time/time_ops.c
@@ -32,22 +32,15 @@
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BKE_context.h"
#include "BKE_utildefines.h"
-#include "UI_interface.h"
-#include "UI_view2d.h"
#include "ED_screen.h"
-#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
index d1a8c4e9ff9..4d6d303625b 100644
--- a/source/blender/editors/space_userpref/space_userpref.c
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -29,8 +29,6 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
@@ -39,7 +37,6 @@
#include "BKE_context.h"
#include "BKE_screen.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index 721ab12dbc1..8db1ddb7505 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -38,16 +38,10 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_ID.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -72,11 +66,8 @@
#include "BIF_glutil.h"
#include "ED_armature.h"
-#include "ED_anim_api.h"
#include "ED_keyframes_draw.h"
-#include "WM_api.h"
-#include "WM_types.h"
#include "BLF_api.h"
#include "UI_resources.h"
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 3ed8fdc3eab..1073d260189 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -38,17 +38,11 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_ID.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -74,8 +68,6 @@
#include "ED_armature.h"
#include "ED_keyframes_draw.h"
-#include "WM_api.h"
-#include "WM_types.h"
#include "BLF_api.h"
#include "UI_resources.h"
@@ -1205,7 +1197,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned
{
/* Draw a 3d octahedral bone, we use normalized space based on length,
- for glDisplayLists */
+ for glDisplayLists */
glScalef(length, length, length);
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 57ab9191bee..ced745bb5d4 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -35,20 +35,13 @@
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-#include "DNA_image_types.h"
-#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
#include "DNA_property_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_bmfont.h"
#include "BKE_displist.h"
@@ -68,7 +61,6 @@
#include "BIF_glutil.h"
#include "UI_resources.h"
-#include "UI_interface_icons.h"
#include "gpu_buffers.h"
#include "GPU_extensions.h"
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 5a495488afa..128d5050455 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -34,34 +34,20 @@
#include "MEM_guardedalloc.h"
-#include "IMB_imbuf.h"
-#include "DNA_armature_types.h"
-#include "DNA_boid_types.h"
#include "DNA_camera_types.h"
#include "DNA_curve_types.h"
#include "DNA_constraint_types.h" // for drawing constraint
-#include "DNA_effect_types.h"
#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_particle_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
#include "DNA_smoke_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
#include "BLI_blenlib.h"
@@ -101,7 +87,6 @@
#include "BIF_glutil.h"
#include "GPU_draw.h"
-#include "GPU_material.h"
#include "GPU_extensions.h"
#include "ED_mesh.h"
@@ -109,10 +94,8 @@
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_types.h"
-#include "ED_util.h"
#include "UI_resources.h"
-#include "UI_interface_icons.h"
#include "WM_api.h"
#include "wm_subwindow.h"
@@ -2237,7 +2220,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
else {
if (cageDM!=finalDM) {
UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.7);
- finalDM->drawEdges(finalDM, 1);
+ finalDM->drawEdges(finalDM, 1, 0);
}
}
@@ -2359,7 +2342,7 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm)
GPU_disable_material();
}
else {
- dm->drawEdges(dm, 0);
+ dm->drawEdges(dm, 0, 1);
}
glLineWidth(1.0);
@@ -2459,7 +2442,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
glEnable(GL_LINE_STIPPLE);
glLineStipple(1, 0x8888);
- dm->drawEdges(dm, 1);
+ dm->drawEdges(dm, 1, 0);
bglPolygonOffset(rv3d->dist, 0.0);
glDepthMask(1);
@@ -2486,9 +2469,11 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
int fast= (p->flags & PAINT_FAST_NAVIGATE) && (rv3d->rflag & RV3D_NAVIGATING);
if(ob->sculpt->partial_redraw) {
- sculpt_get_redraw_planes(planes, ar, rv3d, ob);
- fpl = planes;
- ob->sculpt->partial_redraw = 0;
+ if(ar->do_draw & RGN_DRAW_PARTIAL) {
+ sculpt_get_redraw_planes(planes, ar, rv3d, ob);
+ fpl = planes;
+ ob->sculpt->partial_redraw = 0;
+ }
}
dm->drawFacesSolid(dm, fpl, fast, GPU_enable_material);
@@ -2627,7 +2612,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
glDepthMask(0); // disable write in zbuffer, selected edge wires show better
}
- dm->drawEdges(dm, (dt==OB_WIRE || totface==0));
+ dm->drawEdges(dm, (dt==OB_WIRE || totface==0), 0);
if (dt!=OB_WIRE && draw_wire==2) {
glDepthMask(1);
@@ -2970,7 +2955,7 @@ static void drawDispListshaded(ListBase *lb, Object *ob)
static void drawCurveDMWired(Object *ob)
{
DerivedMesh *dm = ob->derivedFinal;
- dm->drawEdges (dm, 1);
+ dm->drawEdges (dm, 1, 0);
}
/* return 1 when nothing was drawn */
@@ -2978,13 +2963,12 @@ static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, B
{
Object *ob= base->object;
DerivedMesh *dm = ob->derivedFinal;
- Curve *cu= ob->data;
if (!dm) {
return 1;
}
- if(dt>OB_WIRE && displist_has_faces(&cu->disp)!=0) {
+ if(dt>OB_WIRE && dm->getNumFaces(dm)) {
int glsl = draw_glsl_material(scene, ob, v3d, dt);
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
@@ -5813,10 +5797,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
}
- if(ob->pd && ob->pd->forcefield) {
- draw_forcefield(scene, ob, rv3d);
- }
- }
+ if(ob->pd && ob->pd->forcefield) {
+ draw_forcefield(scene, ob, rv3d);
+ }
+ }
/* code for new particle system */
if( (warning_recursive==0) &&
@@ -5973,7 +5957,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
}
- if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
+ if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
bConstraint *con;
for(con=ob->constraints.first; con; con= con->next)
@@ -5986,24 +5970,24 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
}
- /* draw extra: after normal draw because of makeDispList */
- if(dtx && (G.f & G_RENDER_OGL)==0) {
+ /* draw extra: after normal draw because of makeDispList */
+ if(dtx && (G.f & G_RENDER_OGL)==0) {
- if(dtx & OB_AXIS) {
- drawaxes(1.0f, flag, OB_ARROWS);
- }
- if(dtx & OB_BOUNDBOX) draw_bounding_volume(scene, ob);
- if(dtx & OB_TEXSPACE) drawtexspace(ob);
- if(dtx & OB_DRAWNAME) {
- /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
- /* but, we also dont draw names for sets or duplicators */
- if(flag == 0) {
- view3d_cached_text_draw_add(0.0f, 0.0f, 0.0f, ob->id.name+2, 10, 0);
- }
- }
- /*if(dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/
- if((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, rv3d, ob);
- }
+ if(dtx & OB_AXIS) {
+ drawaxes(1.0f, flag, OB_ARROWS);
+ }
+ if(dtx & OB_BOUNDBOX) draw_bounding_volume(scene, ob);
+ if(dtx & OB_TEXSPACE) drawtexspace(ob);
+ if(dtx & OB_DRAWNAME) {
+ /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
+ /* but, we also dont draw names for sets or duplicators */
+ if(flag == 0) {
+ view3d_cached_text_draw_add(0.0f, 0.0f, 0.0f, ob->id.name+2, 10, 0);
+ }
+ }
+ /*if(dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/
+ if((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, rv3d, ob);
+ }
}
if(dt<OB_SHADED) {
@@ -6054,8 +6038,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
else if((flag & DRAW_CONSTCOLOR)==0) {
/* we don't draw centers for duplicators and sets */
if(U.obcenter_dia > 0) {
- /* check > 0 otherwise grease pencil can draw into the circle select which is annoying. */
- drawcentercircle(v3d, rv3d, ob->obmat[3], do_draw_center, ob->id.lib || ob->id.us>1);
+ /* check > 0 otherwise grease pencil can draw into the circle select which is annoying. */
+ drawcentercircle(v3d, rv3d, ob->obmat[3], do_draw_center, ob->id.lib || ob->id.us>1);
}
}
}
@@ -6315,9 +6299,9 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r
if(dt<=OB_WIRE) {
if(dm)
- dm->drawEdges(dm, 1);
+ dm->drawEdges(dm, 1, 0);
else if(edm)
- edm->drawEdges(edm, 1);
+ edm->drawEdges(edm, 1, 0);
}
else {
if(outline)
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 004d4a022f6..b091c4281c9 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -35,35 +35,13 @@
#include "MEM_guardedalloc.h"
-#include "IMB_imbuf.h"
-
-
-
-
-#include "DNA_armature_types.h"
-#include "DNA_boid_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_constraint_types.h" // for drawing constraint
-#include "DNA_effect_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_particle_types.h"
-#include "DNA_space_types.h"
+
+
+
+
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_smoke_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -99,23 +77,13 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "GPU_draw.h"
-#include "GPU_material.h"
#include "GPU_extensions.h"
#include "ED_mesh.h"
-#include "ED_particle.h"
-#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
-#include "UI_resources.h"
-#include "UI_interface_icons.h"
-#include "WM_api.h"
#include "BLF_api.h"
-#include "GPU_extensions.h"
#include "view3d_intern.h" // own include
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index bcfc0071237..869d0c45f2f 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -29,13 +29,8 @@
#include <string.h>
#include <stdio.h>
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
#include "MEM_guardedalloc.h"
@@ -50,21 +45,15 @@
#include "BKE_utildefines.h"
#include "BKE_image.h"
-#include "ED_armature.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_object.h"
#include "BIF_gl.h"
-#include "GPU_draw.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "RNA_access.h"
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 82ed635cc0d..b463d07677b 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -31,24 +31,13 @@
#include <math.h>
#include <float.h>
-#include "DNA_ID.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -78,24 +67,15 @@
#include "WM_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "ED_armature.h"
-#include "ED_curve.h"
-#include "ED_image.h"
#include "ED_gpencil.h"
-#include "ED_keyframing.h"
#include "ED_mesh.h"
-#include "ED_object.h"
-#include "ED_particle.h"
#include "ED_screen.h"
#include "ED_transform.h"
-#include "ED_types.h"
-#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "view3d_intern.h" // own include
@@ -763,57 +743,57 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
uiLayoutSetActive(split, !(bone->parent && bone->flag & BONE_CONNECTED));
}
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, "Location", 0, ptr, "location", 0);
+ uiItemR(colsub, ptr, "location", 0, "Location", 0);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", 0);
- uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
+ uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_LOCKED);
split = uiLayoutSplit(layout, 0.8, 0);
switch(RNA_enum_get(ptr, "rotation_mode")) {
case ROT_MODE_QUAT: /* quaternion */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, "Rotation", 0, ptr, "rotation_quaternion", 0);
+ uiItemR(colsub, ptr, "rotation_quaternion", 0, "Rotation", 0);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, "4L", 0, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE);
+ uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", 0);
if (RNA_boolean_get(ptr, "lock_rotations_4d"))
- uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
+ uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_LOCKED);
else
uiItemL(colsub, "", 0);
- uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_LOCKED);
break;
case ROT_MODE_AXISANGLE: /* axis angle */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, "Rotation", 0, ptr, "rotation_axis_angle", 0);
+ uiItemR(colsub, ptr, "rotation_axis_angle", 0, "Rotation", 0);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, "4L", 0, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE);
+ uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", 0);
if (RNA_boolean_get(ptr, "lock_rotations_4d"))
- uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
+ uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_LOCKED);
else
uiItemL(colsub, "", 0);
- uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_LOCKED);
break;
default: /* euler rotations */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, "Rotation", 0, ptr, "rotation_euler", 0);
+ uiItemR(colsub, ptr, "rotation_euler", 0, "Rotation", 0);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", 0);
- uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_LOCKED);
break;
}
- uiItemR(layout, "", 0, ptr, "rotation_mode", 0);
+ uiItemR(layout, ptr, "rotation_mode", 0, "", 0);
split = uiLayoutSplit(layout, 0.8, 0);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, "Scale", 0, ptr, "scale", 0);
+ uiItemR(colsub, ptr, "scale", 0, "Scale", 0);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", 0);
- uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_scale", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY);
+ uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_LOCKED);
if (ptr->type == &RNA_Object) {
Object *ob = ptr->data;
if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL))
- uiItemR(layout, "Dimensions", 0, ptr, "dimensions", 0);
+ uiItemR(layout, ptr, "dimensions", 0, "Dimensions", 0);
}
}
@@ -939,18 +919,18 @@ static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, flo
col= uiLayoutColumn(layout, 0);
- uiItemR(col, "Head", 0, &eboneptr, "head", 0);
+ uiItemR(col, &eboneptr, "head", 0, "Head", 0);
if (ebone->parent && ebone->flag & BONE_CONNECTED ) {
PointerRNA parptr = RNA_pointer_get(&eboneptr, "parent");
- uiItemR(col, "Radius", 0, &parptr, "tail_radius", 0);
+ uiItemR(col, &parptr, "tail_radius", 0, "Radius", 0);
} else {
- uiItemR(col, "Radius", 0, &eboneptr, "head_radius", 0);
+ uiItemR(col, &eboneptr, "head_radius", 0, "Radius", 0);
}
- uiItemR(col, "Tail", 0, &eboneptr, "tail", 0);
- uiItemR(col, "Radius", 0, &eboneptr, "tail_radius", 0);
+ uiItemR(col, &eboneptr, "tail", 0, "Tail", 0);
+ uiItemR(col, &eboneptr, "tail_radius", 0, "Radius", 0);
- uiItemR(col, "Roll", 0, &eboneptr, "roll", 0);
+ uiItemR(col, &eboneptr, "roll", 0, "Roll", 0);
}
static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim)
@@ -969,12 +949,12 @@ static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim)
RNA_pointer_create(&mball->id, &RNA_MetaElement, mball->lastelem, &ptr);
col= uiLayoutColumn(layout, 0);
- uiItemR(col, "Location", 0, &ptr, "location", 0);
+ uiItemR(col, &ptr, "location", 0, "Location", 0);
- uiItemR(col, "Radius", 0, &ptr, "radius", 0);
- uiItemR(col, "Stiffness", 0, &ptr, "stiffness", 0);
+ uiItemR(col, &ptr, "radius", 0, "Radius", 0);
+ uiItemR(col, &ptr, "stiffness", 0, "Stiffness", 0);
- uiItemR(col, "Type", 0, &ptr, "type", 0);
+ uiItemR(col, &ptr, "type", 0, "Type", 0);
col= uiLayoutColumn(layout, 1);
switch (RNA_enum_get(&ptr, "type")) {
@@ -982,24 +962,24 @@ static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim)
break;
case MB_CUBE:
uiItemL(col, "Size:", 0);
- uiItemR(col, "X", 0, &ptr, "size_x", 0);
- uiItemR(col, "Y", 0, &ptr, "size_y", 0);
- uiItemR(col, "Z", 0, &ptr, "size_z", 0);
+ uiItemR(col, &ptr, "size_x", 0, "X", 0);
+ uiItemR(col, &ptr, "size_y", 0, "Y", 0);
+ uiItemR(col, &ptr, "size_z", 0, "Z", 0);
break;
case MB_TUBE:
uiItemL(col, "Size:", 0);
- uiItemR(col, "X", 0, &ptr, "size_x", 0);
+ uiItemR(col, &ptr, "size_x", 0, "X", 0);
break;
case MB_PLANE:
uiItemL(col, "Size:", 0);
- uiItemR(col, "X", 0, &ptr, "size_x", 0);
- uiItemR(col, "Y", 0, &ptr, "size_y", 0);
+ uiItemR(col, &ptr, "size_x", 0, "X", 0);
+ uiItemR(col, &ptr, "size_y", 0, "Y", 0);
break;
case MB_ELIPSOID:
uiItemL(col, "Size:", 0);
- uiItemR(col, "X", 0, &ptr, "size_x", 0);
- uiItemR(col, "Y", 0, &ptr, "size_y", 0);
- uiItemR(col, "Z", 0, &ptr, "size_z", 0);
+ uiItemR(col, &ptr, "size_x", 0, "X", 0);
+ uiItemR(col, &ptr, "size_y", 0, "Y", 0);
+ uiItemR(col, &ptr, "size_z", 0, "Z", 0);
break;
}
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ce3bf293051..c75e068648f 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -30,19 +30,13 @@
#include <stdio.h>
#include <math.h>
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
#include "DNA_customdata_types.h"
#include "DNA_group_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -74,24 +68,19 @@
#include "BIF_glutil.h"
#include "WM_api.h"
-#include "WM_types.h"
#include "BLF_api.h"
#include "ED_armature.h"
#include "ED_keyframing.h"
#include "ED_gpencil.h"
-#include "ED_mesh.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_screen_types.h"
-#include "ED_util.h"
#include "ED_transform.h"
-#include "ED_types.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "GPU_draw.h"
#include "GPU_material.h"
@@ -476,11 +465,11 @@ static void drawfloor(Scene *scene, View3D *v3d)
if (draw_line) {
glBegin(GL_LINE_STRIP);
- vert[0]= a*v3d->grid;
- vert[1]= grid;
- glVertex3fv(vert);
- vert[1]= -grid;
- glVertex3fv(vert);
+ vert[0]= a*v3d->grid;
+ vert[1]= grid;
+ glVertex3fv(vert);
+ vert[1]= -grid;
+ glVertex3fv(vert);
glEnd();
}
}
@@ -515,11 +504,11 @@ static void drawfloor(Scene *scene, View3D *v3d)
if (draw_line) {
glBegin(GL_LINE_STRIP);
- vert[1]= a*v3d->grid;
- vert[0]= grid;
- glVertex3fv(vert );
- vert[0]= -grid;
- glVertex3fv(vert);
+ vert[1]= a*v3d->grid;
+ vert[0]= grid;
+ glVertex3fv(vert );
+ vert[0]= -grid;
+ glVertex3fv(vert);
glEnd();
}
}
@@ -1077,7 +1066,7 @@ void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
rcti winrct;
if(base && (base->object->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT) ||
- paint_facesel_test(base->object)));
+ paint_facesel_test(base->object)));
else if((base && (base->object->mode & OB_MODE_TEXTURE_PAINT)) &&
scene->toolsettings && (scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE));
else if((base && (base->object->mode & OB_MODE_PARTICLE_EDIT)) && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT));
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 6b9a65d60a2..bdf157a96d9 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -31,17 +31,9 @@
#include <math.h>
#include <float.h>
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_lamp_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -60,7 +52,6 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "RE_pipeline.h" // make_stars
#include "BIF_gl.h"
@@ -72,15 +63,10 @@
#include "ED_particle.h"
#include "ED_retopo.h"
-#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_transform.h"
-#include "ED_types.h"
#include "ED_mesh.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
#include "PIL_time.h" /* smoothview */
@@ -1277,9 +1263,9 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
rv3d->persp= RV3D_PERSP;
smooth_view(C, NULL, v3d->camera, new_ofs, NULL, &new_dist, NULL);
}
- else {
- smooth_view(C, NULL, NULL, new_ofs, NULL, &new_dist, NULL);
- }
+ else {
+ smooth_view(C, NULL, NULL, new_ofs, NULL, &new_dist, NULL);
+ }
}
// XXX BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
@@ -2647,21 +2633,21 @@ float m_dist;
void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode)
{
RegionView3D *rv3d= ar->regiondata;
- int i;
- float phi;
- float dval[7];
+ int i;
+ float phi;
+ float dval[7];
// static fval[6] for low pass filter; device input vector is dval[6]
static float fval[6];
- float tvec[3],rvec[3];
- float q1[4];
+ float tvec[3],rvec[3];
+ float q1[4];
float mat[3][3];
float upvec[3];
- /*----------------------------------------------------
+ /*----------------------------------------------------
* sometimes this routine is called from headerbuttons
- * viewmove needs to refresh the screen
- */
+ * viewmove needs to refresh the screen
+ */
// XXX areawinset(ar->win);
@@ -2765,8 +2751,8 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode)
/*----------------------------------------------------
- * refresh the screen XXX
- */
+ * refresh the screen XXX
+ */
// update render preview window
@@ -2796,10 +2782,10 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
float mat[3][3];
float upvec[3];
- /* Sensitivity will control how fast the view rotates. The value was
- * obtained experimentally by tweaking until the author didn't get dizzy watching.
- * Perhaps this should be a configurable user parameter.
- */
+ /* Sensitivity will control how fast the view rotates. The value was
+ * obtained experimentally by tweaking until the author didn't get dizzy watching.
+ * Perhaps this should be a configurable user parameter.
+ */
float psens = 0.005f * (float) U.ndof_pan; /* pan sensitivity */
float rsens = 0.005f * (float) U.ndof_rotate; /* rotate sensitivity */
float zsens = 0.3f; /* zoom sensitivity */
@@ -2825,16 +2811,16 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
add_v3_v3v3(rv3d->ofs, rv3d->ofs, upvec);
}
- /*----------------------------------------------------
+ /*----------------------------------------------------
* sometimes this routine is called from headerbuttons
- * viewmove needs to refresh the screen
- */
+ * viewmove needs to refresh the screen
+ */
// XXX areawinset(curarea->win);
- /*----------------------------------------------------
- * record how much time has passed. clamp at 10 Hz
- * pretend the previous frame occured at the clamped time
- */
+ /*----------------------------------------------------
+ * record how much time has passed. clamp at 10 Hz
+ * pretend the previous frame occured at the clamped time
+ */
// now = PIL_check_seconds_timer();
// frametime = (now - prevTime);
// if (frametime > 0.1f){ /* if more than 1/10s */
@@ -2843,13 +2829,13 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
// prevTime = now;
// sbadjust *= 60 * frametime; /* normalize ndof device adjustments to 100Hz for framerate independence */
- /* fetch the current state of the ndof device & enforce dominant mode if selected */
+ /* fetch the current state of the ndof device & enforce dominant mode if selected */
// XXX getndof(fval);
if (v3d->ndoffilter)
filterNDOFvalues(fval);
- // put scaling back here, was previously in ghostwinlay
+ // put scaling back here, was previously in ghostwinlay
fval[0] = fval[0] * (1.0f/600.0f);
fval[1] = fval[1] * (1.0f/600.0f);
fval[2] = fval[2] * (1.0f/1100.0f);
@@ -2858,7 +2844,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
fval[5] = fval[5] * 0.00005f;
fval[6] = fval[6] / 1000000.0f;
- // scale more if not in perspective mode
+ // scale more if not in perspective mode
if (rv3d->persp == RV3D_ORTHO) {
fval[0] = fval[0] * 0.05f;
fval[1] = fval[1] * 0.05f;
@@ -2869,7 +2855,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
zsens *= 8;
}
- /* set object offset */
+ /* set object offset */
if (ob) {
obofs[0] = -ob->obmat[3][0];
obofs[1] = -ob->obmat[3][1];
@@ -2879,102 +2865,102 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
VECCOPY(obofs, rv3d->ofs);
}
- /* calc an adjustment based on distance from camera
- disabled per patch 14402 */
- d = 1.0f;
+ /* calc an adjustment based on distance from camera
+ disabled per patch 14402 */
+ d = 1.0f;
/* if (ob) {
- sub_v3_v3v3(diff, obofs, rv3d->ofs);
- d = len_v3(diff);
- }
+ sub_v3_v3v3(diff, obofs, rv3d->ofs);
+ d = len_v3(diff);
+ }
*/
- reverse = (rv3d->persmat[2][1] < 0.0f) ? -1.0f : 1.0f;
-
- /*----------------------------------------------------
- * ndof device pan
- */
- psens *= 1.0f + d;
- curareaX = sbadjust * psens * fval[0];
- curareaY = sbadjust * psens * fval[1];
- dvec[0] = curareaX * rv3d->persinv[0][0] + curareaY * rv3d->persinv[1][0];
- dvec[1] = curareaX * rv3d->persinv[0][1] + curareaY * rv3d->persinv[1][1];
- dvec[2] = curareaX * rv3d->persinv[0][2] + curareaY * rv3d->persinv[1][2];
- add_v3_v3v3(rv3d->ofs, rv3d->ofs, dvec);
-
- /*----------------------------------------------------
- * ndof device dolly
- */
- len = zsens * sbadjust * fval[2];
-
- if (rv3d->persp==RV3D_CAMOB) {
- if(rv3d->persp==RV3D_CAMOB) { /* This is stupid, please fix - TODO */
- rv3d->camzoom+= 10.0f * -len;
- }
- if (rv3d->camzoom < minZoom) rv3d->camzoom = minZoom;
- else if (rv3d->camzoom > maxZoom) rv3d->camzoom = maxZoom;
- }
- else if ((rv3d->dist> 0.001*v3d->grid) && (rv3d->dist<10.0*v3d->far)) {
- rv3d->dist*=(1.0 + len);
- }
-
-
- /*----------------------------------------------------
- * ndof device turntable
- * derived from the turntable code in viewmove
- */
-
- /* Get the 3x3 matrix and its inverse from the quaternion */
- quat_to_mat3( m,rv3d->viewquat);
- invert_m3_m3(m_inv,m);
-
- /* Determine the direction of the x vector (for rotating up and down) */
- /* This can likely be compuated directly from the quaternion. */
- mul_m3_v3(m_inv,xvec);
- mul_m3_v3(m_inv,yvec);
- mul_m3_v3(m_inv,zvec);
-
- /* Perform the up/down rotation */
- phi = sbadjust * rsens * /*0.5f * */ fval[3]; /* spin vertically half as fast as horizontally */
- q1[0] = cos(phi);
- mul_v3_v3fl(q1+1, xvec, sin(phi));
- mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, q1);
-
- if (use_sel) {
- conjugate_qt(q1); /* conj == inv for unit quat */
- sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
- mul_qt_v3(q1, rv3d->ofs);
- add_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
- }
-
- /* Perform the orbital rotation */
- /* Perform the orbital rotation
- If the seen Up axis is parallel to the zoom axis, rotation should be
- achieved with a pure Roll motion (no Spin) on the device. When you start
- to tilt, moving from Top to Side view, Spinning will increasingly become
- more relevant while the Roll component will decrease. When a full
- Side view is reached, rotations around the world's Up axis are achieved
- with a pure Spin-only motion. In other words the control of the spinning
- around the world's Up axis should move from the device's Spin axis to the
- device's Roll axis depending on the orientation of the world's Up axis
- relative to the screen. */
- //phi = sbadjust * rsens * reverse * fval[4]; /* spin the knob, y axis */
- phi = sbadjust * rsens * (yvec[2] * fval[4] + zvec[2] * fval[5]);
- q1[0] = cos(phi);
- q1[1] = q1[2] = 0.0;
- q1[3] = sin(phi);
- mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, q1);
-
- if (use_sel) {
- conjugate_qt(q1);
- sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
- mul_qt_v3(q1, rv3d->ofs);
- add_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
- }
-
- /*----------------------------------------------------
- * refresh the screen
- */
+ reverse = (rv3d->persmat[2][1] < 0.0f) ? -1.0f : 1.0f;
+
+ /*----------------------------------------------------
+ * ndof device pan
+ */
+ psens *= 1.0f + d;
+ curareaX = sbadjust * psens * fval[0];
+ curareaY = sbadjust * psens * fval[1];
+ dvec[0] = curareaX * rv3d->persinv[0][0] + curareaY * rv3d->persinv[1][0];
+ dvec[1] = curareaX * rv3d->persinv[0][1] + curareaY * rv3d->persinv[1][1];
+ dvec[2] = curareaX * rv3d->persinv[0][2] + curareaY * rv3d->persinv[1][2];
+ add_v3_v3v3(rv3d->ofs, rv3d->ofs, dvec);
+
+ /*----------------------------------------------------
+ * ndof device dolly
+ */
+ len = zsens * sbadjust * fval[2];
+
+ if (rv3d->persp==RV3D_CAMOB) {
+ if(rv3d->persp==RV3D_CAMOB) { /* This is stupid, please fix - TODO */
+ rv3d->camzoom+= 10.0f * -len;
+ }
+ if (rv3d->camzoom < minZoom) rv3d->camzoom = minZoom;
+ else if (rv3d->camzoom > maxZoom) rv3d->camzoom = maxZoom;
+ }
+ else if ((rv3d->dist> 0.001*v3d->grid) && (rv3d->dist<10.0*v3d->far)) {
+ rv3d->dist*=(1.0 + len);
+ }
+
+
+ /*----------------------------------------------------
+ * ndof device turntable
+ * derived from the turntable code in viewmove
+ */
+
+ /* Get the 3x3 matrix and its inverse from the quaternion */
+ quat_to_mat3( m,rv3d->viewquat);
+ invert_m3_m3(m_inv,m);
+
+ /* Determine the direction of the x vector (for rotating up and down) */
+ /* This can likely be compuated directly from the quaternion. */
+ mul_m3_v3(m_inv,xvec);
+ mul_m3_v3(m_inv,yvec);
+ mul_m3_v3(m_inv,zvec);
+
+ /* Perform the up/down rotation */
+ phi = sbadjust * rsens * /*0.5f * */ fval[3]; /* spin vertically half as fast as horizontally */
+ q1[0] = cos(phi);
+ mul_v3_v3fl(q1+1, xvec, sin(phi));
+ mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, q1);
+
+ if (use_sel) {
+ conjugate_qt(q1); /* conj == inv for unit quat */
+ sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+ mul_qt_v3(q1, rv3d->ofs);
+ add_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+ }
+
+ /* Perform the orbital rotation */
+ /* Perform the orbital rotation
+ If the seen Up axis is parallel to the zoom axis, rotation should be
+ achieved with a pure Roll motion (no Spin) on the device. When you start
+ to tilt, moving from Top to Side view, Spinning will increasingly become
+ more relevant while the Roll component will decrease. When a full
+ Side view is reached, rotations around the world's Up axis are achieved
+ with a pure Spin-only motion. In other words the control of the spinning
+ around the world's Up axis should move from the device's Spin axis to the
+ device's Roll axis depending on the orientation of the world's Up axis
+ relative to the screen. */
+ //phi = sbadjust * rsens * reverse * fval[4]; /* spin the knob, y axis */
+ phi = sbadjust * rsens * (yvec[2] * fval[4] + zvec[2] * fval[5]);
+ q1[0] = cos(phi);
+ q1[1] = q1[2] = 0.0;
+ q1[3] = sin(phi);
+ mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, q1);
+
+ if (use_sel) {
+ conjugate_qt(q1);
+ sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+ mul_qt_v3(q1, rv3d->ofs);
+ add_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs);
+ }
+
+ /*----------------------------------------------------
+ * refresh the screen
+ */
// XXX scrarea_do_windraw(curarea);
}
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index af03662c524..558e817157f 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -30,19 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "DNA_armature_types.h"
-#include "DNA_ID.h"
-#include "DNA_image_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h" /* U.smooth_viewtx */
-#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
@@ -66,9 +54,6 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h" /* for VECCOPY */
-#include "ED_armature.h"
-#include "ED_particle.h"
-#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_util.h"
#include "ED_screen.h"
@@ -78,7 +63,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -90,9 +74,7 @@
#include "BLI_editVert.h"
#include "UI_interface.h"
-#include "UI_interface_icons.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "view3d_intern.h"
@@ -397,25 +379,25 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
if( shift==0 || v3d->twtype==0) {
v3d->twtype= V3D_MANIP_TRANSLATE;
}
- ED_area_tag_redraw(sa);
- break;
+ ED_area_tag_redraw(sa);
+ break;
case B_MAN_ROT:
if( shift==0 || v3d->twtype==0) {
- v3d->twtype= V3D_MANIP_ROTATE;
+ v3d->twtype= V3D_MANIP_ROTATE;
}
- ED_area_tag_redraw(sa);
+ ED_area_tag_redraw(sa);
break;
case B_MAN_SCALE:
if( shift==0 || v3d->twtype==0) {
- v3d->twtype= V3D_MANIP_SCALE;
+ v3d->twtype= V3D_MANIP_SCALE;
}
- ED_area_tag_redraw(sa);
+ ED_area_tag_redraw(sa);
break;
case B_NDOF:
- ED_area_tag_redraw(sa);
+ ED_area_tag_redraw(sa);
break;
case B_MAN_MODE:
- ED_area_tag_redraw(sa);
+ ED_area_tag_redraw(sa);
break;
default:
break;
@@ -484,7 +466,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiBlockEndAlign(block);
/* Draw type */
- uiItemR(layout, "", 0, &v3dptr, "viewport_shading", UI_ITEM_R_ICON_ONLY);
+ uiItemR(layout, &v3dptr, "viewport_shading", UI_ITEM_R_ICON_ONLY, "", 0);
if (obedit==NULL && ((ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)))) {
/* Manipulators aren't used in weight paint mode */
@@ -492,13 +474,13 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
PointerRNA meshptr;
RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
- uiItemR(layout, "", 0, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY);
+ uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", 0);
} else {
char *str_menu;
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY);
- uiItemR(row, "", 0, &v3dptr, "pivot_point_align", UI_ITEM_R_ICON_ONLY);
+ uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", 0);
+ uiItemR(row, &v3dptr, "pivot_point_align", UI_ITEM_R_ICON_ONLY, "", 0);
/* NDOF */
/* Not implemented yet
@@ -506,14 +488,14 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiDefIconTextButC(block, ICONTEXTROW,B_NDOF, ICON_NDOF_TURN, ndof_pup(), 0,0,XIC+10,YIC, &(v3d->ndofmode), 0, 3.0, 0, 0, "Ndof mode");
uiDefIconButC(block, TOG, B_NDOF, ICON_NDOF_DOM,
- 0,0,XIC,YIC,
- &v3d->ndoffilter, 0, 1, 0, 0, "dominant axis");
+ 0,0,XIC,YIC,
+ &v3d->ndoffilter, 0, 1, 0, 0, "dominant axis");
}
*/
/* Transform widget / manipulators */
row= uiLayoutRow(layout, 1);
- uiItemR(row, "", 0, &v3dptr, "manipulator", UI_ITEM_R_ICON_ONLY);
+ uiItemR(row, &v3dptr, "manipulator", UI_ITEM_R_ICON_ONLY, "", 0);
block= uiLayoutGetBlock(row);
if(v3d->twflag & V3D_USE_MANIPULATOR) {
@@ -541,7 +523,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiTemplateLayers(layout, &v3dptr, "visible_layers", &v3dptr, "used_layers", ob_lay);
/* Scene lock */
- uiItemR(layout, "", 0, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY);
+ uiItemR(layout, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY, "", 0);
}
/* selection modus, dont use python for this since it cant do the toggle buttons with shift+click as well as clicking to set one. */
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index 6d75d1d0b81..ccc2717556d 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -35,9 +35,7 @@
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -47,12 +45,10 @@
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_screen.h"
#include "ED_transform.h"
#include "view3d_intern.h"
@@ -186,25 +182,25 @@ void view3d_keymap(wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELUPMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPUP);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELDOWNMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPDOWN);
- /* active aligned, replaces '*' key in 2.4x */
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT, 0);
- RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT);
- RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT, 0);
- RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_RIGHT);
- RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT, 0);
- RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_TOP);
- RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
- RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BACK);
- RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
- RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_LEFT);
- RNA_boolean_set(kmi->ptr, "align_active", TRUE);
- kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
- RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BOTTOM);
- RNA_boolean_set(kmi->ptr, "align_active", TRUE);
+ /* active aligned, replaces '*' key in 2.4x */
+ kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT);
+ RNA_boolean_set(kmi->ptr, "align_active", TRUE);
+ kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_RIGHT);
+ RNA_boolean_set(kmi->ptr, "align_active", TRUE);
+ kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_TOP);
+ RNA_boolean_set(kmi->ptr, "align_active", TRUE);
+ kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BACK);
+ RNA_boolean_set(kmi->ptr, "align_active", TRUE);
+ kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_LEFT);
+ RNA_boolean_set(kmi->ptr, "align_active", TRUE);
+ kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BOTTOM);
+ RNA_boolean_set(kmi->ptr, "align_active", TRUE);
WM_keymap_add_item(keymap, "VIEW3D_OT_localview", PADSLASHKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 2eecede4907..d0c69c9a4cb 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -31,21 +31,12 @@
#include <math.h>
#include <float.h>
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_lamp_types.h"
#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -65,7 +56,6 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "RE_pipeline.h" // make_stars
#include "BIF_gl.h"
@@ -82,15 +72,10 @@
#include "ED_object.h"
#include "ED_retopo.h"
#include "ED_screen.h"
-#include "ED_types.h"
-#include "ED_util.h"
#include "ED_mball.h"
#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-#include "PIL_time.h" /* smoothview */
#include "view3d_intern.h" // own include
@@ -941,7 +926,7 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe
WM_operator_properties_create(&ptr, "OBJECT_OT_select_name");
RNA_string_set(&ptr, "name", name);
RNA_boolean_set(&ptr, "extend", extend);
- uiItemFullO(column, name, uiIconFromID((ID *)ob), "OBJECT_OT_select_name", ptr.data, WM_OP_EXEC_DEFAULT, 0);
+ uiItemFullO(column, "OBJECT_OT_select_name", name, uiIconFromID((ID *)ob), ptr.data, WM_OP_EXEC_DEFAULT, 0);
}
node= node->next;
@@ -2051,10 +2036,10 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
int x= RNA_int_get(op->ptr, "x");
int y= RNA_int_get(op->ptr, "y");
int radius= RNA_int_get(op->ptr, "radius");
- int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
- int selecting;
+ int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
+ int selecting;
- selecting= (gesture_mode==GESTURE_MODAL_SELECT);
+ selecting= (gesture_mode==GESTURE_MODAL_SELECT);
if(CTX_data_edit_object(C) || (obact && obact->mode & OB_MODE_PARTICLE_EDIT)) {
ViewContext vc;
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index ada0462a8ff..48658b57297 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -32,20 +32,11 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
-#include "DNA_group_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
@@ -70,16 +61,11 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "RNA_access.h"
-#include "RNA_define.h"
-#include "UI_interface.h"
-#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_mesh.h"
#include "ED_screen.h"
-#include "ED_view3d.h"
#include "view3d_intern.h"
@@ -255,7 +241,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
bArmature *arm= obedit->data;
int totmalloc= BLI_countlist(arm->edbo);
- totmalloc *= 2; /* probably overkill but bones can have 2 trans verts each */
+ totmalloc *= 2; /* probably overkill but bones can have 2 trans verts each */
tv=transvmain= MEM_callocN(totmalloc*sizeof(TransVert), "maketransverts armature");
@@ -1088,18 +1074,18 @@ void VIEW3D_OT_snap_selected_to_center(wmOperatorType *ot)
/*New Code - Snap Cursor to Center -*/
static int snap_curs_to_center(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
- float *curs;
- curs= give_cursor(scene, v3d);
-
- curs[0]= 0.0;
- curs[1]= 0.0;
- curs[2]= 0.0;
+ Scene *scene= CTX_data_scene(C);
+ View3D *v3d= CTX_wm_view3d(C);
+ float *curs;
+ curs= give_cursor(scene, v3d);
+
+ curs[0]= 0.0;
+ curs[1]= 0.0;
+ curs[2]= 0.0;
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
+ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot)
@@ -1110,12 +1096,12 @@ void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot)
ot->description= "Snap cursor to the Center";
ot->idname= "VIEW3D_OT_snap_cursor_to_center";
- /* api callbacks */
- ot->exec= snap_curs_to_center;
- ot->poll= ED_operator_view3d_active;
+ /* api callbacks */
+ ot->exec= snap_curs_to_center;
+ ot->poll= ED_operator_view3d_active;
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
/* **************************************************** */
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 11e5975cabb..ac6d61fce18 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -31,23 +31,8 @@
#include <math.h>
#include <float.h>
-#include "DNA_ID.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -76,23 +61,12 @@
#include "WM_types.h"
#include "RNA_access.h"
-#include "RNA_define.h"
-
-#include "ED_armature.h"
-#include "ED_curve.h"
-#include "ED_image.h"
-#include "ED_keyframing.h"
-#include "ED_mesh.h"
-#include "ED_object.h"
-#include "ED_particle.h"
+
#include "ED_screen.h"
-#include "ED_transform.h"
-#include "ED_types.h"
#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
-#include "UI_view2d.h"
#include "view3d_intern.h" // own include
@@ -282,7 +256,7 @@ static void view3d_panel_tool_shelf(const bContext *C, Panel *pa)
for(ct= st->toolshelf.first; ct; ct= ct->next) {
if(0==strncmp(context, ct->context, OP_MAX_TYPENAME)) {
col= uiLayoutColumn(pa->layout, 1);
- uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN, 0);
+ uiItemFullO(col, ct->opname, NULL, 0, NULL, WM_OP_INVOKE_REGION_WIN, 0);
}
}
}
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index fd7e2c22137..798a6949433 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -32,17 +32,9 @@
#include <float.h>
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
#include "DNA_lamp_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -63,7 +55,6 @@
#include "BKE_utildefines.h"
#include "BKE_depsgraph.h" /* for fly mode updating */
-#include "RE_pipeline.h" // make_stars
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -72,16 +63,10 @@
#include "WM_types.h"
#include "ED_keyframing.h"
-#include "ED_mesh.h"
#include "ED_screen.h"
-#include "ED_view3d.h"
#include "ED_armature.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-#include "GPU_draw.h"
#include "PIL_time.h" /* smoothview */
@@ -260,14 +245,14 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo
* the angle between quats
* this means small rotations wont lag */
if (quat && !ofs && !dist) {
- float vec1[3], vec2[3];
+ float vec1[3], vec2[3];
- VECCOPY(vec1, sms.new_quat);
- VECCOPY(vec2, sms.orig_quat);
- normalize_v3(vec1);
- normalize_v3(vec2);
- /* scale the time allowed by the rotation */
- sms.time_allowed *= angle_normalized_v3v3(vec1, vec2)/(M_PI/2);
+ VECCOPY(vec1, sms.new_quat);
+ VECCOPY(vec2, sms.orig_quat);
+ normalize_v3(vec1);
+ normalize_v3(vec2);
+ /* scale the time allowed by the rotation */
+ sms.time_allowed *= angle_normalized_v3v3(vec1, vec2)/(M_PI/2);
}
/* original values */
@@ -692,8 +677,8 @@ void view3d_unproject(bglMats *mats, float out[3], const short x, const short y,
{
double ux, uy, uz;
- gluUnProject(x,y,z, mats->modelview, mats->projection,
- (GLint *)mats->viewport, &ux, &uy, &uz );
+ gluUnProject(x,y,z, mats->modelview, mats->projection,
+ (GLint *)mats->viewport, &ux, &uy, &uz );
out[0] = ux;
out[1] = uy;
out[2] = uz;
@@ -902,20 +887,20 @@ int get_view3d_ortho(View3D *v3d, RegionView3D *rv3d)
Camera *cam;
if(rv3d->persp==RV3D_CAMOB) {
- if(v3d->camera && v3d->camera->type==OB_CAMERA) {
- cam= v3d->camera->data;
-
- if(cam && cam->type==CAM_ORTHO)
- return 1;
- else
- return 0;
- }
- else
- return 0;
+ if(v3d->camera && v3d->camera->type==OB_CAMERA) {
+ cam= v3d->camera->data;
+
+ if(cam && cam->type==CAM_ORTHO)
+ return 1;
+ else
+ return 0;
+ }
+ else
+ return 0;
}
if(rv3d->persp==RV3D_ORTHO)
- return 1;
+ return 1;
return 0;
}
@@ -1941,6 +1926,7 @@ void fly_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_ANY, KM_ANY, 0, FLY_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_CONFIRM);
+ WM_modalkeymap_add_item(keymap, SPACEKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, FLY_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, PADPLUSKEY, KM_PRESS, 0, 0, FLY_MODAL_ACCELERATE);
@@ -2571,7 +2557,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
ID *id_key;
/* transform the parent or the camera? */
if(fly->root_parent) {
- Object *ob_update;
+ Object *ob_update;
float view_mat[4][4];
float prev_view_imat[4][4];
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index b14bd03df19..5c3d133f523 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -47,20 +47,9 @@
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
-#include "DNA_action_types.h" /* for some special action-editor settings */
#include "DNA_constraint_types.h"
-#include "DNA_ipo_types.h" /* some silly ipo flag */
-#include "DNA_listBase.h"
#include "DNA_meshdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h" /* PET modes */
-#include "DNA_screen_types.h" /* area dimensions */
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
@@ -98,7 +87,6 @@
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_markers.h"
-#include "ED_util.h"
#include "ED_view3d.h"
#include "ED_mesh.h"
@@ -112,7 +100,6 @@
#include "BLI_ghash.h"
#include "BLI_linklist.h"
-#include "PIL_time.h" /* sleep */
#include "UI_resources.h"
@@ -556,7 +543,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
t->redraw |= TREDRAW_SOFT;
if (t->state == TRANS_STARTING) {
- t->state = TRANS_RUNNING;
+ t->state = TRANS_RUNNING;
}
applyMouseInput(t, &t->mouse, t->mval, t->values);
@@ -2540,16 +2527,16 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't resize objects itself
if((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)){
/* scale val and reset size */
- *td->val = td->ival * (1 + (fsize[0] - 1) * td->factor);
+ *td->val = td->ival * (1 + (fsize[0] - 1) * td->factor);
td->ext->size[0] = td->ext->isize[0];
td->ext->size[1] = td->ext->isize[1];
td->ext->size[2] = td->ext->isize[2];
- }
+ }
else {
/* Reset val if SINGLESIZE but using a constraint */
if (td->flag & TD_SINGLESIZE)
- *td->val = td->ival;
+ *td->val = td->ival;
td->ext->size[0] = td->ext->isize[0] * (1 + (fsize[0] - 1) * td->factor);
td->ext->size[1] = td->ext->isize[1] * (1 + (fsize[1] - 1) * td->factor);
@@ -2948,7 +2935,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* rotation */
if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
/* euler or quaternion? */
- if ((td->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
+ if ((td->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
mat3_to_quat( quat,fmat); // Actual transform
@@ -5719,11 +5706,11 @@ void BIF_TransformSetUndo(char *str)
void NDofTransform()
{
#if 0 // TRANSFORM_FIX_ME
- float fval[7];
- float maxval = 50.0f; // also serves as threshold
- int axis = -1;
- int mode = 0;
- int i;
+ float fval[7];
+ float maxval = 50.0f; // also serves as threshold
+ int axis = -1;
+ int mode = 0;
+ int i;
getndof(fval);
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 4f2a3960491..3fe61bbe851 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -108,25 +108,25 @@ typedef struct TransSnap {
typedef struct TransCon {
short orientation; /**/
- char text[50]; /* Description of the Constraint for header_print */
- float mtx[3][3]; /* Matrix of the Constraint space */
- float imtx[3][3]; /* Inverse Matrix of the Constraint space */
- float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
- float center[3]; /* transformation center to define where to draw the view widget
- ALWAYS in global space. Unlike the transformation center */
+ char text[50]; /* Description of the Constraint for header_print */
+ float mtx[3][3]; /* Matrix of the Constraint space */
+ float imtx[3][3]; /* Inverse Matrix of the Constraint space */
+ float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
+ float center[3]; /* transformation center to define where to draw the view widget
+ ALWAYS in global space. Unlike the transformation center */
short imval[2]; /* initial mouse value for visual calculation */
- /* the one in TransInfo is not garanty to stay the same (Rotates change it) */
- int mode; /* Mode flags of the Constraint */
+ /* the one in TransInfo is not garanty to stay the same (Rotates change it) */
+ int mode; /* Mode flags of the Constraint */
void (*drawExtra)(struct TransInfo *);
/* For constraints that needs to draw differently from the other
uses this instead of the generic draw function */
- void (*applyVec)(struct TransInfo *, struct TransData *, float *, float *, float *);
- /* Apply function pointer for linear vectorial transformation */
- /* The last three parameters are pointers to the in/out/printable vectors */
- void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]);
- /* Apply function pointer for size transformation */
- void (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *);
- /* Apply function pointer for rotation transformation */
+ void (*applyVec)(struct TransInfo *, struct TransData *, float *, float *, float *);
+ /* Apply function pointer for linear vectorial transformation */
+ /* The last three parameters are pointers to the in/out/printable vectors */
+ void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]);
+ /* Apply function pointer for size transformation */
+ void (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *);
+ /* Apply function pointer for rotation transformation */
} TransCon;
typedef struct TransDataExtension {
@@ -135,16 +135,16 @@ typedef struct TransDataExtension {
float drotAxis[3]; /* Initial object drotAxis */
float dquat[4]; /* Initial object dquat */
float dsize[3]; /* Initial object dsize */
- float *rot; /* Rotation of the data to transform (Faculative) */
- float irot[3]; /* Initial rotation */
- float *quat; /* Rotation quaternion of the data to transform (Faculative) */
- float iquat[4]; /* Initial rotation quaternion */
+ float *rot; /* Rotation of the data to transform (Faculative) */
+ float irot[3]; /* Initial rotation */
+ float *quat; /* Rotation quaternion of the data to transform (Faculative) */
+ float iquat[4]; /* Initial rotation quaternion */
float *rotAngle; /* Rotation angle of the data to transform (Faculative) */
float irotAngle; /* Initial rotation angle */
float *rotAxis; /* Rotation axis of the data to transform (Faculative) */
float irotAxis[4]; /* Initial rotation axis */
- float *size; /* Size of the data to transform (Faculative) */
- float isize[3]; /* Initial size */
+ float *size; /* Size of the data to transform (Faculative) */
+ float isize[3]; /* Initial size */
float obmat[4][4]; /* Object matrix */
} TransDataExtension;
@@ -214,20 +214,20 @@ typedef struct TransData {
float dist; /* Distance needed to affect element (for Proportionnal Editing) */
float rdist; /* Distance to the nearest element (for Proportionnal Editing) */
float factor; /* Factor of the transformation (for Proportionnal Editing) */
- float *loc; /* Location of the data to transform */
- float iloc[3]; /* Initial location */
+ float *loc; /* Location of the data to transform */
+ float iloc[3]; /* Initial location */
float *val; /* Value pointer for special transforms */
float ival; /* Old value*/
- float center[3]; /* Individual data center */
- float mtx[3][3]; /* Transformation matrix from data space to global space */
- float smtx[3][3]; /* Transformation matrix from global space to data space */
+ float center[3]; /* Individual data center */
+ float mtx[3][3]; /* Transformation matrix from data space to global space */
+ float smtx[3][3]; /* Transformation matrix from global space to data space */
float axismtx[3][3];/* Axis orientation matrix of the data */
struct Object *ob;
struct bConstraint *con; /* for objects/bones, the first constraint in its constraint stack */
TransDataExtension *ext; /* for objects, poses. 1 single malloc per TransInfo! */
TransDataCurveHandleFlags *hdata; /* for curves, stores handle flags for modification/cancel */
void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */
- int flag; /* Various flags */
+ int flag; /* Various flags */
short protectflag; /* If set, copy of Object or PoseChannel protection */
int rotOrder; /* rotation mode, as defined in eRotationModes (DNA_action_types.h) */
} TransData;
@@ -236,7 +236,7 @@ typedef struct MouseInput {
void (*apply)(struct TransInfo *, struct MouseInput *, short [2], float [3]);
void (*post)(struct TransInfo *, float [3]);
- short imval[2]; /* initial mouse position */
+ short imval[2]; /* initial mouse position */
char precision;
short precision_mval[2]; /* mouse position when precision key was pressed */
int center[2];
@@ -245,32 +245,32 @@ typedef struct MouseInput {
} MouseInput;
typedef struct TransInfo {
- int mode; /* current mode */
- int flag; /* generic flags for special behaviors */
- int modifiers; /* special modifiers, by function, not key */
+ int mode; /* current mode */
+ int flag; /* generic flags for special behaviors */
+ int modifiers; /* special modifiers, by function, not key */
short state; /* current state (running, canceled,...)*/
- int options; /* current context/options for transform */
- float val; /* init value for some transformations (and rotation angle) */
- float fac; /* factor for distance based transform */
- int (*transform)(struct TransInfo *, short *);
- /* transform function pointer */
+ int options; /* current context/options for transform */
+ float val; /* init value for some transformations (and rotation angle) */
+ float fac; /* factor for distance based transform */
+ int (*transform)(struct TransInfo *, short *);
+ /* transform function pointer */
int (*handleEvent)(struct TransInfo *, struct wmEvent *);
/* event handler function pointer RETURN 1 if redraw is needed */
- int total; /* total number of transformed data */
- TransData *data; /* transformed data (array) */
+ int total; /* total number of transformed data */
+ TransData *data; /* transformed data (array) */
TransDataExtension *ext; /* transformed data extension (array) */
TransData2D *data2d; /* transformed data for 2d (array) */
- TransCon con; /* transformed constraint */
- TransSnap tsnap;
- NumInput num; /* numerical input */
- NDofInput ndof; /* ndof input */
- MouseInput mouse; /* mouse input */
- char redraw; /* redraw flag */
+ TransCon con; /* transformed constraint */
+ TransSnap tsnap;
+ NumInput num; /* numerical input */
+ NDofInput ndof; /* ndof input */
+ MouseInput mouse; /* mouse input */
+ char redraw; /* redraw flag */
float prop_size; /* proportional circle radius */
char proptext[20]; /* proportional falloff text */
- float center[3]; /* center of transformation */
- int center2d[2]; /* center in screen coordinates */
- short imval[2]; /* initial mouse position */
+ float center[3]; /* center of transformation */
+ int center2d[2]; /* center in screen coordinates */
+ short imval[2]; /* initial mouse position */
short event_type; /* event->type used to invoke transform */
short idx_max; /* maximum index on the input vector */
float snap[3]; /* Snapping Gears */
@@ -317,12 +317,12 @@ typedef struct TransInfo {
struct Scene *scene;
struct ToolSettings *settings;
struct wmTimer *animtimer;
- short mval[2]; /* current mouse position */
- struct Object *obedit;
- void *draw_handle_apply;
- void *draw_handle_view;
- void *draw_handle_pixel;
- void *draw_handle_cursor;
+ short mval[2]; /* current mouse position */
+ struct Object *obedit;
+ void *draw_handle_apply;
+ void *draw_handle_view;
+ void *draw_handle_pixel;
+ void *draw_handle_cursor;
} TransInfo;
@@ -349,7 +349,7 @@ typedef struct TransInfo {
#define T_POSE (1 << 2)
#define T_TEXTURE (1 << 3)
#define T_CAMERA (1 << 4)
- // trans on points, having no rotation/scale
+ // trans on points, having no rotation/scale
#define T_POINTS (1 << 6)
// for manipulator exceptions, like scaling using center point, drawing help lines
#define T_USES_MANIPULATOR (1 << 7)
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index d27e87932b0..14d0676786e 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -44,19 +44,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
@@ -79,7 +66,6 @@
//
//#include "mydevice.h"
-#include "WM_types.h"
#include "UI_resources.h"
@@ -877,7 +863,7 @@ static void setNearestAxis3d(TransInfo *t)
axis[1] = (float)(icoord[1] - t->center2d[1]);
axis[2] = 0.0f;
- if (normalize_v3(axis) != 0.0f) {
+ if (normalize_v3(axis) != 0.0f) {
project_v3_v3v3(proj, mvec, axis);
sub_v3_v3v3(axis, mvec, proj);
len[i] = normalize_v3(axis);
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 4e4fd0c24ae..02e4ee5da91 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -38,37 +38,15 @@
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_image_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_nla_types.h"
#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_sequence_types.h"
-#include "DNA_texture_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_property_types.h"
-#include "DNA_vfont_types.h"
#include "DNA_constraint_types.h"
-#include "DNA_listBase.h"
-#include "DNA_gpencil_types.h"
#include "BKE_action.h"
#include "BKE_armature.h"
@@ -115,7 +93,6 @@
#include "ED_mesh.h"
#include "ED_types.h"
#include "ED_uvedit.h"
-#include "ED_view3d.h"
#include "UI_view2d.h"
@@ -1001,8 +978,8 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob)
t->poseobj= ob; /* we also allow non-active objects to be transformed, in weightpaint */
/* init trans data */
- td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransPoseBone");
- tdx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransPoseBoneExt");
+ td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransPoseBone");
+ tdx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransPoseBoneExt");
for(i=0; i<t->total; i++, td++, tdx++) {
td->ext= tdx;
td->val = NULL;
@@ -1069,12 +1046,12 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t)
}
}
- if (!t->total) return;
+ if (!t->total) return;
copy_m3_m4(mtx, t->obedit->obmat);
invert_m3_m3(smtx, mtx);
- td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransEditBone");
+ td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransEditBone");
for (ebo = edbo->first; ebo; ebo = ebo->next)
{
@@ -1231,7 +1208,7 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t)
static void createTransMBallVerts(bContext *C, TransInfo *t)
{
MetaBall *mb = (MetaBall*)t->obedit->data;
- MetaElem *ml;
+ MetaElem *ml;
TransData *td;
TransDataExtension *tx;
float mtx[3][3], smtx[3][3];
@@ -1361,7 +1338,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
TransData *td = NULL;
- Nurb *nu;
+ Nurb *nu;
BezTriple *bezt;
BPoint *bp;
float mtx[3][3], smtx[3][3];
@@ -1409,7 +1386,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
copy_m3_m4(mtx, t->obedit->obmat);
invert_m3_m3(smtx, mtx);
- td = t->data;
+ td = t->data;
for(nu= cu->editnurb->first; nu; nu= nu->next) {
if(nu->type == CU_BEZIER) {
TransData *head, *tail;
@@ -1581,7 +1558,7 @@ static void createTransLatticeVerts(bContext *C, TransInfo *t)
bp++;
}
- /* note: in prop mode we need at least 1 selected */
+ /* note: in prop mode we need at least 1 selected */
if (countsel==0) return;
if(propmode) t->total = count;
@@ -1666,7 +1643,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
}
}
- /* note: in prop mode we need at least 1 selected */
+ /* note: in prop mode we need at least 1 selected */
if (hasselected==0) return;
t->total = count;
@@ -2148,7 +2125,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
}
}
- /* note: in prop mode we need at least 1 selected */
+ /* note: in prop mode we need at least 1 selected */
if (countsel==0) return;
/* check active */
@@ -2471,7 +2448,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
}
}
- /* note: in prop mode we need at least 1 selected */
+ /* note: in prop mode we need at least 1 selected */
if (countsel==0) return;
t->total= (propmode)? count: countsel;
@@ -3602,7 +3579,7 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv
/* dynamically allocate an array of chars to mark whether an TransData's
* pointers have been fixed already, so that we don't override ones that are
* already done
- */
+ */
adjusted= MEM_callocN(t->total, "beztmap_adjusted_map");
/* for each beztmap item, find if it is used anywhere */
@@ -4756,7 +4733,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
FCurve *fcu= (FCurve *)ale->key_data;
if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
+ ((cancelled == 0) || (duplicate)) )
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
@@ -4783,7 +4760,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* Do curve cleanups? */
if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
+ ((cancelled == 0) || (duplicate)) )
{
posttrans_action_clean(&ac, (bAction *)ac.data);
}
@@ -4852,7 +4829,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
FCurve *fcu= (FCurve *)ale->key_data;
if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
+ ((cancelled == 0) || (duplicate)) )
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
@@ -5215,7 +5192,7 @@ void createTransData(bContext *C, TransInfo *t)
t->ext = NULL;
if (t->obedit->type == OB_MESH) {
createTransEditVerts(C, t);
- }
+ }
else if ELEM(t->obedit->type, OB_CURVE, OB_SURF) {
createTransCurveVerts(C, t);
}
@@ -5228,7 +5205,7 @@ void createTransData(bContext *C, TransInfo *t)
else if (t->obedit->type==OB_ARMATURE) {
t->flag &= ~T_PROP_EDIT;
createTransArmatureVerts(C, t);
- }
+ }
else {
printf("edit type not implemented!\n");
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 8d7c5c820d0..5dbd2a833a6 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -35,24 +35,11 @@
#include "BLO_sys_types.h" // for intptr_t support
#include "DNA_anim_types.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
@@ -105,7 +92,6 @@
#include "BLI_editVert.h"
#include "BLI_rand.h"
-#include "RNA_access.h"
#include "WM_types.h"
#include "WM_api.h"
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index e3386f1b1e7..d7ebd28f604 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -26,7 +26,6 @@
#include <math.h>
#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 754ad8ad9a3..5e7c6fc9d3d 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -41,17 +41,11 @@
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "RNA_access.h"
@@ -78,8 +72,6 @@
#include "ED_armature.h"
#include "ED_mesh.h"
#include "ED_particle.h"
-#include "ED_space_api.h"
-#include "ED_transform.h"
#include "ED_view3d.h"
#include "UI_resources.h"
diff --git a/source/blender/editors/transform/transform_ndofinput.c b/source/blender/editors/transform/transform_ndofinput.c
index a6171723752..3e47484c54c 100644
--- a/source/blender/editors/transform/transform_ndofinput.c
+++ b/source/blender/editors/transform/transform_ndofinput.c
@@ -30,8 +30,6 @@
#include "BKE_global.h" /* for G */
#include "BKE_utildefines.h" /* ABS */
-#include "DNA_view3d_types.h" /* for G.vd (view3d) */
-#include "DNA_windowmanager_types.h" /* for G.vd (view3d) */
#include "WM_types.h"
@@ -44,7 +42,7 @@ static void resetNDofInput(NDofInput *n);
void initNDofInput(NDofInput *n)
{
- int i;
+ int i;
n->flag = 0;
n->axis = 0;
@@ -128,9 +126,9 @@ void applyNDofInput(NDofInput *n, float *vec)
static int updateNDofMotion(NDofInput *n)
{
- float fval[7];
- int i;
- int retval = 0;
+ float fval[7];
+ int i;
+ int retval = 0;
getndof(fval);
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 6ff30a0b683..b12de7fd6f8 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -25,8 +25,6 @@
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_windowmanager_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -533,9 +531,9 @@ void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Tilt";
- /*optionals -
- "Tilt selected vertices."
- "Specify an extra axis rotation for selected vertices of 3d curve." */
+ /*optionals -
+ "Tilt selected vertices."
+ "Specify an extra axis rotation for selected vertices of 3d curve." */
ot->description= "Tilt selected control vertices of 3d curve";
ot->idname = OP_TILT;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -640,7 +638,7 @@ void TRANSFORM_OT_tosphere(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "To Sphere";
- //added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()"
+ //added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()"
ot->description= "Move selected vertices outward in a spherical shape around mesh center";
ot->idname = OP_TOSPHERE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 805afa4fb95..253f6689e1d 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -28,16 +28,10 @@
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
#include "DNA_curve_types.h"
-#include "DNA_listBase.h"
#include "DNA_object_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meta_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BKE_global.h"
@@ -57,9 +51,7 @@
#include "ED_armature.h"
#include "ED_mesh.h"
-#include "ED_util.h"
-#include "UI_interface.h"
#include "RNA_define.h"
@@ -483,7 +475,7 @@ void applyTransformOrientation(const bContext *C, float mat[3][3], char *name) {
break;
}
}
- }
+ }
}
static int count_bone_select(bArmature *arm, ListBase *lb, int do_it)
@@ -814,7 +806,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);
VECCOPY(normal, mat[2]);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 71952579b32..e7e2ba6ce76 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -34,14 +34,11 @@
#include "PIL_time.h"
-#include "DNA_action_types.h"
#include "DNA_armature_types.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_meshdata_types.h" // Temporary, for snapping to other unselected meshes
#include "DNA_space_types.h"
#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "DNA_windowmanager_types.h"
@@ -73,7 +70,6 @@
#include "ED_armature.h"
#include "ED_image.h"
#include "ED_mesh.h"
-#include "ED_transform.h"
#include "ED_uvedit.h"
#include "ED_view3d.h"
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index ff982e9d133..52e3b9baa13 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -31,11 +31,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_curve_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index 60f8385a5db..8597454fdb5 100644
--- a/source/blender/editors/util/editmode_undo.c
+++ b/source/blender/editors/util/editmode_undo.c
@@ -34,12 +34,8 @@
#include "MEM_guardedalloc.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
@@ -51,7 +47,6 @@
#include "BKE_utildefines.h"
-#include "ED_util.h"
#include "ED_mesh.h"
#include "UI_interface.h"
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index fc193373327..a5c0bfeb73a 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -34,7 +34,6 @@
#include "BKE_utildefines.h" /* ABS */
#include "WM_types.h"
-#include "DNA_windowmanager_types.h"
#include "ED_numinput.h"
@@ -170,13 +169,13 @@ char handleNumInput(NumInput *n, wmEvent *event)
if (!n->ctrl[idx])
n->ctrl[idx] = 1;
- n->val[idx] += n->increment;
+ n->val[idx] += n->increment;
break;
case NUM_MODAL_INCREMENT_DOWN:
if (!n->ctrl[idx])
n->ctrl[idx] = 1;
- n->val[idx] -= n->increment;
+ n->val[idx] -= n->increment;
break;
default:
return 0;
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 4c7831c589c..636ce9dcec5 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -34,13 +34,7 @@
#include "MEM_guardedalloc.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_context.h"
@@ -69,8 +63,6 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_interface.h"
-#include "UI_resources.h"
#include "util_intern.h"
@@ -244,7 +236,7 @@ void ED_OT_undo(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Undo";
- ot->description= "Undo previous action";
+ ot->description= "Undo previous action";
ot->idname= "ED_OT_undo";
/* api callbacks */
@@ -256,7 +248,7 @@ void ED_OT_redo(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Redo";
- ot->description= "Redo previous action";
+ ot->description= "Redo previous action";
ot->idname= "ED_OT_redo";
/* api callbacks */
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index 17010c25e31..ce59c8e37b4 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -29,7 +29,6 @@
#include <math.h>
#include <stdlib.h>
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
@@ -731,7 +730,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
pointsize = UI_GetThemeValuef(TH_FACEDOT_SIZE);
glPointSize(pointsize); // TODO - drawobject.c changes this value after - Investigate!
- /* unselected faces */
+ /* unselected faces */
UI_ThemeColor(TH_WIRE);
bglBegin(GL_POINTS);
@@ -763,7 +762,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
/* 6. draw uv vertices */
if(drawfaces != 2) { /* 2 means Mesh Face Mode */
- /* unselected uvs */
+ /* unselected uvs */
UI_ThemeColor(TH_VERTEX);
pointsize = UI_GetThemeValuef(TH_VERTEX_SIZE);
glPointSize(pointsize);
@@ -787,7 +786,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
/* pinned uvs */
/* give odd pointsizes odd pin pointsizes */
- glPointSize(pointsize*2 + (((int)pointsize % 2)? (-1): 0));
+ glPointSize(pointsize*2 + (((int)pointsize % 2)? (-1): 0));
cpack(0xFF);
bglBegin(GL_POINTS);
@@ -809,7 +808,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
/* selected uvs */
UI_ThemeColor(TH_VERTEX_SELECT);
- glPointSize(pointsize);
+ glPointSize(pointsize);
bglBegin(GL_POINTS);
for(efa= em->faces.first; efa; efa= efa->next) {
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index bc63d412046..fe0478a2a15 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -34,12 +34,8 @@
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_space_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -62,7 +58,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -2294,7 +2289,7 @@ int circle_select_exec(bContext *C, wmOperator *op)
MTFace *tface;
int x, y, radius, width, height, select;
float zoomx, zoomy, offset[2], ellipse[2];
- int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
+ int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
/* get operator properties */
select= (gesture_mode == GESTURE_MODAL_SELECT);
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 2de3c60f54c..dbc04f85497 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -388,7 +388,7 @@ static float p_face_area(PFace *f)
static float p_area_signed(float *v1, float *v2, float *v3)
{
return 0.5f*(((v2[0] - v1[0])*(v3[1] - v1[1])) -
- ((v3[0] - v1[0])*(v2[1] - v1[1])));
+ ((v3[0] - v1[0])*(v2[1] - v1[1])));
}
static float p_face_uv_area_signed(PFace *f)
@@ -397,30 +397,30 @@ static float p_face_uv_area_signed(PFace *f)
PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
return 0.5f*(((v2->uv[0] - v1->uv[0])*(v3->uv[1] - v1->uv[1])) -
- ((v3->uv[0] - v1->uv[0])*(v2->uv[1] - v1->uv[1])));
+ ((v3->uv[0] - v1->uv[0])*(v2->uv[1] - v1->uv[1])));
}
static float p_edge_length(PEdge *e)
{
- PVert *v1 = e->vert, *v2 = e->next->vert;
- float d[3];
+ PVert *v1 = e->vert, *v2 = e->next->vert;
+ float d[3];
- d[0] = v2->co[0] - v1->co[0];
- d[1] = v2->co[1] - v1->co[1];
- d[2] = v2->co[2] - v1->co[2];
+ d[0] = v2->co[0] - v1->co[0];
+ d[1] = v2->co[1] - v1->co[1];
+ d[2] = v2->co[2] - v1->co[2];
- return sqrt(d[0]*d[0] + d[1]*d[1] + d[2]*d[2]);
+ return sqrt(d[0]*d[0] + d[1]*d[1] + d[2]*d[2]);
}
static float p_edge_uv_length(PEdge *e)
{
- PVert *v1 = e->vert, *v2 = e->next->vert;
- float d[3];
+ PVert *v1 = e->vert, *v2 = e->next->vert;
+ float d[3];
- d[0] = v2->uv[0] - v1->uv[0];
- d[1] = v2->uv[1] - v1->uv[1];
+ d[0] = v2->uv[0] - v1->uv[0];
+ d[1] = v2->uv[1] - v1->uv[1];
- return sqrt(d[0]*d[0] + d[1]*d[1]);
+ return sqrt(d[0]*d[0] + d[1]*d[1]);
}
static void p_chart_uv_bbox(PChart *chart, float *minv, float *maxv)
@@ -522,7 +522,7 @@ static PEdge *p_boundary_edge_next(PEdge *e)
static PEdge *p_boundary_edge_prev(PEdge *e)
{
- PEdge *we = e, *last;
+ PEdge *we = e, *last;
do {
last = we;
@@ -591,7 +591,7 @@ static void p_vert_load_pin_select_uvs(PHandle *handle, PVert *v)
if (e->flag & PEDGE_SELECT)
v->flag |= PVERT_SELECT;
- if (e->flag & PEDGE_PIN) {
+ if (e->flag & PEDGE_PIN) {
pinuv[0] += e->orig_uv[0]*handle->aspx;
pinuv[1] += e->orig_uv[1]*handle->aspy;
npins++;
@@ -821,7 +821,7 @@ static PBool p_edge_has_pair(PHandle *handle, PEdge *e, PEdge **pair, PBool impl
/* don't connect seams and t-junctions */
if ((pe->flag & PEDGE_SEAM) || *pair ||
- (impl && p_edge_implicit_seam(e, pe))) {
+ (impl && p_edge_implicit_seam(e, pe))) {
*pair = NULL;
return P_FALSE;
}
@@ -1030,8 +1030,8 @@ static PFace *p_face_add(PHandle *handle)
}
static PFace *p_face_add_construct(PHandle *handle, ParamKey key, ParamKey *vkeys,
- float *co[3], float *uv[3], int i1, int i2, int i3,
- ParamBool *pin, ParamBool *select)
+ float *co[3], float *uv[3], int i1, int i2, int i3,
+ ParamBool *pin, ParamBool *select)
{
PFace *f = p_face_add(handle);
PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
@@ -1122,8 +1122,8 @@ static PBool p_quad_split_direction(PHandle *handle, float **co, PHashKey *vkeys
static void p_chart_boundaries(PChart *chart, int *nboundaries, PEdge **outer)
{
- PEdge *e, *be;
- float len, maxlen = -1.0;
+ PEdge *e, *be;
+ float len, maxlen = -1.0;
if (nboundaries)
*nboundaries = 0;
@@ -1131,29 +1131,29 @@ static void p_chart_boundaries(PChart *chart, int *nboundaries, PEdge **outer)
*outer = NULL;
for (e=chart->edges; e; e=e->nextlink) {
- if (e->pair || (e->flag & PEDGE_DONE))
- continue;
+ if (e->pair || (e->flag & PEDGE_DONE))
+ continue;
if (nboundaries)
(*nboundaries)++;
- len = 0.0f;
+ len = 0.0f;
be = e;
do {
- be->flag |= PEDGE_DONE;
- len += p_edge_length(be);
+ be->flag |= PEDGE_DONE;
+ len += p_edge_length(be);
be = be->next->vert->edge;
- } while(be != e);
+ } while(be != e);
- if (outer && (len > maxlen)) {
+ if (outer && (len > maxlen)) {
*outer = e;
- maxlen = len;
- }
- }
+ maxlen = len;
+ }
+ }
for (e=chart->edges; e; e=e->nextlink)
- e->flag &= ~PEDGE_DONE;
+ e->flag &= ~PEDGE_DONE;
}
static float p_edge_boundary_angle(PEdge *e)
@@ -1270,8 +1270,8 @@ static void p_chart_fill_boundaries(PChart *chart, PEdge *outer)
for (e=chart->edges; e; e=e->nextlink) {
/* enext = e->nextlink; - as yet unused */
- if (e->pair || (e->flag & PEDGE_FILLED))
- continue;
+ if (e->pair || (e->flag & PEDGE_FILLED))
+ continue;
nedges = 0;
be = e;
@@ -1283,7 +1283,7 @@ static void p_chart_fill_boundaries(PChart *chart, PEdge *outer)
if (e != outer)
p_chart_fill_boundary(chart, e, nedges);
- }
+ }
}
#if 0
@@ -1846,7 +1846,7 @@ static PBool p_collapse_allowed(PEdge *edge, PEdge *pair)
return P_FALSE;
return (p_collapse_allowed_topologic(edge, pair) &&
- p_collapse_allowed_geometric(edge, pair));
+ p_collapse_allowed_geometric(edge, pair));
}
static float p_collapse_cost(PEdge *edge, PEdge *pair)
@@ -2791,7 +2791,7 @@ static PBool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PV
float maxlen = 0.0f, curlen = 0.0f, totlen = 0.0f, firstlen = 0.0f;
float len1, len2;
- /* find longest series of verts split in the chart itself, these are
+ /* find longest series of verts split in the chart itself, these are
marked during construction */
be = outer;
lastbe = p_boundary_edge_prev(be);
@@ -2802,7 +2802,7 @@ static PBool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PV
nextbe = p_boundary_edge_next(be);
if ((be->vert->flag & PVERT_SPLIT) ||
- (lastbe->vert->flag & nextbe->vert->flag & PVERT_SPLIT)) {
+ (lastbe->vert->flag & nextbe->vert->flag & PVERT_SPLIT)) {
if (!cure) {
if (be == outer)
firste1 = be;
@@ -4072,7 +4072,7 @@ void param_delete(ParamHandle *handle)
int i;
param_assert((phandle->state == PHANDLE_STATE_ALLOCATED) ||
- (phandle->state == PHANDLE_STATE_CONSTRUCTED));
+ (phandle->state == PHANDLE_STATE_CONSTRUCTED));
for (i = 0; i < phandle->ncharts; i++)
p_chart_delete(phandle->charts[i]);
@@ -4093,8 +4093,8 @@ void param_delete(ParamHandle *handle)
}
void param_face_add(ParamHandle *handle, ParamKey key, int nverts,
- ParamKey *vkeys, float **co, float **uv,
- ParamBool *pin, ParamBool *select)
+ ParamKey *vkeys, float **co, float **uv,
+ ParamBool *pin, ParamBool *select)
{
PHandle *phandle = (PHandle*)handle;
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h b/source/blender/editors/uvedit/uvedit_parametrizer.h
index f1454ee3865..0fa54c64d95 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.h
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.h
@@ -22,7 +22,7 @@ typedef enum ParamBool {
- vertices are implicitly created
- in construct_end the mesh will be split up according to the seams
- the resulting charts must be:
- - manifold, connected, open (at least one boundary loop)
+ - manifold, connected, open (at least one boundary loop)
- output will be written to the uv pointers
*/
@@ -31,16 +31,16 @@ ParamHandle *param_construct_begin();
void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy);
void param_face_add(ParamHandle *handle,
- ParamKey key,
- int nverts,
- ParamKey *vkeys,
- float **co,
- float **uv,
+ ParamKey key,
+ int nverts,
+ ParamKey *vkeys,
+ float **co,
+ float **uv,
ParamBool *pin,
ParamBool *select);
void param_edge_set_seam(ParamHandle *handle,
- ParamKey *vkeys);
+ ParamKey *vkeys);
void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl);
void param_delete(ParamHandle *chart);
@@ -49,8 +49,8 @@ void param_delete(ParamHandle *chart);
-----------------------------
- charts with less than two pinned vertices are assigned 2 pins
- lscm is divided in three steps:
- - begin: compute matrix and it's factorization (expensive)
- - solve using pinned coordinates (cheap)
+ - begin: compute matrix and it's factorization (expensive)
+ - solve using pinned coordinates (cheap)
- end: clean up
- uv coordinates are allowed to change within begin/end, for
quick re-solving
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index bc5a0150b2d..2948592daf8 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -34,12 +34,9 @@
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
@@ -52,6 +49,7 @@
#include "BLI_math.h"
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
+#include "BLI_uvproject.h"
#include "PIL_time.h"
@@ -64,7 +62,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "UI_interface.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -869,115 +866,7 @@ void UV_OT_unwrap(wmOperatorType *ot)
}
/**************** Project From View operator **************/
-
-static void uv_from_view_bounds(float target[2], float source[3], float rotmat[4][4])
-{
- float pv[3];
-
- mul_m4_v3(rotmat, pv);
-
- /* ortho projection */
- target[0] = -pv[0];
- target[1] = pv[2];
-}
-
-typedef struct UvCameraInfo {
- float camangle;
- float camsize;
- float xasp, yasp;
- float shiftx, shifty;
- float rotmat[4][4];
- float caminv[4][4];
- short do_persp, do_pano;
-} UvCameraInfo;
-
-//static void uv_from_camera(float camsize, float camangle, float xasp, float yasp, float target[2], float source[3], float rotmat[4][4], float caminv[4][4], int persp, int pano)
-static void uv_from_camera(UvCameraInfo *uci, float target[2], float source[3])
-{
- float pv4[4];
-
- copy_v3_v3(pv4, source);
- pv4[3]= 1.0;
-
- /* rotmat is the object matrix in this case */
- mul_m4_v4(uci->rotmat, pv4);
-
- /* caminv is the inverse camera matrix */
- mul_m4_v4(uci->caminv, pv4);
-
- if(uci->do_pano) {
- float angle= atan2f(pv4[0], -pv4[2]) / (M_PI * 2.0); /* angle around the camera */
- if (uci->do_persp==0) {
- target[0] = angle; /* no correct method here, just map to 0-1 */
- target[1] = pv4[1] / uci->camsize;
- }
- else {
- float vec2d[2]= {pv4[0], pv4[2]}; /* 2D position from the camera */
- target[0] = angle * (M_PI / uci->camangle);
- target[1] = pv4[1] / (len_v2(vec2d) * uci->camsize);
- }
- }
- else {
- if (pv4[2]==0.0f) pv4[2]=0.00001f; /* don't allow div by 0 */
-
- if (uci->do_persp==0) {
- target[0]=(pv4[0]/uci->camsize) * uci->xasp;
- target[1]=(pv4[1]/uci->camsize) * uci->yasp;
- }
- else {
- target[0]=(-pv4[0]*((1.0f/uci->camsize)/pv4[2])*uci->xasp) / 2.0f;
- target[1]=(-pv4[1]*((1.0f/uci->camsize)/pv4[2])*uci->yasp) / 2.0f;
- }
- }
-
- /* adds camera shift + 0.5 */
- target[0] += uci->shiftx;
- target[1] += uci->shifty;
-}
-
-static void uv_from_view(ARegion *ar, float target[2], float source[3], float rotmat[4][4])
-{
- RegionView3D *rv3d= ar->regiondata;
- float pv[3], pv4[4], dx, dy, x= 0.0, y= 0.0;
-
- mul_m4_v3(rotmat, pv);
-
- dx= ar->winx;
- dy= ar->winy;
-
- copy_v3_v3(pv4, source);
- pv4[3]= 1.0;
-
- /* rotmat is the object matrix in this case */
- mul_m4_v4(rotmat, pv4);
-
- /* almost project_short */
- mul_m4_v4(rv3d->persmat, pv4);
- if(fabs(pv4[3]) > 0.00001) { /* avoid division by zero */
- target[0] = dx/2.0 + (dx/2.0)*pv4[0]/pv4[3];
- target[1] = dy/2.0 + (dy/2.0)*pv4[1]/pv4[3];
- }
- else {
- /* scaling is lost but give a valid result */
- target[0] = dx/2.0 + (dx/2.0)*pv4[0];
- target[1] = dy/2.0 + (dy/2.0)*pv4[1];
- }
-
- /* v3d->persmat seems to do this funky scaling */
- if(dx > dy) {
- y= (dx-dy)/2.0;
- dy = dx;
- }
- else {
- x= (dy-dx)/2.0;
- dx = dy;
- }
-
- target[0]= (x + target[0])/dx;
- target[1]= (y + target[1])/dy;
-}
-
-static int from_view_exec(bContext *C, wmOperator *op)
+static int uv_from_view_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
@@ -1008,53 +897,31 @@ static int from_view_exec(bContext *C, wmOperator *op)
if(efa->f & SELECT) {
tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv_from_view_bounds(tf->uv[0], efa->v1->co, rotmat);
- uv_from_view_bounds(tf->uv[1], efa->v2->co, rotmat);
- uv_from_view_bounds(tf->uv[2], efa->v3->co, rotmat);
+ project_from_view_ortho(tf->uv[0], efa->v1->co, rotmat);
+ project_from_view_ortho(tf->uv[1], efa->v2->co, rotmat);
+ project_from_view_ortho(tf->uv[2], efa->v3->co, rotmat);
if(efa->v4)
- uv_from_view_bounds(tf->uv[3], efa->v4->co, rotmat);
+ project_from_view_ortho(tf->uv[3], efa->v4->co, rotmat);
}
}
}
else if (camera) {
- UvCameraInfo uci;
-
- uci.do_pano = (camera->flag & CAM_PANORAMA);
- uci.do_persp = (camera->type==CAM_PERSP);
-
- uci.camangle= DEG2RAD(camera->angle)/2.0f;
- uci.camsize= uci.do_persp ? uci.camsize= tanf(uci.camangle) : camera->ortho_scale;
-
- if (invert_m4_m4(uci.caminv, v3d->camera->obmat)) {
-
- /* normal projection */
- copy_m4_m4(uci.rotmat, obedit->obmat);
-
- /* also make aspect ratio adjustment factors */
- if (scene->r.xsch > scene->r.ysch) {
- uci.xasp= 1.0f;
- uci.yasp= (float)(scene->r.xsch)/(float)(scene->r.ysch);
- }
- else {
- uci.xasp= (float)(scene->r.ysch)/(float)(scene->r.xsch);
- uci.yasp= 1.0f;
- }
-
- /* include 0.5f here to move the UVs into the center */
- uci.shiftx = 0.5f - camera->shiftx;
- uci.shifty = 0.5f - camera->shifty;
-
+ struct UvCameraInfo *uci= project_camera_info(v3d->camera, obedit->obmat, scene->r.xsch, scene->r.ysch);
+
+ if(uci) {
for(efa= em->faces.first; efa; efa= efa->next) {
if(efa->f & SELECT) {
tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv_from_camera(&uci, tf->uv[0], efa->v1->co);
- uv_from_camera(&uci, tf->uv[1], efa->v2->co);
- uv_from_camera(&uci, tf->uv[2], efa->v3->co);
+ project_from_camera(tf->uv[0], efa->v1->co, uci);
+ project_from_camera(tf->uv[1], efa->v2->co, uci);
+ project_from_camera(tf->uv[2], efa->v3->co, uci);
if(efa->v4)
- uv_from_camera(&uci, tf->uv[3], efa->v4->co);
+ project_from_camera(tf->uv[3], efa->v4->co, uci);
}
}
+
+ MEM_freeN(uci);
}
}
else {
@@ -1064,11 +931,11 @@ static int from_view_exec(bContext *C, wmOperator *op)
if(efa->f & SELECT) {
tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv_from_view(ar, tf->uv[0], efa->v1->co, rotmat);
- uv_from_view(ar, tf->uv[1], efa->v2->co, rotmat);
- uv_from_view(ar, tf->uv[2], efa->v3->co, rotmat);
+ project_from_view(tf->uv[0], efa->v1->co, rv3d->persmat, rotmat, ar->winx, ar->winy);
+ project_from_view(tf->uv[1], efa->v2->co, rv3d->persmat, rotmat, ar->winx, ar->winy);
+ project_from_view(tf->uv[2], efa->v3->co, rv3d->persmat, rotmat, ar->winx, ar->winy);
if(efa->v4)
- uv_from_view(ar, tf->uv[3], efa->v4->co, rotmat);
+ project_from_view(tf->uv[3], efa->v4->co, rv3d->persmat, rotmat, ar->winx, ar->winy);
}
}
}
@@ -1082,7 +949,7 @@ static int from_view_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-static int from_view_poll(bContext *C)
+static int uv_from_view_poll(bContext *C)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
@@ -1100,8 +967,8 @@ void UV_OT_from_view(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* api callbacks */
- ot->exec= from_view_exec;
- ot->poll= from_view_poll;
+ ot->exec= uv_from_view_exec;
+ ot->poll= uv_from_view_poll;
/* properties */
RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", "Use orthographic projection.");
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 90b0ac2aee9..686e89b8310 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -91,14 +91,14 @@ int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
/* GPU Texture
- always returns unsigned char RGBA textures
- if texture with non square dimensions is created, depending on the
- graphics card capabilities the texture may actually be stored in a
+ graphics card capabilities the texture may actually be stored in a
larger texture with power of two dimensions. the actual dimensions
may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
calls glTexCoord2f with the coordinates adjusted for this.
- can use reference counting:
- - reference counter after GPU_texture_create is 1
- - GPU_texture_ref increases by one
- - GPU_texture_free decreases by one, and frees if 0
+ - reference counter after GPU_texture_create is 1
+ - GPU_texture_ref increases by one
+ - GPU_texture_free decreases by one, and frees if 0
- if created with from_blender, will not free the texture
*/
@@ -123,10 +123,10 @@ int GPU_texture_opengl_height(GPUTexture *tex);
/* GPU Framebuffer
- this is a wrapper for an OpenGL framebuffer object (FBO). in practice
- multiple FBO's may be created, to get around limitations on the number
+ multiple FBO's may be created, to get around limitations on the number
of attached textures and the dimension requirements.
- after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
- be called before rendering to the window framebuffer again */
+ be called before rendering to the window framebuffer again */
GPUFrameBuffer *GPU_framebuffer_create();
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex);
diff --git a/source/blender/gpu/gpu_buffers.h b/source/blender/gpu/gpu_buffers.h
index 945cccced8d..98cefa7a696 100644
--- a/source/blender/gpu/gpu_buffers.h
+++ b/source/blender/gpu/gpu_buffers.h
@@ -137,7 +137,7 @@ void GPU_update_mesh_buffers(void *buffers, struct MVert *mvert,
void *GPU_build_grid_buffers(struct DMGridData **grids,
int *grid_indices, int totgrid, int gridsize);
void GPU_update_grid_buffers(void *buffers_v, struct DMGridData **grids,
- int *grid_indices, int totgrid, int gridsize);
+ int *grid_indices, int totgrid, int gridsize, int smooth);
void GPU_draw_buffers(void *buffers);
void GPU_free_buffers(void *buffers);
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 868930f4056..74bef43e928 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -520,11 +520,11 @@ void *GPU_build_mesh_buffers(GHash *map, MVert *mvert, MFace *mface,
}
void GPU_update_grid_buffers(void *buffers_v, DMGridData **grids,
- int *grid_indices, int totgrid, int gridsize)
+ int *grid_indices, int totgrid, int gridsize, int smooth)
{
GPU_Buffers *buffers = buffers_v;
DMGridData *vert_data;
- int i, totvert;
+ int i, j, k, totvert;
totvert= gridsize*gridsize*totgrid;
@@ -539,6 +539,22 @@ void GPU_update_grid_buffers(void *buffers_v, DMGridData **grids,
for(i = 0; i < totgrid; ++i) {
DMGridData *grid= grids[grid_indices[i]];
memcpy(vert_data, grid, sizeof(DMGridData)*gridsize*gridsize);
+
+ if(!smooth) {
+ /* for flat shading, recalc normals and set the last vertex of
+ each quad in the index buffer to have the flat normal as
+ that is what opengl will use */
+ for(j = 0; j < gridsize-1; ++j) {
+ for(k = 0; k < gridsize-1; ++k) {
+ normal_quad_v3(vert_data[(j+1)*gridsize + (k+1)].no,
+ vert_data[(j+1)*gridsize + k].co,
+ vert_data[(j+1)*gridsize + k+1].co,
+ vert_data[j*gridsize + k+1].co,
+ vert_data[j*gridsize + k].co);
+ }
+ }
+ }
+
vert_data += gridsize*gridsize;
}
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
@@ -589,10 +605,10 @@ void *GPU_build_grid_buffers(DMGridData **grids,
for(i = 0; i < totgrid; ++i) {
for(j = 0; j < gridsize-1; ++j) {
for(k = 0; k < gridsize-1; ++k) {
+ *(quad_data++)= offset + j*gridsize + k+1;
*(quad_data++)= offset + j*gridsize + k;
*(quad_data++)= offset + (j+1)*gridsize + k;
*(quad_data++)= offset + (j+1)*gridsize + k+1;
- *(quad_data++)= offset + j*gridsize + k+1;
}
}
@@ -619,10 +635,10 @@ void *GPU_build_grid_buffers(DMGridData **grids,
for(i = 0; i < totgrid; ++i) {
for(j = 0; j < gridsize-1; ++j) {
for(k = 0; k < gridsize-1; ++k) {
+ *(quad_data++)= offset + j*gridsize + k+1;
*(quad_data++)= offset + j*gridsize + k;
*(quad_data++)= offset + (j+1)*gridsize + k;
*(quad_data++)= offset + (j+1)*gridsize + k+1;
- *(quad_data++)= offset + j*gridsize + k+1;
}
}
@@ -642,7 +658,6 @@ void *GPU_build_grid_buffers(DMGridData **grids,
/* Build VBO */
if(buffers->index_buf)
glGenBuffersARB(1, &buffers->vert_buf);
- GPU_update_grid_buffers(buffers, grids, grid_indices, totgrid, gridsize);
buffers->tot_quad = totquad;
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index efaae5c2720..a3196f5125b 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -492,7 +492,7 @@ static void codegen_set_unique_ids(ListBase *nodes)
/* set texid used for settings texture slot with multitexture */
if (codegen_input_has_texture(input) &&
- ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL))) {
+ ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL))) {
if (input->link) {
/* input is texture from buffer, assign only one texid per
buffer to avoid sampling the same texture twice */
@@ -1033,7 +1033,7 @@ static void gpu_node_input_socket(GPUNode *node, GPUNodeStack *sock)
gpu_node_input_link(node, sock->link, sock->type);
}
else {
- link = GPU_node_link_create(0);
+ link = GPU_node_link_create(0);
link->ptr1 = sock->vec;
gpu_node_input_link(node, link, sock->type);
}
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h
index 883c1abe034..3272f0fa1a9 100644
--- a/source/blender/gpu/intern/gpu_codegen.h
+++ b/source/blender/gpu/intern/gpu_codegen.h
@@ -59,7 +59,7 @@ GPUFunction *GPU_lookup_function(char *name);
/* Pass Generation
- Takes a list of nodes and a desired output, and makes a pass. This
- will take ownership of the nodes and free them early if unused or
+ will take ownership of the nodes and free them early if unused or
at the end if used.
*/
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 10638ca552a..f00126a7fab 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -762,11 +762,11 @@ void GPU_free_smoke(SmokeModifierData *smd)
if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain)
{
if(smd->domain->tex)
- GPU_texture_free(smd->domain->tex);
+ GPU_texture_free(smd->domain->tex);
smd->domain->tex = NULL;
if(smd->domain->tex_shadow)
- GPU_texture_free(smd->domain->tex_shadow);
+ GPU_texture_free(smd->domain->tex_shadow);
smd->domain->tex_shadow = NULL;
}
}
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 3ca55c12ce2..4b735a8bd84 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -176,7 +176,7 @@ int GPU_print_error(char *str)
if (G.f & G_DEBUG) {
if ((errCode = glGetError()) != GL_NO_ERROR) {
- fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode));
+ fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode));
return 1;
}
}
@@ -1138,7 +1138,7 @@ GPUPixelBuffer *gpu_pixelbuffer_create(int x, int y, int halffloat, int numbuffe
pb->numbuffers = numbuffers;
pb->halffloat = halffloat;
- glGenBuffersARB(pb->numbuffers, pb->bindcode);
+ glGenBuffersARB(pb->numbuffers, pb->bindcode);
if (!pb->bindcode[0]) {
fprintf(stderr, "GPUPixelBuffer allocation failed\n");
@@ -1154,9 +1154,9 @@ void GPU_pixelbuffer_texture(GPUTexture *tex, GPUPixelBuffer *pb)
void *pixels;
int i;
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
- for (i = 0; i < pb->numbuffers; i++) {
+ for (i = 0; i < pb->numbuffers; i++) {
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->bindcode[pb->current]);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->datasize, NULL,
GL_STREAM_DRAW_ARB);
@@ -1170,22 +1170,22 @@ void GPU_pixelbuffer_texture(GPUTexture *tex, GPUPixelBuffer *pb)
}
}
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
}
static int pixelbuffer_map_into_gpu(GLuint bindcode)
{
void *pixels;
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
pixels = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY);
/* do stuff in pixels */
- if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT)) {
+ if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT)) {
fprintf(stderr, "Could not unmap opengl PBO\n");
return 0;
- }
+ }
return 1;
}
@@ -1193,14 +1193,14 @@ static int pixelbuffer_map_into_gpu(GLuint bindcode)
static void pixelbuffer_copy_to_texture(GPUTexture *tex, GPUPixelBuffer *pb, GLuint bindcode)
{
GLenum type = (pb->halffloat)? GL_HALF_FLOAT_NV: GL_UNSIGNED_BYTE;
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
- glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, tex->w, tex->h,
- GL_RGBA, type, NULL);
+ glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, tex->w, tex->h,
+ GL_RGBA, type, NULL);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
}
void GPU_pixelbuffer_async_to_gpu(GPUTexture *tex, GPUPixelBuffer *pb)
@@ -1217,7 +1217,7 @@ void GPU_pixelbuffer_async_to_gpu(GPUTexture *tex, GPUPixelBuffer *pb)
pixelbuffer_map_into_gpu(pb->bindcode[newbuffer]);
pixelbuffer_copy_to_texture(tex, pb, pb->bindcode[pb->current]);
- }
+ }
}
#endif
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 03afa0b1b5a..c81ddd6a770 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -435,34 +435,34 @@ static GPUNodeLink *lamp_get_visibility(GPUMaterial *mat, GPULamp *lamp, GPUNode
#if 0
static void area_lamp_vectors(LampRen *lar)
{
- float xsize= 0.5*lar->area_size, ysize= 0.5*lar->area_sizey, multifac;
-
- /* make it smaller, so area light can be multisampled */
- multifac= 1.0f/sqrt((float)lar->ray_totsamp);
- xsize *= multifac;
- ysize *= multifac;
-
- /* corner vectors */
- lar->area[0][0]= lar->co[0] - xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
- lar->area[0][1]= lar->co[1] - xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
- lar->area[0][2]= lar->co[2] - xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
-
- /* corner vectors */
- lar->area[1][0]= lar->co[0] - xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
- lar->area[1][1]= lar->co[1] - xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
- lar->area[1][2]= lar->co[2] - xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
-
- /* corner vectors */
- lar->area[2][0]= lar->co[0] + xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
- lar->area[2][1]= lar->co[1] + xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
- lar->area[2][2]= lar->co[2] + xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
-
- /* corner vectors */
- lar->area[3][0]= lar->co[0] + xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
- lar->area[3][1]= lar->co[1] + xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
- lar->area[3][2]= lar->co[2] + xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
- /* only for correction button size, matrix size works on energy */
- lar->areasize= lar->dist*lar->dist/(4.0*xsize*ysize);
+ float xsize= 0.5*lar->area_size, ysize= 0.5*lar->area_sizey, multifac;
+
+ /* make it smaller, so area light can be multisampled */
+ multifac= 1.0f/sqrt((float)lar->ray_totsamp);
+ xsize *= multifac;
+ ysize *= multifac;
+
+ /* corner vectors */
+ lar->area[0][0]= lar->co[0] - xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
+ lar->area[0][1]= lar->co[1] - xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
+ lar->area[0][2]= lar->co[2] - xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[1][0]= lar->co[0] - xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
+ lar->area[1][1]= lar->co[1] - xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
+ lar->area[1][2]= lar->co[2] - xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[2][0]= lar->co[0] + xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
+ lar->area[2][1]= lar->co[1] + xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
+ lar->area[2][2]= lar->co[2] + xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[3][0]= lar->co[0] + xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
+ lar->area[3][1]= lar->co[1] + xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
+ lar->area[3][2]= lar->co[2] + xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
+ /* only for correction button size, matrix size works on energy */
+ lar->areasize= lar->dist*lar->dist/(4.0*xsize*ysize);
}
#endif
@@ -965,7 +965,7 @@ static void do_material_tex(GPUShadeInput *shi)
if(tex->imaflag & TEX_USEALPHA)
talpha= 1;
- }
+ }
else continue;
/* texture output */
@@ -1187,7 +1187,7 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
shr->alpha = shi->alpha;
if(world) {
- /* exposure correction */
+ /* exposure correction */
if(world->exp!=0.0f || world->range!=1.0f) {
linfac= 1.0 + pow((2.0*world->exp + 0.5), -10);
logfac= log((linfac-1.0)/linfac)/world->range;
@@ -1478,7 +1478,7 @@ void GPU_lamp_free(Object *ob)
int GPU_lamp_has_shadow_buffer(GPULamp *lamp)
{
return (!(lamp->scene->gm.flag & GAME_GLSL_NO_SHADOWS) &&
- !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) &&
+ !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) &&
lamp->tex && lamp->fb);
}
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index 0305c6c6b49..39b8e48fb7f 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -62,7 +62,7 @@
#endif
#include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
- BLI_countlist BLI_stringdec */
+ BLI_countlist BLI_stringdec */
#include "imbuf.h"
#include "imbuf_patch.h"
diff --git a/source/blender/imbuf/intern/IMB_imginfo.h b/source/blender/imbuf/intern/IMB_imginfo.h
index 18a2231b0fc..2884abcaf6e 100644
--- a/source/blender/imbuf/intern/IMB_imginfo.h
+++ b/source/blender/imbuf/intern/IMB_imginfo.h
@@ -44,7 +44,7 @@ typedef struct ImgInfo {
} ImgInfo;
/** The imginfo is a list of key/value pairs (both char*) that can me
- saved in the header of several image formats.
+ saved in the header of several image formats.
Apart from some common keys like
'Software' and 'Description' (png standard) we'll use keys within the
Blender namespace, so should be called 'Blender::StampInfo' or 'Blender::FrameNum'
@@ -59,7 +59,7 @@ void IMB_imginfo_free(struct ImBuf* img);
* @param img - the ImBuf that contains the image data
* @param key - the key of the field
* @param value - the data in the field, first one found with key is returned,
- memory has to be allocated by user.
+ memory has to be allocated by user.
* @param len - length of value buffer allocated by user.
* @return - 1 (true) if ImageInfo present and value for the key found, 0 (false) otherwise
*/
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index 52ec5b37a6f..710dbde21b2 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -302,7 +302,7 @@ short imb_addrectImBuf(struct ImBuf * ibuf)
imb_freerectImBuf(ibuf);
size = ibuf->x * ibuf->y;
- size = size * sizeof(unsigned int);
+ size = size * sizeof(unsigned int);
if ( (ibuf->rect = MEM_mapallocN(size, "imb_addrectImBuf")) ){
ibuf->mall |= IB_rect;
diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c
index d5ca605cad4..5a5b5ada4a1 100644
--- a/source/blender/imbuf/intern/anim.c
+++ b/source/blender/imbuf/intern/anim.c
@@ -59,7 +59,7 @@
#endif
#include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
- BLI_countlist BLI_stringdec */
+ BLI_countlist BLI_stringdec */
#include "DNA_userdef_types.h"
#include "BKE_global.h"
@@ -256,7 +256,7 @@ static int an_stringdec(char *string, char* kop, char *staart,unsigned short *nu
static void an_stringenc(char *string, char *head, char *start, unsigned short numlen, int pic) {
- BLI_stringenc(string, head, start, numlen, pic);
+ BLI_stringenc(string, head, start, numlen, pic);
}
static void free_anim_avi (struct anim *anim) {
@@ -536,7 +536,7 @@ static int startffmpeg(struct anim * anim) {
dump_format(pFormatCtx, 0, anim->name, 0);
- /* Find the first video stream */
+ /* Find the first video stream */
videoStream=-1;
for(i=0; i<pFormatCtx->nb_streams; i++)
if(get_codec_from_stream(pFormatCtx->streams[i])->codec_type
@@ -552,7 +552,7 @@ static int startffmpeg(struct anim * anim) {
pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]);
- /* Find the decoder for the video stream */
+ /* Find the decoder for the video stream */
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
if(pCodec==NULL) {
av_close_input_file(pFormatCtx);
@@ -599,7 +599,7 @@ static int startffmpeg(struct anim * anim) {
anim->pFrameRGB = avcodec_alloc_frame();
if (avpicture_get_size(PIX_FMT_RGBA, anim->x, anim->y)
- != anim->x * anim->y * 4) {
+ != anim->x * anim->y * 4) {
fprintf (stderr,
"ffmpeg has changed alloc scheme ... ARGHHH!\n");
avcodec_close(anim->pCodecCtx);
@@ -613,11 +613,11 @@ static int startffmpeg(struct anim * anim) {
if (anim->ib_flags & IB_animdeinterlace) {
avpicture_fill((AVPicture*) anim->pFrameDeinterlaced,
- MEM_callocN(avpicture_get_size(
+ MEM_callocN(avpicture_get_size(
anim->pCodecCtx->pix_fmt,
anim->x, anim->y),
"ffmpeg deinterlace"),
- anim->pCodecCtx->pix_fmt, anim->x, anim->y);
+ anim->pCodecCtx->pix_fmt, anim->x, anim->y);
}
if (pCodecCtx->has_b_frames) {
@@ -664,13 +664,13 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
ibuf = IMB_allocImBuf(anim->x, anim->y, 32, IB_rect, 0);
avpicture_fill((AVPicture*) anim->pFrameRGB,
- (unsigned char*) ibuf->rect,
- PIX_FMT_RGBA, anim->x, anim->y);
+ (unsigned char*) ibuf->rect,
+ PIX_FMT_RGBA, anim->x, anim->y);
if (position != anim->curposition + 1) {
if (position > anim->curposition + 1
- && anim->preseek
- && position - (anim->curposition + 1) < anim->preseek) {
+ && anim->preseek
+ && position - (anim->curposition + 1) < anim->preseek) {
while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
if (packet.stream_index == anim->videoStream) {
avcodec_decode_video(
@@ -698,11 +698,11 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
#else
double frame_rate =
av_q2d(anim->pFormatCtx->streams[anim->videoStream]
- ->r_frame_rate);
+ ->r_frame_rate);
#endif
double time_base =
av_q2d(anim->pFormatCtx->streams[anim->videoStream]
- ->time_base);
+ ->time_base);
long long pos = (long long) (position - anim->preseek)
* AV_TIME_BASE / frame_rate;
long long st_time = anim->pFormatCtx
@@ -717,7 +717,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
}
av_seek_frame(anim->pFormatCtx, -1,
- pos, AVSEEK_FLAG_BACKWARD);
+ pos, AVSEEK_FLAG_BACKWARD);
pts_to_search = (long long)
(((double) position) / time_base / frame_rate);
@@ -732,8 +732,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
if(packet.stream_index == anim->videoStream) {
avcodec_decode_video(anim->pCodecCtx,
- anim->pFrame, &frameFinished,
- packet.data, packet.size);
+ anim->pFrame, &frameFinished,
+ packet.data, packet.size);
if (frameFinished && !pos_found) {
if (packet.dts >= pts_to_search) {
@@ -748,21 +748,21 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
/* This means the data wasnt read properly,
this check stops crashing */
if (input->data[0]==0 && input->data[1]==0
- && input->data[2]==0 && input->data[3]==0){
+ && input->data[2]==0 && input->data[3]==0){
av_free_packet(&packet);
break;
}
if (anim->ib_flags & IB_animdeinterlace) {
if (avpicture_deinterlace(
- (AVPicture*)
- anim->pFrameDeinterlaced,
- (const AVPicture*)
- anim->pFrame,
- anim->pCodecCtx->pix_fmt,
- anim->pCodecCtx->width,
- anim->pCodecCtx->height)
- < 0) {
+ (AVPicture*)
+ anim->pFrameDeinterlaced,
+ (const AVPicture*)
+ anim->pFrame,
+ anim->pCodecCtx->pix_fmt,
+ anim->pCodecCtx->width,
+ anim->pCodecCtx->height)
+ < 0) {
filter_y = 1;
} else {
input = anim->pFrameDeinterlaced;
@@ -931,8 +931,8 @@ static ImBuf * redcode_fetchibuf(struct anim * anim, int position) {
return NULL;
}
- ibuf = IMB_allocImBuf(raw_frame->width * 2,
- raw_frame->height * 2, 32, IB_rectfloat, 0);
+ ibuf = IMB_allocImBuf(raw_frame->width * 2,
+ raw_frame->height * 2, 32, IB_rectfloat, 0);
redcode_decode_video_float(raw_frame, ibuf->rect_float, 1);
diff --git a/source/blender/imbuf/intern/anim5.c b/source/blender/imbuf/intern/anim5.c
index 28ba23ef73c..41c4c2c610b 100644
--- a/source/blender/imbuf/intern/anim5.c
+++ b/source/blender/imbuf/intern/anim5.c
@@ -30,7 +30,7 @@
*/
#include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
- BLI_countlist BLI_stringdec */
+ BLI_countlist BLI_stringdec */
#include "imbuf.h"
#include "imbuf_patch.h"
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 0fd483b6b49..606cce645ee 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -207,7 +207,7 @@ short imb_savebmp(struct ImBuf *ibuf, char *name, int flags) {
data = (uchar *) ibuf->rect;
ofile = fopen(name,"wb");
- if (!ofile) return 0;
+ if (!ofile) return 0;
putShortLSB(19778,ofile); /* "BM" */
putIntLSB(0,ofile); /* This can be 0 for BI_RGB bitmaps */
diff --git a/source/blender/imbuf/intern/data.c b/source/blender/imbuf/intern/data.c
index 526f7012768..3b1f3035d62 100644
--- a/source/blender/imbuf/intern/data.c
+++ b/source/blender/imbuf/intern/data.c
@@ -104,9 +104,9 @@ static unsigned short quadbase[511] = {
558, 525, 493, 462, 432, 403, 375, 348,
322, 297, 273, 250, 228, 207, 187, 168,
150, 133, 117, 102, 88, 75, 63, 52,
- 42, 33, 25, 18, 12, 7, 3, 0,
- 3, 7, 12, 18, 25, 33, 42, 52,
- 63, 75, 88, 102, 117, 133, 150, 168,
+ 42, 33, 25, 18, 12, 7, 3, 0,
+ 3, 7, 12, 18, 25, 33, 42, 52,
+ 63, 75, 88, 102, 117, 133, 150, 168,
187, 207, 228, 250, 273, 297, 322, 348,
375, 403, 432, 462, 493, 525, 558, 592,
627, 663, 700, 738, 777, 817, 858, 900,
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.h b/source/blender/imbuf/intern/dds/DirectDrawSurface.h
index e48a06b12f1..ed1972aa966 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.h
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.h
@@ -83,11 +83,11 @@ struct DDSCaps
/// DDS file header for DX10.
struct DDSHeader10
{
- uint dxgiFormat;
- uint resourceDimension;
- uint miscFlag;
- uint arraySize;
- uint reserved;
+ uint dxgiFormat;
+ uint resourceDimension;
+ uint miscFlag;
+ uint arraySize;
+ uint reserved;
};
/// DDS file header.
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index 8ed70b5509f..4e8d61f8675 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -156,7 +156,7 @@ void IMB_gamwarp(struct ImBuf *ibuf, double gamma)
if (rect) {
for (i = 255 ; i >= 0 ; i--)
gam[i] = (255.0 * pow(i / 255.0 ,
- gamma)) + 0.5;
+ gamma)) + 0.5;
for (i = ibuf->x * ibuf->y ; i>0 ; i--, rect+=4){
rect[0] = gam[rect[0]];
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index d7d45b711fc..b2ed8b87d0f 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -296,8 +296,8 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, int size, int flags)
/*
2048x1080 (2K) at 24 fps or 48 fps, or 4096x2160 (4K) at 24 fps; 3×12 bits per pixel, XYZ color space
- * In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the imager is used
- * In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the imager is used
+ * In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the imager is used
+ * In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the imager is used
*/
/* ****************************** COPIED FROM image_to_j2k.c */
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 2c4b8618637..127145c967d 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -207,7 +207,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, int siz
if (bytes_in_buffer == 0) { \
if (! (*datasrc->fill_input_buffer) (cinfo)) \
{ action; } \
- INPUT_RELOAD(cinfo); \
+ INPUT_RELOAD(cinfo); \
} \
bytes_in_buffer--
@@ -699,7 +699,7 @@ static int save_jstjpeg(char * name, struct ImBuf * ibuf)
sprintf(fieldname, "%s.jf0", name);
returnval = save_vidjpeg(fieldname, tbuf) ;
- if (returnval == 1) {
+ if (returnval == 1) {
IMB_rectcpy(tbuf, ibuf, 0, 0, tbuf->x, 0, ibuf->x, ibuf->y);
sprintf(fieldname, "%s.jf1", name);
returnval = save_vidjpeg(fieldname, tbuf);
diff --git a/source/blender/imbuf/intern/md5.c b/source/blender/imbuf/intern/md5.c
index a3165467b53..a2528fbd93c 100644
--- a/source/blender/imbuf/intern/md5.c
+++ b/source/blender/imbuf/intern/md5.c
@@ -31,7 +31,7 @@
#ifdef WORDS_BIGENDIAN
# define SWAP(n) \
- (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
+ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#else
# define SWAP(n) (n)
#endif
@@ -46,7 +46,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
(RFC 1321, 3.3: Step 3) */
void
md5_init_ctx (ctx)
- struct md5_ctx *ctx;
+ struct md5_ctx *ctx;
{
ctx->A = 0x67452301;
ctx->B = 0xefcdab89;
@@ -58,8 +58,8 @@ md5_init_ctx (ctx)
be in little endian byte order. */
void *
md5_read_ctx (ctx, resbuf)
- const struct md5_ctx *ctx;
- void *resbuf;
+ const struct md5_ctx *ctx;
+ void *resbuf;
{
((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
@@ -74,8 +74,8 @@ md5_read_ctx (ctx, resbuf)
beginning at RESBLOCK. */
int
md5_stream (stream, resblock)
- FILE *stream;
- void *resblock;
+ FILE *stream;
+ void *resblock;
{
/* Important: BLOCKSIZE must be a multiple of 64. */
#define BLOCKSIZE 4096
@@ -92,49 +92,49 @@ md5_stream (stream, resblock)
/* Iterate over full file contents. */
while (1)
- {
- /* We read the file in blocks of BLOCKSIZE bytes. One call of the
+ {
+ /* We read the file in blocks of BLOCKSIZE bytes. One call of the
computation function processes the whole buffer so that with the
next round of the loop another block can be read. */
- size_t n;
- sum = 0;
+ size_t n;
+ sum = 0;
- /* Read block. Take care for partial reads. */
- do
+ /* Read block. Take care for partial reads. */
+ do
{
n = fread (buffer, 1, BLOCKSIZE - sum, stream);
sum += n;
}
- while (sum < BLOCKSIZE && n != 0);
- if (n == 0 && ferror (stream))
- return 1;
+ while (sum < BLOCKSIZE && n != 0);
+ if (n == 0 && ferror (stream))
+ return 1;
- /* RFC 1321 specifies the possible length of the file up to 2^64 bits.
+ /* RFC 1321 specifies the possible length of the file up to 2^64 bits.
Here we only compute the number of bytes. Do a double word
- increment. */
- len[0] += sum;
- if (len[0] < sum)
+ increment. */
+ len[0] += sum;
+ if (len[0] < sum)
++len[1];
- /* If end of file is reached, end the loop. */
- if (n == 0)
+ /* If end of file is reached, end the loop. */
+ if (n == 0)
break;
- /* Process buffer with BLOCKSIZE bytes. Note that
+ /* Process buffer with BLOCKSIZE bytes. Note that
BLOCKSIZE % 64 == 0
- */
- md5_process_block (buffer, BLOCKSIZE, &ctx);
- }
+ */
+ md5_process_block (buffer, BLOCKSIZE, &ctx);
+ }
/* We can copy 64 byte because the buffer is always big enough. FILLBUF
- contains the needed bits. */
+ contains the needed bits. */
memcpy (&buffer[sum], fillbuf, 64);
/* Compute amount of padding bytes needed. Alignment is done to
(N + PAD) % 64 == 56
- There is always at least one byte padded. I.e. even the alignment
- is correctly aligned 64 padding bytes are added. */
+ There is always at least one byte padded. I.e. even the alignment
+ is correctly aligned 64 padding bytes are added. */
pad = sum & 63;
pad = pad >= 56 ? 64 + 56 - pad : 56 - pad;
@@ -157,9 +157,9 @@ md5_stream (stream, resblock)
digest. */
void *
md5_buffer (buffer, len, resblock)
- const char *buffer;
- size_t len;
- void *resblock;
+ const char *buffer;
+ size_t len;
+ void *resblock;
{
struct md5_ctx ctx;
char restbuf[64 + 72];
@@ -177,11 +177,11 @@ md5_buffer (buffer, len, resblock)
/* Copy to own buffer. */
memcpy (restbuf, &buffer[blocks], rest);
/* Append needed fill bytes at end of buffer. We can copy 64 byte
- because the buffer is always big enough. */
+ because the buffer is always big enough. */
memcpy (&restbuf[rest], fillbuf, 64);
/* PAD bytes are used for padding to correct alignment. Note that
- always at least one byte is padded. */
+ always at least one byte is padded. */
pad = rest >= 56 ? 64 + 56 - rest : 56 - rest;
/* Put length of buffer in *bits* in last eight bytes. */
@@ -210,9 +210,9 @@ md5_buffer (buffer, len, resblock)
void
md5_process_block (buffer, len, ctx)
- const void *buffer;
- size_t len;
- struct md5_ctx *ctx;
+ const void *buffer;
+ size_t len;
+ struct md5_ctx *ctx;
{
md5_uint32 correct_words[16];
const md5_uint32 *words = buffer;
@@ -224,16 +224,16 @@ md5_process_block (buffer, len, ctx)
md5_uint32 D = ctx->D;
/* Process all bytes in the buffer with 64 bytes in each round of
- the loop. */
+ the loop. */
while (words < endp)
- {
- md5_uint32 *cwp = correct_words;
- md5_uint32 A_save = A;
- md5_uint32 B_save = B;
- md5_uint32 C_save = C;
- md5_uint32 D_save = D;
-
- /* First round: using the given function, the context and a constant
+ {
+ md5_uint32 *cwp = correct_words;
+ md5_uint32 A_save = A;
+ md5_uint32 B_save = B;
+ md5_uint32 C_save = C;
+ md5_uint32 D_save = D;
+
+ /* First round: using the given function, the context and a constant
the next context is computed. Because the algorithms processing
unit is a 32-bit word and it is determined to work on words in
little endian byte order we perhaps have to change the byte order
@@ -241,116 +241,116 @@ md5_process_block (buffer, len, ctx)
we store the swapped words in the array CORRECT_WORDS. */
#define OP(a, b, c, d, s, T) \
- do \
- { \
+ do \
+ { \
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
++words; \
CYCLIC (a, s); \
a += b; \
- } \
- while (0)
+ } \
+ while (0)
- /* It is unfortunate that C does not provide an operator for
+ /* It is unfortunate that C does not provide an operator for
cyclic rotation. Hope the C compiler is smart enough. */
#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
- /* Before we start, one word to the strange constants.
+ /* Before we start, one word to the strange constants.
They are defined in RFC 1321 as
T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
- */
-
- /* Round 1. */
- OP (A, B, C, D, 7, 0xd76aa478);
- OP (D, A, B, C, 12, 0xe8c7b756);
- OP (C, D, A, B, 17, 0x242070db);
- OP (B, C, D, A, 22, 0xc1bdceee);
- OP (A, B, C, D, 7, 0xf57c0faf);
- OP (D, A, B, C, 12, 0x4787c62a);
- OP (C, D, A, B, 17, 0xa8304613);
- OP (B, C, D, A, 22, 0xfd469501);
- OP (A, B, C, D, 7, 0x698098d8);
- OP (D, A, B, C, 12, 0x8b44f7af);
- OP (C, D, A, B, 17, 0xffff5bb1);
- OP (B, C, D, A, 22, 0x895cd7be);
- OP (A, B, C, D, 7, 0x6b901122);
- OP (D, A, B, C, 12, 0xfd987193);
- OP (C, D, A, B, 17, 0xa679438e);
- OP (B, C, D, A, 22, 0x49b40821);
-
- /* For the second to fourth round we have the possibly swapped words
+ */
+
+ /* Round 1. */
+ OP (A, B, C, D, 7, 0xd76aa478);
+ OP (D, A, B, C, 12, 0xe8c7b756);
+ OP (C, D, A, B, 17, 0x242070db);
+ OP (B, C, D, A, 22, 0xc1bdceee);
+ OP (A, B, C, D, 7, 0xf57c0faf);
+ OP (D, A, B, C, 12, 0x4787c62a);
+ OP (C, D, A, B, 17, 0xa8304613);
+ OP (B, C, D, A, 22, 0xfd469501);
+ OP (A, B, C, D, 7, 0x698098d8);
+ OP (D, A, B, C, 12, 0x8b44f7af);
+ OP (C, D, A, B, 17, 0xffff5bb1);
+ OP (B, C, D, A, 22, 0x895cd7be);
+ OP (A, B, C, D, 7, 0x6b901122);
+ OP (D, A, B, C, 12, 0xfd987193);
+ OP (C, D, A, B, 17, 0xa679438e);
+ OP (B, C, D, A, 22, 0x49b40821);
+
+ /* For the second to fourth round we have the possibly swapped words
in CORRECT_WORDS. Redefine the macro to take an additional first
argument specifying the function to use. */
#undef OP
#define OP(f, a, b, c, d, k, s, T) \
- do \
+ do \
{ \
a += f (b, c, d) + correct_words[k] + T; \
CYCLIC (a, s); \
a += b; \
} \
- while (0)
-
- /* Round 2. */
- OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
- OP (FG, D, A, B, C, 6, 9, 0xc040b340);
- OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
- OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
- OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
- OP (FG, D, A, B, C, 10, 9, 0x02441453);
- OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
- OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
- OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
- OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
- OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
- OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
- OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
- OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
- OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
- OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
-
- /* Round 3. */
- OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
- OP (FH, D, A, B, C, 8, 11, 0x8771f681);
- OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
- OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
- OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
- OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
- OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
- OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
- OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
- OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
- OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
- OP (FH, B, C, D, A, 6, 23, 0x04881d05);
- OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
- OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
- OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
- OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
-
- /* Round 4. */
- OP (FI, A, B, C, D, 0, 6, 0xf4292244);
- OP (FI, D, A, B, C, 7, 10, 0x432aff97);
- OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
- OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
- OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
- OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
- OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
- OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
- OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
- OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
- OP (FI, C, D, A, B, 6, 15, 0xa3014314);
- OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
- OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
- OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
- OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
- OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
-
- /* Add the starting values of the context. */
- A += A_save;
- B += B_save;
- C += C_save;
- D += D_save;
- }
+ while (0)
+
+ /* Round 2. */
+ OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
+ OP (FG, D, A, B, C, 6, 9, 0xc040b340);
+ OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
+ OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
+ OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
+ OP (FG, D, A, B, C, 10, 9, 0x02441453);
+ OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
+ OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
+ OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
+ OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
+ OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
+ OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
+ OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
+ OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
+ OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
+ OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
+
+ /* Round 3. */
+ OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
+ OP (FH, D, A, B, C, 8, 11, 0x8771f681);
+ OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
+ OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
+ OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
+ OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
+ OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
+ OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
+ OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
+ OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
+ OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
+ OP (FH, B, C, D, A, 6, 23, 0x04881d05);
+ OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
+ OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
+ OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
+ OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
+
+ /* Round 4. */
+ OP (FI, A, B, C, D, 0, 6, 0xf4292244);
+ OP (FI, D, A, B, C, 7, 10, 0x432aff97);
+ OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
+ OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
+ OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
+ OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
+ OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
+ OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
+ OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
+ OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
+ OP (FI, C, D, A, B, 6, 15, 0xa3014314);
+ OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
+ OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
+ OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
+ OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
+ OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
+
+ /* Add the starting values of the context. */
+ A += A_save;
+ B += B_save;
+ C += C_save;
+ D += D_save;
+ }
/* Put checksum in context given as argument. */
ctx->A = A;
diff --git a/source/blender/imbuf/intern/md5.h b/source/blender/imbuf/intern/md5.h
index b49f8f559f7..1299eacffbf 100644
--- a/source/blender/imbuf/intern/md5.h
+++ b/source/blender/imbuf/intern/md5.h
@@ -54,11 +54,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
typedef unsigned short md5_uint32;
# else
# if ULONG_MAX == UINT_MAX_32_BITS
- typedef unsigned long md5_uint32;
+ typedef unsigned long md5_uint32;
# else
- /* The following line is intended to evoke an error.
- Using #error is not portable enough. */
- "Cannot determine unsigned 32-bit data type."
+ /* The following line is intended to evoke an error.
+ Using #error is not portable enough. */
+ "Cannot determine unsigned 32-bit data type."
# endif
# endif
#endif
@@ -93,7 +93,7 @@ void md5_init_ctx __P ((struct md5_ctx *ctx));
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
void md5_process_block __P ((const void *buffer, size_t len,
- struct md5_ctx *ctx));
+ struct md5_ctx *ctx));
/* Put result from CTX in first 16 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index 7f686b11087..2dafa043da6 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -188,7 +188,7 @@ short imb_savepng(struct ImBuf *ibuf, char *name, int flags)
Flush);
} else {
fp = fopen(name, "wb");
- if (!fp) {
+ if (!fp) {
MEM_freeN(pixels);
return 0;
}
@@ -443,7 +443,7 @@ struct ImBuf *imb_loadpng(unsigned char *mem, int size, int flags)
for(i = 0; i < count; i++) {
IMB_imginfo_add_field(ibuf, text_chunks[i].key, text_chunks[i].text);
ibuf->flags |= IB_imginfo;
- }
+ }
}
png_read_end(png_ptr, info_ptr);
diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c
index 570d8961758..9ad28abeae4 100644
--- a/source/blender/imbuf/intern/radiance_hdr.c
+++ b/source/blender/imbuf/intern/radiance_hdr.c
@@ -257,7 +257,7 @@ static int fwritecolrs(FILE* file, int width, int channels, unsigned char* ibufs
rgbe_scan = (RGBE*)MEM_mallocN(sizeof(RGBE)*width, "radhdr_write_tmpscan");
/* convert scanline */
- j= 0;
+ j= 0;
for (i=0;i<width;i++) {
if (fpscan) {
fcol[RED] = fpscan[j];
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index 4896ff0ab33..c23daacb919 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -221,7 +221,7 @@ struct ImBuf *IMB_loadiffmem(int *mem, int flags) {
if (GET_ID(mem) == FORM){
len = ((GET_BIG_LONG(mem+1) + 1) & ~1) + 8;
if ((GET_ID(mem+2) == ILBM) || (GET_ID(mem+2) == ANIM)) break;
- mem = (int *)((uchar *)mem +len);
+ mem = (int *)((uchar *)mem +len);
maxlen -= len;
} else return(0);
}
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index 14b1753f586..b3e25b52140 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -263,7 +263,7 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1)
for(x = ibuf2->x ; x>0 ; x--) *dest1++ = *dest2++ = *p1++;
dest1 = dest2;
}
- if (do_float) {
+ if (do_float) {
dest2f = dest1f + (4*ibuf2->x);
for(x = ibuf2->x*4 ; x>0 ; x--) *dest1f++ = *dest2f++ = *p1f++;
dest1f = dest2f;
@@ -520,38 +520,38 @@ static void enlarge_picture_byte(
*dst++ = ((((line1[x] * weight1y) >> 16)
* weight1x) >> 16)
+ ((((line2[x] * weight2y) >> 16)
- * weight1x) >> 16)
+ * weight1x) >> 16)
+ ((((line1[4 + x] * weight1y) >> 16)
* weight2x) >> 16)
+ ((((line2[4 + x] * weight2y) >> 16)
- * weight2x) >> 16);
+ * weight2x) >> 16);
*dst++ = ((((line1[x + 1] * weight1y) >> 16)
* weight1x) >> 16)
+ ((((line2[x + 1] * weight2y) >> 16)
- * weight1x) >> 16)
+ * weight1x) >> 16)
+ ((((line1[4 + x + 1] * weight1y) >> 16)
* weight2x) >> 16)
+ ((((line2[4 + x + 1] * weight2y) >> 16)
- * weight2x) >> 16);
+ * weight2x) >> 16);
*dst++ = ((((line1[x + 2] * weight1y) >> 16)
* weight1x) >> 16)
+ ((((line2[x + 2] * weight2y) >> 16)
- * weight1x) >> 16)
+ * weight1x) >> 16)
+ ((((line1[4 + x + 2] * weight1y) >> 16)
* weight2x) >> 16)
+ ((((line2[4 + x + 2] * weight2y) >> 16)
- * weight2x) >> 16);
+ * weight2x) >> 16);
*dst++ = ((((line1[x + 3] * weight1y) >> 16)
* weight1x) >> 16)
+ ((((line2[x + 3] * weight2y) >> 16)
- * weight1x) >> 16)
+ * weight1x) >> 16)
+ ((((line1[4 + x + 3] * weight1y) >> 16)
* weight2x) >> 16)
+ ((((line2[4 + x + 3] * weight2y) >> 16)
- * weight2x) >> 16);
+ * weight2x) >> 16);
x_src += dx_src;
}
@@ -661,7 +661,7 @@ static void shrink_picture_byte(
*dst++ = (val= (dst_line1[x].a * f) >> 15) > 255 ? 255: val;
}
memset(dst_line1, 0, dst_width *
- sizeof(struct scale_outpix_byte));
+ sizeof(struct scale_outpix_byte));
temp = dst_line1;
dst_line1 = dst_line2;
dst_line2 = temp;
@@ -688,10 +688,10 @@ static void q_scale_byte(unsigned char* in, unsigned char* out, int in_width,
{
if (dst_width > in_width && dst_height > in_height) {
enlarge_picture_byte(in, out, in_width, in_height,
- dst_width, dst_height);
+ dst_width, dst_height);
} else if (dst_width < in_width && dst_height < in_height) {
shrink_picture_byte(in, out, in_width, in_height,
- dst_width, dst_height);
+ dst_width, dst_height);
}
}
@@ -777,7 +777,7 @@ static void shrink_picture_float(
double ratioy = (double) (dst_height) / (double) (src_height);
uintptr_t x_src;
uintptr_t y_src;
- float dx_dst, x_dst;
+ float dx_dst, x_dst;
float dy_dst, y_dst;
float y_counter;
float * dst_begin = dst;
@@ -862,7 +862,7 @@ static void shrink_picture_float(
*dst++ = dst_line1[x].a * f;
}
memset(dst_line1, 0, dst_width *
- sizeof(struct scale_outpix_float));
+ sizeof(struct scale_outpix_float));
temp = dst_line1;
dst_line1 = dst_line2;
dst_line2 = temp;
@@ -888,10 +888,10 @@ static void q_scale_float(float* in, float* out, int in_width,
{
if (dst_width > in_width && dst_height > in_height) {
enlarge_picture_float(in, out, in_width, in_height,
- dst_width, dst_height);
+ dst_width, dst_height);
} else if (dst_width < in_width && dst_height < in_height) {
shrink_picture_float(in, out, in_width, in_height,
- dst_width, dst_height);
+ dst_width, dst_height);
}
}
@@ -906,7 +906,7 @@ static void q_scale_float(float* in, float* out, int in_width,
but that is pretty fast:
* does only blit once instead of two passes like the old code
- (fewer cache misses)
+ (fewer cache misses)
* uses fixed point integer arithmetic for byte buffers
* doesn't branch in tight loops
@@ -920,7 +920,7 @@ static int q_scale_linear_interpolation(
struct ImBuf *ibuf, int newx, int newy)
{
if ((newx >= ibuf->x && newy <= ibuf->y) ||
- (newx <= ibuf->x && newy >= ibuf->y)) {
+ (newx <= ibuf->x && newy >= ibuf->y)) {
return FALSE;
}
@@ -928,7 +928,7 @@ static int q_scale_linear_interpolation(
unsigned char * newrect =
MEM_mallocN(newx * newy * sizeof(int), "q_scale rect");
q_scale_byte((unsigned char *)ibuf->rect, newrect, ibuf->x, ibuf->y,
- newx, newy);
+ newx, newy);
imb_freerectImBuf(ibuf);
ibuf->mall |= IB_rect;
@@ -937,9 +937,9 @@ static int q_scale_linear_interpolation(
if (ibuf->rect_float) {
float * newrect =
MEM_mallocN(newx * newy * 4 *sizeof(float),
- "q_scale rectfloat");
+ "q_scale rectfloat");
q_scale_float(ibuf->rect_float, newrect, ibuf->x, ibuf->y,
- newx, newy);
+ newx, newy);
imb_freerectfloatImBuf(ibuf);
ibuf->mall |= IB_rectfloat;
ibuf->rect_float = newrect;
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index aafc9711a4e..092c52d427b 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -287,7 +287,7 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags)
buf[17] |= 0x08;
}
fildes = fopen(name,"wb");
- if (!fildes) return 0;
+ if (!fildes) return 0;
if (fwrite(buf, 1, 18,fildes) != 18) {
fclose(fildes);
@@ -297,9 +297,9 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags)
if (ibuf->cmap){
for (i = 0 ; i<ibuf->maxcol ; i++){
if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) {
- fclose(fildes);
- return (0);
- }
+ fclose(fildes);
+ return (0);
+ }
}
}
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 5a31a705591..dd18c77c5c6 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -92,7 +92,7 @@ static void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size)
static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
{
- return (0);
+ return (0);
}
/**
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 216f82fada5..b1ca414434f 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -327,7 +327,7 @@ static int isffmpeg (char *filename) {
if(UTIL_DEBUG) dump_format(pFormatCtx, 0, filename, 0);
- /* Find the first video stream */
+ /* Find the first video stream */
videoStream=-1;
for(i=0; i<pFormatCtx->nb_streams; i++)
if(pFormatCtx->streams[i] &&
@@ -345,7 +345,7 @@ static int isffmpeg (char *filename) {
pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]);
- /* Find the decoder for the video stream */
+ /* Find the decoder for the video stream */
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
if(pCodec==NULL) {
av_close_input_file(pFormatCtx);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 24e1a9f24e9..e9b1b655ad8 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -58,11 +58,11 @@ typedef struct IDProperty {
seemed like a good idea as a pad var was needed anyway :)*/
IDPropertyData data; /* note, alignment for 64 bits */
int len; /* array length, also (this is important!) string length + 1.
- the idea is to be able to reuse array realloc functions on strings.*/
+ the idea is to be able to reuse array realloc functions on strings.*/
/*totallen is total length of allocated array/string, including a buffer.
Note that the buffering is mild; the code comes from python's list implementation.*/
int totallen; /*strings and arrays are both buffered, though the buffer isn't
- saved.*/
+ saved.*/
} IDProperty;
#define MAX_IDPROP_NAME 32
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 27d47ea5a42..937dd3ee324 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -357,9 +357,9 @@ typedef enum ePose_Flags {
POSE_CONSTRAINTS_TIMEDEPEND = (1<<3),
/* recalculate bone paths */
POSE_RECALCPATHS = (1<<4),
- /* set by armature_rebuild_pose to give a chance to the IK solver to rebuild IK tree */
+ /* set by armature_rebuild_pose to give a chance to the IK solver to rebuild IK tree */
POSE_WAS_REBUILT = (1<<5),
- /* set by game_copy_pose to indicate that this pose is used in the game engine */
+ /* set by game_copy_pose to indicate that this pose is used in the game engine */
POSE_GAME_ENGINE = (1<<6),
} ePose_Flags;
diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index dc075af353c..a15f9a4eb4c 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -53,7 +53,7 @@ typedef struct Camera {
/* yafray: dof params */
/* qdn: yafray var 'YF_dofdist' now enabled for defocus composit node as well.
- The name was not changed so that no other files need to be modified */
+ The name was not changed so that no other files need to be modified */
float YF_dofdist, YF_aperture;
short YF_bkhtype, YF_bkhbias;
float YF_bkhrot;
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index 8e04107afe0..8fa63e6acc4 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -77,7 +77,7 @@ typedef struct ClothSimSettings
short vgroup_mass; /* optional vertexgroup name for assigning weight.*/
short vgroup_struct; /* vertex group for scaling structural stiffness */
short presets; /* used for presets on GUI */
- short reset;
+ short reset;
struct EffectorWeights *effector_weights;
} ClothSimSettings;
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 358cbb6e34c..6c7bda171eb 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -454,7 +454,7 @@ typedef enum eBConstraint_SpaceTypes {
CONSTRAINT_SPACE_LOCAL, /* = 1 */
/* for posechannels - pose space */
CONSTRAINT_SPACE_POSE, /* = 2 */
- /* for posechannels - local with parent */
+ /* for posechannels - local with parent */
CONSTRAINT_SPACE_PARLOCAL, /* = 3 */
/* for files from between 2.43-2.46 (should have been parlocal) */
CONSTRAINT_SPACE_INVALID, /* = 4. do not exchange for anything! */
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index cb458708b3e..1cf6b25c58f 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -81,16 +81,16 @@ typedef struct Lamp {
/* sun/sky */
short sun_effect_type;
short skyblendtype;
- float horizon_brightness;
- float spread;
- float sun_brightness;
- float sun_size;
- float backscattered_light;
- float sun_intensity;
+ float horizon_brightness;
+ float spread;
+ float sun_brightness;
+ float sun_size;
+ float backscattered_light;
+ float sun_intensity;
float atm_turbidity;
- float atm_inscattering_factor;
- float atm_extinction_factor;
- float atm_distance_factor;
+ float atm_inscattering_factor;
+ float atm_extinction_factor;
+ float atm_distance_factor;
float skyblendfac;
float sky_exposure;
short sky_colorspace, pad4;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 5d321fe49c2..44c1bdff876 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -65,6 +65,7 @@ typedef enum ModifierType {
eModifierType_Smoke,
eModifierType_ShapeKey,
eModifierType_Solidify,
+ eModifierType_Screw,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -167,31 +168,31 @@ typedef struct ArrayModifierData {
struct Object *offset_ob;
/* a constant duplicate offset;
1 means the duplicates are 1 unit apart
- */
+ */
float offset[3];
/* a scaled factor for duplicate offsets;
1 means the duplicates are 1 object-width apart
- */
+ */
float scale[3];
/* the length over which to distribute the duplicates */
float length;
/* the limit below which to merge vertices in adjacent duplicates */
float merge_dist;
/* determines how duplicate count is calculated; one of:
- MOD_ARR_FIXEDCOUNT -> fixed
- MOD_ARR_FITLENGTH -> calculated to fit a set length
- MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
- */
+ MOD_ARR_FIXEDCOUNT -> fixed
+ MOD_ARR_FITLENGTH -> calculated to fit a set length
+ MOD_ARR_FITCURVE -> calculated to fit the length of a Curve object
+ */
int fit_type;
/* flags specifying how total offset is calculated; binary OR of:
- MOD_ARR_OFF_CONST -> total offset += offset
- MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
- MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
+ MOD_ARR_OFF_CONST -> total offset += offset
+ MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
+ MOD_ARR_OFF_OBJ -> total offset += offset_ob's matrix
total offset is the sum of the individual enabled offsets
*/
int offset_type;
/* general flags:
- MOD_ARR_MERGE -> merge vertices in adjacent duplicates
+ MOD_ARR_MERGE -> merge vertices in adjacent duplicates
*/
int flags;
/* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
@@ -692,4 +693,22 @@ typedef struct SolidifyModifierData {
#define MOD_SOLIDIFY_EVEN (1<<1)
#define MOD_SOLIDIFY_NORMAL_CALC (1<<2)
+typedef struct ScrewModifierData {
+ ModifierData modifier;
+ struct Object *ob_axis;
+ int steps;
+ int render_steps;
+ int iter;
+ float screw_ofs;
+ float angle;
+ short axis;
+ short flag;
+} ScrewModifierData;
+
+#define MOD_SCREW_NORMAL_FLIP (1<<0)
+#define MOD_SCREW_NORMAL_CALC (1<<1)
+#define MOD_SCREW_OBJECT_OFFSET (1<<2)
+// #define MOD_SCREW_OBJECT_ANGLE (1<<4)
+
+
#endif
diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h
index fa918fc30d9..700021eaceb 100644
--- a/source/blender/makesdna/DNA_object_fluidsim.h
+++ b/source/blender/makesdna/DNA_object_fluidsim.h
@@ -63,8 +63,10 @@ typedef struct FluidsimSettings {
short viscosityExponent;
/* gravity strength */
float gravx,gravy,gravz;
- /* anim start end time */
+ /* anim start end time (in seconds) */
float animStart, animEnd;
+ /* bake start end time (in blender frames) */
+ int bakeStart, bakeEnd;
/* g star param (LBM compressibility) */
float gstar;
/* activate refinement? */
@@ -160,8 +162,10 @@ typedef struct FluidsimSettings {
#define OB_FSPART_FLOAT (1<<4)
#define OB_FSPART_TRACER (1<<5)
-// new fluid bit flags for fss->flags - dg
-#define OB_FLUIDSIM_REVERSE (1 << 0)
+// new fluid bit flags for fss->flags
+#define OB_FLUIDSIM_REVERSE (1 << 0)
+#define OB_FLUIDSIM_ACTIVE (1 << 1)
+#define OB_FLUIDSIM_OVERRIDE_TIME (1 << 2)
#ifdef __cplusplus
}
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 1df76a39d9d..29a188c0f92 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -266,7 +266,7 @@ typedef struct SoftBody {
/* springs */
float inspring; /* softbody inner springs */
float infrict; /* softbody inner springs friction */
- char namedVG_Spring_K[32]; /* along with it introduce Spring_K painting
+ char namedVG_Spring_K[32]; /* along with it introduce Spring_K painting
starting to fix old bug .. nastyness that VG are indexes
rather find them by name tag to find it -> jow20090613 */
@@ -286,7 +286,7 @@ typedef struct SoftBody {
float balldamp; /* cooling down collision response */
float ballstiff; /* pressure the ball is loaded with */
short sbc_mode;
- short aeroedge,
+ short aeroedge,
minloops,
maxloops,
choke,
@@ -302,11 +302,11 @@ typedef struct SoftBody {
struct ListBase ptcaches;
struct EffectorWeights *effector_weights;
- /* reverse esimated obmatrix .. no need to store in blend file .. how ever who cares */
+ /* reverse esimated obmatrix .. no need to store in blend file .. how ever who cares */
float lcom[3];
float lrot[3][3];
float lscale[3][3];
- char pad4[4];
+ char pad4[4];
} SoftBody;
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index c4d4363db81..b572c50a4ae 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -169,7 +169,7 @@ typedef struct Object {
float mass, damping, inertia;
/* The form factor k is introduced to give the user more control
* and to fix incompatibility problems.
- * For rotational symmetric objects, the inertia value can be
+ * For rotational symmetric objects, the inertia value can be
* expressed as: Theta = k * m * r^2
* where m = Mass, r = Radius
* For a Sphere, the form factor is by default = 0.4
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index bae6a1f1c8a..4e1b24a1b1d 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -224,7 +224,7 @@ typedef struct RenderData {
short dimensionspreset; /* for the dimensions presets menu */
- short filtertype; /* filter is box, tent, gauss, mitch, etc */
+ short filtertype; /* filter is box, tent, gauss, mitch, etc */
short size, maximsize; /* size in %, max in Kb */
/* from buttons: */
@@ -250,7 +250,7 @@ typedef struct RenderData {
/** Mode bits: */
/* 0: Enable backbuffering for images */
short bufflag;
- short quality;
+ short quality;
/**
* Render to image editor, fullscreen or to new window.
@@ -333,7 +333,7 @@ typedef struct RenderData {
/** post-production settings. Depricated, but here for upwards compat (initialized to 1) */
float postgamma, posthue, postsat;
- /* Dither noise intensity */
+ /* Dither noise intensity */
float dither_intensity;
/* Bake Render options */
@@ -539,9 +539,10 @@ typedef struct ImagePaintSettings {
} ImagePaintSettings;
typedef struct ParticleBrushData {
- short size, strength; /* common settings */
- short step, invert; /* for specific brushes only */
- int flag, pad;
+ short size; /* common setting */
+ short step, invert, count; /* for specific brushes only */
+ int flag;
+ float strength;
} ParticleBrushData;
typedef struct ParticleEditSettings {
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index ce165c0bac8..6d73c261f23 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -244,5 +244,9 @@ enum {
#define RGN_FLAG_HIDDEN 1
#define RGN_FLAG_TOO_SMALL 2
+/* region do_draw */
+#define RGN_DRAW 1
+#define RGN_DRAW_PARTIAL 2
+
#endif
diff --git a/source/blender/makesdna/DNA_sdna_types.h b/source/blender/makesdna/DNA_sdna_types.h
index d13edb99f07..9b486e2851d 100644
--- a/source/blender/makesdna/DNA_sdna_types.h
+++ b/source/blender/makesdna/DNA_sdna_types.h
@@ -48,7 +48,7 @@ typedef struct SDNA {
int nr_structs; /* number of struct types */
short **structs; /* sp= structs[a] is the adress of a struct definintion
- sp[0] is struct type number, sp[1] amount of members
+ sp[0] is struct type number, sp[1] amount of members
(sp[2], sp[3]), (sp[4], sp[5]), .. are the member
type and name numbers respectively */
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
index 41476c81c85..3bbcb128f07 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -75,21 +75,21 @@ typedef struct bKeyboardSensor {
} bKeyboardSensor;
typedef struct bPropertySensor {
- int type;
- int pad;
+ int type;
+ int pad;
char name[32];
char value[32];
- char maxvalue[32];
+ char maxvalue[32];
} bPropertySensor;
typedef struct bActuatorSensor {
- int type;
- int pad;
+ int type;
+ int pad;
char name[32];
} bActuatorSensor;
typedef struct bDelaySensor {
- short delay;
+ short delay;
short duration;
short flag;
short pad;
@@ -101,7 +101,7 @@ typedef struct bCollisionSensor {
// struct Material *ma; // XXX remove materialName
short damptimer, damp;
short mode; /* flag to choose material or property */
- short pad2;
+ short pad2;
} bCollisionSensor;
typedef struct bRadarSensor {
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 1a73588d6eb..2fd83742367 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -207,7 +207,7 @@ typedef struct GlowVars {
float fMini; /* Minimum intensity to trigger a glow */
float fClamp;
float fBoost; /* Amount to multiply glow intensity */
- float dDist; /* Radius of glow blurring */
+ float dDist; /* Radius of glow blurring */
int dQuality;
int bNoComp; /* SHOW/HIDE glow buffer */
} GlowVars;
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 0ea64765198..e2c263dd5f1 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -260,6 +260,7 @@ typedef struct SpaceImage {
struct bGPdata *gpd; /* grease pencil data */
struct Histogram hist; /* viewer histogram */
+ struct Histogram sample_line_hist; /* sample line histogram */
} SpaceImage;
typedef struct SpaceNla {
@@ -769,7 +770,7 @@ enum {
#define ST_SCROLL_SELECT 0x0001 // scrollable
#define ST_CLEAR_NAMESPACE 0x0010 // clear namespace after script
- // execution (see BPY_main.c)
+ // execution (see BPY_main.c)
#define ST_FIND_WRAP 0x0020
#define ST_FIND_ALL 0x0040
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 5d80936d2cc..2c5c50d7dc2 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -170,7 +170,7 @@ typedef struct PointDensity {
short noise_depth;
short noise_influence;
short noise_basis;
- short pdpad3[3];
+ short pdpad3[3];
float noise_fac;
float speed_scale;
diff --git a/source/blender/makesdna/DNA_vec_types.h b/source/blender/makesdna/DNA_vec_types.h
index 4a6f7f3a3cc..5d6f1039ed5 100644
--- a/source/blender/makesdna/DNA_vec_types.h
+++ b/source/blender/makesdna/DNA_vec_types.h
@@ -78,13 +78,13 @@ typedef struct vec4d {
#endif
typedef struct rcti {
- int xmin, xmax;
- int ymin, ymax;
+ int xmin, xmax;
+ int ymin, ymax;
} rcti;
typedef struct rctf {
- float xmin, xmax;
- float ymin, ymax;
+ float xmin, xmax;
+ float ymin, ymax;
} rctf;
#endif
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 60aba105ff4..c5516a3bff5 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -63,14 +63,14 @@ struct wmTimer;
/* Background Picture in 3D-View */
typedef struct BGpic {
- struct BGpic *next, *prev;
+ struct BGpic *next, *prev;
- struct Image *ima;
+ struct Image *ima;
struct ImageUser iuser;
- float xof, yof, size, blend;
- short view;
- short flag;
- float pad2;
+ float xof, yof, size, blend;
+ short view;
+ short flag;
+ float pad2;
} BGpic;
/* ********************************* */
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 9379fdf7288..5f098f471d4 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -336,8 +336,8 @@ int add_name(char *str)
/*
* Put )(void) at the end? Maybe )(). Should check this with
- * old sdna. Actually, sometimes )(), sometimes )(void...)
- * Alas.. such is the nature of braindamage :(
+ * old sdna. Actually, sometimes )(), sometimes )(void...)
+ * Alas.. such is the nature of braindamage :(
*
* Sorted it out: always do )(), except for headdraw and
* windraw, part of ScrArea. This is important, because some
@@ -921,7 +921,7 @@ int make_structDNA(char *baseDirectory, FILE *file)
if (debugSDNA) printf("\tStart of header scan:\n");
for (i = 0; strlen(includefiles[i]); i++) {
sprintf(str, "%s%s", baseDirectory, includefiles[i]);
- if (debugSDNA) printf("\t|-- Converting %s\n", str);
+ if (debugSDNA) printf("\t|-- Converting %s\n", str);
if (convert_include(str)) {
return (1);
}
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index f9e3b0620b6..2207a9d035e 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -384,6 +384,7 @@ extern StructRNA RNA_SceneGameData;
extern StructRNA RNA_SceneRenderLayer;
extern StructRNA RNA_SceneSequence;
extern StructRNA RNA_Screen;
+extern StructRNA RNA_ScrewModifier;
extern StructRNA RNA_Sculpt;
extern StructRNA RNA_Sensor;
extern StructRNA RNA_Sequence;
@@ -765,10 +766,10 @@ char *RNA_path_append(const char *path, PointerRNA *ptr, PropertyRNA *prop,
char *RNA_path_back(const char *path);
int RNA_path_resolve(PointerRNA *ptr, const char *path,
- PointerRNA *r_ptr, PropertyRNA **r_prop);
+ PointerRNA *r_ptr, PropertyRNA **r_prop);
int RNA_path_resolve_full(PointerRNA *ptr, const char *path,
- PointerRNA *r_ptr, PropertyRNA **r_prop, int *index);
+ PointerRNA *r_ptr, PropertyRNA **r_prop, int *index);
char *RNA_path_from_ID_to_struct(PointerRNA *ptr);
char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop);
@@ -891,6 +892,8 @@ const struct ListBase *RNA_function_defined_parameters(FunctionRNA *func);
ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, FunctionRNA *func);
void RNA_parameter_list_free(ParameterList *parms);
int RNA_parameter_list_size(ParameterList *parms);
+int RNA_parameter_list_arg_count(ParameterList *parms);
+int RNA_parameter_list_ret_count(ParameterList *parms);
void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter);
void RNA_parameter_list_next(ParameterIterator *iter);
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index 9ccab8394e9..6adad6aa92c 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -73,6 +73,8 @@ extern EnumPropertyItem unpack_method_items[];
extern EnumPropertyItem object_type_items[];
+extern EnumPropertyItem object_type_curve_items[];
+
extern EnumPropertyItem space_type_items[];
extern EnumPropertyItem keymap_propvalue_items[];
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 77eff6ad4c5..6eecd091b7f 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -245,8 +245,10 @@ typedef struct ParameterList {
/* storage for parameters */
void *data;
- /* store the parameter count */
- int tot;
+ /* store the parameter size */
+ int alloc_size;
+
+ int arg_count, ret_count;
/* function passed at creation time */
struct FunctionRNA *func;
@@ -340,6 +342,7 @@ typedef struct ExtensionRNA {
#define MainActions Main
#define MainGroups Main
#define MainTextures Main
+#define MainCurves Main
#ifdef __cplusplus
}
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 6d3d78907f1..c9db05c30b1 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -30,9 +30,7 @@
#include "MEM_guardedalloc.h"
-#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -2294,8 +2292,8 @@ static void rna_generate(BlenderRNA *brna, FILE *f, char *filename, char *api_fi
FunctionDefRNA *dfunc;
fprintf(f, "\n/* Automatically generated struct definitions for the Data API.\n"
- " Do not edit manually, changes will be overwritten. */\n\n"
- "#define RNA_RUNTIME\n\n");
+ " Do not edit manually, changes will be overwritten. */\n\n"
+ "#define RNA_RUNTIME\n\n");
fprintf(f, "#include <float.h>\n");
fprintf(f, "#include <limits.h>\n");
@@ -2370,7 +2368,7 @@ static void rna_generate_header(BlenderRNA *brna, FILE *f)
fprintf(f, "#define __RNA_BLENDER_H__\n\n");
fprintf(f, "/* Automatically generated function declarations for the Data API.\n"
- " Do not edit manually, changes will be overwritten. */\n\n");
+ " Do not edit manually, changes will be overwritten. */\n\n");
fprintf(f, "#include \"RNA_types.h\"\n\n");
@@ -2525,7 +2523,7 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
fprintf(f, "#define __RNA_BLENDER_CPP_H__\n\n");
fprintf(f, "/* Automatically generated classes for the Data API.\n"
- " Do not edit manually, changes will be overwritten. */\n\n");
+ " Do not edit manually, changes will be overwritten. */\n\n");
fprintf(f, "#include \"RNA_blender.h\"\n");
fprintf(f, "#include \"RNA_types.h\"\n");
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index aa6414e854d..3263d816ad0 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -27,7 +27,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 672ca5d7b90..c110b89a818 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -47,7 +47,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
/* flush updates */
#include "DNA_object_types.h"
@@ -3758,15 +3757,24 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr,
{
PropertyRNA *parm;
void *data;
- int tot= 0, size;
+ int alloc_size= 0, size;
+ parms->arg_count= 0;
+ parms->ret_count= 0;
+
/* allocate data */
- for(parm= func->cont.properties.first; parm; parm= parm->next)
- tot+= rna_parameter_size_alloc(parm);
+ for(parm= func->cont.properties.first; parm; parm= parm->next) {
+ alloc_size += rna_parameter_size_alloc(parm);
+
+ if(parm->flag & PROP_OUTPUT)
+ parms->ret_count++;
+ else
+ parms->arg_count++;
+ }
- parms->data= MEM_callocN(tot, "RNA_parameter_list_create");
+ parms->data= MEM_callocN(alloc_size, "RNA_parameter_list_create");
parms->func= func;
- parms->tot= tot;
+ parms->alloc_size= alloc_size;
/* set default values */
data= parms->data;
@@ -3840,7 +3848,17 @@ void RNA_parameter_list_free(ParameterList *parms)
int RNA_parameter_list_size(ParameterList *parms)
{
- return parms->tot;
+ return parms->alloc_size;
+}
+
+int RNA_parameter_list_arg_count(ParameterList *parms)
+{
+ return parms->arg_count;
+}
+
+int RNA_parameter_list_ret_count(ParameterList *parms)
+{
+ return parms->ret_count;
}
void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter)
@@ -4146,7 +4164,7 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop
if(prop->flag & PROP_RNAPTR) {
*((PointerRNA*)dest)= *((PointerRNA*)src);
break;
- }
+ }
if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) {
fprintf(stderr, "%s.%s: wrong type for parameter %s, an object of type %s was expected, passed an object of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna));
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index e642d9546e8..2f0f9f40b85 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_action_api.c b/source/blender/makesrna/intern/rna_action_api.c
index b09e91f1119..0304ef2b0bd 100644
--- a/source/blender/makesrna/intern/rna_action_api.c
+++ b/source/blender/makesrna/intern/rna_action_api.c
@@ -30,7 +30,6 @@
#include <time.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "DNA_action_types.h"
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index c24b6b99c59..004b5eef571 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index ebb251c32ca..75cf06b5b2d 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -26,7 +26,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -177,13 +176,13 @@ static StructRNA *rna_KeyingSetInfo_register(const bContext *C, ReportList *repo
if (validate(&dummyptr, data, have_function) != 0)
return NULL;
- if (strlen(identifier) >= sizeof(dummyksi.name)) {
- BKE_reportf(reports, RPT_ERROR, "registering keying set info class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummyksi.name));
+ if (strlen(identifier) >= sizeof(dummyksi.idname)) {
+ BKE_reportf(reports, RPT_ERROR, "registering keying set info class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummyksi.idname));
return NULL;
}
/* check if we have registered this info before, and remove it */
- ksi = ANIM_keyingset_info_find_named(dummyksi.name);
+ ksi = ANIM_keyingset_info_find_named(dummyksi.idname);
if (ksi && ksi->ext.srna)
rna_KeyingSetInfo_unregister(C, ksi->ext.srna);
@@ -192,7 +191,7 @@ static StructRNA *rna_KeyingSetInfo_register(const bContext *C, ReportList *repo
memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo));
/* set RNA-extensions info */
- ksi->ext.srna= RNA_def_struct(&BLENDER_RNA, ksi->name, "KeyingSetInfo");
+ ksi->ext.srna= RNA_def_struct(&BLENDER_RNA, ksi->idname, "KeyingSetInfo");
ksi->ext.data= data;
ksi->ext.call= call;
ksi->ext.free= free;
@@ -270,14 +269,6 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
/* ****************************** */
-static int rna_KeyingSet_typeinfo_name_editable(PointerRNA *ptr)
-{
- KeyingSet *ks= (KeyingSet *)ptr->data;
-
- /* only editable if we're using relative paths */
- return ((ks->flag & KEYINGSET_ABSOLUTE)==0);
-}
-
static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr)
{
KeyingSet *ks= (KeyingSet *)ptr->data;
@@ -320,6 +311,17 @@ static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, i
*max= MAX2(0, *max);
}
+static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr)
+{
+ KeyingSet *ks= (KeyingSet *)ptr->data;
+ KeyingSetInfo *ksi = NULL;
+
+ /* keying set info is only for builtin Keying Sets */
+ if ((ks->flag & KEYINGSET_ABSOLUTE)==0)
+ ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
+ return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetInfo, ksi);
+}
+
#else
/* helper function for Keying Set -> keying settings */
@@ -354,7 +356,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
srna= RNA_def_struct(brna, "KeyingSetInfo", NULL);
RNA_def_struct_sdna(srna, "KeyingSetInfo");
- RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for relative Keying Sets");
+ RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for builtin Keying Sets");
RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine");
RNA_def_struct_register_funcs(srna, "rna_KeyingSetInfo_register", "rna_KeyingSetInfo_unregister");
@@ -362,18 +364,17 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
RNA_define_verify_sdna(0); // not in sdna
- /* Name */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "idname");
+ RNA_def_property_flag(prop, PROP_REGISTER);
+
+ /* Name */
+ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "bl_builtin", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "builtin", 1);
- RNA_def_property_ui_text(prop, "BuiltIn", "Keying Set type is required internally.");
- RNA_def_property_flag(prop, PROP_REGISTER);
-
rna_def_common_keying_flags(srna, 1); /* '1' arg here is to indicate that we need these to be set on registering */
RNA_define_verify_sdna(1);
@@ -471,14 +472,14 @@ static void rna_def_keyingset(BlenderRNA *brna)
/* Name */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_struct_ui_icon(srna, ICON_KEY_HLT); // TODO: we need a dedicated icon
RNA_def_struct_name_property(srna, prop);
- /* TypeInfo associated with Relative KeyingSet (only) */
- prop= RNA_def_property(srna, "typeinfo_name", PROP_STRING, PROP_NONE);
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_string_sdna(prop, NULL, "typeinfo");
- RNA_def_property_editable_func(prop, "rna_KeyingSet_typeinfo_name_editable");
- RNA_def_property_ui_text(prop, "TypeInfo Name", "");
+ /* KeyingSetInfo (Type Info) for Builtin Sets only */
+ prop= RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyingSetInfo");
+ RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for builtin Keying Sets");
/* Paths */
prop= RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE);
@@ -501,7 +502,7 @@ static void rna_def_keyingset(BlenderRNA *brna)
/* Flags */
prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE);
- RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
+ RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
/* Keyframing Flags */
rna_def_common_keying_flags(srna, 0);
diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c
index 659a30792bb..ba06697f9e9 100644
--- a/source/blender/makesrna/intern/rna_animation_api.c
+++ b/source/blender/makesrna/intern/rna_animation_api.c
@@ -31,7 +31,6 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
-#include "RNA_types.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
@@ -42,19 +41,20 @@
#include "BKE_animsys.h"
static KS_Path *rna_KeyingSet_add_path(KeyingSet *keyingset, ReportList *reports,
- ID *id, char rna_path[], int array_index, int entire_array,
- int grouping_method, char group_name[])
+ ID *id, char rna_path[], int index, int grouping_method, char group_name[])
{
KS_Path *ksp = NULL;
short flag = 0;
- /* validate flags */
- if (entire_array)
+ /* special case when index = -1, we key the whole array (as with other places where index is used) */
+ if (index == -1) {
flag |= KSP_FLAG_WHOLE_ARRAY;
+ index = 0;
+ }
/* if data is valid, call the API function for this */
if (keyingset) {
- ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, array_index, flag, grouping_method);
+ ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, grouping_method);
keyingset->active_path= BLI_countlist(&keyingset->paths);
}
else {
@@ -81,6 +81,26 @@ static void rna_KeyingSet_remove_path(KeyingSet *keyingset, ReportList *reports,
}
}
+static void rna_KeyingSet_remove_all_paths(KeyingSet *keyingset, ReportList *reports)
+{
+ /* if data is valid, call the API function for this */
+ if (keyingset) {
+ KS_Path *ksp, *kspn;
+
+ /* free each path as we go to avoid looping twice */
+ for (ksp= keyingset->paths.first; ksp; ksp= kspn) {
+ kspn= ksp->next;
+ BKE_keyingset_free_path(keyingset, ksp);
+ }
+
+ /* reset the active path, since there aren't any left */
+ keyingset->active_path = 0;
+ }
+ else {
+ BKE_report(reports, RPT_ERROR, "Keying Set Paths could not be removed.");
+ }
+}
+
#else
void RNA_api_keyingset(StructRNA *srna)
@@ -101,9 +121,8 @@ void RNA_api_keyingset(StructRNA *srna)
/* rna-path */
parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm=RNA_def_int(func, "array_index", 0, 0, INT_MAX, "Array Index", "If applicable, the index ", 0, INT_MAX);
- /* flags */
- parm=RNA_def_boolean(func, "entire_array", 1, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used.");
+ /* index (defaults to -1 for entire array) */
+ parm=RNA_def_int(func, "index", -1, 0, INT_MAX, "Index", "The index of the destination property (i.e. axis of Location/Rotation/etc.), or -1 for the entire array.", 0, INT_MAX);
/* grouping */
parm=RNA_def_enum(func, "grouping_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use.");
parm=RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name).");
@@ -115,6 +134,11 @@ void RNA_api_keyingset(StructRNA *srna)
/* path to remove */
parm= RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ /* Remove All Paths */
+ func= RNA_def_function(srna, "remove_all_paths", "rna_KeyingSet_remove_all_paths");
+ RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c
index 90267a76edc..9be14f8e2cf 100644
--- a/source/blender/makesrna/intern/rna_animviz.c
+++ b/source/blender/makesrna/intern/rna_animviz.c
@@ -24,10 +24,7 @@
#include <stdlib.h>
-#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
-#include "RNA_enum_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index d994a1c20be..e592f930778 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c
index 0f38486a6fc..cd78bd6e578 100644
--- a/source/blender/makesrna/intern/rna_armature_api.c
+++ b/source/blender/makesrna/intern/rna_armature_api.c
@@ -30,7 +30,6 @@
#include <time.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#ifdef RNA_RUNTIME
@@ -38,7 +37,6 @@
#include "BLI_blenlib.h"
-#include "ED_armature.h"
void rna_EditBone_align_roll(EditBone *ebo, float *no)
{
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index 063e20a73b7..ddf9cf1aeda 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -32,7 +32,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index df08dc7b861..fff29ba8f56 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -367,7 +366,7 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Flip", "");
/* XXX: Tool (this will be for pressing a modifier key for a different brush,
- e.g. switching to a Smooth brush in the middle of the stroke */
+ e.g. switching to a Smooth brush in the middle of the stroke */
}
void RNA_def_brush(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 2776289b6f0..c4dc461ad38 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 4ecb93eb1d6..7dcdd92a90a 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -26,7 +26,6 @@
#include <limits.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index dc395e6ccc3..daf3f73a3d7 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -26,7 +26,6 @@
#include <stdio.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "DNA_color_types.h"
@@ -276,12 +275,12 @@ static void rna_ColorRamp_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_def_curvemappoint(BlenderRNA *brna)
{
StructRNA *srna;
- PropertyRNA *prop;
+ PropertyRNA *prop;
static EnumPropertyItem prop_handle_type_items[] = {
- {0, "AUTO", 0, "Auto Handle", ""},
- {CUMA_VECTOR, "VECTOR", 0, "Vector Handle", ""},
+ {0, "AUTO", 0, "Auto Handle", ""},
+ {CUMA_VECTOR, "VECTOR", 0, "Vector Handle", ""},
{0, NULL, 0, NULL, NULL}
- };
+ };
srna= RNA_def_struct(brna, "CurveMapPoint", NULL);
RNA_def_struct_ui_text(srna, "CurveMapPoint", "Point of a curve used for a curve mapping");
@@ -308,12 +307,12 @@ static void rna_def_curvemappoint(BlenderRNA *brna)
static void rna_def_curvemap(BlenderRNA *brna)
{
StructRNA *srna;
- PropertyRNA *prop;
+ PropertyRNA *prop;
static EnumPropertyItem prop_extend_items[] = {
- {0, "HORIZONTAL", 0, "Horizontal", ""},
- {CUMA_EXTEND_EXTRAPOLATE, "EXTRAPOLATED", 0, "Extrapolated", ""},
+ {0, "HORIZONTAL", 0, "Horizontal", ""},
+ {CUMA_EXTEND_EXTRAPOLATE, "EXTRAPOLATED", 0, "Extrapolated", ""},
{0, NULL, 0, NULL, NULL}
- };
+ };
srna= RNA_def_struct(brna, "CurveMap", NULL);
RNA_def_struct_ui_text(srna, "CurveMap", "Curve in a curve mapping");
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 68a29fe9c83..5eb41136350 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -104,7 +103,6 @@ EnumPropertyItem constraint_ik_axisref_items[] ={
#include "BKE_context.h"
#include "BKE_depsgraph.h"
-#include "ED_object.h"
static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
{
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index 27808b7d1bf..9ee2ca1a322 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -29,7 +29,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "BKE_context.h"
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index 0c1d3d69283..67c7bd0f2d8 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -50,7 +49,7 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
return &RNA_XorController;
case CONT_LOGIC_XNOR:
return &RNA_XnorController;
- case CONT_EXPRESSION:
+ case CONT_EXPRESSION:
return &RNA_ExpressionController;
case CONT_PYTHON:
return &RNA_PythonController;
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 579ebfc9332..39ca6351543 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -1017,12 +1016,12 @@ static void rna_def_curve(BlenderRNA *brna)
prop= RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
RNA_def_property_range(prop, 0, INT_MAX);
- RNA_def_property_ui_range(prop, 1, 64, 1, 0);
+ RNA_def_property_ui_range(prop, 0, 64, 1, 0);
RNA_def_property_ui_text(prop, "Render Resolution U", "Surface resolution in U direction used while rendering. Zero skips this property");
prop= RNA_def_property(srna, "render_resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv_ren");
- RNA_def_property_ui_range(prop, 1, 64, 1, 0);
+ RNA_def_property_ui_range(prop, 0, 64, 1, 0);
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering. Zero skips this property");
@@ -1096,7 +1095,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "Spline", NULL);
- RNA_def_struct_sdna(srna, "Nurb");
+ RNA_def_struct_sdna(srna, "Nurb");
RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either Nurbs, Bezier or Polyline or a character with text objects");
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 7629387d4fe..373151fb369 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -34,9 +34,7 @@
#include "DNA_genfile.h"
#include "DNA_sdna_types.h"
-#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "BLI_ghash.h"
#include "BLI_string.h"
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index fcd5bb858c7..a237edc330a 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -26,7 +26,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_fcurve_api.c b/source/blender/makesrna/intern/rna_fcurve_api.c
index 2f221663540..27deb242d73 100644
--- a/source/blender/makesrna/intern/rna_fcurve_api.c
+++ b/source/blender/makesrna/intern/rna_fcurve_api.c
@@ -30,7 +30,6 @@
#include <time.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "DNA_anim_types.h"
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index c14c7ee365b..0782ee4fb84 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -173,6 +172,7 @@ static void rna_def_fluidsim_slip(StructRNA *srna)
prop= RNA_def_property(srna, "slip_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "typeFlags");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, slip_items);
RNA_def_property_ui_text(prop, "Slip Type", "");
@@ -216,16 +216,6 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Preview Resolution", "Preview resolution in X,Y and Z direction");
- prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
- RNA_def_property_float_sdna(prop, NULL, "animStart");
- RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame");
-
- prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
- RNA_def_property_float_sdna(prop, NULL, "animEnd");
- RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame");
-
prop= RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode");
RNA_def_property_enum_items(prop, quality_items);
@@ -253,13 +243,31 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain");
/* advanced settings */
-
prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "gravx");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction");
-
+
+ prop= RNA_def_property(srna, "override_time", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME);
+ RNA_def_property_ui_text(prop, "Override Time", "Use a custom start and end time (in seconds) instead of the scene's timeline");
+
+ prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
+ RNA_def_property_float_sdna(prop, NULL, "animStart");
+ RNA_def_property_range(prop, 0, 100);
+ RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame");
+
+ prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
+ RNA_def_property_float_sdna(prop, NULL, "animEnd");
+ RNA_def_property_range(prop, 0, 100);
+ RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame");
+
+ prop= RNA_def_property(srna, "real_world_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "realsize");
+ RNA_def_property_range(prop, 0.001, 10);
+ RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres");
+
prop= RNA_def_property(srna, "viscosity_preset", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "viscosityMode");
RNA_def_property_enum_items(prop, viscosity_items);
@@ -275,18 +283,15 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Viscosity Exponent", "Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6.)");
- prop= RNA_def_property(srna, "real_world_size", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "realsize");
- RNA_def_property_range(prop, 0.001, 10);
- RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres");
-
prop= RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxRefine");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -1, 4);
RNA_def_property_ui_text(prop, "Grid Levels", "Number of coarsened grids to use (-1 for automatic)");
prop= RNA_def_property(srna, "compressibility", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gstar");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_text(prop, "Compressibility", "Allowed compressibility due to gravitational force for standing fluid. (directly affects simulation step size)");
@@ -296,27 +301,32 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
prop= RNA_def_property(srna, "surface_smoothing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, 5.0);
RNA_def_property_ui_text(prop, "Surface Smoothing", "Amount of surface smoothing. A value of 0 is off, 1 is normal smoothing and more than 1 is extra smoothing");
prop= RNA_def_property(srna, "surface_subdivisions", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "surfaceSubdivs");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions. This is necessary for the inclusion of particles into the surface generation. Warning - can lead to longer computation times!");
prop= RNA_def_property(srna, "generate_speed_vectors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur");
/* particles */
prop= RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "generateTracers");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Tracer Particles", "Number of tracer particles to generate");
prop= RNA_def_property(srna, "generate_particles", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "generateParticles");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Generate Particles", "Amount of particles to generate (0=off, 1=normal, >1=more)");
}
@@ -333,14 +343,25 @@ static void rna_def_fluidsim_volume(StructRNA *srna)
prop= RNA_def_property(srna, "volume_initialization", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "volumeInitType");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, volume_type_items);
RNA_def_property_ui_text(prop, "Volume Initialization", "Volume initialization type");
prop= RNA_def_property(srna, "export_animated_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "domainNovecgen", 0);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Export Animated Mesh", "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it");
}
+static void rna_def_fluidsim_active(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_ACTIVE);
+ RNA_def_property_ui_text(prop, "Active", "Object contributes to the fluid simulation");
+}
+
static void rna_def_fluidsim_fluid(BlenderRNA *brna)
{
StructRNA *srna;
@@ -350,8 +371,9 @@ static void rna_def_fluidsim_fluid(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Fluid Fluid Simulation Settings", "Fluid simulation settings for the fluid in the simulation");
+ rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna);
-
+
prop= RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "iniVelx");
RNA_def_property_array(prop, 3);
@@ -364,15 +386,17 @@ static void rna_def_fluidsim_obstacle(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ObstacleFluidSettings", "FluidSettings");
+ srna= RNA_def_struct(brna, "ObstacleFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Obstacle Fluid Simulation Settings", "Fluid simulation settings for obstacles in the simulation");
+ rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna);
rna_def_fluidsim_slip(srna);
prop= RNA_def_property(srna, "impact_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -2.0, 10.0);
RNA_def_property_ui_text(prop, "Impact Factor", "This is an unphysical value for moving objects - it controls the impact an obstacle has on the fluid, =0 behaves a bit like outflow (deleting fluid), =1 is default, while >1 results in high forces. Can be used to tweak total mass");
}
@@ -382,10 +406,11 @@ static void rna_def_fluidsim_inflow(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "InflowFluidSettings", "FluidSettings");
+ srna= RNA_def_struct(brna, "InflowFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Inflow Fluid Simulation Settings", "Fluid simulation settings for objects adding fluids in the simulation");
+ rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna);
prop= RNA_def_property(srna, "inflow_velocity", PROP_FLOAT, PROP_VELOCITY);
@@ -395,6 +420,7 @@ static void rna_def_fluidsim_inflow(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Inflow Velocity", "Initial velocity of fluid");
prop= RNA_def_property(srna, "local_coordinates", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSINFLOW_LOCALCOORD);
RNA_def_property_ui_text(prop, "Local Coordinates", "Use local coordinates for inflow. (e.g. for rotating objects)");
}
@@ -403,10 +429,11 @@ static void rna_def_fluidsim_outflow(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "OutflowFluidSettings", "FluidSettings");
+ srna= RNA_def_struct(brna, "OutflowFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Outflow Fluid Simulation Settings", "Fluid simulation settings for objects removing fluids from the simulation");
+ rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna);
}
@@ -415,7 +442,7 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ParticleFluidSettings", "FluidSettings");
+ srna= RNA_def_struct(brna, "ParticleFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Particle Fluid Simulation Settings", "Fluid simulation settings for objects storing fluid particles generated by the simulation");
@@ -453,10 +480,12 @@ static void rna_def_fluidsim_control(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "ControlFluidSettings", "FluidSettings");
+ srna= RNA_def_struct(brna, "ControlFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Control Fluid Simulation Settings", "Fluid simulation settings for objects controlling the motion of fluid in the simulation");
+ rna_def_fluidsim_active(srna);
+
prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeStart");
RNA_def_property_range(prop, 0.0, 100.0);
@@ -489,11 +518,13 @@ static void rna_def_fluidsim_control(BlenderRNA *brna)
prop= RNA_def_property(srna, "quality", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cpsQuality");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 5.0, 100.0);
RNA_def_property_ui_text(prop, "Quality", "Specifies the quality which is used for object sampling. (higher = better but slower)");
prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse control object movement");
}
@@ -523,6 +554,7 @@ void RNA_def_fluidsim(BlenderRNA *brna)
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_fluid_type_items);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation");
RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type");
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 4e9d15b182d..a541015139f 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -25,8 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
-#include "RNA_enum_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index 8e8db26ffb3..e16d586b5fa 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index fdd79781d79..f009db229d3 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -181,7 +180,7 @@ static void rna_Image_size_get(PointerRNA *ptr,int *values)
values[0]= ibuf->x;
values[1]= ibuf->y;
}
- else {
+ else {
values[0]= 0;
values[1]= 0;
}
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index 3e5b6bd6030..aa2ed58623e 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -32,7 +32,6 @@
#include <time.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#ifdef RNA_RUNTIME
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index b53218b2d50..8c7e684b422 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -227,7 +226,7 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA
Nurb *nu;
int tot= kb->totelem, size= key->elemsize;
- if(GS(key->from->name) == ID_CU) {
+ if(GS(key->from->name) == ID_CU) {
cu= (Curve*)key->from;
nu= cu->nurb.first;
@@ -248,7 +247,7 @@ static int rna_ShapeKey_data_length(PointerRNA *ptr)
Nurb *nu;
int tot= kb->totelem;
- if(GS(key->from->name) == ID_CU) {
+ if(GS(key->from->name) == ID_CU) {
cu= (Curve*)key->from;
nu= cu->nurb.first;
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 5b9913ad311..fb5242f64f4 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -263,7 +262,7 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sun Size", "Sun size");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
- prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index b017bc830c9..e56cb2659f7 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 002494504b6..e51bea20f27 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -26,7 +26,6 @@
#include <string.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -235,42 +234,52 @@ static PointerRNA rna_Test_test_get(PointerRNA *ptr)
#else
-typedef void (*CollectionDefFunc)(struct BlenderRNA *brna, struct PropertyRNA *cprop);
+/* local convenience types */
+typedef void (CollectionDefFunc)(struct BlenderRNA *brna, struct PropertyRNA *cprop);
+
+typedef struct MainCollectionDef {
+ const char *identifier;
+ const char *type;
+ const char *iter_begin;
+ const char *name;
+ const char *description;
+ CollectionDefFunc *func;
+} MainCollectionDef;
void RNA_def_main(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- CollectionDefFunc func;
-
- const char *lists[][6]= {
- {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks.", (char *)RNA_def_main_cameras},
- {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", (char *)RNA_def_main_scenes},
- {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks.", (char *)RNA_def_main_objects},
- {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks.", (char *)RNA_def_main_materials},
- {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks.", (char *)RNA_def_main_node_groups},
- {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks.", (char *)RNA_def_main_meshes},
- {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks.", (char *)RNA_def_main_lamps},
- {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks.", (char *)RNA_def_main_libraries},
- {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks.", (char *)RNA_def_main_screens},
- {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks.", (char *)RNA_def_main_window_managers},
- {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks.", (char *)RNA_def_main_images},
- {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks.", (char *)RNA_def_main_lattices},
- {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks.", (char *)RNA_def_main_curves} ,
- {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks.", (char *)RNA_def_main_metaballs},
- {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks.", (char *)RNA_def_main_vfonts},
- {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks.", (char *)RNA_def_main_textures},
- {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", (char *)RNA_def_main_brushes},
- {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", (char *)RNA_def_main_worlds},
- {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", (char *)RNA_def_main_groups},
+ CollectionDefFunc *func;
+
+ MainCollectionDef lists[]= {
+ {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks.", RNA_def_main_cameras},
+ {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", RNA_def_main_scenes},
+ {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks.", RNA_def_main_objects},
+ {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks.", RNA_def_main_materials},
+ {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks.", RNA_def_main_node_groups},
+ {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks.", RNA_def_main_meshes},
+ {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks.", RNA_def_main_lamps},
+ {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks.", RNA_def_main_libraries},
+ {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks.", RNA_def_main_screens},
+ {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks.", 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} ,
+ {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks.", RNA_def_main_metaballs},
+ {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks.", RNA_def_main_vfonts},
+ {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks.", RNA_def_main_textures},
+ {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", RNA_def_main_brushes},
+ {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", RNA_def_main_worlds},
+ {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", RNA_def_main_groups},
/* {"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL}, */
- {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", (char *)NULL},
- {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", (char *)RNA_def_main_texts},
- {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", (char *)RNA_def_main_sounds},
- {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", (char *)RNA_def_main_armatures},
- {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", (char *)RNA_def_main_actions},
- {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", (char *)RNA_def_main_particles},
- {"gpencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", (char *)RNA_def_main_gpencil},
+ {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL},
+ {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", RNA_def_main_texts},
+ {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", RNA_def_main_sounds},
+ {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", RNA_def_main_armatures},
+ {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", RNA_def_main_actions},
+ {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", RNA_def_main_particles},
+ {"gpencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", RNA_def_main_gpencil},
{NULL, NULL, NULL, NULL, NULL, NULL}};
int i;
@@ -285,15 +294,15 @@ void RNA_def_main(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
- for(i=0; lists[i][0]; i++)
+ for(i=0; lists[i].name; i++)
{
- prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, lists[i][1]);
- RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
- RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]);
+ prop= RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, lists[i].type);
+ RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_ui_text(prop, lists[i].name, lists[i].description);
/* collection functions */
- func= (CollectionDefFunc *)lists[i][5];
+ func= lists[i].func;
if(func)
func(brna, prop);
}
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 9433294fdd3..d70962568e5 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -31,7 +31,6 @@
#include "RNA_define.h"
#include "RNA_access.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "BKE_utildefines.h"
@@ -54,6 +53,7 @@
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
+#include "DNA_curve_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
@@ -243,6 +243,20 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
/* XXX python now has invalid pointer? */
}
+Curve *rna_Main_curves_new(Main *bmain, char* name, int type)
+{
+ Curve *cu= add_curve(name, type);
+ cu->id.us--;
+ return cu;
+}
+void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
+{
+ if(ID_REAL_USERS(cu) <= 0)
+ free_libblock(&bmain->curve, cu);
+ else
+ BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d.", cu->id.name+2, ID_REAL_USERS(cu));
+}
+
Tex *rna_Main_textures_new(Main *bmain, char* name)
{
Tex *tex= add_texture(name);
@@ -508,7 +522,7 @@ void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
}
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
{
-
+
}
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -552,7 +566,29 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
}
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ RNA_def_property_srna(cprop, "MainCurves");
+ srna= RNA_def_struct(brna, "MainCurves", NULL);
+ RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
+ func= RNA_def_function(srna, "new", "rna_Main_curves_new");
+ RNA_def_function_ui_description(func, "Add a new curve to the main database");
+ parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve object to add");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove", "rna_Main_curves_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a curve from the current blendfile.");
+ parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
{
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 361aec5260c..b6a6f072c6b 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -648,8 +647,8 @@ static void rna_def_material_colors(StructRNA *srna)
{MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""},
{MA_RAMP_VAL, "VALUE", 0, "Value", ""},
{MA_RAMP_COLOR, "COLOR", 0, "Color", ""},
- {MA_RAMP_SOFT, "SOFT LIGHT", 0, "Soft Light", ""},
- {MA_RAMP_LINEAR, "LINEAR LIGHT", 0, "Linear Light", ""},
+ {MA_RAMP_SOFT, "SOFT LIGHT", 0, "Soft Light", ""},
+ {MA_RAMP_LINEAR, "LINEAR LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_ramp_input_items[] = {
diff --git a/source/blender/makesrna/intern/rna_material_api.c b/source/blender/makesrna/intern/rna_material_api.c
index 8511df208cf..03eba157bf3 100644
--- a/source/blender/makesrna/intern/rna_material_api.c
+++ b/source/blender/makesrna/intern/rna_material_api.c
@@ -30,7 +30,6 @@
#include <stdio.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "DNA_material_types.h"
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 2925c9cde3a..ce8001c8ecd 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -525,28 +524,28 @@ static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values)
static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
{
- Mesh *me= (Mesh*)ptr->id.data;
- CustomData *fdata= rna_mesh_fdata(me);
- CustomDataLayer *cdl;
- int a;
- size_t b;
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomData *fdata= rna_mesh_fdata(me);
+ CustomDataLayer *cdl;
+ int a;
+ size_t b;
- for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
- if(cdl->type == type) {
- b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
- if(b >= 0 && b < me->totface)
- return (me->mface[b].v4? 4: 3);
- }
- }
+ for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
+ if(cdl->type == type) {
+ b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
+ if(b >= 0 && b < me->totface)
+ return (me->mface[b].v4? 4: 3);
+ }
+ }
- return 0;
+ return 0;
}
static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
length[0]= rna_CustomDataData_numverts(ptr, CD_MTFACE);
length[1]= 2;
- return length[0]*length[1];
+ return length[0]*length[1];
}
static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values)
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index f07184608c8..1657e0e64d7 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -30,7 +30,6 @@
#include <stdio.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "BLO_sys_types.h"
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index 004e5fe0c6f..76c64c374f2 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 69370b63362..8d253ac47b8 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -37,6 +36,8 @@
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
+#include "BLI_math.h"
+
#include "BKE_animsys.h"
#include "BKE_bmesh.h" /* For BevelModifierData */
#include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
@@ -54,6 +55,7 @@ EnumPropertyItem modifier_type_items[] ={
{eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
{eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
{eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
+ {eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
{eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
{eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
{eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
@@ -164,6 +166,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
return &RNA_SmokeModifier;
case eModifierType_Solidify:
return &RNA_SolidifyModifier;
+ case eModifierType_Screw:
+ return &RNA_ScrewModifier;
default:
return &RNA_Modifier;
}
@@ -204,7 +208,7 @@ static void rna_Modifier_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
rna_Modifier_update(bmain, scene, ptr);
- DAG_scene_sort(scene);
+ DAG_scene_sort(scene);
}
static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -492,7 +496,7 @@ static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value)
{
Object **ob= (Object**)ptr->data;
- if(*ob)
+ if(*ob)
id_us_min((ID*)*ob);
if(value.data)
id_us_plus((ID*)value.data);
@@ -1191,6 +1195,7 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "EdgeSplitModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT);
+ // XXX, convert to radians.
prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 180);
RNA_def_property_ui_range(prop, 0, 180, 100, 2);
@@ -2069,6 +2074,85 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_NORMAL_CALC);
RNA_def_property_ui_text(prop, "High Quality Normals", "Calculate normals which result in more even thickness (slow, disable when not needed)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+}
+
+static void rna_def_modifier_screw(BlenderRNA *brna)
+{
+ static EnumPropertyItem axis_items[]= {
+ {0, "X", 0, "X Axis", ""},
+ {1, "Y", 0, "Y Axis", ""},
+ {2, "Z", 0, "Z Axis", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ScrewModifier", "Modifier");
+ RNA_def_struct_ui_text(srna, "Screw Modifier", "Revolve edges");
+ RNA_def_struct_sdna(srna, "ScrewModifierData");
+ RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW);
+
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "ob_axis");
+ RNA_def_property_ui_text(prop, "Object", "Object to define the screw axis");
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
+ RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
+
+ prop= RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_range(prop, 2, 10000);
+ RNA_def_property_ui_range(prop, 2, 512, 1, 0);
+ RNA_def_property_ui_text(prop, "Steps", "Number of steps in the revolution");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "render_steps", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_range(prop, 2, 10000);
+ RNA_def_property_ui_range(prop, 2, 512, 1, 0);
+ RNA_def_property_ui_text(prop, "Render Steps", "Number of steps in the revolution");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "iter");
+ RNA_def_property_range(prop, 1, 10000);
+ RNA_def_property_ui_range(prop, 1, 100, 1, 0);
+ RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply the screw operation");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, axis_items);
+ RNA_def_property_ui_text(prop, "Axis", "Screw axis");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_ui_range(prop, 0, -M_PI*2, M_PI*2, 2);
+ RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Angle", "Angle of revolution");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "screw_offset", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "screw_ofs");
+ RNA_def_property_ui_text(prop, "Screw", "Offset the revolution along its axis");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "use_normal_flip", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_FLIP);
+ RNA_def_property_ui_text(prop, "Flip", "Flip normals of lathed faces");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "use_normal_calculate", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_CALC);
+ RNA_def_property_ui_text(prop, "Calc Order", "Calculate the order of edges (needed for meshes, but not curves)");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "use_object_screw_offset", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_OFFSET);
+ RNA_def_property_ui_text(prop, "Object Screw", "Use the distance between the objects to make a screw");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ /*prop= RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_ANGLE);
+ RNA_def_property_ui_text(prop, "Object Angle", "Use the angle between the objects rather then the fixed angle");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");*/
}
void RNA_def_modifier(BlenderRNA *brna)
@@ -2160,6 +2244,7 @@ void RNA_def_modifier(BlenderRNA *brna)
rna_def_modifier_surface(brna);
rna_def_modifier_smoke(brna);
rna_def_modifier_solidify(brna);
+ rna_def_modifier_screw(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index b3f4aab7599..e3a31414356 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 81579293402..6a30a78cd02 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -25,9 +25,7 @@
#include <stdlib.h>
#include <string.h>
-#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -1929,7 +1927,8 @@ static void def_cmp_colorbalance(StructRNA *srna)
prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "lift");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
+ RNA_def_property_float_array_default(prop, default_1);
+ RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_ui_text(prop, "Lift", "Correction for Shadows");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 21a1b7994a5..3823af25619 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -27,7 +27,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -76,12 +75,17 @@ static EnumPropertyItem collision_bounds_items[] = {
//{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
{0, NULL, 0, NULL, NULL}};
+/* used for 2 enums */
+#define OBTYPE_CU_CURVE {OB_CURVE, "CURVE", 0, "Curve", ""}
+#define OBTYPE_CU_SURF {OB_SURF, "SURFACE", 0, "Surface", ""}
+#define OBTYPE_CU_TEXT {OB_FONT, "TEXT", 0, "Text", ""}
+
EnumPropertyItem object_type_items[] = {
{OB_MESH, "MESH", 0, "Mesh", ""},
- {OB_CURVE, "CURVE", 0, "Curve", ""},
- {OB_SURF, "SURFACE", 0, "Surface", ""},
+ OBTYPE_CU_CURVE,
+ OBTYPE_CU_SURF,
{OB_MBALL, "META", 0, "Meta", ""},
- {OB_FONT, "TEXT", 0, "Text", ""},
+ OBTYPE_CU_TEXT,
{0, "", 0, NULL, NULL},
{OB_ARMATURE, "ARMATURE", 0, "Armature", ""},
{OB_LATTICE, "LATTICE", 0, "Lattice", ""},
@@ -91,6 +95,12 @@ EnumPropertyItem object_type_items[] = {
{OB_LAMP, "LAMP", 0, "Lamp", ""},
{0, NULL, 0, NULL, NULL}};
+EnumPropertyItem object_type_curve_items[] = {
+ OBTYPE_CU_CURVE,
+ OBTYPE_CU_SURF,
+ OBTYPE_CU_TEXT,
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "BLI_math.h"
@@ -174,7 +184,7 @@ static void rna_Object_layer_update__internal(Scene *scene, Base *base, Object *
{
/* try to avoid scene sort */
if((ob->lay & scene->lay) && (base->lay & scene->lay)) {
- /* pass */
+ /* pass */
} else if((ob->lay & scene->lay)==0 && (base->lay & scene->lay)==0) {
/* pass */
} else {
@@ -569,41 +579,13 @@ static void rna_Object_rotation_mode_set(PointerRNA *ptr, int value)
static void rna_Object_dimensions_get(PointerRNA *ptr, float *value)
{
Object *ob= ptr->data;
- BoundBox *bb = NULL;
-
- bb= object_get_boundbox(ob);
- if (bb) {
- float scale[3];
-
- mat4_to_size( scale,ob->obmat);
-
- value[0] = fabs(scale[0]) * (bb->vec[4][0] - bb->vec[0][0]);
- value[1] = fabs(scale[1]) * (bb->vec[2][1] - bb->vec[0][1]);
- value[2] = fabs(scale[2]) * (bb->vec[1][2] - bb->vec[0][2]);
- } else {
- value[0] = value[1] = value[2] = 0.f;
- }
+ object_get_dimensions(ob, value);
}
static void rna_Object_dimensions_set(PointerRNA *ptr, const float *value)
{
Object *ob= ptr->data;
- BoundBox *bb = NULL;
-
- bb= object_get_boundbox(ob);
- if (bb) {
- float scale[3], len[3];
-
- 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];
- len[2] = bb->vec[1][2] - bb->vec[0][2];
-
- if (len[0] > 0.f) ob->size[0] = value[0] / len[0];
- if (len[1] > 0.f) ob->size[1] = value[1] / len[1];
- if (len[2] > 0.f) ob->size[2] = value[2] / len[2];
- }
+ object_set_dimensions(ob, value);
}
static int rna_Object_location_editable(PointerRNA *ptr, int index)
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 649a2a9f52f..27a88006b40 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -32,7 +32,6 @@
#include <time.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "DNA_object_types.h"
@@ -81,10 +80,10 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports
Scene *sce = CTX_data_scene(C);
/* perform the mesh extraction based on type */
- switch (ob->type) {
- case OB_FONT:
- case OB_CURVE:
- case OB_SURF:
+ switch (ob->type) {
+ case OB_FONT:
+ case OB_CURVE:
+ case OB_SURF:
/* copies object and modifiers (but not the data) */
tmpobj= copy_object(ob);
@@ -124,7 +123,7 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports
free_libblock_us( &G.main->object, tmpobj );
break;
- case OB_MBALL:
+ case OB_MBALL:
/* metaballs don't have modifiers, so just convert to mesh */
ob = find_basis_mball( sce, ob );
/* todo, re-generatre for render-res */
@@ -132,9 +131,9 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports
tmpmesh = add_mesh("Mesh");
mball_to_mesh( &ob->disp, tmpmesh );
- break;
+ break;
- case OB_MESH:
+ case OB_MESH:
/* copies object and modifiers (but not the data) */
if (cage) {
/* copies the data */
@@ -159,10 +158,10 @@ static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports
}
break;
- default:
+ default:
BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
- return NULL;
- }
+ return NULL;
+ }
/* Copy materials to new mesh */
switch (ob->type) {
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 9fb17c82fa3..296179db238 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c
index be0d948b2d1..41c4d9b2769 100644
--- a/source/blender/makesrna/intern/rna_packedfile.c
+++ b/source/blender/makesrna/intern/rna_packedfile.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 4028ef28307..e2d684ecbfb 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -28,8 +28,6 @@
#include "limits.h"
#include "RNA_define.h"
-#include "RNA_types.h"
-#include "RNA_access.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 240d02f7f9e..03687a5f366 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -26,7 +26,6 @@
#include <string.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c
index 4f5dbe74dee..922fa285f84 100644
--- a/source/blender/makesrna/intern/rna_pose_api.c
+++ b/source/blender/makesrna/intern/rna_pose_api.c
@@ -32,7 +32,6 @@
#include <time.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "DNA_object_types.h"
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c
index ff410d11ca7..6de403f28d1 100644
--- a/source/blender/makesrna/intern/rna_property.c
+++ b/source/blender/makesrna/intern/rna_property.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index b10df075121..710a22ba17a 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -27,11 +27,9 @@
#include "DNA_scene_types.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
-#include "WM_types.h"
#include "RE_pipeline.h"
@@ -44,7 +42,6 @@
#include "BKE_context.h"
#include "BKE_report.h"
-#include "WM_api.h"
/* RenderEngine */
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 7c4b48b09f6..c75706b91bb 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -28,7 +28,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 02e56e92a8d..1f5d47dbfbc 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -167,6 +166,7 @@ EnumPropertyItem image_type_items[] = {
#include "ED_view3d.h"
#include "ED_object.h"
#include "ED_mesh.h"
+#include "ED_keyframing.h"
#include "RE_pipeline.h"
@@ -359,46 +359,60 @@ static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
sound_seek_scene(C);
}
-static int rna_Scene_active_keying_set_editable(PointerRNA *ptr)
-{
- Scene *scene= (Scene *)ptr->data;
-
- /* only editable if there are some Keying Sets to change to */
- return (scene->keyingsets.first != NULL);
-}
-
static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
{
Scene *scene= (Scene *)ptr->data;
- return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, BLI_findlink(&scene->keyingsets, scene->active_keyingset-1));
+ return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
}
static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
{
Scene *scene= (Scene *)ptr->data;
KeyingSet *ks= (KeyingSet*)value.data;
- scene->active_keyingset= BLI_findindex(&scene->keyingsets, ks) + 1;
+
+ scene->active_keyingset= ANIM_scene_get_keyingset_index(scene, ks);
}
-static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
+#if 0 // XXX: these need to be fixed up first...
+static void rna_Scene_active_keying_set_index_range(PointerRNA *ptr, int *min, int *max)
{
Scene *scene= (Scene *)ptr->data;
- return MAX2(scene->active_keyingset-1, 0);
+
+ // FIXME: would need access to builtin keyingsets list to count min...
+ *min= 0;
+ *max= 0;
}
+#endif
+
+// XXX: evil... builtin_keyingsets is defined in keyingsets.c!
+// TODO: make API function to retrieve this...
+extern ListBase builtin_keyingsets;
-static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
+static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Scene *scene= (Scene *)ptr->data;
- scene->active_keyingset= value+1;
+ Scene *scene= (Scene*)ptr->data;
+
+ /* start going over the scene KeyingSets first, while we still have pointer to it
+ * but only if we have any Keying Sets to use...
+ */
+ if (scene->keyingsets.first)
+ rna_iterator_listbase_begin(iter, &scene->keyingsets, NULL);
+ else
+ rna_iterator_listbase_begin(iter, &builtin_keyingsets, NULL);
}
-static void rna_Scene_active_keying_set_index_range(PointerRNA *ptr, int *min, int *max)
+static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
{
- Scene *scene= (Scene *)ptr->data;
-
- *min= 0;
- *max= BLI_countlist(&scene->keyingsets)-1;
- *max= MAX2(0, *max);
+ ListBaseIterator *internal= iter->internal;
+ KeyingSet *ks= (KeyingSet*)internal->link;
+
+ /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */
+ if ((ks->next == NULL) && (ks != builtin_keyingsets.last))
+ internal->link= (Link*)builtin_keyingsets.first;
+ else
+ internal->link= (Link*)ks->next;
+
+ iter->valid= (internal->link != NULL);
}
@@ -634,7 +648,7 @@ static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
Scene *scene= (Scene*)ptr->id.data;
SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
- BLI_strncpy(rl->name, value, sizeof(rl->name));
+ BLI_strncpy(rl->name, value, sizeof(rl->name));
if(scene->nodetree) {
bNode *node;
@@ -1447,7 +1461,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem stereo_modes_items[] ={
+ static EnumPropertyItem stereo_modes_items[] ={
{STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""},
{STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""},
{STEREO_INTERLACED, "INTERLACED", 0, "Interlaced", ""},
@@ -1456,7 +1470,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{STEREO_VINTERLACE, "VINTERLACE", 0, "Vinterlace", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem stereo_items[] ={
+ static EnumPropertyItem stereo_items[] ={
{STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"},
{STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"},
{STEREO_DOME, "DOME", 0, "Dome", "Enable Dome environment"},
@@ -2422,7 +2436,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
- RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
+ RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2909,21 +2923,26 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
RNA_def_property_struct_type(prop, "KeyingSet");
- RNA_def_property_ui_text(prop, "Keying Sets", "Keying Sets for this Scene");
+ RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+
+ prop= RNA_def_property(srna, "all_keying_sets", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_struct_type(prop, "KeyingSet");
+ RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (builtins and Absolute Keying Sets for this Scene)");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSet");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_editable_func(prop, "rna_Scene_active_keying_set_editable");
RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL);
RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
prop= RNA_def_property(srna, "active_keying_set_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
- RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", "rna_Scene_active_keying_set_index_range");
- RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index");
+ //RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Scene_active_keying_set_index_range"); // XXX
+ RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
/* Tool Settings */
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 6cae59c4dce..376ef54f4d8 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -30,8 +30,6 @@
#include <stdio.h>
#include "RNA_define.h"
-#include "RNA_enum_types.h"
-#include "RNA_types.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
@@ -46,10 +44,7 @@
#include "BKE_depsgraph.h"
#include "BKE_writeavi.h"
-#include "ED_object.h"
-#include "ED_anim_api.h"
-#include "WM_api.h"
static void rna_Scene_set_frame(Scene *scene, bContext *C, int frame)
{
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index b2148e38de1..d7dfd6fba9a 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -26,7 +26,6 @@
#include <stddef.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index c4830250aa8..cafc9bb8f82 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -34,6 +33,7 @@
#include "BKE_paint.h"
+#include "WM_api.h"
#include "WM_types.h"
static EnumPropertyItem particle_edit_hair_brush_items[] = {
@@ -128,7 +128,21 @@ static void rna_ParticleEdit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
if(ob) DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
+static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
+{
+ ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
+
+ /* redraw hair completely if weight brush is/was used */
+ if(pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) {
+ Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL;
+ if(ob) {
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ }
+ }
+ pset->brushtype = value;
+}
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free)
{
Scene *scene= CTX_data_scene(C);
@@ -407,7 +421,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "brushtype");
RNA_def_property_enum_items(prop, particle_edit_hair_brush_items);
- RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ParticleEdit_tool_itemf");
+ RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
RNA_def_property_ui_text(prop, "Tool", "");
prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE);
@@ -445,7 +459,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "draw_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
prop= RNA_def_property(srna, "add_interpolate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
@@ -504,11 +518,15 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 100, 10, 3);
RNA_def_property_ui_text(prop, "Size", "Brush size");
- prop= RNA_def_property(srna, "strength", PROP_INT, PROP_NONE);
- RNA_def_property_range(prop, 1, INT_MAX);
- RNA_def_property_ui_range(prop, 1, 100, 10, 3);
+ prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.001, 1.0);
RNA_def_property_ui_text(prop, "Strength", "Brush strength");
+ prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 1, 1000);
+ RNA_def_property_ui_range(prop, 1, 100, 10, 3);
+ RNA_def_property_ui_text(prop, "Count", "Particle count");
+
prop= RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "step");
RNA_def_property_range(prop, 1, INT_MAX);
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 3e628e9dbe2..533aab1a317 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 3b07643a0ad..ac3a17427ba 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -27,7 +27,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 8d5b38d767d..970abf92b08 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -26,7 +26,6 @@
#include <limits.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -47,7 +46,6 @@
#include "BKE_depsgraph.h"
#include "BKE_particle.h"
-#include "ED_object.h"
static void rna_Smoke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -57,7 +55,7 @@ static void rna_Smoke_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
rna_Smoke_update(bmain, scene, ptr);
- DAG_scene_sort(scene);
+ DAG_scene_sort(scene);
}
static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index 584e3802db1..3ff81df02f8 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 2c9bc945618..ada78b37613 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -28,7 +28,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -1188,6 +1187,11 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
+ prop= RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
+ RNA_def_property_struct_type(prop, "Histogram");
+ RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
+
/* image draw */
prop= RNA_def_property(srna, "draw_repeated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
diff --git a/source/blender/makesrna/intern/rna_test.c b/source/blender/makesrna/intern/rna_test.c
index 558ac00e3bf..592d88c718a 100644
--- a/source/blender/makesrna/intern/rna_test.c
+++ b/source/blender/makesrna/intern/rna_test.c
@@ -28,7 +28,6 @@
#include <string.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index b054b049fc9..ad90afb84a6 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -30,7 +30,6 @@
#include "BKE_text.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c
index 0c446faf9af..2534eb63f2b 100644
--- a/source/blender/makesrna/intern/rna_text_api.c
+++ b/source/blender/makesrna/intern/rna_text_api.c
@@ -26,7 +26,6 @@
#include "RNA_define.h"
-#include "RNA_types.h"
#ifdef RNA_RUNTIME
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index bdd1b710db5..69d1884e756 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -429,8 +428,8 @@ static void rna_def_mtex(BlenderRNA *brna)
{MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""},
{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_SOFT_LIGHT, "SOFT LIGHT", 0, "Soft Light", ""},
+ {MTEX_LIN_LIGHT , "LINEAR LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem output_node_items[] = {
diff --git a/source/blender/makesrna/intern/rna_timeline.c b/source/blender/makesrna/intern/rna_timeline.c
index 895cae6b51b..afc1d087cf2 100644
--- a/source/blender/makesrna/intern/rna_timeline.c
+++ b/source/blender/makesrna/intern/rna_timeline.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index f204efb88c5..d25efd23da0 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -27,7 +27,6 @@
#include "DNA_screen_types.h"
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
#include "RNA_enum_types.h"
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 6415f04a39f..89c7876f6e0 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -30,14 +30,12 @@
#include <stdio.h>
#include "RNA_define.h"
-#include "RNA_types.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#ifdef RNA_RUNTIME
-static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only, int event, int full_event, int no_bg, int index)
+static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int no_bg, int index)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
int flag= 0;
@@ -55,12 +53,12 @@ static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr,
flag |= (full_event)? UI_ITEM_R_FULL_EVENT: 0;
flag |= (no_bg)? UI_ITEM_R_NO_BG: 0;
- uiItemFullR(layout, name, icon, ptr, prop, index, 0, flag);
+ uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
}
-static PointerRNA rna_uiItemO(uiLayout *layout, char *name, int icon, char *opname)
+static PointerRNA rna_uiItemO(uiLayout *layout, char *opname, char *name, int icon)
{
- return uiItemFullO(layout, name, icon, opname, NULL, uiLayoutGetOperatorContext(layout), UI_ITEM_O_RETURN_PROPS);
+ return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), UI_ITEM_O_RETURN_PROPS);
}
#else
@@ -83,13 +81,17 @@ static void api_ui_item_common(FunctionRNA *func)
}
-static void api_ui_item_op_common(FunctionRNA *func)
+static void api_ui_item_op(FunctionRNA *func)
{
PropertyRNA *parm;
+ parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+}
+static void api_ui_item_op_common(FunctionRNA *func)
+{
+ api_ui_item_op(func);
api_ui_item_common(func);
- parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
}
static void api_ui_item_rna_common(FunctionRNA *func)
@@ -150,8 +152,8 @@ void RNA_api_ui_layout(StructRNA *srna)
/* items */
func= RNA_def_function(srna, "prop", "rna_uiItemR");
- api_ui_item_common(func);
api_ui_item_rna_common(func);
+ api_ui_item_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values.");
RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values.");
@@ -165,22 +167,22 @@ void RNA_api_ui_layout(StructRNA *srna)
api_ui_item_rna_common(func);
func= RNA_def_function(srna, "prop_menu_enum", "uiItemMenuEnumR");
- api_ui_item_common(func);
api_ui_item_rna_common(func);
+ api_ui_item_common(func);
func= RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
- api_ui_item_common(func);
api_ui_item_rna_common(func);
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value.");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ api_ui_item_common(func);
func= RNA_def_function(srna, "prop_object", "uiItemPointerR");
- api_ui_item_common(func);
api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property.");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ api_ui_item_common(func);
func= RNA_def_function(srna, "operator", "rna_uiItemO");
api_ui_item_op_common(func);
@@ -202,9 +204,10 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO");
- api_ui_item_op_common(func);
+ api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ api_ui_item_common(func);
/* func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
api_ui_item_op_common(func);
@@ -239,8 +242,8 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "menu", "uiItemM");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- api_ui_item_common(func);
parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu.");
+ api_ui_item_common(func);
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "separator", "uiItemS");
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 2e1352eaa8e..116fc8b68ea 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -1382,7 +1381,7 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
- rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
+ rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3);
@@ -1901,7 +1900,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c
index d0098e7b216..1f8be906eb3 100644
--- a/source/blender/makesrna/intern/rna_vfont.c
+++ b/source/blender/makesrna/intern/rna_vfont.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index cda7fca1073..73bce1fbf0c 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -27,7 +27,6 @@
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -409,7 +408,7 @@ static int rna_wmKeyMapItem_map_type_get(PointerRNA *ptr)
wmKeyMapItem *kmi= ptr->data;
if(ISTIMER(kmi->type)) return KMI_TYPE_TIMER;
- if(ISKEYBOARD(kmi->type)) return KMI_TYPE_KEYBOARD;
+ if(ISKEYBOARD(kmi->type)) return KMI_TYPE_KEYBOARD;
if(ISTWEAK(kmi->type)) return KMI_TYPE_TWEAK;
if(ISMOUSE(kmi->type)) return KMI_TYPE_MOUSE;
if(kmi->type == KM_TEXTINPUT) return KMI_TYPE_TEXTINPUT;
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 66b620b106b..13e38ea435b 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -30,7 +30,6 @@
#include <stdio.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "DNA_screen_types.h"
@@ -40,8 +39,6 @@
#include "BKE_context.h"
-#include "WM_api.h"
-#include "WM_types.h"
static wmKeyMap *rna_keymap_add(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid, int modal)
{
@@ -175,10 +172,10 @@ static void rna_generic_op_invoke(FunctionRNA *func, int flag)
RNA_def_property_flag(parm, PROP_REQUIRED);
}
- if(flag & WM_GEN_INVOKE_SIZE) {
- parm= RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX);
- parm= RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX);
- }
+ if(flag & WM_GEN_INVOKE_SIZE) {
+ parm= RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX);
+ parm= RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX);
+ }
if(flag & WM_GEN_INVOKE_RETURN) {
parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", "");
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index 903b3aa521c..b6d63eae47b 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
index 701fe688f5f..b1fe0a2897b 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
@@ -69,32 +69,32 @@ static void do_channel_matte(bNode *node, float *out, float *in)
float alpha=0.0;
switch(c->algorithm) {
- case 0: { /* Alpha=key_channel-limit channel */
- int key_channel=node->custom2-1;
- int limit_channel=c->channel-1;
- alpha=in[key_channel]-in[limit_channel];
- break;
- }
- case 1: { /* Alpha=G-MAX(R, B) */
- switch(node->custom2) {
- case 1: {
- alpha=in[0]-MAX2(in[1],in[2]);
- break;
- }
- case 2: {
- alpha=in[1]-MAX2(in[0],in[2]);
- break;
- }
- case 3: {
- alpha=in[2]-MAX2(in[0],in[1]);
- break;
- }
- default:
- break;
- }
- }
- default:
- break;
+ case 0: { /* Alpha=key_channel-limit channel */
+ int key_channel=node->custom2-1;
+ int limit_channel=c->channel-1;
+ alpha=in[key_channel]-in[limit_channel];
+ break;
+ }
+ case 1: { /* Alpha=G-MAX(R, B) */
+ switch(node->custom2) {
+ case 1: {
+ alpha=in[0]-MAX2(in[1],in[2]);
+ break;
+ }
+ case 2: {
+ alpha=in[1]-MAX2(in[0],in[2]);
+ break;
+ }
+ case 3: {
+ alpha=in[2]-MAX2(in[0],in[1]);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ default:
+ break;
}
/*flip because 0.0 is transparent, not 1.0*/
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
index 44f690e1fa6..8d5f4688657 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
@@ -51,10 +51,10 @@ static void do_color_key(bNode *node, float *out, float *in)
VECCOPY(out, in);
if(fabs(in[0]-c->key[0]) < c->t1 &&
- fabs(in[1]-c->key[1]) < c->t2 &&
- fabs(in[2]-c->key[2]) < c->t3)
+ fabs(in[1]-c->key[1]) < c->t2 &&
+ fabs(in[2]-c->key[2]) < c->t3)
{
- out[3]=0.0; /*make transparent*/
+ out[3]=0.0; /*make transparent*/
}
else { /*pixel is outside key color */
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
index 23a5b719e5b..54fb1e384c3 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
@@ -109,7 +109,7 @@ static void do_apply_spillmap_green(bNode *node, float* out, float *in, float *m
out[0]=in[0]+(ncs->uspillr*map[0]);
out[1]=in[1]-(ncs->uspillg*map[0]);
out[2]=in[2]+(ncs->uspillb*map[0]);
- }
+ }
else {
out[0]=in[0];
out[1]=in[1];
@@ -125,7 +125,7 @@ static void do_apply_spillmap_blue(bNode *node, float* out, float *in, float *ma
out[0]=in[0]+(ncs->uspillr*map[0]);
out[1]=in[1]+(ncs->uspillg*map[0]);
out[2]=in[2]-(ncs->uspillb*map[0]);
- }
+ }
else {
out[0]=in[0];
out[1]=in[1];
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
index 7ec28e6461d..b40b27e06ee 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
@@ -56,7 +56,7 @@ DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slop
DO_INLINE float colorbalance_lgg(float in, float lift, float gamma, float gain)
{
- float x = gain*(in+lift*(1-in));
+ float x = gain*(in+(lift-1)*(1-in));
/* prevent NaN */
if (x < 0.f) x = 0.f;
@@ -150,7 +150,7 @@ static void node_composit_init_colorbalance(bNode *node)
{
NodeColorBalance *n= node->storage= MEM_callocN(sizeof(NodeColorBalance), "node colorbalance");
- n->lift[0] = n->lift[1] = n->lift[2] = 0.0f;
+ n->lift[0] = n->lift[1] = n->lift[2] = 1.0f;
n->gamma[0] = n->gamma[1] = n->gamma[2] = 1.0f;
n->gain[0] = n->gain[1] = n->gain[2] = 1.0f;
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c
index 00038f6fde2..c2edb3dd52f 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c
@@ -83,7 +83,7 @@ static void node_composit_exec_crop(void *data, bNode *node, bNodeStack **in, bN
srcfp= cbuf->rect + (y * cbuf->x + outputrect.xmin) * cbuf->type;
outfp= stackbuf->rect + (y * stackbuf->x + outputrect.xmin) * stackbuf->type;
for(x=outputrect.xmin; x<outputrect.xmax; x++, outfp+= stackbuf->type, srcfp+= cbuf->type)
- memcpy(outfp, srcfp, sizeof(float)*stackbuf->type);
+ memcpy(outfp, srcfp, sizeof(float)*stackbuf->type);
}
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
index aa282a78af1..0735a369d12 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
@@ -51,8 +51,8 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *
float alpha;
difference=fabs(inColor2[0]-inColor1[0])+
- fabs(inColor2[1]-inColor1[1])+
- fabs(inColor2[2]-inColor1[2]);
+ fabs(inColor2[1]-inColor1[1])+
+ fabs(inColor2[2]-inColor1[2]);
/*average together the distances*/
difference=difference/3.0;
@@ -61,19 +61,19 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *
/*make 100% transparent*/
if(difference < tolerence){
- outColor[3]=0.0;
+ outColor[3]=0.0;
}
/*in the falloff region, make partially transparent */
else if(difference < falloff+tolerence){
- difference=difference-tolerence;
- alpha=difference/falloff;
- /*only change if more transparent than before */
- if(alpha < inColor1[3]) {
- outColor[3]=alpha;
- }
- else { /* leave as before */
- outColor[3]=inColor1[3];
- }
+ difference=difference-tolerence;
+ alpha=difference/falloff;
+ /*only change if more transparent than before */
+ if(alpha < inColor1[3]) {
+ outColor[3]=alpha;
+ }
+ else { /* leave as before */
+ outColor[3]=inColor1[3];
+ }
}
else {
/*foreground object*/
@@ -99,7 +99,7 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **
/* if there's an image, use that, if not use the color */
if(in[1]->data) {
- imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA);
+ imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA);
}
c=node->storage;
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c
index 4213a5f5389..e0e595fc8f6 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c
@@ -53,29 +53,29 @@ static void do_distance_matte(bNode *node, float *out, float *in)
float alpha;
distance=sqrt((c->key[0]-in[0])*(c->key[0]-in[0]) +
- (c->key[1]-in[1])*(c->key[1]-in[1]) +
- (c->key[2]-in[2])*(c->key[2]-in[2]));
+ (c->key[1]-in[1])*(c->key[1]-in[1]) +
+ (c->key[2]-in[2])*(c->key[2]-in[2]));
VECCOPY(out, in);
/*make 100% transparent */
if(distance < tolerence) {
- out[3]=0.0;
+ out[3]=0.0;
}
/*in the falloff region, make partially transparent */
else if(distance < falloff+tolerence){
- distance=distance-tolerence;
- alpha=distance/falloff;
- /*only change if more transparent than before */
- if(alpha < in[3]) {
- out[3]=alpha;
- }
- else { /* leave as before */
- out[3]=in[3];
- }
+ distance=distance-tolerence;
+ alpha=distance/falloff;
+ /*only change if more transparent than before */
+ if(alpha < in[3]) {
+ out[3]=alpha;
+ }
+ else { /* leave as before */
+ out[3]=in[3];
+ }
}
else {
- out[3]=in[3];
+ out[3]=in[3];
}
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
index 1726347b367..c0e524a3ae9 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
@@ -35,7 +35,7 @@
static bNodeSocketType cmp_node_gamma_in[]= {
{ SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
{ SOCK_VALUE, 1, "Gamma", 1.0f, 0.0f, 0.0f, 0.0f, 0.001f, 10.0f},
- { -1, 0, "" }
+ { -1, 0, "" }
};
static bNodeSocketType cmp_node_gamma_out[]= {
{ SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
@@ -82,11 +82,11 @@ bNodeType cmp_node_gamma= {
/* output sock */ cmp_node_gamma_out,
/* storage */ "",
/* execfunc */ node_composit_exec_gamma,
- /* butfunc */ NULL,
- /* initfunc */ NULL,
- /* freestoragefunc */ NULL,
- /* copysotragefunc */ NULL,
- /* id */ NULL
+ /* butfunc */ NULL,
+ /* initfunc */ NULL,
+ /* freestoragefunc */ NULL,
+ /* copysotragefunc */ NULL,
+ /* id */ NULL
};
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
index a5063702365..be91eb61587 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
@@ -293,23 +293,23 @@ static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, in
{
float *fp= RE_RenderLayerGetPass(rl, passcode);
if(fp) {
- CompBuf *buf;
- int buftype= CB_VEC3;
-
- if(ELEM3(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST))
- buftype= CB_VAL;
- else if(passcode==SCE_PASS_VECTOR)
- buftype= CB_VEC4;
- else if(ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA))
- buftype= CB_RGBA;
-
- if(rd->scemode & R_COMP_CROP)
- buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype);
- else {
- buf= alloc_compbuf(rectx, recty, buftype, 0);
- buf->rect= fp;
- }
- return buf;
+ CompBuf *buf;
+ int buftype= CB_VEC3;
+
+ if(ELEM3(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST))
+ buftype= CB_VAL;
+ else if(passcode==SCE_PASS_VECTOR)
+ buftype= CB_VEC4;
+ else if(ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA))
+ buftype= CB_RGBA;
+
+ if(rd->scemode & R_COMP_CROP)
+ buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype);
+ else {
+ buf= alloc_compbuf(rectx, recty, buftype, 0);
+ buf->rect= fp;
+ }
+ return buf;
}
return NULL;
};
@@ -317,30 +317,30 @@ static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, in
void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out, int rectx, int recty)
{
if(out[RRES_OUT_Z]->hasoutput)
- out[RRES_OUT_Z]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_Z);
+ out[RRES_OUT_Z]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_Z);
if(out[RRES_OUT_VEC]->hasoutput)
- out[RRES_OUT_VEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_VECTOR);
+ out[RRES_OUT_VEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_VECTOR);
if(out[RRES_OUT_NORMAL]->hasoutput)
- out[RRES_OUT_NORMAL]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_NORMAL);
+ out[RRES_OUT_NORMAL]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_NORMAL);
if(out[RRES_OUT_UV]->hasoutput)
- out[RRES_OUT_UV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_UV);
+ out[RRES_OUT_UV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_UV);
if(out[RRES_OUT_RGBA]->hasoutput)
- out[RRES_OUT_RGBA]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_RGBA);
+ out[RRES_OUT_RGBA]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_RGBA);
if(out[RRES_OUT_DIFF]->hasoutput)
- out[RRES_OUT_DIFF]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE);
+ out[RRES_OUT_DIFF]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_DIFFUSE);
if(out[RRES_OUT_SPEC]->hasoutput)
- out[RRES_OUT_SPEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SPEC);
+ out[RRES_OUT_SPEC]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SPEC);
if(out[RRES_OUT_SHADOW]->hasoutput)
- out[RRES_OUT_SHADOW]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SHADOW);
+ out[RRES_OUT_SHADOW]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_SHADOW);
if(out[RRES_OUT_AO]->hasoutput)
- out[RRES_OUT_AO]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_AO);
+ out[RRES_OUT_AO]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_AO);
if(out[RRES_OUT_REFLECT]->hasoutput)
- out[RRES_OUT_REFLECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFLECT);
+ out[RRES_OUT_REFLECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFLECT);
if(out[RRES_OUT_REFRACT]->hasoutput)
- out[RRES_OUT_REFRACT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFRACT);
+ out[RRES_OUT_REFRACT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFRACT);
if(out[RRES_OUT_INDIRECT]->hasoutput)
- out[RRES_OUT_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDIRECT);
+ out[RRES_OUT_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDIRECT);
if(out[RRES_OUT_INDEXOB]->hasoutput)
out[RRES_OUT_INDEXOB]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXOB);
if(out[RRES_OUT_MIST]->hasoutput)
@@ -362,38 +362,38 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **in,
rr= RE_AcquireResultRead(re);
if(rr) {
- SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
- if(srl) {
- RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
- if(rl && rl->rectf) {
- CompBuf *stackbuf;
-
- /* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */
- if(rd->scemode & R_COMP_CROP)
- stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA);
- else {
- stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0);
- stackbuf->rect= rl->rectf;
- }
- if(stackbuf==NULL) {
- printf("Error; Preview Panel in UV Window returns zero sized image\n");
- }
- else {
- stackbuf->xof= rr->xof;
- stackbuf->yof= rr->yof;
-
- /* put on stack */
- out[RRES_OUT_IMAGE]->data= stackbuf;
-
- if(out[RRES_OUT_ALPHA]->hasoutput)
- out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
-
- node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty);
-
- generate_preview(data, node, stackbuf);
- }
- }
- }
+ SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
+ if(srl) {
+ RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
+ if(rl && rl->rectf) {
+ CompBuf *stackbuf;
+
+ /* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */
+ if(rd->scemode & R_COMP_CROP)
+ stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA);
+ else {
+ stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0);
+ stackbuf->rect= rl->rectf;
+ }
+ if(stackbuf==NULL) {
+ printf("Error; Preview Panel in UV Window returns zero sized image\n");
+ }
+ else {
+ stackbuf->xof= rr->xof;
+ stackbuf->yof= rr->yof;
+
+ /* put on stack */
+ out[RRES_OUT_IMAGE]->data= stackbuf;
+
+ if(out[RRES_OUT_ALPHA]->hasoutput)
+ out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
+
+ node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty);
+
+ generate_preview(data, node, stackbuf);
+ }
+ }
+ }
}
if(re)
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c
index f61d98692fd..f663dc76b5c 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c
@@ -171,7 +171,7 @@ static void node_composit_exec_math(void *data, bNode *node, bNodeStack **in, bN
stackbuf=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
}
/* and if it doesn't exist use the second input since we
- know that one of them must exist at this point*/
+ know that one of them must exist at this point*/
else {
stackbuf=alloc_compbuf(cbuf2->x, cbuf2->y, CB_VAL, 1);
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
index 4da0b20c6f8..4103981af46 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
@@ -53,7 +53,7 @@ static void node_composit_exec_rotate(void *data, bNode *node, bNodeStack **in,
CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* note, this returns zero'd image */
float rad, u, v, s, c, centx, centy, miny, maxy, minx, maxx;
int x, y, yo, xo;
- ImBuf *ibuf, *obuf;
+ ImBuf *ibuf, *obuf;
rad= (M_PI*in[1]->vec[0])/180.0f;
@@ -68,36 +68,36 @@ static void node_composit_exec_rotate(void *data, bNode *node, bNodeStack **in,
maxy= -centy + (float)cbuf->y;
- ibuf=IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0);
- obuf=IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0, 0);
+ ibuf=IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0);
+ obuf=IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0, 0);
- if(ibuf){
- ibuf->rect_float=cbuf->rect;
- obuf->rect_float=stackbuf->rect;
+ if(ibuf){
+ ibuf->rect_float=cbuf->rect;
+ obuf->rect_float=stackbuf->rect;
for(y=miny; y<maxy; y++) {
yo= y+(int)centy;
- for(x=minx; x<maxx;x++) {
- u=c*x + y*s + centx;
- v=-s*x + c*y + centy;
- xo= x+(int)centx;
+ for(x=minx; x<maxx;x++) {
+ u=c*x + y*s + centx;
+ v=-s*x + c*y + centy;
+ xo= x+(int)centx;
- switch(node->custom1) {
- case 0:
- neareast_interpolation(ibuf, obuf, u, v, xo, yo);
- break ;
- case 1:
- bilinear_interpolation(ibuf, obuf, u, v, xo, yo);
- break;
- case 2:
- bicubic_interpolation(ibuf, obuf, u, v, xo, yo);
- }
+ switch(node->custom1) {
+ case 0:
+ neareast_interpolation(ibuf, obuf, u, v, xo, yo);
+ break ;
+ case 1:
+ bilinear_interpolation(ibuf, obuf, u, v, xo, yo);
+ break;
+ case 2:
+ bicubic_interpolation(ibuf, obuf, u, v, xo, yo);
+ }
- }
+ }
}
- /* rotate offset vector too, but why negative rad, ehh?? Has to be replaced with [3][3] matrix once (ton) */
+ /* rotate offset vector too, but why negative rad, ehh?? Has to be replaced with [3][3] matrix once (ton) */
s= sin(-rad);
c= cos(-rad);
centx= (float)cbuf->xof; centy= (float)cbuf->yof;
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c
index 0edacd20e6d..d80dd9b0a4b 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c
@@ -145,29 +145,29 @@ static void node_composit_exec_combhsva(void *data, bNode *node, bNodeStack **in
/* input no image? then only color operation */
if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) {
- out[0]->vec[0] = in[0]->vec[0];
- out[0]->vec[1] = in[1]->vec[0];
- out[0]->vec[2] = in[2]->vec[0];
- out[0]->vec[3] = in[3]->vec[0];
+ out[0]->vec[0] = in[0]->vec[0];
+ out[0]->vec[1] = in[1]->vec[0];
+ out[0]->vec[2] = in[2]->vec[0];
+ out[0]->vec[3] = in[3]->vec[0];
}
else {
- /* make output size of first available input image */
- CompBuf *cbuf;
- CompBuf *stackbuf;
+ /* make output size of first available input image */
+ CompBuf *cbuf;
+ CompBuf *stackbuf;
- /* allocate a CompBuf the size of the first available input */
- if (in[0]->data) cbuf = in[0]->data;
- else if (in[1]->data) cbuf = in[1]->data;
- else if (in[2]->data) cbuf = in[2]->data;
- else cbuf = in[3]->data;
+ /* allocate a CompBuf the size of the first available input */
+ if (in[0]->data) cbuf = in[0]->data;
+ else if (in[1]->data) cbuf = in[1]->data;
+ else if (in[2]->data) cbuf = in[2]->data;
+ else cbuf = in[3]->data;
- stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
+ stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
- composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec,
- in[2]->data, in[2]->vec, in[3]->data, in[3]->vec,
- do_comb_hsva, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
+ composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec,
+ in[2]->data, in[2]->vec, in[3]->data, in[3]->vec,
+ do_comb_hsva, CB_VAL, CB_VAL, CB_VAL, CB_VAL);
- out[0]->data= stackbuf;
+ out[0]->data= stackbuf;
}
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c
index 020b3797074..7be9f34f00b 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c
@@ -31,7 +31,7 @@
/* **************** Z COMBINE ******************** */
- /* lazy coder note: node->custom1 is abused to send signal */
+ /* lazy coder note: node->custom1 is abused to send signal */
static bNodeSocketType cmp_node_zcombine_in[]= {
{ SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
{ SOCK_VALUE, 1, "Z", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 10000.0f},
diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c
index 1d64cf0b45f..6e53e8bb968 100644
--- a/source/blender/nodes/intern/CMP_util.c
+++ b/source/blender/nodes/intern/CMP_util.c
@@ -725,18 +725,18 @@ void gamma_correct_compbuf(CompBuf *img, int inversed)
drect= img->rect;
if(inversed) {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
- if(drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f;
- if(drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f;
- if(drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f;
- }
+ for(x=img->x*img->y; x>0; x--, drect+=4) {
+ if(drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f;
+ if(drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f;
+ if(drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f;
+ }
}
else {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
- if(drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f;
- if(drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f;
- if(drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f;
- }
+ for(x=img->x*img->y; x>0; x--, drect+=4) {
+ if(drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f;
+ if(drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f;
+ if(drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f;
+ }
}
}
@@ -749,7 +749,7 @@ void premul_compbuf(CompBuf *img, int inversed)
drect= img->rect;
if(inversed) {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
+ for(x=img->x*img->y; x>0; x--, drect+=4) {
if(fabs(drect[3]) < 1e-5f) {
drect[0]= 0.0f;
drect[1]= 0.0f;
@@ -760,14 +760,14 @@ void premul_compbuf(CompBuf *img, int inversed)
drect[1] /= drect[3];
drect[2] /= drect[3];
}
- }
+ }
}
else {
- for(x=img->x*img->y; x>0; x--, drect+=4) {
+ for(x=img->x*img->y; x>0; x--, drect+=4) {
drect[0] *= drect[3];
drect[1] *= drect[3];
drect[2] *= drect[3];
- }
+ }
}
}
diff --git a/source/blender/nodes/intern/CMP_util.h b/source/blender/nodes/intern/CMP_util.h
index ae3fe97b21a..4b6b5551146 100644
--- a/source/blender/nodes/intern/CMP_util.h
+++ b/source/blender/nodes/intern/CMP_util.h
@@ -185,8 +185,8 @@ typedef float fRGB[4];
#define fRGB_rgbmult(c, r, g, b) { c[0]*=(r); c[1]*=(g); c[2]*=(b); }
/* swap colors c1 & c2 */
#define fRGB_swap(c1, c2) { float _t=c1[0]; c1[0]=c2[0]; c2[0]=_t;\
- _t=c1[1]; c1[1]=c2[1]; c2[1]=_t;\
- _t=c1[2]; c1[2]=c2[2]; c2[2]=_t;\
+ _t=c1[1]; c1[1]=c2[1]; c2[1]=_t;\
+ _t=c1[2]; c1[2]=c2[2]; c2[2]=_t;\
_t=c1[3]; c1[3]=c2[3]; c3[3]=_t;}
void qd_getPixel(CompBuf* src, int x, int y, float* col);
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
index 18972aa4b0b..926dcd0f046 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
@@ -51,7 +51,7 @@ bNodeStack **out)
nodestack_get_vec(vec+1, SOCK_VALUE, in[1]);
nodestack_get_vec(vec+2, SOCK_VALUE, in[2]);
- out[0]->vec[0] = 1.0f / (1.0f + pow(2.71828183,-((vec[0]-vec[2])*vec[1]))) ;
+ out[0]->vec[0] = 1.0f / (1.0f + pow(2.71828183,-((vec[0]-vec[2])*vec[1]))) ;
}
static int gpu_shader_squeeze(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
index 16b65a4b0be..3e7ef0e94fe 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
@@ -111,24 +111,24 @@ static int count_outputs(bNode *node)
/* Boilerplate generators */
#define ProcNoInputs(name) \
- static void name##_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) \
- {}
+ static void name##_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) \
+ {}
#define ProcDef(name) \
- static void name##_colorfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
- { \
- texfn(result, p, node, in, 0, &name##_map_inputs, thread); \
- } \
- static void name##_normalfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
- { \
- texfn(result, p, node, in, 1, &name##_map_inputs, thread); \
- } \
- static void name##_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) \
- { \
- int outs = count_outputs(node); \
- if(outs >= 1) tex_output(node, in, out[0], &name##_colorfn, data); \
- if(outs >= 2) tex_output(node, in, out[1], &name##_normalfn, data); \
- }
+ static void name##_colorfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
+ { \
+ texfn(result, p, node, in, 0, &name##_map_inputs, thread); \
+ } \
+ static void name##_normalfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
+ { \
+ texfn(result, p, node, in, 1, &name##_map_inputs, thread); \
+ } \
+ static void name##_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) \
+ { \
+ int outs = count_outputs(node); \
+ if(outs >= 1) tex_output(node, in, out[0], &name##_colorfn, data); \
+ if(outs >= 2) tex_output(node, in, out[1], &name##_normalfn, data); \
+ }
/* --- VORONOI -- */
diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c
index f471198d8ee..dc31685827f 100644
--- a/source/blender/nodes/intern/TEX_util.c
+++ b/source/blender/nodes/intern/TEX_util.c
@@ -35,11 +35,11 @@
the TexDelegate* from its input stack, and uses tex_call_delegate to
retrieve the colour from the delegate.
- comments: (ton)
+ comments: (ton)
- This system needs recode, a node system should rely on the stack, and
+ This system needs recode, a node system should rely on the stack, and
callbacks for nodes only should evaluate own node, not recursively go
- over other previous ones.
+ over other previous ones.
*/
#include <assert.h>
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index 0d9bf8a7ffe..11208d54a73 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -67,11 +67,11 @@ extern "C" {
some_drawspace_pylist = PyList_New(0);
BPy_Set_DrawButtonsList(some_drawspace_pylist);
- Also, BPy_Free_DrawButtonsList() must be called as necassary when a drawspace
- with python callbacks is destroyed.
+ Also, BPy_Free_DrawButtonsList() must be called as necassary when a drawspace
+ with python callbacks is destroyed.
- This is necassary to avoid blender buttons storing invalid pointers to freed
- python data.*/
+ This is necassary to avoid blender buttons storing invalid pointers to freed
+ python data.*/
// void BPy_Set_DrawButtonsList(void *list);
// void BPy_Free_DrawButtonsList(void);
//
diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c
index f204fa62904..158b07b1be5 100644
--- a/source/blender/python/generic/Geometry.c
+++ b/source/blender/python/generic/Geometry.c
@@ -295,7 +295,7 @@ static PyObject *M_Geometry_TriangleArea( PyObject * self, PyObject * args )
float v1[3], v2[3], v3[3];
if( !PyArg_ParseTuple
- ( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2
+ ( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2
, &vector_Type, &vec3 ) ) {
PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n");
return NULL;
diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c
index 1cf4d2254ea..542bf7a6ca9 100644
--- a/source/blender/python/generic/Mathutils.c
+++ b/source/blender/python/generic/Mathutils.c
@@ -509,7 +509,7 @@ static PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args)
}
if((strcmp(plane, "X") == 0)
- && matSize == 2) {
+ && matSize == 2) {
mat[0] = 1.0f;
mat[2] = factor;
mat[3] = 1.0f;
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index b17d25ae784..2ca84f3a311 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -61,7 +61,7 @@ static PyObject *Buffer_item( PyObject * self, int i );
static PyObject *Buffer_slice( PyObject * self, int begin, int end );
static int Buffer_ass_item( PyObject * self, int i, PyObject * v );
static int Buffer_ass_slice( PyObject * self, int begin, int end,
- PyObject * seq );
+ PyObject * seq );
static PySequenceMethods Buffer_SeqMethods = {
( lenfunc ) Buffer_len, /*sq_length */
@@ -430,7 +430,7 @@ BGL_Wrap(3, AreTexturesResident, GLboolean, (GLsizei, GLuintP, GLbooleanP))
BGL_Wrap(1, Begin, void, (GLenum))
BGL_Wrap(2, BindTexture, void, (GLenum, GLuint))
BGL_Wrap(7, Bitmap, void, (GLsizei, GLsizei, GLfloat,
- GLfloat, GLfloat, GLfloat, GLubyteP))
+ GLfloat, GLfloat, GLfloat, GLubyteP))
BGL_Wrap(2, BlendFunc, void, (GLenum, GLenum))
BGL_Wrap(1, CallList, void, (GLuint))
BGL_Wrap(3, CallLists, void, (GLsizei, GLenum, GLvoidP))
@@ -511,7 +511,7 @@ BGL_Wrap(2, Fogi, void, (GLenum, GLint))
BGL_Wrap(2, Fogiv, void, (GLenum, GLintP))
BGL_Wrap(1, FrontFace, void, (GLenum))
BGL_Wrap(6, Frustum, void, (GLdouble, GLdouble,
- GLdouble, GLdouble, GLdouble, GLdouble))
+ GLdouble, GLdouble, GLdouble, GLdouble))
BGL_Wrap(1, GenLists, GLuint, (GLsizei))
BGL_Wrap(2, GenTextures, void, (GLsizei, GLuintP))
BGL_Wrap(2, GetBooleanv, void, (GLenum, GLbooleanP))
@@ -573,19 +573,19 @@ BGL_Wrap(1, LoadMatrixf, void, (GLfloatP))
BGL_Wrap(1, LoadName, void, (GLuint))
BGL_Wrap(1, LogicOp, void, (GLenum))
BGL_Wrap(6, Map1d, void, (GLenum, GLdouble, GLdouble,
- GLint, GLint, GLdoubleP))
+ GLint, GLint, GLdoubleP))
BGL_Wrap(6, Map1f, void, (GLenum, GLfloat, GLfloat,
- GLint, GLint, GLfloatP))
+ GLint, GLint, GLfloatP))
BGL_Wrap(10, Map2d, void, (GLenum, GLdouble, GLdouble,
- GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdoubleP))
+ GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdoubleP))
BGL_Wrap(10, Map2f, void, (GLenum, GLfloat, GLfloat,
- GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloatP))
+ GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloatP))
BGL_Wrap(3, MapGrid1d, void, (GLint, GLdouble, GLdouble))
BGL_Wrap(3, MapGrid1f, void, (GLint, GLfloat, GLfloat))
BGL_Wrap(6, MapGrid2d, void, (GLint, GLdouble, GLdouble,
- GLint, GLdouble, GLdouble))
+ GLint, GLdouble, GLdouble))
BGL_Wrap(6, MapGrid2f, void, (GLint, GLfloat, GLfloat,
- GLint, GLfloat, GLfloat))
+ GLint, GLfloat, GLfloat))
BGL_Wrap(3, Materialf, void, (GLenum, GLenum, GLfloat))
BGL_Wrap(3, Materialfv, void, (GLenum, GLenum, GLfloatP))
BGL_Wrap(3, Materiali, void, (GLenum, GLenum, GLint))
@@ -605,7 +605,7 @@ BGL_Wrap(1, Normal3iv, void, (GLintP))
BGL_Wrap(3, Normal3s, void, (GLshort, GLshort, GLshort))
BGL_Wrap(1, Normal3sv, void, (GLshortP))
BGL_Wrap(6, Ortho, void, (GLdouble, GLdouble,
- GLdouble, GLdouble, GLdouble, GLdouble))
+ GLdouble, GLdouble, GLdouble, GLdouble))
BGL_Wrap(1, PassThrough, void, (GLfloat))
BGL_Wrap(3, PixelMapfv, void, (GLenum, GLint, GLfloatP))
BGL_Wrap(3, PixelMapuiv, void, (GLenum, GLint, GLuintP))
@@ -654,7 +654,7 @@ BGL_Wrap(4, RasterPos4s, void, (GLshort, GLshort, GLshort, GLshort))
BGL_Wrap(1, RasterPos4sv, void, (GLshortP))
BGL_Wrap(1, ReadBuffer, void, (GLenum))
BGL_Wrap(7, ReadPixels, void, (GLint, GLint, GLsizei,
- GLsizei, GLenum, GLenum, GLvoidP))
+ GLsizei, GLenum, GLenum, GLvoidP))
BGL_Wrap(4, Rectd, void, (GLdouble, GLdouble, GLdouble, GLdouble))
BGL_Wrap(2, Rectdv, void, (GLdoubleP, GLdoubleP))
BGL_Wrap(4, Rectf, void, (GLfloat, GLfloat, GLfloat, GLfloat))
@@ -717,9 +717,9 @@ BGL_Wrap(3, TexGenfv, void, (GLenum, GLenum, GLfloatP))
BGL_Wrap(3, TexGeni, void, (GLenum, GLenum, GLint))
BGL_Wrap(3, TexGeniv, void, (GLenum, GLenum, GLintP))
BGL_Wrap(8, TexImage1D, void, (GLenum, GLint, GLint,
- GLsizei, GLint, GLenum, GLenum, GLvoidP))
+ GLsizei, GLint, GLenum, GLenum, GLvoidP))
BGL_Wrap(9, TexImage2D, void, (GLenum, GLint, GLint,
- GLsizei, GLsizei, GLint, GLenum, GLenum, GLvoidP))
+ GLsizei, GLsizei, GLint, GLenum, GLenum, GLvoidP))
BGL_Wrap(3, TexParameterf, void, (GLenum, GLenum, GLfloat))
BGL_Wrap(3, TexParameterfv, void, (GLenum, GLenum, GLfloatP))
BGL_Wrap(3, TexParameteri, void, (GLenum, GLenum, GLint))
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index fc0cd3fc18b..6b79945ccd8 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -186,7 +186,7 @@ static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * k
static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0};
if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOOi:bpy_import_meth", kwlist,
- &name, &globals, &locals, &fromlist, &dummy_val) )
+ &name, &globals, &locals, &fromlist, &dummy_val) )
return NULL;
/* import existing builtin modules or modules that have been imported alredy */
diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c
index 3c20d341c7b..892e42657b7 100644
--- a/source/blender/python/generic/euler.c
+++ b/source/blender/python/generic/euler.c
@@ -443,7 +443,7 @@ static PyObject *Euler_slice(EulerObject * self, int begin, int end)
//----------------------------object[z:y]------------------------
//sequence slice (set)
static int Euler_ass_slice(EulerObject * self, int begin, int end,
- PyObject * seq)
+ PyObject * seq)
{
int i, y, size = 0;
float eul[3];
diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c
index bd819128753..216139dc44f 100644
--- a/source/blender/python/generic/matrix.c
+++ b/source/blender/python/generic/matrix.c
@@ -221,7 +221,7 @@ static PyObject *Matrix_toQuat(MatrixObject * self)
return NULL;
}
if(self->colSize == 3){
- mat3_to_quat( quat,(float (*)[3])self->contigPtr);
+ mat3_to_quat( quat,(float (*)[3])self->contigPtr);
}else{
mat4_to_quat( quat,(float (*)[4])self->contigPtr);
}
@@ -1172,8 +1172,8 @@ static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
}
else {
PyErr_Format(PyExc_TypeError,
- "vector indices must be integers, not %.200s",
- item->ob_type->tp_name);
+ "vector indices must be integers, not %.200s",
+ item->ob_type->tp_name);
return NULL;
}
}
@@ -1203,8 +1203,8 @@ static int Matrix_ass_subscript(MatrixObject* self, PyObject* item, PyObject* va
}
else {
PyErr_Format(PyExc_TypeError,
- "matrix indices must be integers, not %.200s",
- item->ob_type->tp_name);
+ "matrix indices must be integers, not %.200s",
+ item->ob_type->tp_name);
return -1;
}
}
@@ -1389,13 +1389,13 @@ PyTypeObject matrix_Type = {
/*------------------------newMatrixObject (internal)-------------
creates a new matrix object
self->matrix self->contiguous_ptr (reference to data.xxx)
- [0]------------->[0]
- [1]
- [2]
- [1]------------->[3]
- [4]
- [5]
- ....
+ [0]------------->[0]
+ [1]
+ [2]
+ [1]------------->[3]
+ [4]
+ [5]
+ ....
self->matrix[1][1] = self->contigPtr[4] */
/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c
index b08383cb508..36d01e7aa9f 100644
--- a/source/blender/python/generic/quat.c
+++ b/source/blender/python/generic/quat.c
@@ -183,7 +183,7 @@ static PyObject *Quaternion_Difference(QuaternionObject * self, QuaternionObject
tempQuat[3] = - self->quat[3];
dot = sqrt(tempQuat[0] * tempQuat[0] + tempQuat[1] * tempQuat[1] +
- tempQuat[2] * tempQuat[2] + tempQuat[3] * tempQuat[3]);
+ tempQuat[2] * tempQuat[2] + tempQuat[3] * tempQuat[3]);
for(x = 0; x < 4; x++) {
tempQuat[x] /= (float)(dot * dot);
@@ -731,7 +731,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw
PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
return NULL;
}
- if(size == 3){ //get angle in axis/angle
+ if(size == 3){ //get angle in axis/angle
n = PySequence_GetItem(args, 1);
if(n == NULL) { // parsed item not a number or getItem fail
PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c
index e320f87e9b9..fa26946a682 100644
--- a/source/blender/python/generic/vector.c
+++ b/source/blender/python/generic/vector.c
@@ -522,7 +522,7 @@ static char Vector_Angle_doc[] =
" .. note:: Zero length vectors raise an :exc:`AttributeError`.\n";
static PyObject *Vector_Angle(VectorObject * self, VectorObject * value)
{
- double dot = 0.0f, angleRads, test_v1 = 0.0f, test_v2 = 0.0f;
+ double dot = 0.0f, angleRads, test_v1 = 0.0f, test_v2 = 0.0f;
int x, size;
if (!VectorObject_Check(value)) {
@@ -797,7 +797,7 @@ static PyObject *Vector_slice(VectorObject * self, int begin, int end)
/*----------------------------object[z:y]------------------------
sequence slice (set) */
static int Vector_ass_slice(VectorObject * self, int begin, int end,
- PyObject * seq)
+ PyObject * seq)
{
int i, y, size = 0;
float vec[4], scalar;
@@ -1321,8 +1321,8 @@ static PyObject *Vector_subscript(VectorObject* self, PyObject* item)
}
else {
PyErr_Format(PyExc_TypeError,
- "vector indices must be integers, not %.200s",
- item->ob_type->tp_name);
+ "vector indices must be integers, not %.200s",
+ item->ob_type->tp_name);
return NULL;
}
}
@@ -1352,8 +1352,8 @@ static int Vector_ass_subscript(VectorObject* self, PyObject* item, PyObject* va
}
else {
PyErr_Format(PyExc_TypeError,
- "vector indices must be integers, not %.200s",
- item->ob_type->tp_name);
+ "vector indices must be integers, not %.200s",
+ item->ob_type->tp_name);
return -1;
}
}
@@ -1515,11 +1515,11 @@ static PyObject *Vector_getSwizzle(VectorObject * self, void *closure)
/* Set the items of this vector using a swizzle.
- If value is a vector or list this operates like an array copy, except that
- the destination is effectively re-ordered as defined by the swizzle. At
- most min(len(source), len(dest)) values will be copied.
+ the destination is effectively re-ordered as defined by the swizzle. At
+ most min(len(source), len(dest)) values will be copied.
- If the value is scalar, it is copied to all axes listed in the swizzle.
- If an axis appears more than once in the swizzle, the final occurrence is
- the one that determines its value.
+ the one that determines its value.
Returns 0 on success and -1 on failure. On failure, the vector will be
unchanged. */
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index eed9f4174c2..a14e8ee98c3 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -54,23 +54,23 @@ static char bpy_home_paths_doc[] =
PyObject *bpy_home_paths(PyObject *self, PyObject *args)
{
- PyObject *ret= PyTuple_New(3);
- char *path;
- char *subfolder= "";
+ PyObject *ret= PyTuple_New(3);
+ char *path;
+ char *subfolder= "";
if (!PyArg_ParseTuple(args, "|s:blender_homes", &subfolder))
return NULL;
- path= BLI_gethome_folder(subfolder, BLI_GETHOME_SYSTEM);
- PyTuple_SET_ITEM(ret, 0, PyUnicode_FromString(path?path:""));
+ path= BLI_gethome_folder(subfolder, BLI_GETHOME_SYSTEM);
+ PyTuple_SET_ITEM(ret, 0, PyUnicode_FromString(path?path:""));
- path= BLI_gethome_folder(subfolder, BLI_GETHOME_LOCAL);
- PyTuple_SET_ITEM(ret, 1, PyUnicode_FromString(path?path:""));
+ path= BLI_gethome_folder(subfolder, BLI_GETHOME_LOCAL);
+ PyTuple_SET_ITEM(ret, 1, PyUnicode_FromString(path?path:""));
- path= BLI_gethome_folder(subfolder, BLI_GETHOME_USER);
- PyTuple_SET_ITEM(ret, 2, PyUnicode_FromString(path?path:""));
+ path= BLI_gethome_folder(subfolder, BLI_GETHOME_USER);
+ PyTuple_SET_ITEM(ret, 2, PyUnicode_FromString(path?path:""));
- return ret;
+ return ret;
}
static PyMethodDef meth_bpy_home_paths[] = {{ "home_paths", (PyCFunction)bpy_home_paths, METH_VARARGS, bpy_home_paths_doc}};
diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c
index a20a7f54e22..9ceba4ae004 100644
--- a/source/blender/python/intern/bpy_array.c
+++ b/source/blender/python/intern/bpy_array.c
@@ -34,15 +34,15 @@ typedef void (*RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *)
/*
arr[3][4][5]
- 0 1 2 <- dimension index
+ 0 1 2 <- dimension index
*/
/*
arr[2] = x
py_to_array_index(arraydim=0, arrayoffset=0, index=2)
- validate_array(lvalue_dim=0)
- ... make real index ...
+ validate_array(lvalue_dim=0)
+ ... make real index ...
*/
/* arr[3]=x, self->arraydim is 0, lvalue_dim is 1 */
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index eab4d352225..00ea556792e 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -271,11 +271,11 @@ float BPY_pydriver_eval (ChannelDriver *driver)
PyGILState_Release(gilstate);
- if(finite(result)) {
- return (float)result;
- }
- else {
- fprintf(stderr, "\tBPY_pydriver_eval() - driver '%s' evaluates to '%f'\n", dvar->name, result);
- return 0.0f;
- }
+ if(finite(result)) {
+ return (float)result;
+ }
+ else {
+ fprintf(stderr, "\tBPY_pydriver_eval() - driver '%s' evaluates to '%f'\n", dvar->name, result);
+ return 0.0f;
+ }
}
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index c23ff2f2951..85935c05cb1 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -111,7 +111,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -177,7 +177,7 @@ PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -254,7 +254,7 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -321,7 +321,7 @@ PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -402,7 +402,7 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -477,7 +477,7 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -555,7 +555,7 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -667,7 +667,7 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -731,7 +731,7 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix
}
if(!RNA_struct_is_a(srna, &RNA_IDPropertyGroup)) {
- PyErr_Format(PyExc_SystemError, "%.200s expected an RNA type derived from IDPropertyGroup", error_prefix);
+ PyErr_Format(PyExc_SystemError, "%.200s expected an RNA type derived from IDPropertyGroup", error_prefix);
return NULL;
}
@@ -752,7 +752,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
@@ -813,7 +813,7 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *srna;
if (PyTuple_GET_SIZE(args) > 0) {
- PyErr_SetString(PyExc_ValueError, "all args must be keywords");
+ PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index dcbdc6d64d4..4792d284ca7 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -1099,12 +1099,17 @@ static Py_ssize_t pyrna_prop_collection_length( BPy_PropertyRNA *self )
static PyObject *pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_ssize_t keynum)
{
PointerRNA newptr;
+ int len= RNA_property_collection_length(&self->ptr, self->prop);
- if(keynum < 0) keynum += RNA_property_collection_length(&self->ptr, self->prop);
-
- if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr))
- return pyrna_struct_CreatePyObject(&newptr);
+ if(keynum < 0) keynum += len;
+ if(keynum >= 0 && keynum < len) {
+ if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr)) {
+ return pyrna_struct_CreatePyObject(&newptr);
+ }
+ PyErr_Format(PyExc_IndexError, "bpy_prop_collection[index]: index %d could not be found", keynum);
+ return NULL;
+ }
PyErr_Format(PyExc_IndexError, "bpy_prop_collection[index]: index %d out of range", keynum);
return NULL;
}
@@ -2030,8 +2035,8 @@ static PyObject *pyrna_struct_getattro( BPy_StructRNA *self, PyObject *pyname )
}
}
else if ((prop = RNA_struct_find_property(&self->ptr, name))) {
- ret = pyrna_prop_to_py(&self->ptr, prop);
- }
+ ret = pyrna_prop_to_py(&self->ptr, prop);
+ }
/* RNA function only if callback is declared (no optional functions) */
else if ((func = RNA_struct_find_function(&self->ptr, name)) && RNA_function_defined(func)) {
ret = pyrna_func_to_py((BPy_DummyPointerRNA *)self, func);
@@ -2971,7 +2976,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
RNA_parameter_list_create(&parms, self_ptr, self_func);
RNA_parameter_list_begin(&parms, &iter);
- parms_len= RNA_parameter_list_size(&parms);
+ parms_len= RNA_parameter_list_arg_count(&parms);
ret_len= 0;
if(pyargs_len + pykw_len > parms_len) {
@@ -2999,7 +3004,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
parm_id= RNA_property_identifier(parm);
item= NULL;
- if ((i < pyargs_len) && (flag & PROP_REQUIRED)) {
+ if (i < pyargs_len) {
item= PyTuple_GET_ITEM(args, i);
i++;
@@ -3044,7 +3049,6 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
RNA_parameter_list_end(&iter);
-
/* Check if we gave args that dont exist in the function
* printing the error is slow but it should only happen when developing.
* the if below is quick, checking if it passed less keyword args then we gave.
@@ -3903,19 +3907,19 @@ StructRNA *pyrna_struct_as_srna(PyObject *self, int parent, const char *error_pr
}
if(py_srna==NULL) {
- PyErr_Format(PyExc_SystemError, "%.200s internal error, self of type '%.200s' had no bl_rna attribute, should never happen", error_prefix, Py_TYPE(self)->tp_name);
+ PyErr_Format(PyExc_SystemError, "%.200s internal error, self of type '%.200s' had no bl_rna attribute, should never happen", error_prefix, Py_TYPE(self)->tp_name);
return NULL;
}
if(!BPy_StructRNA_Check(py_srna)) {
- PyErr_Format(PyExc_SystemError, "%.200s internal error, bl_rna was of type '%.200s', instead of %.200s instance", error_prefix, Py_TYPE(py_srna)->tp_name, pyrna_struct_Type.tp_name);
- Py_DECREF(py_srna);
+ PyErr_Format(PyExc_SystemError, "%.200s internal error, bl_rna was of type '%.200s', instead of %.200s instance", error_prefix, Py_TYPE(py_srna)->tp_name, pyrna_struct_Type.tp_name);
+ Py_DECREF(py_srna);
return NULL;
}
if(py_srna->ptr.type != &RNA_Struct) {
PyErr_Format(PyExc_SystemError, "%.200s internal error, bl_rna was not a RNA_Struct type of rna struct", error_prefix);
- Py_DECREF(py_srna);
+ Py_DECREF(py_srna);
return NULL;
}
@@ -4441,12 +4445,12 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class)
PyObject *item;
const char *identifier= "";
- if(PyDict_GetItemString(((PyTypeObject*)py_class)->tp_dict, "bl_rna")) {
+ if(PyDict_GetItemString(((PyTypeObject*)py_class)->tp_dict, "bl_rna")) {
PyErr_SetString(PyExc_AttributeError, "bpy.types.register(...): already registered as a subclass.");
return NULL;
- }
+ }
- /* warning: gets parent classes srna, only for the register function */
+ /* warning: gets parent classes srna, only for the register function */
srna= pyrna_struct_as_srna(py_class, 1, "bpy.types.register(...):");
if(srna==NULL)
return NULL;
@@ -4513,10 +4517,10 @@ PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class)
StructUnregisterFunc unreg;
StructRNA *srna;
- /*if(PyDict_GetItemString(((PyTypeObject*)py_class)->tp_dict, "bl_rna")==NULL) {
+ /*if(PyDict_GetItemString(((PyTypeObject*)py_class)->tp_dict, "bl_rna")==NULL) {
PyErr_SetString(PyExc_ValueError, "bpy.types.unregister(): not a registered as a subclass.");
return NULL;
- }*/
+ }*/
srna= pyrna_struct_as_srna(py_class, 0, "bpy.types.unregister(...):");
if(srna==NULL)
diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h
index 10cd6ba010b..e7e7bb09419 100644
--- a/source/blender/python/intern/bpy_util.h
+++ b/source/blender/python/intern/bpy_util.h
@@ -50,9 +50,9 @@ PyObject *PyObject_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
/* Class type checking, use for checking classes can be added as operators, panels etc */
typedef struct BPY_class_attr_check {
const char *name; /* name of the class attribute */
- char type; /* 's' = string, 'f' = function, 'l' = list, (add as needed) */
- int arg_count; /* only for function types, -1 for undefined, includes self arg */
- int len; /* only for string types currently */
+ char type; /* 's' = string, 'f' = function, 'l' = list, (add as needed) */
+ int arg_count; /* only for function types, -1 for undefined, includes self arg */
+ int len; /* only for string types currently */
int flag; /* other options */
} BPY_class_attr_check;
diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c
index 5bea41b105a..aaf2634bbf6 100644
--- a/source/blender/quicktime/apple/quicktime_export.c
+++ b/source/blender/quicktime/apple/quicktime_export.c
@@ -871,20 +871,20 @@ int fromcocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
void SCENE_OT_render_data_set_quicktime_codec(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Change codec";
- ot->description= "Change Quicktime codec Settings";
- ot->idname= "SCENE_OT_render_data_set_quicktime_codec";
+ ot->name= "Change codec";
+ ot->description= "Change Quicktime codec Settings";
+ ot->idname= "SCENE_OT_render_data_set_quicktime_codec";
- /* api callbacks */
+ /* api callbacks */
#if defined(__APPLE__) && defined(GHOST_COCOA)
ot->exec = cocoa_request_qtcodec_settings;
#else
- ot->exec= request_qtcodec_settings;
+ ot->exec= request_qtcodec_settings;
#endif
- ot->poll= ED_operator_setqtcodec;
+ ot->poll= ED_operator_setqtcodec;
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
#endif /* USE_QTKIT */
diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c
index edcf7213cc1..10b45cafa91 100644
--- a/source/blender/quicktime/apple/quicktime_import.c
+++ b/source/blender/quicktime/apple/quicktime_import.c
@@ -783,25 +783,25 @@ bail:
#if 0
struct ImageDescription {
- long idSize;
- CodecType cType;
- long resvd1;
- short resvd2;
- short dataRefIndex;
- short version;
- short revisionLevel;
- long vendor;
- CodecQ temporalQuality;
- CodecQ spatialQuality;
- short width;
- short height;
- Fixed hRes;
- Fixed vRes;
- long dataSize;
- short frameCount;
- Str31 name;
- short depth;
- short clutID;
+ long idSize;
+ CodecType cType;
+ long resvd1;
+ short resvd2;
+ short dataRefIndex;
+ short version;
+ short revisionLevel;
+ long vendor;
+ CodecQ temporalQuality;
+ CodecQ spatialQuality;
+ short width;
+ short height;
+ Fixed hRes;
+ Fixed vRes;
+ long dataSize;
+ short frameCount;
+ Str31 name;
+ short depth;
+ short clutID;
};
#endif // 0
diff --git a/source/blender/readblenfile/test/test.c b/source/blender/readblenfile/test/test.c
index 86473c18687..1706da59d92 100644
--- a/source/blender/readblenfile/test/test.c
+++ b/source/blender/readblenfile/test/test.c
@@ -35,13 +35,13 @@
struct streamGlueControlStruct *Global_streamGlueControl;
- int
+ int
streamGlueWrite(
- struct streamGlueControlStruct *streamGlueControl,
- struct streamGlueStruct **streamGlue,
- unsigned char *data,
- unsigned int dataIn,
- int finishUp)
+ struct streamGlueControlStruct *streamGlueControl,
+ struct streamGlueStruct **streamGlue,
+ unsigned char *data,
+ unsigned int dataIn,
+ int finishUp)
{
printf("called with %d bytes in buffer [%s]\n", dataIn, data);
return (0);
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h
index 615d41b9b0a..e16ec83fb61 100644
--- a/source/blender/render/intern/include/rayobject.h
+++ b/source/blender/render/intern/include/rayobject.h
@@ -64,7 +64,7 @@ extern "C" {
This leads to 4 possible types of RayObject:
addr&3 - type of object
- 0 Self (reserved for each structure)
+ 0 Self (reserved for each structure)
1 RayFace (tri/quad primitive)
2 RayObject (generic with API callbacks)
3 VlakPrimitive
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 0b0ea075d79..127fbce20eb 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -376,18 +376,18 @@ typedef struct VlakRen {
typedef struct HaloRen
{
- short miny, maxy;
- float alfa, xs, ys, rad, radsq, sin, cos, co[3], no[3];
+ short miny, maxy;
+ float alfa, xs, ys, rad, radsq, sin, cos, co[3], no[3];
float hard, b, g, r;
- int zs, zd;
- int zBufDist; /* depth in the z-buffer coordinate system */
- char starpoints, type, add, tex;
- char linec, ringc, seed;
+ int zs, zd;
+ int zBufDist; /* depth in the z-buffer coordinate system */
+ char starpoints, type, add, tex;
+ char linec, ringc, seed;
short flarec; /* used to be a char. why ?*/
- float hasize;
- int pixels;
- unsigned int lay;
- struct Material *mat;
+ float hasize;
+ int pixels;
+ unsigned int lay;
+ struct Material *mat;
} HaloRen;
/* ------------------------------------------------------------------------- */
diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h
index 7f1defc2dd4..111d1df2694 100644
--- a/source/blender/render/intern/include/sunsky.h
+++ b/source/blender/render/intern/include/sunsky.h
@@ -33,43 +33,43 @@
typedef struct SunSky
{
- short effect_type, skyblendtype, sky_colorspace;
- float turbidity;
- float theta, phi;
+ short effect_type, skyblendtype, sky_colorspace;
+ float turbidity;
+ float theta, phi;
- float toSun[3];
+ float toSun[3];
- /*float sunSpectralRaddata[SPECTRUM_MAX_COMPONENTS];*/
- float sunSolidAngle;
+ /*float sunSpectralRaddata[SPECTRUM_MAX_COMPONENTS];*/
+ float sunSolidAngle;
- float zenith_Y, zenith_x, zenith_y;
+ float zenith_Y, zenith_x, zenith_y;
- float perez_Y[5], perez_x[5], perez_y[5];
+ float perez_Y[5], perez_x[5], perez_y[5];
- /* suggested by glome in
- * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/
- float horizon_brightness;
- float spread;
- float sun_brightness;
- float sun_size;
- float backscattered_light;
- float skyblendfac;
+ /* suggested by glome in
+ * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/
+ float horizon_brightness;
+ float spread;
+ float sun_brightness;
+ float sun_size;
+ float backscattered_light;
+ float skyblendfac;
float sky_exposure;
- float atm_HGg;
+ float atm_HGg;
- float atm_SunIntensity;
- float atm_InscatteringMultiplier;
- float atm_ExtinctionMultiplier;
- float atm_BetaRayMultiplier;
- float atm_BetaMieMultiplier;
- float atm_DistanceMultiplier;
+ float atm_SunIntensity;
+ float atm_InscatteringMultiplier;
+ float atm_ExtinctionMultiplier;
+ float atm_BetaRayMultiplier;
+ float atm_BetaMieMultiplier;
+ float atm_DistanceMultiplier;
- float atm_BetaRay[3];
- float atm_BetaDashRay[3];
- float atm_BetaMie[3];
- float atm_BetaDashMie[3];
- float atm_BetaRM[3];
+ float atm_BetaRay[3];
+ float atm_BetaDashRay[3];
+ float atm_BetaMie[3];
+ float atm_BetaDashMie[3];
+ float atm_BetaRM[3];
}SunSky;
/**
diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h
index fb6760c28d3..dcaaca7d718 100644
--- a/source/blender/render/intern/include/zbuf.h
+++ b/source/blender/render/intern/include/zbuf.h
@@ -59,22 +59,22 @@ void zbuffer_sss(RenderPart *pa, unsigned int lay, void *handle, void (*func)(vo
int zbuffer_strands_abuf(struct Render *re, struct RenderPart *pa, struct APixstrand *apixbuf, struct ListBase *apsmbase, unsigned int lay, int negzmask, float winmat[][4], int winx, int winy, int sample, float (*jit)[2], float clipcrop, int shadow, struct StrandShadeCache *cache);
typedef struct APixstr {
- unsigned short mask[4]; /* jitter mask */
- int z[4]; /* distance */
- int p[4]; /* index */
+ unsigned short mask[4]; /* jitter mask */
+ int z[4]; /* distance */
+ int p[4]; /* index */
int obi[4]; /* object instance */
short shadfac[4]; /* optimize storage for irregular shadow */
- struct APixstr *next;
+ struct APixstr *next;
} APixstr;
typedef struct APixstrand {
- unsigned short mask[4]; /* jitter mask */
- int z[4]; /* distance */
- int p[4]; /* index */
+ unsigned short mask[4]; /* jitter mask */
+ int z[4]; /* distance */
+ int p[4]; /* index */
int obi[4]; /* object instance */
int seg[4]; /* for strands, segment number */
float u[4], v[4]; /* for strands, u,v coordinate in segment */
- struct APixstrand *next;
+ struct APixstrand *next;
} APixstrand;
typedef struct APixstrMain
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index c756a135048..727f490e31f 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -316,7 +316,7 @@ NOTE THAT U/V COORDINATES ARE SOMETIMES SWAPPED !!
u | | F1 | F2 |
| | | |
()----p1----p2----()
- v ->
+ v ->
*/
/* ------------------------------------------------------------------------- */
@@ -1006,8 +1006,8 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, Par
/* use actual Blender units for strand width and fall back to minimum width */
if(ma->mode & MA_STR_B_UNITS){
- crosslen= len_v3(cross);
- w= 2.0f*crosslen*ma->strand_min/w;
+ crosslen= len_v3(cross);
+ w= 2.0f*crosslen*ma->strand_min/w;
if(width < w)
width= w;
@@ -3713,7 +3713,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->sunsky->effect_type = la->sun_effect_type;
VECCOPY(vec,ob->obmat[2]);
- normalize_v3(vec);
+ normalize_v3(vec);
InitSunSky(lar->sunsky, la->atm_turbidity, vec, la->horizon_brightness,
la->spread, la->sun_brightness, la->sun_size, la->backscattered_light,
@@ -4674,7 +4674,7 @@ static int allow_render_dupli_instance(Render *re, DupliObject *dob, Object *obd
/* don't allow lamp, animated duplis, or radio render */
return (render_object_type(obd->type) &&
- (!(dob->type == OB_DUPLIGROUP) || !dob->animated));
+ (!(dob->type == OB_DUPLIGROUP) || !dob->animated));
}
static void dupli_render_particle_set(Render *re, Object *ob, int timeoffset, int level, int enable)
@@ -4723,7 +4723,7 @@ static int get_vector_renderlayers(Scene *sce)
SceneRenderLayer *srl;
unsigned int lay= 0;
- for(srl= sce->r.layers.first; srl; srl= srl->next)
+ for(srl= sce->r.layers.first; srl; srl= srl->next)
if(srl->passflag & SCE_PASS_VECTOR)
lay |= srl->lay;
diff --git a/source/blender/render/intern/source/gammaCorrectionTables.c b/source/blender/render/intern/source/gammaCorrectionTables.c
index 02410d28048..afb7fbb74dc 100644
--- a/source/blender/render/intern/source/gammaCorrectionTables.c
+++ b/source/blender/render/intern/source/gammaCorrectionTables.c
@@ -75,7 +75,7 @@ float gammaCorrect(float c)
if (i < 0) res = -pow(abs(c), valid_gamma);
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
else res = gamma_range_table[i] +
- ( (c - color_domain_table[i]) * gamfactor_table[i]);
+ ( (c - color_domain_table[i]) * gamfactor_table[i]);
return res;
} /* end of float gammaCorrect(float col) */
@@ -92,7 +92,7 @@ float invGammaCorrect(float col)
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
else res = inv_gamma_range_table[i] +
- ( (col - color_domain_table[i]) * inv_gamfactor_table[i]);
+ ( (col - color_domain_table[i]) * inv_gamfactor_table[i]);
return res;
} /* end of float invGammaCorrect(float col) */
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 4f0e21a9fbb..21077c289c3 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -420,7 +420,7 @@ static float clipy_rctf(rctf *rf, float y1, float y2)
static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres)
{
/* sample box, is clipped already, and minx etc. have been set at ibuf size.
- Enlarge with antialiased edges of the pixels */
+ Enlarge with antialiased edges of the pixels */
float muly, mulx, div, col[4];
int x, y, startx, endx, starty, endy;
@@ -1080,7 +1080,7 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec,
if (tex->imaflag & TEX_FILTER_MIN) {
// make sure the filtersize is minimal in pixels (normal, ref map can have miniature pixel dx/dy)
- const float addval = (0.5f * tex->filtersize) / (float)MIN2(ibuf->x, ibuf->y);
+ const float addval = (0.5f * tex->filtersize) / (float)MIN2(ibuf->x, ibuf->y);
if (addval > minx) minx = addval;
if (addval > miny) miny = addval;
}
@@ -1481,7 +1481,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f
if(tex->imaflag & TEX_FILTER_MIN) {
/* make sure the filtersize is minimal in pixels (normal, ref map can have miniature pixel dx/dy) */
- float addval= (0.5f * tex->filtersize) / (float) MIN2(ibuf->x, ibuf->y);
+ float addval= (0.5f * tex->filtersize) / (float) MIN2(ibuf->x, ibuf->y);
if(addval > minx)
minx= addval;
diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c
index 5542a036d9a..26c68d0a167 100644
--- a/source/blender/render/intern/source/initrender.c
+++ b/source/blender/render/intern/source/initrender.c
@@ -109,10 +109,10 @@ static void init_render_jit(Render *re)
static float filt_quadratic(float x)
{
- if (x < 0.0f) x = -x;
- if (x < 0.5f) return 0.75f-(x*x);
- if (x < 1.5f) return 0.50f*(x-1.5f)*(x-1.5f);
- return 0.0f;
+ if (x < 0.0f) x = -x;
+ if (x < 0.5f) return 0.75f-(x*x);
+ if (x < 1.5f) return 0.50f*(x-1.5f)*(x-1.5f);
+ return 0.0f;
}
@@ -120,11 +120,11 @@ static float filt_cubic(float x)
{
float x2= x*x;
- if (x < 0.0f) x = -x;
+ if (x < 0.0f) x = -x;
- if (x < 1.0f) return 0.5*x*x2 - x2 + 2.0f/3.0f;
- if (x < 2.0f) return (2.0-x)*(2.0-x)*(2.0-x)/6.0f;
- return 0.0f;
+ if (x < 1.0f) return 0.5*x*x2 - x2 + 2.0f/3.0f;
+ if (x < 2.0f) return (2.0-x)*(2.0-x)*(2.0-x)/6.0f;
+ return 0.0f;
}
@@ -132,10 +132,10 @@ static float filt_catrom(float x)
{
float x2= x*x;
- if (x < 0.0f) x = -x;
- if (x < 1.0f) return 1.5f*x2*x - 2.5f*x2 + 1.0f;
- if (x < 2.0f) return -0.5f*x2*x + 2.5*x2 - 4.0f*x + 2.0f;
- return 0.0f;
+ if (x < 0.0f) x = -x;
+ if (x < 1.0f) return 1.5f*x2*x - 2.5f*x2 + 1.0f;
+ if (x < 2.0f) return -0.5f*x2*x + 2.5*x2 - 4.0f*x + 2.0f;
+ return 0.0f;
}
static float filt_mitchell(float x) /* Mitchell & Netravali's two-param cubic */
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index 39faf22fb31..ab656ad1c3b 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -1025,8 +1025,8 @@ static float occ_quad_form_factor(float *p, float *n, float *q0, float *q1, floa
/* dot */
vresult.v = (vec_splat_float(n[0])*gx +
- vec_splat_float(n[1])*gy +
- vec_splat_float(n[2])*gz)*vangle;
+ vec_splat_float(n[1])*gy +
+ vec_splat_float(n[2])*gz)*vangle;
result= (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3])*(0.5f/(float)M_PI);
result= MAX2(result, 0.0f);
@@ -1096,7 +1096,7 @@ static float occ_quad_form_factor(float *p, float *n, float *q0, float *q1, floa
aresult = (_mm_set_ps1(n[0])*gx + _mm_set_ps1(n[1])*gy + _mm_set_ps1(n[2])*gz)*angle;
/* sum together */
- result= (fresult[0] + fresult[1] + fresult[2] + fresult[3])*(0.5f/(float)M_PI);
+ result= (fresult[0] + fresult[1] + fresult[2] + fresult[3])*(0.5f/(float)M_PI);
result= MAX2(result, 0.0f);
return result;
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 9c35451bca0..e11c37db09a 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -2684,7 +2684,7 @@ static int is_rendering_allowed(Render *re)
}
}
- /* check valid camera, without camera render is OK (compo, seq) */
+ /* check valid camera, without camera render is OK (compo, seq) */
if(re->scene->camera==NULL)
re->scene->camera= scene_find_camera(re->scene);
diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c
index 683c6323fb2..8ff35bc9bae 100644
--- a/source/blender/render/intern/source/pixelblending.c
+++ b/source/blender/render/intern/source/pixelblending.c
@@ -74,8 +74,8 @@ extern struct Render R;
void addAlphaOverFloat(float *dest, float *source)
{
- /* d = s + (1-alpha_s)d*/
- float mul;
+ /* d = s + (1-alpha_s)d*/
+ float mul;
mul= 1.0 - source[3];
@@ -91,7 +91,7 @@ void addAlphaOverFloat(float *dest, float *source)
void addAlphaUnderFloat(float *dest, float *source)
{
- float mul;
+ float mul;
mul= 1.0 - dest[3];
@@ -105,41 +105,41 @@ void addAlphaUnderFloat(float *dest, float *source)
/* ------------------------------------------------------------------------- */
void addalphaAddfacFloat(float *dest, float *source, char addfac)
{
- float m; /* weiging factor of destination */
- float c; /* intermediate color */
+ float m; /* weiging factor of destination */
+ float c; /* intermediate color */
- /* Addfac is a number between 0 and 1: rescale */
- /* final target is to diminish the influence of dest when addfac rises */
- m = 1.0 - ( source[3] * ((255.0 - addfac) / 255.0));
+ /* Addfac is a number between 0 and 1: rescale */
+ /* final target is to diminish the influence of dest when addfac rises */
+ m = 1.0 - ( source[3] * ((255.0 - addfac) / 255.0));
- /* blend colors*/
- c= (m * dest[0]) + source[0];
+ /* blend colors*/
+ c= (m * dest[0]) + source[0];
#ifdef RE_FLOAT_COLOR_CLIPPING
- if(c >= RE_FULL_COLOR_FLOAT) dest[0] = RE_FULL_COLOR_FLOAT;
- else
+ if(c >= RE_FULL_COLOR_FLOAT) dest[0] = RE_FULL_COLOR_FLOAT;
+ else
#endif
- dest[0]= c;
+ dest[0]= c;
- c= (m * dest[1]) + source[1];
+ c= (m * dest[1]) + source[1];
#ifdef RE_FLOAT_COLOR_CLIPPING
- if(c >= RE_FULL_COLOR_FLOAT) dest[1] = RE_FULL_COLOR_FLOAT;
- else
+ if(c >= RE_FULL_COLOR_FLOAT) dest[1] = RE_FULL_COLOR_FLOAT;
+ else
#endif
- dest[1]= c;
+ dest[1]= c;
- c= (m * dest[2]) + source[2];
+ c= (m * dest[2]) + source[2];
#ifdef RE_FLOAT_COLOR_CLIPPING
- if(c >= RE_FULL_COLOR_FLOAT) dest[2] = RE_FULL_COLOR_FLOAT;
- else
+ if(c >= RE_FULL_COLOR_FLOAT) dest[2] = RE_FULL_COLOR_FLOAT;
+ else
#endif
- dest[2]= c;
+ dest[2]= c;
c= (m * dest[3]) + source[3];
#ifdef RE_ALPHA_CLIPPING
if(c >= RE_FULL_COLOR_FLOAT) dest[3] = RE_FULL_COLOR_FLOAT;
else
#endif
- dest[3]= c;
+ dest[3]= c;
}
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index 69e1f1103e2..768fc4ecacb 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -285,14 +285,14 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
int a;
if(R.wrld.mode & WO_MIST) {
- if(har->type & HA_ONLYSKY) {
- /* stars but no mist */
- alpha= har->alfa;
- }
- else {
- /* a bit patchy... */
- alpha= mistfactor(-har->co[2], har->co)*har->alfa;
- }
+ if(har->type & HA_ONLYSKY) {
+ /* stars but no mist */
+ alpha= har->alfa;
+ }
+ else {
+ /* a bit patchy... */
+ alpha= mistfactor(-har->co[2], har->co)*har->alfa;
+ }
}
else alpha= har->alfa;
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 6bc3c6c54a7..d22b24bf544 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -306,12 +306,12 @@ void free_pointdensities(Render *re)
typedef struct PointDensityRangeData
{
- float *density;
- float squared_radius;
- float *point_data;
+ float *density;
+ float squared_radius;
+ float *point_data;
float *vec;
float softness;
- short falloff_type;
+ short falloff_type;
short noise_influence;
float *age;
int point_data_used;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index d0a334f039e..cf1f339591d 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -1028,7 +1028,7 @@ void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
static void reset_sky_speed(RenderPart *pa, RenderLayer *rl)
{
/* for all pixels with max speed, set to zero */
- RenderLayer *rlpp[RE_MAX_OSA];
+ RenderLayer *rlpp[RE_MAX_OSA];
float *fp;
int a, sample, totsample;
@@ -1045,9 +1045,9 @@ static void reset_sky_speed(RenderPart *pa, RenderLayer *rl)
static unsigned short *make_solid_mask(RenderPart *pa)
{
- intptr_t *rd= pa->rectdaps;
- unsigned short *solidmask, *sp;
- int x;
+ intptr_t *rd= pa->rectdaps;
+ unsigned short *solidmask, *sp;
+ int x;
if(rd==NULL) return NULL;
@@ -1092,7 +1092,7 @@ static void addAlphaOverFloatMask(float *dest, float *source, unsigned short dma
dest[3]+= source[3];
return;
- }
+ }
dest[0]= (mul*dest[0]) + source[0];
dest[1]= (mul*dest[1]) + source[1];
@@ -2725,12 +2725,12 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up
}
/* calculate return value */
- for(a=0; a<re->r.threads; a++) {
+ for(a=0; a<re->r.threads; a++) {
vdone+= handles[a].vdone;
zbuf_free_span(handles[a].zspan);
MEM_freeN(handles[a].zspan);
- }
+ }
MEM_freeN(handles);
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 954ff373c89..35d969f9f21 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -945,13 +945,13 @@ static int firstreadshadbuf(ShadBuf *shb, ShadSampleBuf *shsample, int **rz, int
ofs= (ys>>4)*(shb->size>>4) + (xs>>4);
ct= shsample->cbuf+ofs;
if(*ct==0) {
- if(nr==0) {
+ if(nr==0) {
*rz= *( (int **)(shsample->zbuf+ofs) );
return 1;
- }
+ }
else if(*rz!= *( (int **)(shsample->zbuf+ofs) )) return 0;
- return 1;
+ return 1;
}
return 0;
@@ -1071,7 +1071,7 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int
else {
/* got warning on this for 64 bits.... */
/* but it's working code! in this case rz is not a pointer but zvalue (ton) */
- zsamp= GET_INT_FROM_POINTER(rz);
+ zsamp= GET_INT_FROM_POINTER(rz);
}
/* tricky stuff here; we use ints which can overflow easily with bias values */
@@ -1174,7 +1174,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *co, float *dxco, float *dyc
/* in case we have a constant value in a tile, we can do quicker lookup */
if(xres<16.0f && yres<16.0f) {
shsample= shb->buffers.first;
- if(firstreadshadbuf(shb, shsample, &rz, (int)xs1, (int)ys1, 0)) {
+ if(firstreadshadbuf(shb, shsample, &rz, (int)xs1, (int)ys1, 0)) {
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)) {
@@ -1182,7 +1182,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *co, float *dxco, float *dyc
}
}
}
- }
+ }
}
/* full jittered shadow buffer lookup */
@@ -1255,7 +1255,7 @@ static float readshadowbuf_halo(ShadBuf *shb, ShadSampleBuf *shsample, int xs, i
else {
/* same as before */
/* still working code! (ton) */
- zsamp= GET_INT_FROM_POINTER(rz);
+ zsamp= GET_INT_FROM_POINTER(rz);
}
/* NO schadow when sampled at 'eternal' distance */
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index bed75266767..6bc1153f8b3 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -31,11 +31,11 @@
- add fresnel terms
- adapt Rd table to scale, now with small scale there are a lot of misses?
- possible interesting method: perform sss on all samples in the tree,
- and then use those values interpolated somehow later. can also do this
+ and then use those values interpolated somehow later. can also do this
filtering on demand for speed. since we are doing things in screen
space now there is an exact correspondence
- avoid duplicate shading (filtering points in advance, irradiance cache
- like lookup?)
+ like lookup?)
- lower resolution samples
*/
@@ -196,13 +196,13 @@ static float compute_reduced_albedo(ScatterSettings *ss)
if(xn_1 > 1.0f) xn_1= 1.0f;
fxn= f_Rd(xn, ss->A, ss->ro);
- }
+ }
/* avoid division by zero later */
if(xn <= 0.0f)
xn= 0.00001f;
- return xn;
+ return xn;
}
/* Exponential falloff functions */
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index c754ed1eab9..1bf1f1fe582 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -658,8 +658,8 @@ static void strand_render(Render *re, StrandSegment *sseg, float winmat[][4], St
obi= sseg->obi - re->objectinstance;
index= sseg->strand->index;
- projectvert(p1->co, winmat, hoco1);
- projectvert(p2->co, winmat, hoco2);
+ projectvert(p1->co, winmat, hoco1);
+ projectvert(p2->co, winmat, hoco2);
for(a=0; a<totzspan; a++) {
#if 0
diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c
index 66b352a9ba6..193fd2aa46f 100644
--- a/source/blender/render/intern/source/sunsky.c
+++ b/source/blender/render/intern/source/sunsky.c
@@ -63,12 +63,12 @@
* */
void ClipColor(float c[3])
{
- if (c[0] > 1.0) c[0] = 1.0;
- if (c[0] < 0.0) c[0] = 0.0;
- if (c[1] > 1.0) c[1] = 1.0;
- if (c[1] < 0.0) c[1] = 0.0;
- if (c[2] > 1.0) c[2] = 1.0;
- if (c[2] < 0.0) c[2] = 0.0;
+ if (c[0] > 1.0) c[0] = 1.0;
+ if (c[0] < 0.0) c[0] = 0.0;
+ if (c[1] > 1.0) c[1] = 1.0;
+ if (c[1] < 0.0) c[1] = 0.0;
+ if (c[2] > 1.0) c[2] = 1.0;
+ if (c[2] < 0.0) c[2] = 0.0;
}
/**
@@ -97,11 +97,11 @@ static float AngleBetween(float thetav, float phiv, float theta, float phi)
* */
static void DirectionToThetaPhi(float *toSun, float *theta, float *phi)
{
- *theta = acos(toSun[2]);
- if (fabs(*theta) < 1e-5)
- *phi = 0;
- else
- *phi = atan2(toSun[1], toSun[0]);
+ *theta = acos(toSun[2]);
+ if (fabs(*theta) < 1e-5)
+ *phi = 0;
+ else
+ *phi = atan2(toSun[1], toSun[0]);
}
/**
@@ -110,15 +110,15 @@ static void DirectionToThetaPhi(float *toSun, float *theta, float *phi)
* */
float PerezFunction(struct SunSky *sunsky, const float *lam, float theta, float gamma, float lvz)
{
- float den, num;
+ float den, num;
- den = ((1 + lam[0] * exp(lam[1])) *
+ den = ((1 + lam[0] * exp(lam[1])) *
(1 + lam[2] * exp(lam[3] * sunsky->theta) + lam[4] * cos(sunsky->theta) * cos(sunsky->theta)));
- num = ((1 + lam[0] * exp(lam[1] / cos(theta))) *
+ num = ((1 + lam[0] * exp(lam[1] / cos(theta))) *
(1 + lam[2] * exp(lam[3] * gamma) + lam[4] * cos(gamma) * cos(gamma)));
- return(lvz * num / den);}
+ return(lvz * num / den);}
/**
* InitSunSky:
@@ -138,7 +138,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b
float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace)
{
- float theta2;
+ float theta2;
float theta3;
float T;
float T2;
@@ -157,10 +157,10 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b
sunsky->sky_colorspace= sky_colorspace;
sunsky->toSun[0] = toSun[0];
- sunsky->toSun[1] = toSun[1];
- sunsky->toSun[2] = toSun[2];
+ sunsky->toSun[1] = toSun[1];
+ sunsky->toSun[2] = toSun[2];
- DirectionToThetaPhi(sunsky->toSun, &sunsky->theta, &sunsky->phi);
+ DirectionToThetaPhi(sunsky->toSun, &sunsky->theta, &sunsky->phi);
sunsky->sunSolidAngle = 0.25 * M_PI * 1.39 * 1.39 / (150 * 150); // = 6.7443e-05
@@ -177,14 +177,14 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b
sunsky->zenith_Y = 1e-6;
sunsky->zenith_x =
- ( + 0.00165 * theta3 - 0.00374 * theta2 + 0.00208 * sunsky->theta + 0) * T2 +
- ( -0.02902 * theta3 + 0.06377 * theta2 - 0.03202 * sunsky->theta + 0.00394) * T +
- ( + 0.11693 * theta3 - 0.21196 * theta2 + 0.06052 * sunsky->theta + 0.25885);
+ ( + 0.00165 * theta3 - 0.00374 * theta2 + 0.00208 * sunsky->theta + 0) * T2 +
+ ( -0.02902 * theta3 + 0.06377 * theta2 - 0.03202 * sunsky->theta + 0.00394) * T +
+ ( + 0.11693 * theta3 - 0.21196 * theta2 + 0.06052 * sunsky->theta + 0.25885);
sunsky->zenith_y =
- ( + 0.00275 * theta3 - 0.00610 * theta2 + 0.00316 * sunsky->theta + 0) * T2 +
- ( -0.04214 * theta3 + 0.08970 * theta2 - 0.04153 * sunsky->theta + 0.00515) * T +
- ( + 0.15346 * theta3 - 0.26756 * theta2 + 0.06669 * sunsky->theta + 0.26688);
+ ( + 0.00275 * theta3 - 0.00610 * theta2 + 0.00316 * sunsky->theta + 0) * T2 +
+ ( -0.04214 * theta3 + 0.08970 * theta2 - 0.04153 * sunsky->theta + 0.00515) * T +
+ ( + 0.15346 * theta3 - 0.26756 * theta2 + 0.06669 * sunsky->theta + 0.26688);
sunsky->perez_Y[0] = 0.17872 * T - 1.46303;
@@ -205,8 +205,8 @@ void InitSunSky(struct SunSky *sunsky, float turb, float *toSun, float horizon_b
sunsky->perez_y[3] = -0.04405 * T - 1.65369;
sunsky->perez_y[4] = -0.01092 * T + 0.05291;
- /* suggested by glome in
- * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/
+ /* suggested by glome in
+ * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/
sunsky->perez_Y[0] *= sunsky->horizon_brightness;
sunsky->perez_x[0] *= sunsky->horizon_brightness;
sunsky->perez_y[0] *= sunsky->horizon_brightness;
@@ -239,12 +239,12 @@ 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 hfade=1, nfade=1;
+ float gamma;
+ float x,y,Y,X,Z;
+ float hfade=1, nfade=1;
- if (theta>(0.5*M_PI)) {
+ if (theta>(0.5*M_PI)) {
hfade = 1.0-(theta*M_1_PI-0.5)*2.0;
hfade = hfade*hfade*(3.0-2.0*hfade);
theta = 0.5*M_PI;
@@ -260,20 +260,20 @@ void GetSkyXYZRadiance(struct SunSky* sunsky, float theta, float phi, float colo
gamma = AngleBetween(theta, phi, sunsky->theta, sunsky->phi);
- // Compute xyY values
- x = PerezFunction(sunsky, sunsky->perez_x, theta, gamma, sunsky->zenith_x);
- y = PerezFunction(sunsky, sunsky->perez_y, theta, gamma, sunsky->zenith_y);
- Y = 6.666666667e-5 * nfade * hfade * PerezFunction(sunsky, sunsky->perez_Y, theta, gamma, sunsky->zenith_Y);
+ // Compute xyY values
+ x = PerezFunction(sunsky, sunsky->perez_x, theta, gamma, sunsky->zenith_x);
+ y = PerezFunction(sunsky, sunsky->perez_y, theta, gamma, sunsky->zenith_y);
+ Y = 6.666666667e-5 * nfade * hfade * PerezFunction(sunsky, sunsky->perez_Y, theta, gamma, sunsky->zenith_Y);
if(sunsky->sky_exposure!=0.0f)
Y = 1.0 - exp(Y*sunsky->sky_exposure);
- X = (x / y) * Y;
- Z = ((1 - x - y) / y) * Y;
+ X = (x / y) * Y;
+ Z = ((1 - x - y) / y) * Y;
- color_out[0] = X;
- color_out[1] = Y;
- color_out[2] = Z;
+ color_out[0] = X;
+ color_out[1] = Y;
+ color_out[2] = Z;
}
/**
@@ -286,19 +286,19 @@ void GetSkyXYZRadiance(struct SunSky* sunsky, float theta, float phi, float colo
* */
void GetSkyXYZRadiancef(struct SunSky* sunsky, const float varg[3], float color_out[3])
{
- float theta, phi;
- float v[3];
+ float theta, phi;
+ float v[3];
copy_v3_v3(v, (float*)varg);
normalize_v3(v);
- if (v[2] < 0.001){
- v[2] = 0.001;
- normalize_v3(v);
- }
+ if (v[2] < 0.001){
+ v[2] = 0.001;
+ normalize_v3(v);
+ }
- DirectionToThetaPhi(v, &theta, &phi);
- GetSkyXYZRadiance(sunsky, theta, phi, color_out);
+ DirectionToThetaPhi(v, &theta, &phi);
+ GetSkyXYZRadiance(sunsky, theta, phi, color_out);
}
/**
@@ -311,13 +311,13 @@ void GetSkyXYZRadiancef(struct SunSky* sunsky, const float varg[3], float color_
* */
void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3])
{
- float fBeta ;
- float fTauR, fTauA;
- float m ;
- float fAlpha;
+ float fBeta ;
+ float fTauR, fTauA;
+ float m ;
+ float fAlpha;
- int i;
- float fLambda[3];
+ int i;
+ float fLambda[3];
fLambda[0] = 0.65f;
fLambda[1] = 0.57f;
fLambda[2] = 0.475f;
@@ -327,7 +327,7 @@ void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3])
m = 1.0/(cos(theta) + 0.15f*pow(93.885f-theta/M_PI*180.0f,-1.253f));
- for(i = 0; i < 3; i++)
+ for(i = 0; i < 3; i++)
{
// Rayleigh Scattering
fTauR = exp( -m * 0.008735f * pow(fLambda[i], (float)(-4.08f)));
@@ -336,7 +336,7 @@ void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3])
fTauA = exp(-m * fBeta * pow(fLambda[i], -fAlpha));
fTau[i] = fTauR * fTauA;
- }
+ }
}
/**
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 9e89d101215..8b33753c2b1 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -1479,16 +1479,16 @@ void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg
VECCOPY(in, out);
ramp_blend(MA_RAMP_COLOR, in, in+1, in+2, fact, tex);
break;
- case MTEX_SOFT_LIGHT:
- fact*= facg;
- VECCOPY(in, out);
- ramp_blend(MA_RAMP_SOFT, in, in+1, in+2, fact, tex);
- break;
- case MTEX_LIN_LIGHT:
- fact*= facg;
- VECCOPY(in, out);
- ramp_blend(MA_RAMP_LINEAR, in, in+1, in+2, fact, tex);
- break;
+ case MTEX_SOFT_LIGHT:
+ fact*= facg;
+ VECCOPY(in, out);
+ ramp_blend(MA_RAMP_SOFT, in, in+1, in+2, fact, tex);
+ break;
+ case MTEX_LIN_LIGHT:
+ fact*= facg;
+ VECCOPY(in, out);
+ ramp_blend(MA_RAMP_LINEAR, in, in+1, in+2, fact, tex);
+ break;
}
}
@@ -1551,18 +1551,18 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
if(col > out) in= col; else in= out;
break;
- case MTEX_SOFT_LIGHT:
- col= fact*tex;
- scf=1.0 - (1.0 - tex) * (1.0 - out);
- in= facm*out + fact * ((1.0 - out) * tex * out) + (out * scf);
- break;
-
- case MTEX_LIN_LIGHT:
- if (tex > 0.5)
- in = out + fact*(2*(tex - 0.5));
- else
- in = out + fact*(2*tex - 1);
- break;
+ case MTEX_SOFT_LIGHT:
+ col= fact*tex;
+ scf=1.0 - (1.0 - tex) * (1.0 - out);
+ in= facm*out + fact * ((1.0 - out) * tex * out) + (out * scf);
+ break;
+
+ case MTEX_LIN_LIGHT:
+ if (tex > 0.5)
+ in = out + fact*(2*(tex - 0.5));
+ else
+ in = out + fact*(2*tex - 1);
+ break;
}
return in;
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index 70e0fd41b7d..99c27aaf81e 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -296,7 +296,7 @@ float vol_get_density(struct ShadeInput *shi, float *co)
if (shi->obi->obr->ob->type == OB_MBALL) {
const float md = metadensity(shi->obi->obr->ob, co);
if (md < 1.f) density *= md;
- }
+ }
return density * density_scale;
}
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index 1e665b2a809..762848c402a 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -283,7 +283,7 @@ static void cache_voxeldata(struct Render *re,Tex *tex)
void make_voxeldata(struct Render *re)
{
- Tex *tex;
+ Tex *tex;
re->i.infostr= "Loading voxel datasets";
re->stats_draw(re->sdh, &re->i);
@@ -325,7 +325,7 @@ void free_voxeldata(Render *re)
int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres)
{
- int retval = TEX_INT;
+ int retval = TEX_INT;
VoxelData *vd = tex->vd;
float co[3], offset[3] = {0.5, 0.5, 0.5};
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 1a4b469cc6f..2e6892cbc1c 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -1910,10 +1910,10 @@ void zbufclip(ZSpan *zspan, int obi, int zvlnr, float *f1, float *f2, float *f3,
}
}
- /* warning, this should never happen! */
+ /* warning, this should never happen! */
if(clve>38 || clvl>31) printf("clip overflow: clve clvl %d %d\n",clve,clvl);
- /* perspective division */
+ /* perspective division */
f1=vez;
for(c1=0;c1<clve;c1++) {
hoco_to_zco(zspan, f1, f1);
@@ -3846,7 +3846,7 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf
ShadeInput *shi= ssamp->shi;
ShadeResult *shr= ssamp->shr;
- for(sample=0; sample<ssamp->tot; sample++, shi++, shr++) {
+ for(sample=0; sample<ssamp->tot; sample++, shi++, shr++) {
if(shi->mask & (1<<a)) {
float fac= (1.0f - samp_shr->combined[3])*shr->combined[3];
diff --git a/source/blender/verify/intern/BLO_verify.c b/source/blender/verify/intern/BLO_verify.c
index 6b79d0e4cab..33e48185e81 100644
--- a/source/blender/verify/intern/BLO_verify.c
+++ b/source/blender/verify/intern/BLO_verify.c
@@ -377,7 +377,7 @@ BLO_verify_end(
/* verify the signature */
verifySuccess = RSA_verify(NID_ripemd160, digest, RIPEMD160_DIGEST_LENGTH,
- BLO_verify->streamHeader->signature,
+ BLO_verify->streamHeader->signature,
BLO_verify->streamHeader->signatureLen, rsa);
if (verifySuccess == 1) {
#ifndef NDEBUG
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index f0c8a1cb978..cfeccfd7f62 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -56,7 +56,6 @@
#include "ED_screen.h"
#include "BPY_extern.h"
-#include "RNA_types.h"
/* ****************************************************** */
@@ -64,11 +63,14 @@
void WM_operator_free(wmOperator *op)
{
+
+#ifndef DISABLE_PYTHON
if(op->py_instance) {
/* do this first incase there are any __del__ functions or
* similar that use properties */
BPY_DECREF(op->py_instance);
}
+#endif
if(op->ptr) {
op->properties= op->ptr->data;
diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c
index 67c49c4717f..22b4b85c01e 100644
--- a/source/blender/windowmanager/intern/wm_apple.c
+++ b/source/blender/windowmanager/intern/wm_apple.c
@@ -107,9 +107,9 @@ static void getMacAvailableBounds(short *top, short *left, short *bottom, short
GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect);
*top = outAvailableRect.top;
- *left = outAvailableRect.left;
- *bottom = outAvailableRect.bottom;
- *right = outAvailableRect.right;
+ *left = outAvailableRect.left;
+ *bottom = outAvailableRect.bottom;
+ *right = outAvailableRect.right;
}
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index a84eb74be33..b16e82726b4 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -660,57 +660,57 @@ END_CURSOR_BLOCK
BEGIN_CURSOR_BLOCK
static char vloop_sbm[]={
- 0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00,
- 0x0e, 0x00, 0x66, 0x60, 0x62, 0x6f, 0x00, 0x00,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x00, 0x00, 0x60, 0x60, 0x60, 0x6f, 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00,
+ 0x0e, 0x00, 0x66, 0x60, 0x62, 0x6f, 0x00, 0x00,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x00, 0x00, 0x60, 0x60, 0x60, 0x6f, 0x00, 0x00,
};
static char vloop_smsk[]={
- 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00,
- 0xff, 0xf0, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xf0,
- 0x61, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0,
+ 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00,
+ 0xff, 0xf0, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xf0,
+ 0x61, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
+ 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0,
};
static char vloop_lbm[]={
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00,
- 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00,
- 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
- 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
- 0x3c, 0x3c, 0x00, 0x3c, 0x3c, 0x3c, 0x00, 0x3c,
- 0x0c, 0x3c, 0xff, 0x3c, 0x0c, 0x3c, 0xff, 0x3c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
- 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
- 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
- 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
- 0x00, 0x3c, 0xff, 0x3c, 0x00, 0x3c, 0xff, 0x3c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00,
+ 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00,
+ 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
+ 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
+ 0x3c, 0x3c, 0x00, 0x3c, 0x3c, 0x3c, 0x00, 0x3c,
+ 0x0c, 0x3c, 0xff, 0x3c, 0x0c, 0x3c, 0xff, 0x3c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
+ 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
+ 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
+ 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
+ 0x00, 0x3c, 0xff, 0x3c, 0x00, 0x3c, 0xff, 0x3c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static char vloop_lmsk[]={
- 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00,
- 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
- 0xff, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00,
- 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
- 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
- 0x0f, 0xff, 0x00, 0xff, 0x0f, 0xff, 0x00, 0xff,
- 0x03, 0x3c, 0x00, 0x3c, 0x03, 0x3c, 0x00, 0x3c,
- 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
- 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
- 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
- 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
- 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
- 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
- 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
+ 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
+ 0xff, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00,
+ 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
+ 0x0f, 0xff, 0x00, 0xff, 0x0f, 0xff, 0x00, 0xff,
+ 0x03, 0x3c, 0x00, 0x3c, 0x03, 0x3c, 0x00, 0x3c,
+ 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
+ 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
+ 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c,
+ 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
+ 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
+ 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
+ 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
};
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 6f093b2b3a9..cf1e58c52fc 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -57,7 +57,6 @@
#include "wm_event_system.h"
#include "wm.h"
-#include "RNA_types.h"
/* ****************************************************** */
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 513e93d9e3d..fec46d32a08 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -158,7 +158,7 @@ static void wm_flush_regions_down(bScreen *screen, rcti *dirty)
for(sa= screen->areabase.first; sa; sa= sa->next) {
for(ar= sa->regionbase.first; ar; ar= ar->next) {
if(BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
- ar->do_draw= 1;
+ ar->do_draw= RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
ar->swap= WIN_NONE_OK;
}
@@ -173,7 +173,7 @@ static void wm_flush_regions_up(bScreen *screen, rcti *dirty)
for(ar= screen->regionbase.first; ar; ar= ar->next) {
if(BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
- ar->do_draw= 1;
+ ar->do_draw= RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
ar->swap= WIN_NONE_OK;
}
@@ -329,7 +329,7 @@ static int is_pow2(int n)
static int smaller_pow2(int n)
{
- while (!is_pow2(n))
+ while (!is_pow2(n))
n= n&(n-1);
return n;
@@ -681,6 +681,13 @@ static int wm_automatic_draw_method(wmWindow *win)
return win->drawmethod;
}
+void wm_tag_redraw_overlay(wmWindow *win, ARegion *ar)
+{
+ /* for draw triple gestures, paint cursors don't need region redraw */
+ if(ar && win && wm_automatic_draw_method(win) != USER_DRAW_TRIPLE)
+ ED_region_tag_redraw(ar);
+}
+
void wm_draw_update(bContext *C)
{
wmWindowManager *wm= CTX_wm_manager(C);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 5de01a6259f..6aea2c0c096 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -56,7 +56,6 @@
#include "ED_fileselect.h"
#include "ED_info.h"
#include "ED_screen.h"
-#include "ED_space_api.h"
#include "ED_util.h"
#include "RNA_access.h"
@@ -71,6 +70,7 @@
#include "wm_window.h"
#include "wm_event_system.h"
#include "wm_event_types.h"
+#include "wm_draw.h"
/* ************ event management ************** */
@@ -1460,9 +1460,7 @@ static void wm_paintcursor_tag(bContext *C, wmPaintCursor *pc, ARegion *ar)
if(pc->poll == NULL || pc->poll(C)) {
wmWindow *win= CTX_wm_window(C);
win->screen->do_draw_paintcursor= 1;
-
- if(win->drawmethod != USER_DRAW_TRIPLE)
- ED_region_tag_redraw(ar);
+ wm_tag_redraw_overlay(win, ar);
}
}
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 80226b8fa56..2959bb4c179 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -76,7 +76,6 @@
#include "BLO_writefile.h"
#include "RNA_access.h"
-#include "RNA_define.h"
#include "ED_datafiles.h"
#include "ED_object.h"
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 856894aa74b..fd7ae142cbd 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -47,8 +47,8 @@
#include "wm.h"
#include "wm_event_system.h"
#include "wm_subwindow.h"
+#include "wm_draw.h"
-#include "ED_screen.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -238,7 +238,7 @@ static void draw_filled_lasso(wmGesture *gt)
if (lastv)
e = BLI_addfilledge(lastv, v);
lastv = v;
- if (firstv==NULL) firstv = v;
+ if (firstv==NULL) firstv = v;
}
/* highly unlikely this will fail, but could crash if (gt->points == 0) */
@@ -346,8 +346,8 @@ void wm_gesture_tag_redraw(bContext *C)
if(screen)
screen->do_draw_gesture= 1;
- if(ar && win->drawmethod != USER_DRAW_TRIPLE)
- ED_region_tag_redraw(ar);
+
+ wm_tag_redraw_overlay(win, ar);
}
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index dd1d41c082a..343b1f68c7f 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -48,9 +48,7 @@
#include "wm_event_types.h"
#include "wm.h"
-#include "ED_screen.h"
-#include "RNA_types.h"
/* ********************** Threaded Jobs Manager ****************************** */
@@ -69,11 +67,11 @@ Start or re-run job
Stop job
- signal job to end
- on end, job will tag itself as sleeping
+ on end, job will tag itself as sleeping
Remove job
- signal job to end
- on end, job will remove itself
+ on end, job will remove itself
When job is done:
- it puts timer to sleep (or removes?)
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 1ec131dd73a..ca6cabe3cce 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -47,7 +47,6 @@
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "WM_api.h"
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index e3d71951b7c..d74f3a3d6e7 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -759,7 +759,7 @@ int WM_operator_confirm_message(bContext *C, wmOperator *op, char *message)
pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION);
layout= uiPupMenuLayout(pup);
- uiItemFullO(layout, message, 0, op->type->idname, properties, WM_OP_EXEC_REGION_WIN, 0);
+ uiItemFullO(layout, op->type->idname, message, 0, properties, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED;
@@ -1130,7 +1130,6 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
char version_buf[128];
char revision_buf[128];
extern char build_rev[];
- char *cp;
version_str = &version_buf[0];
revision_str = &revision_buf[0];
@@ -1335,8 +1334,8 @@ static int wm_operator_winactive_normal(bContext *C)
{
wmWindow *win= CTX_wm_window(C);
- if(win==NULL || win->screen==NULL || win->screen->full != SCREENNORMAL)
- return 0;
+ if(win==NULL || win->screen==NULL || win->screen->full != SCREENNORMAL)
+ return 0;
return 1;
}
@@ -1960,7 +1959,7 @@ static void WM_OT_exit_blender(wmOperatorType *ot)
*/
void *WM_paint_cursor_activate(wmWindowManager *wm, int (*poll)(bContext *C),
- wmPaintCursorDraw draw, void *customdata)
+ wmPaintCursorDraw draw, void *customdata)
{
wmPaintCursor *pc= MEM_callocN(sizeof(wmPaintCursor), "paint cursor");
@@ -2132,8 +2131,8 @@ static void gesture_circle_apply(bContext *C, wmOperator *op)
wmGesture *gesture= op->customdata;
rcti *rect= gesture->customdata;
- if(RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_NOP)
- return;
+ if(RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_NOP)
+ return;
/* operator arguments and storage. */
RNA_int_set(op->ptr, "x", rect->xmin);
@@ -2633,7 +2632,7 @@ int WM_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
rc->initial_mouse[0] = mouse[0];
rc->initial_mouse[1] = mouse[1];
rc->cursor = WM_paint_cursor_activate(CTX_wm_manager(C), op->type->poll,
- wm_radial_control_paint, op->customdata);
+ wm_radial_control_paint, op->customdata);
/* add modal handler */
WM_event_add_modal_handler(C, op);
@@ -2658,7 +2657,7 @@ void WM_radial_control_string(wmOperator *op, char str[], int maxlen)
}
/** Important: this doesn't define an actual operator, it
- just sets up the common parts of the radial control op. **/
+ just sets up the common parts of the radial control op. **/
void WM_OT_radial_control_partial(wmOperatorType *ot)
{
static EnumPropertyItem radial_mode_items[] = {
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index efa9010fc65..f512434a141 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -44,7 +44,6 @@
#include "BKE_global.h"
#include "BIF_gl.h"
-#include "BIF_glutil.h"
#include "WM_api.h"
#include "wm_subwindow.h"
@@ -209,8 +208,8 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
* Really Blender should never _ever_ try
* to do such a thing, but just to be safe
* clamp it anyway (or fix the bScreen
- * scaling routine, and be damn sure you
- * fixed it). - zr (2001!)
+ * scaling routine, and be damn sure you
+ * fixed it). - zr (2001!)
*/
if (swin->winrct.xmax > win->sizex)
diff --git a/source/blender/windowmanager/wm_draw.h b/source/blender/windowmanager/wm_draw.h
index 42d3ec7e8bc..762d759c936 100644
--- a/source/blender/windowmanager/wm_draw.h
+++ b/source/blender/windowmanager/wm_draw.h
@@ -38,5 +38,7 @@ void wm_draw_update (struct bContext *C);
void wm_draw_window_clear (struct wmWindow *win);
void wm_draw_region_clear (struct wmWindow *win, struct ARegion *ar);
+void wm_tag_redraw_overlay (struct wmWindow *win, struct ARegion *ar);
+
#endif /* WM_DRAW_H */
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 4f9218cc887..c41a22e966c 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -46,6 +46,8 @@ struct ID;
struct ImBuf;
struct Image;
struct ImageUser;
+struct KeyingSetInfo;
+struct KeyingSet;
struct LOD_Decimation_Info;
struct MTex;
struct Main;
@@ -78,8 +80,10 @@ struct wmKeyMap;
struct wmOperator;
struct wmWindowManager;
+
+
/*new render funcs */
-float *RE_RenderLayerGetPass(struct RenderLayer *rl, int passtype) {return NULL;}
+float *RE_RenderLayerGetPass(struct RenderLayer *rl, int passtype) {return (float *) NULL;}
float RE_filter_value(int type, float x) {return 0.0f;}
struct RenderLayer *RE_GetRenderLayer(struct RenderResult *rr, const char *name) {return (struct RenderLayer *)NULL;}
@@ -100,9 +104,9 @@ struct RenderResult *RE_GetResult(struct Render *re){return (struct RenderResult
struct Render *RE_GetRender(const char *name){return (struct Render *) NULL;}
/* blenkernel */
-char* btempdir(){return NULL;}
+char* btempdir(){return (char *) NULL;}
void RE_FreeRenderResult(struct RenderResult *res){}
-char* datatoc_bmonofont_ttf(){return NULL;}
+char* datatoc_bmonofont_ttf(){return (char *) NULL;}
int datatoc_bmonofont_ttf_size(){return 0;}
struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return (struct RenderResult *) NULL;}
void RE_GetResultImage(struct Render *re, struct RenderResult *rr){}
@@ -121,10 +125,11 @@ struct Render *RE_NewRender(const char *name){return (struct Render*) NULL;}
void RE_BlenderFrame(struct Render *re, struct Scene *scene, int frame){}
/* rna */
-float *give_cursor(struct Scene *scene, struct View3D *v3d){return NULL;}
+float *give_cursor(struct Scene *scene, struct View3D *v3d){return (float *) NULL;}
void WM_menutype_free(void){}
void WM_menutype_freelink(struct MenuType* mt){}
int WM_menutype_add(struct MenuType *mt) {return 0;}
+int WM_operator_props_dialog_popup (struct bContext *C, struct wmOperator *op, int width, int height){return 0;}
struct MenuType *WM_menutype_find(const char *idname, int quiet){return (struct MenuType *) NULL;}
void WM_autosave_init(struct bContext *C){}
@@ -141,8 +146,8 @@ void object_test_constraints (struct Object *owner){}
void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr){}
void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con){}
void ED_node_composit_default(struct Scene *sce){}
-void *ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *custumdata, int type){return 0;}
-void *ED_region_draw_cb_customdata(void *handle){return 0;}
+void *ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *custumdata, int type){return 0;} /* XXX this one looks wierd */
+void *ED_region_draw_cb_customdata(void *handle){return 0;} /* XXX This one looks wrong also */
void ED_region_draw_cb_exit(struct ARegionType *art, void *handle){}
struct EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, struct EditBone *ebo){return (struct EditBone *) NULL;}
@@ -179,13 +184,16 @@ int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2){ret
/* rna editors */
-struct KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[]){return NULL;}
+struct KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[]){return (struct KeyingSetInfo *) NULL;}
+struct KeyingSet *ANIM_scene_get_active_keyingset (struct Scene *scene){return (struct KeyingSet *) NULL;}
+int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks){return 0;}
+struct ListBase builtin_keyingsets;
void ANIM_keyingset_info_register (const struct bContext *C, struct KeyingSetInfo *ksi){}
void ANIM_keyingset_info_unregister (const struct bContext *C, struct KeyingSetInfo *ksi){}
short ANIM_add_driver(struct ID *id, const char rna_path[], int array_index, short flag, int type){return 0;}
void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock){}
struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock_r){return (struct ImBuf *) NULL;}
-char *ED_info_stats_string(struct Scene *scene){return NULL;}
+char *ED_info_stats_string(struct Scene *scene){return (char *) NULL;}
void ED_area_tag_redraw(struct ScrArea *sa){}
void ED_area_tag_refresh(struct ScrArea *sa){}
void ED_area_newspace(struct bContext *C, struct ScrArea *sa, int type){}
@@ -236,29 +244,29 @@ void EM_selectmode_set(struct EditMesh *em){}
void make_editMesh(struct Scene *scene, struct Object *ob){}
void load_editMesh(struct Scene *scene, struct Object *ob){}
-void uiItemR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int flag){}
+void uiItemR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int flag, char *name, int icon){}
-PointerRNA uiItemFullO(struct uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context, int flag){PointerRNA a; return a;}
+struct PointerRNA uiItemFullO(struct uiLayout *layout, char *idname, char *name, int icon, struct IDProperty *properties, int context, int flag){struct PointerRNA a; return a;}
struct uiLayout *uiLayoutRow(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;}
struct uiLayout *uiLayoutColumn(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;}
struct uiLayout *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align){return (struct uiLayout *) NULL;}
struct uiLayout *uiLayoutBox(struct uiLayout *layout){return (struct uiLayout *) NULL;}
struct uiLayout *uiLayoutSplit(struct uiLayout *layout, float percentage, int align){return (struct uiLayout *) NULL;}
void uiItemsEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){}
-void uiItemMenuEnumR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname){}
-void uiItemEnumR_string(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value){}
-void uiItemPointerR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname){}
+void uiItemMenuEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *name, int icon){}
+void uiItemEnumR_string(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon){}
+void uiItemPointerR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon){}
void uiItemsEnumO(struct uiLayout *layout, char *opname, char *propname){}
void uiItemEnumO_string(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value_str){}
-void uiItemMenuEnumO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname){}
+void uiItemMenuEnumO(struct uiLayout *layout, char *opname, char *propname, char *name, int icon){}
void uiItemBooleanO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){}
void uiItemIntO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){}
void uiItemFloatO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, float value){}
void uiItemStringO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value){}
void uiItemL(struct uiLayout *layout, char *name, int icon){}
-void uiItemM(struct uiLayout *layout, struct bContext *C, char *name, int icon, char *menuname){}
+void uiItemM(struct uiLayout *layout, struct bContext *C, char *menuname, char *name, int icon){}
void uiItemS(struct uiLayout *layout){}
-void uiItemFullR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag){}
+void uiItemFullR(struct uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, char *name, int icon){}
void uiLayoutSetContextPointer(struct uiLayout *layout, char *name, struct PointerRNA *ptr){}
char *uiLayoutIntrospect(struct uiLayout *layout){return (char *)NULL;}
@@ -321,9 +329,9 @@ void WM_operator_py_idname(char *to, const char *from){}
void WM_operator_ui_popup(struct bContext *C, struct wmOperator *op, int width, int height){}
short insert_keyframe (struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;}
short delete_keyframe(struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;};
-char *WM_operator_pystring(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args){return NULL;}
-struct wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value){return NULL;}
-struct wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, char *idname, EnumPropertyItem *items){return NULL;}
+char *WM_operator_pystring(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args){return (char *)NULL;}
+struct wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value){return (struct wmKeyMapItem *)NULL;}
+struct wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, char *idname, EnumPropertyItem *items){return (struct wmKeyMap *) NULL;}
/* intern/decimation */
int LOD_FreeDecimationData(struct LOD_Decimation_Info *info){return 0;}
diff --git a/source/creator/creator.c b/source/creator/creator.c
index d6fa4e586ad..78aff4024f0 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -81,7 +81,6 @@
//XXX #include "playanim_ext.h"
#include "ED_datafiles.h"
-#include "UI_interface.h"
#include "WM_api.h"
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index d1fecb76998..dfac6e1b816 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -1309,8 +1309,10 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
m_logger->StartLog(tc_rasterizer, m_kxsystem->GetTimeInSeconds(), true);
SG_SetActiveStage(SG_STAGE_RENDER);
+#ifndef DISABLE_PYTHON
// Run any pre-drawing python callbacks
scene->RunDrawingCallbacks(scene->GetPreDrawCB());
+#endif
scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools);
@@ -1324,7 +1326,9 @@ void KX_KetsjiEngine::PostRenderScene(KX_Scene* scene)
{
m_rendertools->MotionBlur(m_rasterizer);
scene->Render2DFilters(m_canvas);
+#ifndef DISABLE_PYTHON
scene->RunDrawingCallbacks(scene->GetPostDrawCB());
+#endif
m_rasterizer->FlushDebugLines();
}
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index a5512c2e34a..c4b1aaeacf4 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -407,34 +407,6 @@ bool KX_Scene::IsClearingZBuffer()
return m_isclearingZbuffer;
}
-void KX_Scene::RunDrawingCallbacks(PyObject* cb_list)
-{
- int len;
-
- if (cb_list && (len=PyList_GET_SIZE(cb_list)))
- {
- PyObject* args= PyTuple_New(0); // save python creating each call
- PyObject* func;
- PyObject* ret;
-
- // Iterate the list and run the callbacks
- for (int pos=0; pos < len; pos++)
- {
- func= PyList_GET_ITEM(cb_list, pos);
- ret= PyObject_Call(func, args, NULL);
- if (ret==NULL) {
- PyErr_Print();
- PyErr_Clear();
- }
- else {
- Py_DECREF(ret);
- }
- }
-
- Py_DECREF(args);
- }
-}
-
void KX_Scene::EnableZBufferClearing(bool isclearingZbuffer)
{
m_isclearingZbuffer = isclearingZbuffer;
@@ -1657,9 +1629,6 @@ double KX_Scene::getSuspendedDelta()
return m_suspendeddelta;
}
-#ifndef DISABLE_PYTHON
-
-
#include "KX_BulletPhysicsController.h"
static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to)
@@ -1855,6 +1824,36 @@ void KX_Scene::Render2DFilters(RAS_ICanvas* canvas)
m_filtermanager.RenderFilters(canvas);
}
+#ifndef DISABLE_PYTHON
+
+void KX_Scene::RunDrawingCallbacks(PyObject* cb_list)
+{
+ int len;
+
+ if (cb_list && (len=PyList_GET_SIZE(cb_list)))
+ {
+ PyObject* args= PyTuple_New(0); // save python creating each call
+ PyObject* func;
+ PyObject* ret;
+
+ // Iterate the list and run the callbacks
+ for (int pos=0; pos < len; pos++)
+ {
+ func= PyList_GET_ITEM(cb_list, pos);
+ ret= PyObject_Call(func, args, NULL);
+ if (ret==NULL) {
+ PyErr_Print();
+ PyErr_Clear();
+ }
+ else {
+ Py_DECREF(ret);
+ }
+ }
+
+ Py_DECREF(args);
+ }
+}
+
//----------------------------------------------------------------------------
//Python
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index c3fc23f2979..5b562977837 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -292,11 +292,6 @@ public:
RAS_IRenderTools* rendertools);
/**
- * Run the registered python drawing functions.
- */
- void RunDrawingCallbacks(PyObject* cb_list);
-
- /**
* Update all transforms according to the scenegraph.
*/
static bool KX_ScenegraphUpdateFunc(SG_IObject* node,void* gameobj,void* scene);
@@ -573,6 +568,11 @@ public:
static PyMappingMethods Mapping;
static PySequenceMethods Sequence;
+ /**
+ * Run the registered python drawing functions.
+ */
+ void RunDrawingCallbacks(PyObject* cb_list);
+
PyObject* GetPreDrawCB() { return m_draw_call_pre; };
PyObject* GetPostDrawCB() { return m_draw_call_post; };
#endif
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
index 014169f8838..12a255b4e4e 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
@@ -25,6 +25,7 @@ RAS_ListSlot::RAS_ListSlot(RAS_ListRasterizer* rasty)
: KX_ListSlot(),
m_list(0),
m_flag(LIST_MODIFY|LIST_CREATE),
+ m_matnr(0),
m_rasty(rasty)
{
}
@@ -121,11 +122,23 @@ void RAS_ListRasterizer::RemoveListSlot(RAS_ListSlot* list)
if (list->m_flag & LIST_DERIVEDMESH) {
RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.begin();
while(it != mDerivedMeshLists.end()) {
- if (it->second == list) {
- mDerivedMeshLists.erase(it);
+ RAS_ListSlots *slots = it->second;
+ if (slots->size() > list->m_matnr && slots->at(list->m_matnr) == list) {
+ (*slots)[list->m_matnr] = NULL;
+ // check if all slots are NULL and if yes, delete the entry
+ int i;
+ for (i=slots->size(); i-- > 0; ) {
+ if (slots->at(i) != NULL)
+ break;
+ }
+ if (i < 0) {
+ slots->clear();
+ delete slots;
+ mDerivedMeshLists.erase(it);
+ }
break;
}
- it++;
+ ++it;
}
} else {
RAS_ArrayLists::iterator it = mArrayLists.begin();
@@ -152,13 +165,29 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms)
if (ms.m_pDerivedMesh) {
// that means that we draw based on derived mesh, a display list is possible
// Note that we come here only for static derived mesh
+ int matnr = ms.m_bucket->GetPolyMaterial()->GetMaterialIndex();
+ RAS_ListSlot* nullSlot = NULL;
+ RAS_ListSlots *listVector;
RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.find(ms.m_pDerivedMesh);
if(it == mDerivedMeshLists.end()) {
+ listVector = new RAS_ListSlots(matnr+4, nullSlot);
localSlot = new RAS_ListSlot(this);
localSlot->m_flag |= LIST_DERIVEDMESH;
- mDerivedMeshLists.insert(std::pair<DerivedMesh*, RAS_ListSlot*>(ms.m_pDerivedMesh, localSlot));
+ localSlot->m_matnr = matnr;
+ listVector->at(matnr) = localSlot;
+ mDerivedMeshLists.insert(std::pair<DerivedMesh*, RAS_ListSlots*>(ms.m_pDerivedMesh, listVector));
} else {
- localSlot = static_cast<RAS_ListSlot*>(it->second->AddRef());
+ listVector = it->second;
+ if (listVector->size() <= matnr)
+ listVector->resize(matnr+4, nullSlot);
+ if ((localSlot = listVector->at(matnr)) == NULL) {
+ localSlot = new RAS_ListSlot(this);
+ localSlot->m_flag |= LIST_DERIVEDMESH;
+ localSlot->m_matnr = matnr;
+ listVector->at(matnr) = localSlot;
+ } else {
+ localSlot->AddRef();
+ }
}
} else {
RAS_ArrayLists::iterator it = mArrayLists.find(ms.m_displayArrays);
@@ -179,8 +208,16 @@ void RAS_ListRasterizer::ReleaseAlloc()
for(RAS_ArrayLists::iterator it = mArrayLists.begin();it != mArrayLists.end();++it)
delete it->second;
mArrayLists.clear();
- for (RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.begin();it != mDerivedMeshLists.end();++it)
- delete it->second;
+ for (RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.begin();it != mDerivedMeshLists.end();++it) {
+ RAS_ListSlots* slots = it->second;
+ for (int i=slots->size(); i-- > 0; ) {
+ RAS_ListSlot* slot = slots->at(i);
+ if (slot)
+ delete slot;
+ }
+ slots->clear();
+ delete slots;
+ }
mDerivedMeshLists.clear();
}
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
index cff48081f02..d3c14b4758c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
@@ -12,6 +12,7 @@ class RAS_ListSlot : public KX_ListSlot
friend class RAS_ListRasterizer;
unsigned int m_list;
unsigned int m_flag;
+ unsigned int m_matnr;
RAS_ListRasterizer* m_rasty;
public:
RAS_ListSlot(RAS_ListRasterizer* rasty);
@@ -40,7 +41,8 @@ enum RAS_ListSlotFlags {
struct DerivedMesh;
typedef std::map<RAS_DisplayArrayList, RAS_ListSlot*> RAS_ArrayLists;
-typedef std::map<DerivedMesh*, RAS_ListSlot*> RAS_DerivedMeshLists;
+typedef std::vector<RAS_ListSlot*> RAS_ListSlots; // indexed by material slot number
+typedef std::map<DerivedMesh*, RAS_ListSlots*> RAS_DerivedMeshLists;
class RAS_ListRasterizer : public RAS_VAOpenGLRasterizer
{