svn merge -r 22571:22800 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorAndre Susano Pinto <andresusanopinto@gmail.com>
Tue, 15 Sep 2009 15:15:43 +0000 (15:15 +0000)
committerAndre Susano Pinto <andresusanopinto@gmail.com>
Tue, 15 Sep 2009 15:15:43 +0000 (15:15 +0000)
svn merge -r 22800:23207 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Merged volumetric with new raytrace code (it compiles and rendered volume-cube.blend withouth problems)

Part1:
source/blender

549 files changed:
source/blender/CMakeLists.txt
source/blender/avi/CMakeLists.txt
source/blender/avi/SConscript
source/blender/blenfont/BLF_api.h
source/blender/blenfont/CMakeLists.txt
source/blender/blenfont/SConscript
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_internal.h
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/BKE_anim.h
source/blender/blenkernel/BKE_animsys.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_cloth.h
source/blender/blenkernel/BKE_constraint.h
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_group.h
source/blender/blenkernel/BKE_key.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_pointcache.h
source/blender/blenkernel/BKE_sca.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_sculpt.h [deleted file]
source/blender/blenkernel/BKE_shrinkwrap.h
source/blender/blenkernel/BKE_smoke.h
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/Makefile
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/booleanops.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/sca.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequence.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/unit.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/BLI_fileops.h
source/blender/blenlib/BLI_kdopbvh.h
source/blender/blenlib/BLI_voxel.h [new file with mode: 0644]
source/blender/blenlib/BLI_winstuff.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/MTC_matrixops.h [deleted file]
source/blender/blenlib/SConscript
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/BLI_mempool.c
source/blender/blenlib/intern/arithb.c
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/matrixops.c [deleted file]
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/threads.c
source/blender/blenlib/intern/util.c
source/blender/blenlib/intern/vectorops.c [deleted file]
source/blender/blenlib/intern/voxel.c [new file with mode: 0644]
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/SConscript
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/readfile.h
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/CMakeLists.txt
source/blender/blenpluginapi/SConscript
source/blender/editors/CMakeLists.txt
source/blender/editors/Makefile
source/blender/editors/SConscript
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_intern.h
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/animation/keyframes_general.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_generate.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/datafiles/B.blend.c
source/blender/editors/datafiles/blenderbuttons.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_buttons.c [new file with mode: 0644]
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_intern.h
source/blender/editors/gpencil/gpencil_ops.c [new file with mode: 0644]
source/blender/editors/gpencil/gpencil_paint.c [new file with mode: 0644]
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_fileselect.h
source/blender/editors/include/ED_gpencil.h
source/blender/editors/include/ED_info.h [new file with mode: 0644]
source/blender/editors/include/ED_keyframes_draw.h
source/blender/editors/include/ED_keyframes_edit.h
source/blender/editors/include/ED_keyframing.h
source/blender/editors/include/ED_mball.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_node.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_particle.h
source/blender/editors/include/ED_previewrender.h
source/blender/editors/include/ED_screen.h
source/blender/editors/include/ED_screen_types.h
source/blender/editors/include/ED_sound.h [new file with mode: 0644]
source/blender/editors/include/ED_space_api.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_icons.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_loop.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/loopcut.c [new file with mode: 0644]
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_layers.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c [moved from source/blender/editors/metaball/editmball.c with 93% similarity]
source/blender/editors/object/object_add.c [new file with mode: 0644]
source/blender/editors/object/object_constraint.c [moved from source/blender/editors/object/editconstraint.c with 97% similarity]
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c [moved from source/blender/editors/object/editgroup.c with 60% similarity]
source/blender/editors/object/object_hook.c [new file with mode: 0644]
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_lattice.c [moved from source/blender/editors/object/editlattice.c with 95% similarity]
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c [new file with mode: 0644]
source/blender/editors/object/object_select.c [new file with mode: 0644]
source/blender/editors/object/object_shapekey.c [moved from source/blender/editors/object/editkey.c with 85% similarity]
source/blender/editors/object/object_transform.c [new file with mode: 0644]
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/ed_fluidsim.c
source/blender/editors/physics/ed_pointcache.c
source/blender/editors/physics/editparticle.c
source/blender/editors/preview/previewrender.c
source/blender/editors/screen/CMakeLists.txt
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_context.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c [new file with mode: 0644]
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/sculpt_paint/sculpt_stroke.c [deleted file]
source/blender/editors/sound/Makefile [new file with mode: 0644]
source/blender/editors/sound/SConscript [new file with mode: 0644]
source/blender/editors/sound/sound_intern.h [new file with mode: 0644]
source/blender/editors/sound/sound_ops.c [new file with mode: 0644]
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_header.c
source/blender/editors/space_action/action_intern.h
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_intern.h
source/blender/editors/space_buttons/buttons_ops.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_console/console_report.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_intern.h
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filelist.h
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/graph_header.c
source/blender/editors/space_graph/graph_select.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_intern.h
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_intern.h
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_info/info_stats.c [new file with mode: 0644]
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_nla/nla_header.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_node/node_state.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_outliner/outliner_header.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/script_edit.c
source/blender/editors/space_script/script_ops.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_buttons.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_header.c
source/blender/editors/space_text/text_intern.h
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_header.c [deleted file]
source/blender/editors/space_time/time_ops.c
source/blender/editors/space_userpref/Makefile [new file with mode: 0644]
source/blender/editors/space_userpref/SConscript [new file with mode: 0644]
source/blender/editors/space_userpref/space_userpref.c [new file with mode: 0644]
source/blender/editors/space_userpref/userpref_intern.h [new file with mode: 0644]
source/blender/editors/space_userpref/userpref_ops.c [new file with mode: 0644]
source/blender/editors/space_view3d/SConscript
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c [new file with mode: 0644]
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/util/editmode_undo.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/GPU_draw.h
source/blender/gpu/GPU_extensions.h
source/blender/gpu/SConscript
source/blender/gpu/intern/Makefile
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/SConscript
source/blender/imbuf/intern/anim.c
source/blender/imbuf/intern/anim5.c
source/blender/imbuf/intern/cineon/CMakeLists.txt
source/blender/imbuf/intern/cineon/SConscript
source/blender/imbuf/intern/dds/CMakeLists.txt
source/blender/imbuf/intern/dds/SConscript
source/blender/imbuf/intern/hamx.c
source/blender/imbuf/intern/iff.c
source/blender/imbuf/intern/jp2.c
source/blender/imbuf/intern/openexr/CMakeLists.txt
source/blender/imbuf/intern/openexr/Makefile
source/blender/imbuf/intern/openexr/SConscript
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/writeimage.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_brush_types.h
source/blender/makesdna/DNA_cloth_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_gpencil_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_object_force.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_particle_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_sensor_types.h
source/blender/makesdna/DNA_smoke_types.h
source/blender/makesdna/DNA_sound_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesdna/SConscript
source/blender/makesdna/intern/CMakeLists.txt
source/blender/makesdna/intern/SConscript
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/Makefile
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_animation_api.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_gpencil.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_group.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_mesh_api.c
source/blender/makesrna/intern/rna_meta.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_packedfile.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_sequence.c
source/blender/makesrna/intern/rna_smoke.c
source/blender/makesrna/intern/rna_sound.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_test.c [new file with mode: 0644]
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_world.c
source/blender/nodes/CMP_node.h
source/blender/nodes/CMakeLists.txt
source/blender/nodes/SConscript
source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c [new file with mode: 0644]
source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c [new file with mode: 0644]
source/blender/nodes/intern/CMP_nodes/CMP_levels.c [new file with mode: 0644]
source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
source/blender/nodes/intern/CMP_util.c
source/blender/nodes/intern/CMP_util.h
source/blender/nodes/intern/TEX_nodes/TEX_at.c
source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
source/blender/nodes/intern/TEX_nodes/TEX_checker.c
source/blender/nodes/intern/TEX_nodes/TEX_compose.c
source/blender/nodes/intern/TEX_nodes/TEX_coord.c
source/blender/nodes/intern/TEX_nodes/TEX_curves.c
source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
source/blender/nodes/intern/TEX_nodes/TEX_distance.c
source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
source/blender/nodes/intern/TEX_nodes/TEX_image.c
source/blender/nodes/intern/TEX_nodes/TEX_invert.c
source/blender/nodes/intern/TEX_nodes/TEX_math.c
source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
source/blender/nodes/intern/TEX_nodes/TEX_output.c
source/blender/nodes/intern/TEX_nodes/TEX_proc.c
source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
source/blender/nodes/intern/TEX_nodes/TEX_scale.c
source/blender/nodes/intern/TEX_nodes/TEX_texture.c
source/blender/nodes/intern/TEX_nodes/TEX_translate.c
source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
source/blender/nodes/intern/TEX_util.c
source/blender/nodes/intern/TEX_util.h
source/blender/python/CMakeLists.txt
source/blender/python/SConscript
source/blender/python/epy_doc_gen.py
source/blender/python/generic/Geometry.c
source/blender/python/generic/Mathutils.c
source/blender/python/generic/bpy_internal_import.h
source/blender/python/generic/matrix.c
source/blender/python/generic/vector.c
source/blender/python/intern/bpy_array.c [new file with mode: 0644]
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h
source/blender/python/intern/bpy_util.c
source/blender/python/intern/bpy_util.h
source/blender/quicktime/CMakeLists.txt
source/blender/quicktime/SConscript
source/blender/readblenfile/CMakeLists.txt
source/blender/readblenfile/SConscript
source/blender/readblenfile/intern/BLO_readblenfile.c
source/blender/render/CMakeLists.txt
source/blender/render/SConscript
source/blender/render/extern/include/RE_raytrace.h
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/include/pointdensity.h [moved from source/blender/blenlib/MTC_vectorops.h with 50% similarity]
source/blender/render/intern/include/rayobject.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/include/rendercore.h
source/blender/render/intern/include/shading.h
source/blender/render/intern/include/texture.h
source/blender/render/intern/include/volume_precache.h [new file with mode: 0644]
source/blender/render/intern/include/volumetric.h [new file with mode: 0644]
source/blender/render/intern/include/voxeldata.h [new file with mode: 0644]
source/blender/render/intern/source/Makefile
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/pointdensity.c [new file with mode: 0644]
source/blender/render/intern/source/rayobject.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/texture.c
source/blender/render/intern/source/volume_precache.c [new file with mode: 0644]
source/blender/render/intern/source/volumetric.c [new file with mode: 0644]
source/blender/render/intern/source/voxeldata.c [new file with mode: 0644]
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/Makefile
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c

index a9e3d50211f7eab567bdb8544e3e83c8c117e9ef..703c5acd8a204194002ff2563fb085b0a944cdac 100644 (file)
@@ -42,18 +42,18 @@ ADD_SUBDIRECTORY(render)
 ADD_SUBDIRECTORY(blenfont)
 
 IF(WITH_OPENEXR)
-  ADD_SUBDIRECTORY(imbuf/intern/openexr)
+       ADD_SUBDIRECTORY(imbuf/intern/openexr)
 ENDIF(WITH_OPENEXR)
 
 IF(WITH_DDS)
-  ADD_SUBDIRECTORY(imbuf/intern/dds)
+       ADD_SUBDIRECTORY(imbuf/intern/dds)
 ENDIF(WITH_DDS)
 
 IF(WITH_QUICKTIME)
-  ADD_SUBDIRECTORY(quicktime)
+       ADD_SUBDIRECTORY(quicktime)
 ENDIF(WITH_QUICKTIME)
 
 IF(WITH_PYTHON)
-  ADD_SUBDIRECTORY(python)
+       ADD_SUBDIRECTORY(python)
 ENDIF(WITH_PYTHON)
 
index 4738ea142921038ff5ce49a54174681a9e4bfe0c..4e48b6890554cb9e5cc71ea417ead37fe9f4a11d 100644 (file)
@@ -27,8 +27,8 @@
 FILE(GLOB SRC intern/*.c)
 
 SET(INC 
-  . ../../../intern/guardedalloc
-  ${JPEG_INC}
+       . ../../../intern/guardedalloc
+       ${JPEG_INC}
 )
 
 BLENDERLIB(bf_avi "${SRC}" "${INC}")
index f6e5b787b58004902e5ad43c80485a3f4ee0e16a..0bf8c3c74db3219d208b22b9f834ee5d014bcfdd 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python
-#Import ('extra_includes')
 Import ('env')
 
 sources = env.Glob('intern/*.c')
@@ -7,4 +6,4 @@ sources = env.Glob('intern/*.c')
 incs = '. #/intern/guardedalloc'
 incs += ' ' + env['BF_JPEG_INC']
 
-env.BlenderLib ('bf_avi', sources, Split(incs), [], libtype=['core'], priority = [185] )
+env.BlenderLib ('bf_avi', sources, Split(incs), [], libtype=['core','player'], priority = [190,120] )
index 05df927f9215f5e0066fee23836bbfc608f7b39e..760b7059bc794ac176ae98f75eb8ffa6b5afa901 100644 (file)
@@ -70,6 +70,11 @@ void BLF_boundbox(char *str, struct rctf *box);
 float BLF_width(char *str);
 float BLF_height(char *str);
 
+/*
+ * The following function return the width and height of the string, but
+ * just in one call, so avoid extra freetype2 stuff.
+ */
+void BLF_width_and_height(char *str, float *width, float *height);
 
 /*
  * For fixed width fonts only, returns the width of a
@@ -116,6 +121,28 @@ void BLF_shadow(int level, float r, float g, float b, float a);
  */
 void BLF_shadow_offset(int x, int y);
 
+/*
+ * Set the buffer, size and number of channels to draw, one thing to take care is call
+ * this function with NULL pointer when we finish, for example:
+ *     BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
+ *
+ *     ... set color, position and draw ...
+ *
+ *     BLF_buffer(NULL, NULL, 0, 0, 0);
+ */
+void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch);
+
+/*
+ * Set the color to be used for text.
+ */
+void BLF_buffer_col(float r, float g, float b, float a);
+
+/*
+ * Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_
+ * it's not necessary set both buffer, NULL is valid here.
+ */
+void BLF_draw_buffer(char *str);
+
 /*
  * Search the path directory to the locale files, this try all
  * the case for Linux, Win and Mac.
index bc03e69eb88b5d044e9e2c0a1c9518fe27bb3976..844a6899bf5bb6a36dae40bef5381b1d416eb4dd 100644 (file)
 FILE(GLOB SRC intern/*.c)
 
 SET(INC 
-  ../../../intern/guardedalloc ../blenlib ../makesdna ../editors/include
-  ../blenkernel ../../../extern/glew/include .
-  ${FREETYPE_INCLUDE_DIRS}
+       ../../../intern/guardedalloc ../blenlib ../makesdna ../editors/include
+       ../blenkernel ../../../extern/glew/include .
+       ${FREETYPE_INCLUDE_DIRS}
 )
 
 IF(WITH_INTERNATIONAL)
-  SET(INC ${INC} ${GETTEXT_INC})
+       SET(INC ${INC} ${GETTEXT_INC})
 ENDIF(WITH_INTERNATIONAL)
 
 IF(WIN32)
-  ADD_DEFINITIONS(-D_WIN32 -DUSE_GETTEXT_DLL)
+       ADD_DEFINITIONS(-D_WIN32 -DUSE_GETTEXT_DLL)
 ENDIF(WIN32)
 
 BLENDERLIB(bf_blenfont "${SRC}" "${INC}")
index fa6fa19a9ef10468a3485e17c72f40843845ae93..d070d98524724b6749377ecedf7db9bf2da4cea3 100644 (file)
@@ -14,4 +14,4 @@ defs = ''
 if sys.platform == 'win32':
        defs += ' _WIN32 USE_GETTEXT_DLL'
 
-env.BlenderLib ( 'bf_blenfont', sources, Split(incs), Split(defs), libtype=['core'], priority=[210] )
+env.BlenderLib ( 'bf_blenfont', sources, Split(incs), Split(defs), libtype=['core','player'], priority=[210,210] )
index ded89d18387fb96a5b2a31a28c48d54d5b890af9..8cb237a19ac489b204dbca66ae7feaa7b83eb003 100644 (file)
@@ -371,6 +371,15 @@ void BLF_boundbox(char *str, rctf *box)
                blf_font_boundbox(font, str, box);
 }
 
+void BLF_width_and_height(char *str, float *width, float *height)
+{
+       FontBLF *font;
+
+       font= global_font[global_font_cur];
+       if (font)
+               blf_font_width_and_height(font, str, width, height);
+}
+
 float BLF_width(char *str)
 {
        FontBLF *font;
@@ -513,3 +522,39 @@ void BLF_shadow_offset(int x, int y)
                font->shadow_y= y;
        }
 }
+
+void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch)
+{
+       FontBLF *font;
+
+       font= global_font[global_font_cur];
+       if (font) {
+               font->b_fbuf= fbuf;
+               font->b_cbuf= cbuf;
+               font->bw= w;
+               font->bh= h;
+               font->bch= nch;
+       }
+}
+
+void BLF_buffer_col(float r, float g, float b, float a)
+{
+       FontBLF *font;
+
+       font= global_font[global_font_cur];
+       if (font) {
+               font->b_col[0]= r;
+               font->b_col[1]= g;
+               font->b_col[2]= b;
+               font->b_col[3]= a;
+       }
+}
+
+void BLF_draw_buffer(char *str)
+{
+       FontBLF *font;
+
+       font= global_font[global_font_cur];
+       if (font)
+               blf_font_buffer(font, str);
+}
index 7521b7815f1ad6bd1eff0b3cc4a1422e3966c0fe..2cd72809579d64221631618be898732b65fe2586 100644 (file)
@@ -100,7 +100,7 @@ void blf_font_draw(FontBLF *font, char *str)
        unsigned int c;
        GlyphBLF *g, *g_prev;
        FT_Vector delta;
-       FT_UInt glyph_index, g_prev_index;
+       FT_UInt glyph_index;
        int pen_x, pen_y;
        int i, has_kerning, st;
 
@@ -112,17 +112,17 @@ void blf_font_draw(FontBLF *font, char *str)
        pen_y= 0;
        has_kerning= FT_HAS_KERNING(font->face);
        g_prev= NULL;
-       g_prev_index= 0;
 
        while (str[i]) {
                c= blf_utf8_next((unsigned char *)str, &i);
                if (c == 0)
                        break;
 
-               glyph_index= FT_Get_Char_Index(font->face, c);
                g= blf_glyph_search(font->glyph_cache, c);
-               if (!g)
+               if (!g) {
+                       glyph_index= FT_Get_Char_Index(font->face, c);
                        g= blf_glyph_add(font, glyph_index, c);
+               }
 
                /* if we don't found a glyph, skip it. */
                if (!g)
@@ -133,9 +133,9 @@ void blf_font_draw(FontBLF *font, char *str)
                        delta.y= 0;
 
                        if (font->flags & BLF_KERNING_DEFAULT)
-                               st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta);
+                               st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
                        else
-                               st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
+                               st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
 
                        if (st == 0)
                                pen_x += delta.x >> 6;
@@ -146,7 +146,158 @@ void blf_font_draw(FontBLF *font, char *str)
 
                pen_x += g->advance;
                g_prev= g;
-               g_prev_index= glyph_index;
+       }
+}
+
+void blf_font_buffer(FontBLF *font, char *str)
+{
+       unsigned char *data, *cbuf;
+       unsigned int c;
+       GlyphBLF *g, *g_prev;
+       FT_Vector delta;
+       FT_UInt glyph_index;
+       float a, *fbuf;
+       int pen_x, pen_y, y, x, yb, diff;
+       int i, has_kerning, st, chx, chy;
+
+       if (!font->glyph_cache)
+               return;
+
+       i= 0;
+       pen_x= (int)font->pos[0];
+       pen_y= (int)font->pos[1];
+       has_kerning= FT_HAS_KERNING(font->face);
+       g_prev= NULL;
+
+       while (str[i]) {
+               c= blf_utf8_next((unsigned char *)str, &i);
+               if (c == 0)
+                       break;
+
+               g= blf_glyph_search(font->glyph_cache, c);
+               if (!g) {
+                       glyph_index= FT_Get_Char_Index(font->face, c);
+                       g= blf_glyph_add(font, glyph_index, c);
+               }
+
+               /* if we don't found a glyph, skip it. */
+               if (!g)
+                       continue;
+
+               if (has_kerning && g_prev) {
+                       delta.x= 0;
+                       delta.y= 0;
+
+                       if (font->flags & BLF_KERNING_DEFAULT)
+                               st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
+                       else
+                               st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
+
+                       if (st == 0)
+                               pen_x += delta.x >> 6;
+               }
+
+               chx= pen_x + ((int)g->pos_x);
+               diff= g->height - ((int)g->pos_y);
+               if (diff > 0) {
+                       if (g->pitch < 0)
+                               pen_y += diff;
+                       else
+                               pen_y -= diff;
+               }
+               else if (diff < 0) {
+                       if (g->pitch < 0)
+                               pen_y -= diff;
+                       else
+                               pen_y += diff;
+               }
+
+               if (g->pitch < 0)
+                       chy= pen_y - ((int)g->pos_y);
+               else
+                       chy= pen_y + ((int)g->pos_y);
+
+               if (font->b_fbuf) {
+                       if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) {
+                               if (g->pitch < 0)
+                                       yb= 0;
+                               else
+                                       yb= g->height-1;
+
+                               for (y= 0; y < g->height; y++) {
+                                       for (x= 0; x < g->width; x++) {
+                                               fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
+                                               data= g->bitmap + x + (yb * g->pitch);
+                                               a= data[0]/255.0f;
+
+                                               if (a == 1.0) {
+                                                       fbuf[0]= font->b_col[0];
+                                                       fbuf[1]= font->b_col[1];
+                                                       fbuf[2]= font->b_col[2];
+                                               }
+                                               else {
+                                                       fbuf[0]= (font->b_col[0]*a) + (fbuf[0] * (1-a));
+                                                       fbuf[1]= (font->b_col[1]*a) + (fbuf[1] * (1-a));
+                                                       fbuf[2]= (font->b_col[2]*a) + (fbuf[2] * (1-a));
+                                               }
+                                       }
+
+                                       if (g->pitch < 0)
+                                               yb++;
+                                       else
+                                               yb--;
+                               }
+                       }
+               }
+
+               if (font->b_cbuf) {
+                       if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) {
+                               if (g->pitch < 0)
+                                       yb= 0;
+                               else
+                                       yb= g->height-1;
+
+                               for (y= 0; y < g->height; y++) {
+                                       for (x= 0; x < g->width; x++) {
+                                               cbuf= font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
+                                               data= g->bitmap + x + (yb * g->pitch);
+                                               a= data[0];
+
+                                               if (a == 256) {
+                                                       cbuf[0]= font->b_col[0];
+                                                       cbuf[1]= font->b_col[1];
+                                                       cbuf[2]= font->b_col[2];
+                                               }
+                                               else {
+                                                       cbuf[0]= (font->b_col[0]*a) + (cbuf[0] * (256-a));
+                                                       cbuf[1]= (font->b_col[1]*a) + (cbuf[1] * (256-a));
+                                                       cbuf[2]= (font->b_col[2]*a) + (cbuf[2] * (256-a));
+                                               }
+                                       }
+
+                                       if (g->pitch < 0)
+                                               yb++;
+                                       else
+                                               yb--;
+                               }
+                       }
+               }
+
+               if (diff > 0) {
+                       if (g->pitch < 0)
+                               pen_x -= diff;
+                       else
+                               pen_y += diff;
+               }
+               else if (diff < 0) {
+                       if (g->pitch < 0)
+                               pen_x += diff;
+                       else
+                               pen_y -= diff;
+               }
+
+               pen_x += g->advance;
+               g_prev= g;
        }
 }
 
@@ -155,7 +306,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
        unsigned int c;
        GlyphBLF *g, *g_prev;
        FT_Vector delta;
-       FT_UInt glyph_index, g_prev_index;
+       FT_UInt glyph_index;
        rctf gbox;
        int pen_x, pen_y;
        int i, has_kerning, st;
@@ -173,17 +324,17 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
        pen_y= 0;
        has_kerning= FT_HAS_KERNING(font->face);
        g_prev= NULL;
-       g_prev_index= 0;
 
        while (str[i]) {
                c= blf_utf8_next((unsigned char *)str, &i);
                if (c == 0)
                        break;
 
-               glyph_index= FT_Get_Char_Index(font->face, c);
                g= blf_glyph_search(font->glyph_cache, c);
-               if (!g)
+               if (!g) {
+                       glyph_index= FT_Get_Char_Index(font->face, c);
                        g= blf_glyph_add(font, glyph_index, c);
+               }
 
                /* if we don't found a glyph, skip it. */
                if (!g)
@@ -194,9 +345,9 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
                        delta.y= 0;
 
                        if (font->flags & BLF_KERNING_DEFAULT)
-                               st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta);
+                               st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
                        else
-                               st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
+                               st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
 
                        if (st == 0)
                                pen_x += delta.x >> 6;
@@ -219,7 +370,6 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
 
                pen_x += g->advance;
                g_prev= g;
-               g_prev_index= glyph_index;
        }
 
        if (box->xmin > box->xmax) {
@@ -230,6 +380,17 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
        }
 }
 
+void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height)
+{
+       rctf box;
+
+       if (font->glyph_cache) {
+               blf_font_boundbox(font, str, &box);
+               *width= ((box.xmax - box.xmin) * font->aspect);
+               *height= ((box.ymax - box.ymin) * font->aspect);
+       }
+}
+
 float blf_font_width(FontBLF *font, char *str)
 {
        rctf box;
@@ -311,6 +472,15 @@ void blf_font_fill(FontBLF *font)
        font->glyph_cache= NULL;
        font->blur= 0;
        font->max_tex_size= -1;
+       font->b_fbuf= NULL;
+       font->b_cbuf= NULL;
+       font->bw= 0;
+       font->bh= 0;
+       font->bch= 0;
+       font->b_col[0]= 0;
+       font->b_col[1]= 0;
+       font->b_col[2]= 0;
+       font->b_col[3]= 0;
 }
 
 FontBLF *blf_font_new(char *name, char *filename)
index 78df8ff2bc668bf1b06ceec9312c328a238a0abd..f3db3ddc9a5c10dca5a75c533f3332070beb843b 100644 (file)
@@ -217,6 +217,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
        g->next= NULL;
        g->prev= NULL;
        g->c= c;
+       g->idx= index;
        g->tex= 0;
        g->build_tex= 0;
        g->bitmap= NULL;
@@ -238,6 +239,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
        g->advance= ((float)slot->advance.x) / 64.0f;
        g->pos_x= slot->bitmap_left;
        g->pos_y= slot->bitmap_top;
+       g->pitch= slot->bitmap.pitch;
 
        FT_Outline_Get_CBox(&(slot->outline), &bbox);
        g->box.xmin= ((float)bbox.xMin) / 64.0f;
index 30d5c8ede658afa251732a61b21eb920c5422747..2a69b8652ea748674a7a3d07eb6d7bc720b6c978 100644 (file)
@@ -45,7 +45,9 @@ void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_s
 
 void blf_font_size(FontBLF *font, int size, int dpi);
 void blf_font_draw(FontBLF *font, char *str);
+void blf_font_buffer(FontBLF *font, char *str);
 void blf_font_boundbox(FontBLF *font, char *str, rctf *box);
+void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height);
 float blf_font_width(FontBLF *font, char *str);
 float blf_font_height(FontBLF *font, char *str);
 float blf_font_fixed_width(FontBLF *font);
index d457225662f3955d66de178440f64f5207f5b0ca..fb4a2e6a9e517131434614e0d4bfe21295d817ea 100644 (file)
@@ -85,6 +85,9 @@ typedef struct GlyphBLF {
        /* and the character, as UTF8 */
        unsigned int c;
 
+       /* freetype2 index, to speed-up the search. */
+       FT_UInt idx;
+
        /* glyph box. */
        rctf box;
 
@@ -106,6 +109,7 @@ typedef struct GlyphBLF {
        /* glyph width and height. */
        int width;
        int height;
+       int pitch;
 
        /* uv coords. */
        float uv[2][2];
@@ -176,6 +180,22 @@ typedef struct FontBLF {
 
        /* freetype2 face. */
        FT_Face face;
+
+       /* for draw to buffer, always set this to NULL after finish! */
+       float *b_fbuf;
+
+       /* the same but unsigned char */
+       unsigned char *b_cbuf;
+
+       /* buffer size. */
+       unsigned int bw;
+       unsigned int bh;
+
+       /* number of channels. */
+       int bch;
+
+       /* and the color, the alphas is get from the glyph! */
+       float b_col[4];
 } FontBLF;
 
 typedef struct DirBLF {
index d35acb5447aae7e82c35fca7a1a2513a70336216..4724ee19aaa0e38926115df87fbf4be4e31a7551 100644 (file)
@@ -66,7 +66,7 @@ void free_action(struct bAction *act);
 void make_local_action(struct bAction *act);
 
 /* Some kind of bounding box operation on the action */
-void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden);
+void calc_action_range(const struct bAction *act, float *start, float *end, short incl_modifiers);
 
 /* Does action have any motion data at all? */
 short action_has_motion(const struct bAction *act);
index 5ea511738add0bc3bc12fed02399e69a9cc26200..4b1e758da541ba7ad7b431af8849ce5ba98cdea3 100644 (file)
@@ -51,7 +51,7 @@ typedef struct DupliObject {
 void free_path(struct Path *path);
 void calc_curvepath(struct Object *ob);
 int interval_test(int min, int max, int p1, int cycl);
-int where_on_path(struct Object *ob, float ctime, float *vec, float *dir);
+int where_on_path(struct Object *ob, float ctime, float *vec, float *dir, float *quat, float *radius);
 
 struct ListBase *object_duplilist(struct Scene *sce, struct Object *ob);
 void free_object_duplilist(struct ListBase *lb);
index cabbaa7aa0f5684cbdbb9e102400fca32a115fec..cc5b4dfdcaf7ccfec48d2335430fb067e9216f4d 100644 (file)
@@ -55,6 +55,9 @@ void BKE_free_animdata(struct ID *id);
 /* Copy AnimData */
 struct AnimData *BKE_copy_animdata(struct AnimData *adt);
 
+/* Make Local */
+void BKE_animdata_make_local(struct AnimData *adt);
+
 /* ************************************* */
 /* KeyingSets API */
 
index 0595134f5c9b0c94c84d1d201f77ac939e7f94de..1cbb2331782f223aa5193bd2dc4ff9f94bfdf67b 100644 (file)
@@ -74,7 +74,6 @@ struct bArmature *add_armature(char *name);
 struct bArmature *get_armature(struct Object *ob);
 void free_boneChildren(struct Bone *bone);
 void free_bones (struct bArmature *arm);
-void unlink_armature(struct bArmature *arm);
 void free_armature(struct bArmature *arm);
 void make_local_armature(struct bArmature *arm);
 struct bArmature *copy_armature(struct bArmature *arm);
index 4fe1eec55c0a7a6ceda073722eed9b1984196e5f..d60737d62fee90e13cb18f4fb596c7241de57496 100644 (file)
@@ -43,7 +43,7 @@ struct bContext;
 struct ReportList;
 
 #define BLENDER_VERSION                        250
-#define BLENDER_SUBVERSION             1
+#define BLENDER_SUBVERSION             3
 
 #define BLENDER_MINVERSION             250
 #define BLENDER_MINSUBVERSION  0
index 6ec988e111e2df785fb33a9593bc8ac48980fed6..4d24a2433b3a5f1537de0f49093f49a6fae7b28b 100644 (file)
@@ -64,7 +64,6 @@ float brush_curve_strength(struct Brush *br, float p, const float len);
 
 /* sampling */
 float brush_sample_falloff(struct Brush *brush, float dist);
-float brush_sample_falloff_noalpha(struct Brush *brush, float dist);
 void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
 void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
        struct ImBuf **imbuf);
index bc4585106e6f887a47c0420b2404dd20dd528e0d..e5b3adbd0c0c1b22de180ff0f994bb58ee686040 100644 (file)
@@ -176,7 +176,8 @@ typedef enum
        CLOTH_SIMSETTINGS_FLAG_GOAL = ( 1 << 3 ),       // we have goals enabled
        CLOTH_SIMSETTINGS_FLAG_TEARING = ( 1 << 4 ),// true if tearing is enabled
        CLOTH_SIMSETTINGS_FLAG_SCALING = ( 1 << 8 ), /* is advanced scaling active? */
-       CLOTH_SIMSETTINGS_FLAG_CCACHE_EDIT = (1 << 12)  /* edit cache in editmode */
+       CLOTH_SIMSETTINGS_FLAG_CCACHE_EDIT = (1 << 12), /* edit cache in editmode */
+       CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS = (1 << 13) /* don't allow spring compression */
 } CLOTH_SIMSETTINGS_FLAGS;
 
 /* COLLISION FLAGS */
index 6e69906b71d7d5d6f05618c4e1948ae4aa1a7b3d..a00611734388a65589e0524dff76d10a398cc23b 100644 (file)
@@ -49,6 +49,7 @@ typedef struct bConstraintOb {
        float startmat[4][4];           /* original matrix (before constraint solving) */
        
        short type;                                     /* type of owner  */
+       short rotOrder;                         /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_arithb.h) */
 } bConstraintOb;
 
 /* ---------------------------------------------------------------------------- */
index 035b7e2e5b9423f62323ff3425d9f169bb59bd9f..09e13c2930e4fc7ba7edaf4a5cd5144a81bf395a 100644 (file)
@@ -152,6 +152,7 @@ struct SpaceLogic *CTX_wm_space_logic(const bContext *C);
 struct SpaceIpo *CTX_wm_space_graph(const bContext *C);
 struct SpaceAction *CTX_wm_space_action(const bContext *C);
 struct SpaceInfo *CTX_wm_space_info(const bContext *C);
+struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C);
 
 void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm);
 void CTX_wm_window_set(bContext *C, struct wmWindow *win);
index e5a8df1a9327eab3acd9ddfaf4deeb75f83d0a95..78a2f13a7cc7f86fdfc39f1731fb8f203e1427e7 100644 (file)
@@ -47,7 +47,7 @@ struct BevList;
 #define SEGMENTSU(nu)      ( ((nu)->flagu & CU_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 )
 #define SEGMENTSV(nu)      ( ((nu)->flagv & CU_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 )
 
-#define CU_DO_TILT(cu, nu) (((nu->type & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1)
+#define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1)
 #define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || cu->bevobj || cu->ext1!=0.0 || cu->ext2!=0.0) ? 1:0)
 
 
@@ -72,7 +72,7 @@ void minmaxNurb( struct Nurb *nu, float *min, float *max);
 void makeknots( struct Nurb *nu, short uv);
 
 void makeNurbfaces(struct Nurb *nu, float *coord_array, int rowstride);
-void makeNurbcurve(struct Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, int resolu);
+void makeNurbcurve(struct Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, int resolu, int stride);
 void forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride);
 float *make_orco_curve(struct Scene *scene, struct Object *ob);
 float *make_orco_surf( struct Object *ob);
index 70b6c1d13f4862e834e9795b1b901a2fb368a1c9..e242ead3b87b37440386492c6ad009c695782fc9 100644 (file)
@@ -32,6 +32,8 @@
 #define DEPS_DEBUG
 */
 
+struct ID;
+struct Main;
 struct Scene;
 struct DagNodeQueue;
 struct DagForest;
@@ -103,8 +105,9 @@ void        DAG_object_update_flags(struct Scene *sce, struct Object *ob, unsigned int
 
                /* flushes all recalc flags in objects down the dependency tree */
 void   DAG_scene_flush_update(struct Scene *sce, unsigned int lay, int time);
-               /* flushes all recalc flags for this object down the dependency tree */
-void   DAG_object_flush_update(struct Scene *sce, struct Object *ob, short flag);
+               /* flushes all recalc flags for this object down the dependency tree,
+                  but not the DAG only supports objects and object data currently */
+void   DAG_id_flush_update(struct ID *id, short flag);
 
 void   DAG_pose_sort(struct Object *ob);
                
index 7ce616c37c988e5d3d0a0a4f5d0adfe130443f92..5d0b89220d5123542257a7d5da420325980a85d8 100644 (file)
@@ -119,33 +119,32 @@ typedef struct Global {
 #define G_GREASEPENCIL         (1 << 17)
 
 /* #define G_AUTOMATKEYS       (1 << 30)   also removed */
-#define G_HIDDENHANDLES (1 << 31) /* used for curves only */
 
 /* G.fileflags */
 
 #define G_AUTOPACK               (1 << 0)
 #define G_FILE_COMPRESS          (1 << 1)
 #define G_FILE_AUTOPLAY          (1 << 2)
-#define G_FILE_ENABLE_ALL_FRAMES (1 << 3)
-#define G_FILE_SHOW_DEBUG_PROPS  (1 << 4)
-#define G_FILE_SHOW_FRAMERATE    (1 << 5)
-#define G_FILE_SHOW_PROFILE      (1 << 6)
+#define G_FILE_ENABLE_ALL_FRAMES (1 << 3)                              /* deprecated */
+#define G_FILE_SHOW_DEBUG_PROPS  (1 << 4)                              /* deprecated */
+#define G_FILE_SHOW_FRAMERATE    (1 << 5)                              /* deprecated */
+#define G_FILE_SHOW_PROFILE      (1 << 6)                              /* deprecated */
 #define G_FILE_LOCK              (1 << 7)
 #define G_FILE_SIGN              (1 << 8)
 #define G_FIle_PUBLISH                  (1 << 9)
 #define G_FILE_NO_UI                    (1 << 10)
-#define G_FILE_GAME_TO_IPO              (1 << 11)
-#define G_FILE_GAME_MAT                         (1 << 12)
-#define G_FILE_DISPLAY_LISTS    (1 << 13)
-#define G_FILE_SHOW_PHYSICS             (1 << 14)
-#define G_FILE_GAME_MAT_GLSL    (1 << 15)
-#define G_FILE_GLSL_NO_LIGHTS   (1 << 16)
-#define G_FILE_GLSL_NO_SHADERS  (1 << 17)
-#define G_FILE_GLSL_NO_SHADOWS  (1 << 18)
-#define G_FILE_GLSL_NO_RAMPS    (1 << 19)
-#define G_FILE_GLSL_NO_NODES    (1 << 20)
-#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21)
-#define G_FILE_IGNORE_DEPRECATION_WARNINGS     (1 << 22)
+#define G_FILE_GAME_TO_IPO              (1 << 11)                              /* deprecated */
+#define G_FILE_GAME_MAT                         (1 << 12)                              /* deprecated */
+#define G_FILE_DISPLAY_LISTS    (1 << 13)                              /* deprecated */
+#define G_FILE_SHOW_PHYSICS             (1 << 14)                              /* deprecated */
+#define G_FILE_GAME_MAT_GLSL    (1 << 15)                              /* deprecated */
+#define G_FILE_GLSL_NO_LIGHTS   (1 << 16)                              /* deprecated */
+#define G_FILE_GLSL_NO_SHADERS  (1 << 17)                              /* deprecated */
+#define G_FILE_GLSL_NO_SHADOWS  (1 << 18)                              /* deprecated */
+#define G_FILE_GLSL_NO_RAMPS    (1 << 19)                              /* deprecated */
+#define G_FILE_GLSL_NO_NODES    (1 << 20)                              /* deprecated */
+#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21)                             /* deprecated */
+#define G_FILE_IGNORE_DEPRECATION_WARNINGS     (1 << 22)       /* deprecated */
 
 /* G.windowstate */
 #define G_WINDOWSTATE_USERDEF          0
index 35084aabadf5b1d0e2f6bc4f3a7b8c8e0d950989..b66ddf13527a63beea134ecaee206e68973cccb0 100644 (file)
@@ -41,6 +41,7 @@ void          free_group_object(struct GroupObject *go);
 void           free_group(struct Group *group);
 void           unlink_group(struct Group *group);
 struct Group *add_group(char *name);
+struct Group *copy_group(struct Group *group);
 void           add_to_group(struct Group *group, struct Object *ob);
 int                    rem_from_group(struct Group *group, struct Object *ob);
 struct Group *find_group(struct Object *ob, struct Group *group);
index e2f9dff6226da5621ba3b7c2d6837ecfe5cadadd..4bfa6a41099d5c1e51beeb4e9008c82bb3768bd1 100644 (file)
@@ -52,8 +52,9 @@ struct Key *copy_key(struct Key *key);
 void make_local_key(struct Key *key);
 void sort_keys(struct Key *key);
 
-void set_four_ipo(float d, float *data, int type);
-void set_afgeleide_four_ipo(float d, float *data, int type);
+void key_curve_position_weights(float t, float *data, int type);
+void key_curve_tangent_weights(float t, float *data, int type);
+void key_curve_normal_weights(float t, float *data, int type);
 
 /* only exported to curve.c! */
 void cp_cu_key(struct Curve *cu, struct KeyBlock *kb, int start, int end);
index 4e7db115168ddcf72e10a93f5e8a79cfb65e64c3..0e978128cf6bc65b9bbbca49432b17c65489d2fb 100644 (file)
@@ -46,6 +46,9 @@ void *copy_libblock(void *rt);
 void id_lib_extern(struct ID *id);
 void id_us_plus(struct ID *id);
 void id_us_min(struct ID *id);
+int id_make_local(struct ID *id, int test);
+int id_copy(struct ID *id, struct ID **newid, int test);
+int id_unlink(struct ID *id, int test);
 
 int check_for_dupid(struct ListBase *lb, struct ID *id, char *name);
 int new_id(struct ListBase *lb, struct ID *id, const char *name);
@@ -74,6 +77,7 @@ void IPOnames_to_pupstring(char **str, char *title, char *extraops, struct ListB
 
 void flag_listbase_ids(ListBase *lb, short flag, short value);
 void flag_all_listbases_ids(short flag, short value);
+void recalc_all_library_objects(struct Main *main);
 
 void set_free_windowmanager_cb(void (*func)(struct bContext *, struct wmWindowManager *) );
 
index b65d77751e2b1a9b851dd2333d680dbf33340712..27c751260265d01d88121b031db22b63dbf33bda 100644 (file)
@@ -90,7 +90,10 @@ typedef enum {
        eModifierTypeFlag_UsesPointCache = (1<<6),
 
        /* For physics modifiers, max one per type */
-       eModifierTypeFlag_Single = (1<<7)
+       eModifierTypeFlag_Single = (1<<7),
+
+       /* Some modifier can't be added manually by user */
+       eModifierTypeFlag_NoUserAdd = (1<<8)
 } ModifierTypeFlag;
 
 typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin);
index 6558212519f723c4058e13b631cecff8187a3c80..a331479cad1f587bdf901b9474da33ef8916e26f 100644 (file)
@@ -35,10 +35,12 @@ struct Object;
 
 typedef struct MultiresSubsurf {
        struct MultiresModifierData *mmd;
-       struct Mesh *me;
+       struct Object *ob;
+       int local_mmd;
 } MultiresSubsurf;
 
 /* MultiresDM */
+struct Object *MultiresDM_get_object(struct DerivedMesh *dm);
 struct Mesh *MultiresDM_get_mesh(struct DerivedMesh *dm);
 struct DerivedMesh *MultiresDM_new(struct MultiresSubsurf *, struct DerivedMesh*, int, int, int);
 void *MultiresDM_get_vertnorm(struct DerivedMesh *);
@@ -58,8 +60,8 @@ void multires_mark_as_modified(struct Object *ob);
 
 void multires_force_update(struct Object *ob);
 
-struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*,
-                                                   struct Mesh *, int, int);
+struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, int local_mmd, struct DerivedMesh*,
+                                                   struct Object *, int, int);
 
 struct MultiresModifierData *find_multires_modifier(struct Object *ob);
 int multiresModifier_switch_level(struct Object *, const int);
index 183cdaff0e674d65bf8595c18e2bac18f4dbd4e7..cbb37918d047933546e1012fb3e012d2cf18c0d5 100644 (file)
@@ -25,7 +25,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): none yet.
+ * Contributor(s): Bob Holcomb.
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -325,7 +325,7 @@ void                        ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat);
 #define CMP_NODE_COMBYUVA      234
 #define CMP_NODE_DIFF_MATTE    235
 #define CMP_NODE_COLOR_SPILL   236
-#define CMP_NODE_CHROMA                237
+#define CMP_NODE_CHROMA_MATTE  237
 #define CMP_NODE_CHANNEL_MATTE 238
 #define CMP_NODE_FLIP          239
 #define CMP_NODE_SPLITVIEWER   240
@@ -345,6 +345,9 @@ void                        ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat);
 #define CMP_NODE_DBLUR         254
 #define CMP_NODE_BILATERALBLUR  255
 #define CMP_NODE_PREMULKEY  256
+#define CMP_NODE_DIST_MATTE    257
+#define CMP_NODE_VIEW_LEVELS    258
+#define CMP_NODE_COLOR_MATTE 259
 
 #define CMP_NODE_GLARE         301
 #define CMP_NODE_TONEMAP       302
@@ -421,10 +424,9 @@ extern struct ListBase node_all_textures;
 
 /* API */
 int  ntreeTexTagAnimated(struct bNodeTree *ntree);
-void ntreeTexUpdatePreviews( struct bNodeTree* nodetree );
-void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, char do_preview, short thread, struct Tex *tex, short which_output, int cfra);
+void ntreeTexSetPreviewFlag(int);
+void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra);
 void ntreeTexCheckCyclics(struct bNodeTree *ntree);
-void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node);
 char* ntreeTexOutputMenu(struct bNodeTree *ntree);
 
 
index a57529ccf75f917836e0ed38f94be3e058b073d2..1cb6efeb83859339042d613a3ff0339800693ffc 100644 (file)
@@ -115,6 +115,11 @@ void object_handle_update(struct Scene *scene, struct Object *ob);
 
 float give_timeoffset(struct Object *ob);
 int give_obdata_texspace(struct Object *ob, int **texflag, float **loc, float **size, float **rot);
+
+int object_insert_ptcache(struct Object *ob);
+// void object_delete_ptcache(struct Object *ob, int index);
+
+
 #ifdef __cplusplus
 }
 #endif
index 67b260b234829df3686371c94960afdd531a76b1..7dc9e4499c6cdf9670fe05cee091d1ee5ead2890 100644 (file)
 #define BKE_PAINT_H
 
 struct Brush;
+struct MFace;
+struct MultireModifierData;
+struct MVert;
 struct Object;
 struct Paint;
 struct Scene;
+struct StrokeCache;
 
-void paint_init(struct Paint *p, const char *brush_name);
+extern const char PAINT_CURSOR_SCULPT[3];
+extern const char PAINT_CURSOR_VERTEX_PAINT[3];
+extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
+extern const char PAINT_CURSOR_TEXTURE_PAINT[3];
+
+void paint_init(struct Paint *p, const char col[3]);
 void free_paint(struct Paint *p);
 void copy_paint(struct Paint *orig, struct Paint *new);
 
@@ -48,4 +57,39 @@ void paint_brush_slot_remove(struct Paint *p);
  * however hiding faces is useful */
 int paint_facesel_test(struct Object *ob);
 
+/* Session data (mode-specific) */
+
+typedef struct SculptSession {
+       struct ProjVert *projverts;
+
+       /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */
+       struct MultiresModifierData *multires; /* Special handling for multires meshes */
+       struct MVert *mvert;
+       struct MFace *mface;
+       int totvert, totface;
+       float *face_normals;
+       
+       /* Mesh connectivity */
+       struct ListBase *fmap;
+       struct IndexNode *fmap_mem;
+       int fmap_size;
+
+       /* Used temporarily per-stroke */
+       float *vertexcosnos;
+       ListBase damaged_rects;
+       ListBase damaged_verts;
+       
+       /* Used to cache the render of the active texture */
+       unsigned int texcache_side, *texcache, texcache_actual;
+
+       /* Layer brush persistence between strokes */
+       float (*mesh_co_orig)[3]; /* Copy of the mesh vertices' locations */
+       float *layer_disps; /* Displacements for each vertex */
+
+       struct SculptStroke *stroke;
+       struct StrokeCache *cache;
+} SculptSession;
+
+void free_sculptsession(SculptSession **);
+
 #endif
index cf02efc34acd8b23094746532487d967a0626f6f..c22778f5a3021f0a3129be4462aba17008d13403 100644 (file)
@@ -59,6 +59,9 @@ struct SurfaceModifierData;
 struct BVHTreeRay;
 struct BVHTreeRayHit; 
 
+#define PARTICLE_P                             ParticleData *pa; int p
+#define LOOP_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++)
+
 typedef struct ParticleEffectorCache {
        struct ParticleEffectorCache *next, *prev;
        struct Object *ob;
@@ -109,46 +112,10 @@ typedef struct ParticleCacheKey{
        float vel[3];
        float rot[4];
        float col[3];
+       float time;
        int steps;
 } ParticleCacheKey;
 
-typedef struct ParticleEditKey{
-       float *co;
-       float *vel;
-       float *rot;
-       float *time;
-
-       float world_co[3];
-       float length;
-       short flag;
-} ParticleEditKey;
-
-typedef struct ParticleUndo {
-       struct ParticleUndo *next, *prev;
-       struct ParticleEditKey **keys;
-       struct KDTree *emitter_field;
-       struct ParticleData *particles;
-       float *emitter_cosnos;
-       int totpart, totkeys;
-       char name[64];
-} ParticleUndo;
-
-typedef struct ParticleEdit {
-       ListBase undo;
-       struct ParticleUndo *curundo;
-
-       ParticleEditKey **keys;
-       int totkeys;
-
-       int *mirror_cache;
-
-       struct KDTree *emitter_field;
-       float *emitter_cosnos;
-
-       char sel_col[3];
-       char nosel_col[3];
-} ParticleEdit;
-
 typedef struct ParticleThreadContext {
        /* shared */
        struct Scene *scene;
@@ -240,9 +207,10 @@ int psys_check_enabled(struct Object *ob, struct ParticleSystem *psys);
 void psys_free_boid_rules(struct ListBase *list);
 void psys_free_settings(struct ParticleSettings *part);
 void free_child_path_cache(struct ParticleSystem *psys);
-void psys_free_path_cache(struct ParticleSystem *psys);
-void free_hair(struct ParticleSystem *psys, int softbody);
+void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit);
+void free_hair(struct Object *ob, struct ParticleSystem *psys, int dynamics);
 void free_keyed_keys(struct ParticleSystem *psys);
+void psys_free_particles(struct ParticleSystem *psys);
 void psys_free(struct Object * ob, struct ParticleSystem * psys);
 void psys_free_children(struct ParticleSystem *psys);
 
@@ -271,9 +239,9 @@ void psys_reset(struct ParticleSystem *psys, int mode);
 
 void psys_find_parents(struct Object *ob, struct ParticleSystemModifierData *psmd, struct ParticleSystem *psys);
 
-void psys_cache_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra, int editupdate);
+void psys_cache_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra);
+void psys_cache_edit_paths(struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra);
 void psys_cache_child_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra, int editupdate);
-void psys_update_world_cos(struct Object *ob, struct ParticleSystem *psys);
 int do_guide(struct Scene *scene, struct ParticleKey *state, int pa_num, float time, struct ListBase *lb);
 float psys_get_size(struct Object *ob, struct Material *ma, struct ParticleSystemModifierData *psmd, struct IpoCurve *icu_size, struct ParticleSystem *psys, struct ParticleSettings *part, struct ParticleData *pa, float *vg_size);
 float psys_get_timestep(struct ParticleSettings *part);
@@ -359,12 +327,6 @@ void reset_particle(struct Scene *scene, struct ParticleData *pa, struct Particl
 #define PSYS_EC_PARTICLE       4
 #define PSYS_EC_REACTOR                8
 
-/* ParticleEditKey->flag */
-#define PEK_SELECT             1
-#define PEK_TO_SELECT  2
-#define PEK_TAG                        4
-#define PEK_HIDE               8
-
 /* index_dmcache */
 #define DMCACHE_NOTFOUND       -1
 #define DMCACHE_ISCHILD                -2
index 5d9dddfe30d58fe6f187f65b96dd47d904e493d2..5ae10d736fde178027bdac58c73c68a4827baa4a 100644 (file)
@@ -60,8 +60,8 @@
 #define PTCACHE_TYPE_SOFTBODY                  0
 #define PTCACHE_TYPE_PARTICLES                 1
 #define PTCACHE_TYPE_CLOTH                             2
-#define PTCACHE_TYPE_SMOKE_DOMAIN_LOW  3
-#define PTCACHE_TYPE_SMOKE_DOMAIN_HIGH 4
+#define PTCACHE_TYPE_SMOKE_DOMAIN              3
+#define PTCACHE_TYPE_SMOKE_HIGHRES             4
 
 /* PTCache read return code */
 #define PTCACHE_READ_EXACT                             1
@@ -101,6 +101,8 @@ typedef struct PTCacheFile {
        void *cur[BPHYS_TOT_DATA];
 } PTCacheFile;
 
+#define PTCACHE_VEL_PER_SEC            1
+
 typedef struct PTCacheID {
        struct PTCacheID *next, *prev;
 
@@ -109,6 +111,7 @@ typedef struct PTCacheID {
        void *calldata;
        int type;
        int stack_index;
+       int flag;
 
        /* flags defined in DNA_object_force.h */
        unsigned int data_types, info_types;
@@ -151,6 +154,76 @@ typedef struct PTCacheBaker {
        void *progresscontext;
 } PTCacheBaker;
 
+/* PTCacheEditKey->flag */
+#define PEK_SELECT             1
+#define PEK_TAG                        2
+#define PEK_HIDE               4
+#define PEK_USE_WCO            8
+
+typedef struct PTCacheEditKey{
+       float *co;
+       float *vel;
+       float *rot;
+       float *time;
+
+       float world_co[3];
+       float ftime;
+       float length;
+       short flag;
+} PTCacheEditKey;
+
+/* PTCacheEditPoint->flag */
+#define PEP_TAG                                1
+#define PEP_EDIT_RECALC                2
+#define PEP_TRANSFORM          4
+#define PEP_HIDE                       8
+
+typedef struct PTCacheEditPoint {
+       struct PTCacheEditKey *keys;
+       int totkey;
+       short flag;
+} PTCacheEditPoint;
+
+typedef struct PTCacheUndo {
+       struct PTCacheUndo *next, *prev;
+       struct PTCacheEditPoint *points;
+
+       /* particles stuff */
+       struct ParticleData *particles;
+       struct KDTree *emitter_field;
+       float *emitter_cosnos;
+       int psys_flag;
+
+       /* cache stuff */
+       struct ListBase mem_cache;
+
+       int totpoint;
+       char name[64];
+} PTCacheUndo;
+
+typedef struct PTCacheEdit {
+       ListBase undo;
+       struct PTCacheUndo *curundo;
+       PTCacheEditPoint *points;
+
+       struct PTCacheID pid;
+
+       /* particles stuff */
+       struct ParticleSystem *psys;
+       struct ParticleData *particles;
+       struct KDTree *emitter_field;
+       float *emitter_cosnos;
+       int *mirror_cache;
+
+       struct ParticleCacheKey **pathcache;    /* path cache (runtime) */
+       ListBase pathcachebufs;
+
+       int totpoint, totframes, totcached, edited;
+
+       char sel_col[3];
+       char nosel_col[3];
+} PTCacheEdit;
+
 /* Particle functions */
 void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **data, float time);
 
@@ -158,7 +231,8 @@ void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **da
 void BKE_ptcache_id_from_softbody(PTCacheID *pid, struct Object *ob, struct SoftBody *sb);
 void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys);
 void BKE_ptcache_id_from_cloth(PTCacheID *pid, struct Object *ob, struct ClothModifierData *clmd);
-void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd, int num);
+void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd);
+void BKE_ptcache_id_from_smoke_turbulence(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd);
 
 void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob);
 
@@ -179,6 +253,10 @@ void BKE_ptcache_update_info(PTCacheID *pid);
 /* Size of cache data type. */
 int            BKE_ptcache_data_size(int data_type);
 
+/* Memory cache read/write helpers. */
+void BKE_ptcache_mem_init_pointers(struct PTCacheMem *pm);
+void BKE_ptcache_mem_incr_pointers(struct PTCacheMem *pm);
+
 /* Copy a specific data type from cache data to point data. */
 void   BKE_ptcache_data_get(void **data, int type, int index, void *to);
 
@@ -197,7 +275,7 @@ int BKE_ptcache_get_continue_physics(void);
 
 /******************* Allocate & free ***************/
 struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
-void BKE_ptache_free_mem(struct PointCache *cache);
+void BKE_ptcache_free_mem(struct ListBase *mem_cache);
 void BKE_ptcache_free(struct PointCache *cache);
 void BKE_ptcache_free_list(struct ListBase *ptcaches);
 struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old);
index 22c4f39148a3fe17e6af219d4a24fe19061e3fe4..1b8e61f136f8e10d3cc7fe34428f8ff39458bd2f 100644 (file)
@@ -47,7 +47,6 @@ void unlink_actuators(struct ListBase *lb);
 void free_actuator(struct bActuator *act);
 void free_actuators(struct ListBase *lb);
 
-void free_text_controllers(struct Text *txt);
 void free_sensor(struct bSensor *sens);
 void free_sensors(struct ListBase *lb);
 struct bSensor *copy_sensor(struct bSensor *sens);
index 12a13a2b50c0ff9d6f1746ea2d627a375089b53d..686fc265de0bd41462799c0a478aedc9f3b1d317 100644 (file)
@@ -84,7 +84,5 @@ int get_render_child_particle_number(struct RenderData *r, int num);
 int get_render_shadow_samples(struct RenderData *r, int samples);
 float get_render_aosss_error(struct RenderData *r, float error);
 
-void free_dome_warp_text(struct Text *txt);
-
 #endif
 
diff --git a/source/blender/blenkernel/BKE_sculpt.h b/source/blender/blenkernel/BKE_sculpt.h
deleted file mode 100644 (file)
index 9e5647a..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * $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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BKE_SCULPT_H
-#define BKE_SCULPT_H
-
-struct MFace;
-struct MultireModifierData;
-struct MVert;
-struct Object;
-struct StrokeCache;
-
-typedef struct SculptSession {
-       struct ProjVert *projverts;
-
-       /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */
-       struct MultiresModifierData *multires; /* Special handling for multires meshes */
-       struct MVert *mvert;
-       struct MFace *mface;
-       int totvert, totface;
-       float *face_normals;
-       
-       /* Mesh connectivity */
-       struct ListBase *fmap;
-       struct IndexNode *fmap_mem;
-       int fmap_size;
-
-       /* Used temporarily per-stroke */
-       float *vertexcosnos;
-       ListBase damaged_rects;
-       ListBase damaged_verts;
-       
-       /* Used to cache the render of the active texture */
-       unsigned int texcache_side, *texcache, texcache_actual;
-
-       /* Layer brush persistence between strokes */
-       float (*mesh_co_orig)[3]; /* Copy of the mesh vertices' locations */
-       float *layer_disps; /* Displacements for each vertex */
-
-       struct SculptStroke *stroke;
-       struct StrokeCache *cache;
-} SculptSession;
-
-void free_sculptsession(SculptSession **);
-
-#endif
index eb0e3c4ef00a2687acd3d0d6c935c7200bea14ec..5b413ae4e44a591d5f9dc0da642e152684f3688c 100644 (file)
@@ -115,9 +115,9 @@ typedef struct ShrinkwrapCalcData
        int vgroup;                                             //Vertex group num
 
        struct DerivedMesh *target;             //mesh we are shrinking to      
-       SpaceTransform local2target;    //transform to move bettwem local and target space
+       SpaceTransform local2target;    //transform to move between local and target space
 
-       float keepDist;                                 //Distance to kept from target (units are in local space)
+       float keepDist;                                 //Distance to keep above target surface (units are in local space)
 
 } ShrinkwrapCalcData;
 
index 8dc38640e9a6a72a5c097aa91e3768871050ee46..0f8e9c5edf5d61f4ec23b3e3ecbc5e1ccb3660f8 100644 (file)
 #ifndef BKE_SMOKE_H_
 #define BKE_SMOKE_H_
 
+typedef float (*bresenham_callback) (float *result, float *input, int res[3], int *pixel, float *tRay, float correct);
+
 void smokeModifier_do(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc);
 
 void smokeModifier_free (struct SmokeModifierData *smd);
 void smokeModifier_reset(struct SmokeModifierData *smd);
+void smokeModifier_reset_turbulence(struct SmokeModifierData *smd);
 void smokeModifier_createType(struct SmokeModifierData *smd);
 
-void smoke_set_tray(struct SmokeModifierData *smd, size_t index, float transparency);
-float smoke_get_tray(struct SmokeModifierData *smd, size_t index);
-float smoke_get_tvox(struct SmokeModifierData *smd, size_t index);
-void smoke_set_tvox(struct SmokeModifierData *smd, size_t index, float tvox);
-
-void smoke_set_bigtray(struct SmokeModifierData *smd, size_t index, float transparency);
-float smoke_get_bigtray(struct SmokeModifierData *smd, size_t index);
-float smoke_get_bigtvox(struct SmokeModifierData *smd, size_t index);
-void smoke_set_bigtvox(struct SmokeModifierData *smd, size_t index, float tvox);
-
 long long smoke_get_mem_req(int xres, int yres, int zres, int amplify);
-void smoke_prepare_View(struct SmokeModifierData *smd, float *light);
-void smoke_prepare_bigView(struct SmokeModifierData *smd, float *light);
 
 #endif /* BKE_SMOKE_H_ */
index 1dd90b4dbda3c0f5fab79a9b47e802da83d43270..e9f6eb21e36c546b84da495c315bf87b30d353b8 100644 (file)
@@ -54,7 +54,9 @@ void sound_delete(struct bContext *C, struct bSound* sound);
 
 void sound_cache(struct bSound* sound, int ignore);
 
-void sound_load(struct bSound* sound);
+void sound_delete_cache(struct bSound* sound);
+
+void sound_load(struct Main *main, struct bSound* sound);
 
 void sound_free(struct bSound* sound);
 
index d288c0b651675c2f244ab19c3f0bc28d9102dd28..bd14053d121482b980d6a6ea475387cf50d02751 100644 (file)
@@ -35,6 +35,7 @@
 extern "C" {
 #endif
 
+struct Main;
 struct Text;
 struct TextLine;
 struct SpaceText;
@@ -46,6 +47,7 @@ struct Text*  add_empty_text  (char *name);
 int                reopen_text         (struct Text *text);
 struct Text*   add_text                (char *file, const char *relpath); 
 struct Text*   copy_text               (struct Text *ta);
+void                   unlink_text             (struct Main *bmain, struct Text *text);
 
 char*  txt_to_buf                      (struct Text *text);
 void   txt_clean_text          (struct Text *text);
index a1600ce54738d0fe905600a1bdb585b56a0ebad7..a9862ba586b18a4bb4bf10eedc09af6babd6ea46 100644 (file)
@@ -40,6 +40,8 @@ struct ColorBand;
 struct HaloRen;
 struct TexMapping;
 struct EnvMap;
+struct PointDensity;
+struct VoxelData;
 
 /*  in ColorBand struct */
 #define MAXCOLORBAND 32
@@ -75,6 +77,16 @@ void    BKE_free_envmap(struct EnvMap *env);
 struct EnvMap *BKE_add_envmap(void);
 struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
 
+void    BKE_free_pointdensitydata(struct PointDensity *pd);
+void    BKE_free_pointdensity(struct PointDensity *pd);
+struct PointDensity *BKE_add_pointdensity(void);
+struct PointDensity *BKE_copy_pointdensity(struct PointDensity *pd);
+
+void BKE_free_voxeldatadata(struct VoxelData *vd);
+void BKE_free_voxeldata(struct VoxelData *vd);
+struct VoxelData *BKE_add_voxeldata(void);
+struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd);
+
 int     BKE_texture_dependsOnTime(const struct Tex *texture);
 
 #endif
index eba5032997d6a107dd41b13d51d55b9ec582d630..c0ed843017702855a1a955b78c58730c624691ee 100644 (file)
 #define VECSUB(v1,v2,v3)       {*(v1)= *(v2) - *(v3); *(v1+1)= *(v2+1) - *(v3+1); *(v1+2)= *(v2+2) - *(v3+2);}
 #define VECSUB2D(v1,v2,v3)     {*(v1)= *(v2) - *(v3); *(v1+1)= *(v2+1) - *(v3+1);}
 #define VECADDFAC(v1,v2,v3,fac) {*(v1)= *(v2) + *(v3)*(fac); *(v1+1)= *(v2+1) + *(v3+1)*(fac); *(v1+2)= *(v2+2) + *(v3+2)*(fac);}
+#define VECSUBFAC(v1,v2,v3,fac) {*(v1)= *(v2) - *(v3)*(fac); *(v1+1)= *(v2+1) - *(v3+1)*(fac); *(v1+2)= *(v2+2) - *(v3+2)*(fac);}
 #define QUATADDFAC(v1,v2,v3,fac) {*(v1)= *(v2) + *(v3)*(fac); *(v1+1)= *(v2+1) + *(v3+1)*(fac); *(v1+2)= *(v2+2) + *(v3+2)*(fac); *(v1+3)= *(v2+3) + *(v3+3)*(fac);}
 
 #define INPR(v1, v2)           ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] )
 #define SET_INT_IN_POINTER(i) ((void*)(intptr_t)(i))
 #define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
 
+/*little array macro library.  example of usage:
+
+int *arr = NULL;
+V_DECLARE(arr);
+int i;
+
+for (i=0; i<10; i++) {
+       V_GROW(arr);
+       arr[i] = something;
+}
+V_FREE(arr);
+
+arrays are buffered, using double-buffering (so on each reallocation,
+the array size is doubled).  supposedly this should give good Big Oh
+behaviour, though it may not be the best in practice.
+*/
+
+#define V_DECLARE(vec) int _##vec##_count=0; void *_##vec##_tmp
+
+/*in the future, I plan on having V_DECLARE allocate stack memory it'll
+  use at first, and switch over to heap when it needs more.  that'll mess
+  up cases where you'd want to use this API to build a dynamic list for
+  non-local use, so all such cases should use this macro.*/
+#define V_DYNDECLARE(vec) V_DECLARE(vec)
+
+/*this returns the entire size of the array, including any buffering.*/
+#define V_SIZE(vec) ((signed int)((vec)==NULL ? 0 : MEM_allocN_len(vec) / sizeof(*vec)))
+
+/*this returns the logical size of the array, not including buffering.*/
+#define V_COUNT(vec) _##vec##_count
+
+/*grow the array by one.  zeroes the new elements.*/
+#define V_GROW(vec) \
+       V_SIZE(vec) > _##vec##_count ? _##vec##_count++ : \
+       ((_##vec##_tmp = MEM_callocN(sizeof(*vec)*(_##vec##_count*2+2), #vec " " __FILE__ " ")),\
+       (vec && memcpy(_##vec##_tmp, vec, sizeof(*vec) * _##vec##_count)),\
+       (vec && (MEM_freeN(vec),1)),\
+       (vec = _##vec##_tmp),\
+       _##vec##_count++)
+
+#define V_FREE(vec) if (vec) MEM_freeN(vec);
+
+/*resets the logical size of an array to zero, but doesn't
+  free the memory.*/
+#define V_RESET(vec) _##vec##_count=0
+
+/*set the count of the array*/
+#define V_SETCOUNT(vec, count) _##vec##_count = (count)
+
 #endif
 
index c1dfc2cf639222fbe78ed2d99923ef38cd37ad43..68aed2b0184f1c6b3946e0e5c660ad9c6e36630a 100644 (file)
 FILE(GLOB SRC intern/*.c)
 
 SET(INC 
-  . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna
-  ../render/extern/include ../../../intern/decimation/extern
-  ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern
-  ../../../intern/iksolver/extern ../blenloader ../quicktime
-  ../../../extern/bullet2/src
-  ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern
-  ../../../intern/bsp/extern
-  ../../../intern/audaspace/intern
-  ${ZLIB_INC}
+       . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna
+       ../render/extern/include ../../../intern/decimation/extern
+       ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern
+       ../../../intern/iksolver/extern ../blenloader
+       ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern
+       ../../../intern/bsp/extern ../blenfont
+       ../../../intern/audaspace/intern
+       ../../../extern/lzo/minilzo
+       ../../../extern/lzma
+       ${ZLIB_INC}
 )
 
+IF(WITH_BULLET)
+       SET(INC ${INC} ../../../extern/bullet2/src)
+       ADD_DEFINITIONS(-DUSE_BULLET)
+ENDIF(WITH_BULLET)
+
 IF(WITH_OPENEXR)
-  ADD_DEFINITIONS(-DWITH_OPENEXR)
+       ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)
 
 IF(WITH_OPENJPEG)
-  ADD_DEFINITIONS(-DWITH_OPENJPEG)
+       ADD_DEFINITIONS(-DWITH_OPENJPEG)
 ENDIF(WITH_OPENJPEG)
 
 IF(WITH_DDS)
-  ADD_DEFINITIONS(-DWITH_DDS)
+       ADD_DEFINITIONS(-DWITH_DDS)
 ENDIF(WITH_DDS)
 
 IF(WITH_QUICKTIME)
-  SET(INC ${INC} ${QUICKTIME_INC})
-  ADD_DEFINITIONS(-DWITH_QUICKTIME)
+       SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
+       ADD_DEFINITIONS(-DWITH_QUICKTIME)
 ENDIF(WITH_QUICKTIME)
 
 IF(WITH_FFMPEG)
-  SET(INC ${INC} ${FFMPEG_INC})
-  ADD_DEFINITIONS(-DWITH_FFMPEG)
+       SET(INC ${INC} ${FFMPEG_INC})
+       ADD_DEFINITIONS(-DWITH_FFMPEG)
 ENDIF(WITH_FFMPEG)
 
 IF(WITH_PYTHON)
-  SET(INC ${INC} ../python ${PYTHON_INC})
+       SET(INC ${INC} ../python ${PYTHON_INC})
 ELSE(WITH_PYTHON)
-  ADD_DEFINITIONS(-DDISABLE_PYTHON)
+       ADD_DEFINITIONS(-DDISABLE_PYTHON)
 ENDIF(WITH_PYTHON)
 
 IF(NOT WITH_ELBEEM)
-  ADD_DEFINITIONS(-DDISABLE_ELBEEM)
+       ADD_DEFINITIONS(-DDISABLE_ELBEEM)
 ENDIF(NOT WITH_ELBEEM)
 
 IF(WIN32)
-  SET(INC ${INC} ${PTHREADS_INC})
+       SET(INC ${INC} ${PTHREADS_INC})
 ENDIF(WIN32)
 
 BLENDERLIB(bf_blenkernel "${SRC}" "${INC}")
index 6772cccbda695404dd9f9efbdd4abebe2d9b6cd1..1f42390504d431e0516fea4c4a0b56791936b91b 100644 (file)
@@ -3,7 +3,7 @@ Import ('env')
 
 sources = env.Glob('intern/*.c')
 
-incs = '. #/intern/guardedalloc #/intern/memutil ../editors/include ../blenlib ../makesdna'
+incs = '. #/intern/guardedalloc #/intern/memutil ../editors/include ../blenlib ../blenfont ../makesdna'
 incs += ' ../render/extern/include #/intern/decimation/extern ../makesrna'
 incs += ' ../imbuf ../avi #/intern/elbeem/extern ../nodes'
 incs += ' #/intern/iksolver/extern ../blenloader'
@@ -11,6 +11,8 @@ incs += ' #/extern/bullet2/src'
 incs += ' #/intern/opennl/extern #/intern/bsp/extern'
 incs += ' ../gpu #/extern/glew/include'
 incs += ' #/intern/smoke/extern'
+incs += ' #/extern/lzo/minilzo'
+incs += ' #/extern/lzma'
 incs += ' #/intern/audaspace/intern'
 
 incs += ' ' + env['BF_OPENGL_INC']
@@ -52,7 +54,7 @@ if env['WITH_BF_QUICKTIME']:
        incs += ' ' + env['BF_QUICKTIME_INC']
 
 if env['WITH_BF_BULLET']:
-       defs.append('WITH_BULLET')
+       defs.append('USE_BULLET')
 
 if env['BF_NO_ELBEEM']:
        defs.append('DISABLE_ELBEEM')
@@ -63,4 +65,4 @@ if env['WITH_BF_LCMS']:
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
     incs += ' ' + env['BF_PTHREADS_INC']
 
-env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [165] )
+env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [166,25] )
index 84cccd8b939a549de2466ba0e7e81ddac2a5118a..43b9a63a2c14050aa8fd20ae27ce7889ef1a614e 100644 (file)
@@ -2077,7 +2077,7 @@ static void clear_mesh_caches(Object *ob)
 static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
 {
        Object *obact = scene->basact?scene->basact->object:NULL;
-       int editing = paint_facesel_test(ob)|(ob && ob->mode & OB_MODE_PARTICLE_EDIT);
+       int editing = paint_facesel_test(ob);
        int needMapping = editing && (ob==obact);
        float min[3], max[3];
        
index 60ffdc78726f6b3926c2569ecb271b84051d20be..6c2edc9e25f9d746513f560ea56c5840037b71e7 100644 (file)
@@ -51,6 +51,7 @@ CPPFLAGS += -I../../imbuf
 CPPFLAGS += -I../../blenlib
 CPPFLAGS += -I../../blenloader
 CPPFLAGS += -I../../python
+CPPFLAGS += -I../../blenfont
 # also avi is used
 CPPFLAGS += -I../../avi
 CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
@@ -89,6 +90,10 @@ CPPFLAGS += -I$(NAN_BULLET2)/include
 CPPFLAGS += -I$(NAN_FREETYPE)/include
 CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
 
+# lzo and lzma, for pointcache
+CPPFLAGS += -I$(NAN_LZO)/minilzo
+CPPFLAGS += -I$(NAN_LZMA)
+
 ifeq ($(WITH_FFMPEG),true)
     CPPFLAGS += -DWITH_FFMPEG
     CPPFLAGS += $(NAN_FFMPEGCFLAGS)
@@ -110,3 +115,4 @@ ifeq ($(WITH_QUICKTIME), true)
        CPPFLAGS += -I../../quicktime
        CPPFLAGS += -DWITH_QUICKTIME
 endif
+
index f4d4eb1cc9c3109b4a86100f197142b4082440fc..47de044ea25e9cc7bffddca8dfd9537064639e11 100644 (file)
@@ -410,8 +410,9 @@ bActionGroup *action_groups_find_named (bAction *act, const char name[])
 bPoseChannel *get_pose_channel(const bPose *pose, const char *name)
 {
        bPoseChannel *chan;
-
-       if (pose==NULL) return NULL;
+       
+       if (ELEM(NULL, pose, name) || (name[0] == 0))
+               return NULL;
        
        for (chan=pose->chanbase.first; chan; chan=chan->next) {
                if (chan->name[0] == name[0]) {
@@ -837,14 +838,15 @@ short action_has_motion(const bAction *act)
 }
 
 /* Calculate the extents of given action */
-void calc_action_range(const bAction *act, float *start, float *end, int incl_hidden)
+void calc_action_range(const bAction *act, float *start, float *end, short incl_modifiers)
 {
        FCurve *fcu;
        float min=999999999.0f, max=-999999999.0f;
-       short foundvert=0;
+       short foundvert=0, foundmod=0;
 
        if (act) {
                for (fcu= act->curves.first; fcu; fcu= fcu->next) {
+                       /* if curve has keyframes, consider them first */
                        if (fcu->totvert) {
                                float nmin, nmax;
                                
@@ -857,10 +859,53 @@ void calc_action_range(const bAction *act, float *start, float *end, int incl_hi
                                
                                foundvert= 1;
                        }
+                       
+                       /* if incl_modifiers is enabled, need to consider modifiers too
+                        *      - only really care about the last modifier
+                        */
+                       if ((incl_modifiers) && (fcu->modifiers.last)) {
+                               FModifier *fcm= fcu->modifiers.last;
+                               
+                               /* only use the maximum sensible limits of the modifiers if they are more extreme */
+                               switch (fcm->type) {
+                                       case FMODIFIER_TYPE_LIMITS: /* Limits F-Modifier */
+                                       {
+                                               FMod_Limits *fmd= (FMod_Limits *)fcm->data;
+                                               
+                                               if (fmd->flag & FCM_LIMIT_XMIN) {
+                                                       min= MIN2(min, fmd->rect.xmin);
+                                               }
+                                               if (fmd->flag & FCM_LIMIT_XMAX) {
+                                                       max= MAX2(max, fmd->rect.xmax);
+                                               }
+                                       }
+                                               break;
+                                               
+                                       case FMODIFIER_TYPE_CYCLES: /* Cycles F-Modifier */
+                                       {
+                                               FMod_Cycles *fmd= (FMod_Cycles *)fcm->data;
+                                               
+                                               if (fmd->before_mode != FCM_EXTRAPOLATE_NONE)
+                                                       min= MINAFRAMEF;
+                                               if (fmd->after_mode != FCM_EXTRAPOLATE_NONE)
+                                                       max= MAXFRAMEF;
+                                       }
+                                               break;
+                                               
+                                       // TODO: function modifier may need some special limits
+                                               
+                                       default: /* all other standard modifiers are on the infinite range... */
+                                               min= MINAFRAMEF;
+                                               max= MAXFRAMEF;
+                                               break;
+                               }
+                               
+                               foundmod= 1;
+                       }
                }
        }       
        
-       if (foundvert) {
+       if (foundvert || foundmod) {
                if(min==max) max+= 1.0f;
                *start= min;
                *end= max;
index 6c1b8eb9000cb192e7954bec3aedf235a47b7bcf..8cb88cdb7865a6616df8e06ba634c6b07d79a2bd 100644 (file)
@@ -87,15 +87,16 @@ void free_path(Path *path)
 void calc_curvepath(Object *ob)
 {
        BevList *bl;
-       BevPoint *bevp, *bevpn, *bevpfirst, *bevplast, *tempbevp;
+       BevPoint *bevp, *bevpn, *bevpfirst, *bevplast;
+       PathPoint *pp;
        Curve *cu;
        Nurb *nu;
        Path *path;
-       float *fp, *dist, *maxdist, x, y, z;
+       float *fp, *dist, *maxdist, xyz[3];
        float fac, d=0, fac1, fac2;
        int a, tot, cycl=0;
-       float *ft;
        
+
        /* in a path vertices are with equal differences: path->len = number of verts */
        /* NOW WITH BEVELCURVE!!! */
        
@@ -132,19 +133,12 @@ void calc_curvepath(Object *ob)
        *fp= 0;
        for(a=0; a<tot; a++) {
                fp++;
-               if(cycl && a==tot-1) {
-                       x= bevpfirst->x - bevp->x;
-                       y= bevpfirst->y - bevp->y;
-                       z= bevpfirst->z - bevp->z;
-               }
-               else {
-                        tempbevp = bevp+1;
-                       x= (tempbevp)->x - bevp->x;
-                       y= (tempbevp)->y - bevp->y;
-                       z= (tempbevp)->z - bevp->z;
-               }
-               *fp= *(fp-1)+ (float)sqrt(x*x+y*y+z*z);
+               if(cycl && a==tot-1)
+                       VecSubf(xyz, bevpfirst->vec, bevp->vec);
+               else
+                       VecSubf(xyz, (bevp+1)->vec, bevp->vec);
                
+               *fp= *(fp-1)+VecLength(xyz);
                bevp++;
        }
        
@@ -152,7 +146,7 @@ void calc_curvepath(Object *ob)
 
                /* the path verts  in path->data */
                /* now also with TILT value */
-       ft= path->data = (float *)MEM_callocN(16*path->len, "pathdata");
+       pp= path->data = (PathPoint *)MEM_callocN(sizeof(PathPoint)*4*path->len, "pathdata"); // XXX - why *4? - in 2.4x each element was 4 and the size was 16, so better leave for now - Campbell
        
        bevp= bevpfirst;
        bevpn= bevp+1;
@@ -182,13 +176,13 @@ void calc_curvepath(Object *ob)
                fac1= fac2/fac1;
                fac2= 1.0f-fac1;
 
-               ft[0]= fac1*bevp->x+ fac2*(bevpn)->x;
-               ft[1]= fac1*bevp->y+ fac2*(bevpn)->y;
-               ft[2]= fac1*bevp->z+ fac2*(bevpn)->z;
-               ft[3]= fac1*bevp->alfa+ fac2*(bevpn)->alfa;
+               VecLerpf(pp->vec, bevp->vec, bevpn->vec, fac2);
+               pp->vec[3]= fac1*bevp->alfa + fac2*bevpn->alfa;
+               pp->radius= fac1*bevp->radius + fac2*bevpn->radius;
+               QuatInterpol(pp->quat, bevp->quat, bevpn->quat, fac2);
+               NormalQuat(pp->quat);
                
-               ft+= 4;
-
+               pp++;
        }
        
        MEM_freeN(dist);
@@ -212,13 +206,14 @@ int interval_test(int min, int max, int p1, int cycl)
 
 /* warning, *vec needs FOUR items! */
 /* ctime is normalized range <0-1> */
-int where_on_path(Object *ob, float ctime, float *vec, float *dir)     /* returns OK */
+int where_on_path(Object *ob, float ctime, float *vec, float *dir, float *quat, float *radius) /* returns OK */
 {
        Curve *cu;
        Nurb *nu;
        BevList *bl;
        Path *path;
-       float *fp, *p0, *p1, *p2, *p3, fac;
+       PathPoint *pp, *p0, *p1, *p2, *p3;
+       float fac;
        float data[4];
        int cycl=0, s0, s1, s2, s3;
 
@@ -229,7 +224,7 @@ int where_on_path(Object *ob, float ctime, float *vec, float *dir)  /* returns OK
                return 0;
        }
        path= cu->path;
-       fp= path->data;
+       pp= path->data;
        
        /* test for cyclic */
        bl= cu->bev.first;
@@ -248,19 +243,19 @@ int where_on_path(Object *ob, float ctime, float *vec, float *dir)        /* returns OK
        s2= interval_test(0, path->len-1-cycl, s1+1, cycl);
        s3= interval_test(0, path->len-1-cycl, s1+2, cycl);
 
-       p0= fp + 4*s0;
-       p1= fp + 4*s1;
-       p2= fp + 4*s2;
-       p3= fp + 4*s3;
+       p0= pp + s0;
+       p1= pp + s1;
+       p2= pp + s2;
+       p3= pp + s3;
 
        /* note, commented out for follow constraint */
        //if(cu->flag & CU_FOLLOW) {
                
-               set_afgeleide_four_ipo(1.0f-fac, data, KEY_BSPLINE);
+               key_curve_tangent_weights(1.0f-fac, data, KEY_BSPLINE);
                
-               dir[0]= data[0]*p0[0] + data[1]*p1[0] + data[2]*p2[0] + data[3]*p3[0] ;
-               dir[1]= data[0]*p0[1] + data[1]*p1[1] + data[2]*p2[1] + data[3]*p3[1] ;
-               dir[2]= data[0]*p0[2] + data[1]*p1[2] + data[2]*p2[2] + data[3]*p3[2] ;
+               dir[0]= data[0]*p0->vec[0] + data[1]*p1->vec[0] + data[2]*p2->vec[0] + data[3]*p3->vec[0] ;
+               dir[1]= data[0]*p0->vec[1] + data[1]*p1->vec[1] + data[2]*p2->vec[1] + data[3]*p3->vec[1] ;
+               dir[2]= data[0]*p0->vec[2] + data[1]*p1->vec[2] + data[2]*p2->vec[2] + data[3]*p3->vec[2] ;
                
                /* make compatible with vectoquat */
                dir[0]= -dir[0];
@@ -271,16 +266,35 @@ int where_on_path(Object *ob, float ctime, float *vec, float *dir)        /* returns OK
        nu= cu->nurb.first;
 
        /* make sure that first and last frame are included in the vectors here  */
-       if((nu->type & 7)==CU_POLY) set_four_ipo(1.0f-fac, data, KEY_LINEAR);
-       else if((nu->type & 7)==CU_BEZIER) set_four_ipo(1.0f-fac, data, KEY_LINEAR);
-       else if(s0==s1 || p2==p3) set_four_ipo(1.0f-fac, data, KEY_CARDINAL);
-       else set_four_ipo(1.0f-fac, data, KEY_BSPLINE);
-
-       vec[0]= data[0]*p0[0] + data[1]*p1[0] + data[2]*p2[0] + data[3]*p3[0] ;
-       vec[1]= data[0]*p0[1] + data[1]*p1[1] + data[2]*p2[1] + data[3]*p3[1] ;
-       vec[2]= data[0]*p0[2] + data[1]*p1[2] + data[2]*p2[2] + data[3]*p3[2] ;
+       if(nu->type == CU_POLY) key_curve_position_weights(1.0f-fac, data, KEY_LINEAR);
+       else if(nu->type == CU_BEZIER) key_curve_position_weights(1.0f-fac, data, KEY_LINEAR);
+       else if(s0==s1 || p2==p3) key_curve_position_weights(1.0f-fac, data, KEY_CARDINAL);
+       else key_curve_position_weights(1.0f-fac, data, KEY_BSPLINE);
+
+       vec[0]= data[0]*p0->vec[0] + data[1]*p1->vec[0] + data[2]*p2->vec[0] + data[3]*p3->vec[0] ; /* X */
+       vec[1]= data[0]*p0->vec[1] + data[1]*p1->vec[1] + data[2]*p2->vec[1] + data[3]*p3->vec[1] ; /* Y */
+       vec[2]= data[0]*p0->vec[2] + data[1]*p1->vec[2] + data[2]*p2->vec[2] + data[3]*p3->vec[2] ; /* Z */
+       vec[3]= data[0]*p0->vec[3] + data[1]*p1->vec[3] + data[2]*p2->vec[3] + data[3]*p3->vec[3] ; /* Tilt, should not be needed since we have quat still used */
+       /* Need to verify the quat interpolation is correct - XXX */
+
+       if (quat) {
+               float totfac, q1[4], q2[4];
+
+               totfac= data[0]+data[1];
+               QuatInterpol(q1, p0->quat, p1->quat, data[0] / totfac);
+               NormalQuat(q1);
+
+               totfac= data[2]+data[3];
+               QuatInterpol(q2, p2->quat, p3->quat, data[2] / totfac);
+               NormalQuat(q2);
+
+               totfac = data[0]+data[1]+data[2]+data[3];
+               QuatInterpol(quat, q1, q2, (data[0]+data[1]) / totfac);
+               NormalQuat(quat);
+       }
 
-       vec[3]= data[0]*p0[3] + data[1]*p1[3] + data[2]*p2[3] + data[3]*p3[3] ;
+       if(radius)
+               *radius= data[0]*p0->radius + data[1]*p1->radius + data[2]*p2->radius + data[3]*p3->radius;
 
        return 1;
 }
index 204935cc38d3dc007d13a415351d0c6b45609d74..2d6a97c48ae9de17152db014eefa8d6fdbcbeb1c 100644 (file)
@@ -204,15 +204,35 @@ AnimData *BKE_copy_animdata (AnimData *adt)
        return dadt;
 }
 
+/* Make Local -------------------------------------------- */
+
+static void make_local_strips(ListBase *strips)
+{
+       NlaStrip *strip;
+
+       for(strip=strips->first; strip; strip=strip->next) {
+               if(strip->act) make_local_action(strip->act);
+               if(strip->remap && strip->remap->target) make_local_action(strip->remap->target);
+
+               make_local_strips(&strip->strips);
+       }
+}
+
+void BKE_animdata_make_local(AnimData *adt)
+{
+       NlaTrack *nlt;
+
+       if(adt->action) make_local_action(adt->action);
+       if(adt->tmpact) make_local_action(adt->tmpact);
+       if(adt->remap && adt->remap->target) make_local_action(adt->remap->target);
+
+       for(nlt=adt->nla_tracks.first; nlt; nlt=nlt->next) 
+               make_local_strips(&nlt->strips);
+}
+
 /* *********************************** */ 
 /* KeyingSet API */
 
-/* NOTES:
- * It is very likely that there will be two copies of the api - one for internal use,
- * and one 'operator' based wrapper of the internal API, which should allow for access
- * from Python/scripts so that riggers can automate the creation of KeyingSets for their rigs.
- */
-
 /* Finding Tools --------------------------- */
 
 /* Find the first path that matches the given criteria */
@@ -245,7 +265,7 @@ KS_Path *BKE_keyingset_find_destination (KeyingSet *ks, ID *id, const char group
                if ((ksp->rna_path==0) || strcmp(rna_path, ksp->rna_path))
                        eq_path= 0;
                        
-               /* index */
+               /* index - need to compare whole-array setting too... */
                if (ksp->array_index != array_index)
                        eq_index= 0;
                        
@@ -276,7 +296,7 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho
        if (name)
                BLI_snprintf(ks->name, 64, name);
        else
-               strcpy(ks->name, "Keying Set");
+               strcpy(ks->name, "KeyingSet");
        
        ks->flag= flag;
        ks->keyingflag= keyingflag;
@@ -285,7 +305,7 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho
        BLI_addtail(list, ks);
        
        /* make sure KeyingSet has a unique name (this helps with identification) */
-       BLI_uniquename(list, ks, "Keying Set", ' ', offsetof(KeyingSet, name), 64);
+       BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, name), 64);
        
        /* return new KeyingSet for further editing */
        return ks;
@@ -299,18 +319,25 @@ void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name
        KS_Path *ksp;
        
        /* sanity checks */
-       if ELEM(NULL, ks, rna_path)
+       if ELEM(NULL, ks, rna_path) {
+               printf("ERROR: no Keying Set and/or RNA Path to add destination with \n");
                return;
+       }
        
        /* ID is optional for relative KeyingSets, but is necessary for absolute KeyingSets */
        if (id == NULL) {
-               if (ks->flag & KEYINGSET_ABSOLUTE)
+               if (ks->flag & KEYINGSET_ABSOLUTE) {
+                       printf("ERROR: No ID provided for absolute destination. \n");
                        return;
+               }
        }
        
        /* don't add if there is already a matching KS_Path in the KeyingSet */
-       if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode))
+       if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode)) {
+               if (G.f & G_DEBUG)
+                       printf("ERROR: destination already exists in Keying Set \n");
                return;
+       }
        
        /* allocate a new KeyingSet Path */
        ksp= MEM_callocN(sizeof(KS_Path), "KeyingSet Path");
@@ -440,19 +467,19 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                        switch (RNA_property_type(prop)) 
                        {
                                case PROP_BOOLEAN:
-                                       if (RNA_property_array_length(prop))
+                                       if (RNA_property_array_length(&new_ptr, prop))
                                                RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value);
                                        else
                                                RNA_property_boolean_set(&new_ptr, prop, (int)value);
                                        break;
                                case PROP_INT:
-                                       if (RNA_property_array_length(prop))
+                                       if (RNA_property_array_length(&new_ptr, prop))
                                                RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value);
                                        else
                                                RNA_property_int_set(&new_ptr, prop, (int)value);
                                        break;
                                case PROP_FLOAT:
-                                       if (RNA_property_array_length(prop))
+                                       if (RNA_property_array_length(&new_ptr, prop))
                                                RNA_property_float_set_index(&new_ptr, prop, array_index, value);
                                        else
                                                RNA_property_float_set(&new_ptr, prop, value);
@@ -1177,19 +1204,19 @@ void nladata_flush_channels (ListBase *channels)
                switch (RNA_property_type(prop)) 
                {
                        case PROP_BOOLEAN:
-                               if (RNA_property_array_length(prop))
+                               if (RNA_property_array_length(ptr, prop))
                                        RNA_property_boolean_set_index(ptr, prop, array_index, (int)value);
                                else
                                        RNA_property_boolean_set(ptr, prop, (int)value);
                                break;
                        case PROP_INT:
-                               if (RNA_property_array_length(prop))
+                               if (RNA_property_array_length(ptr, prop))
                                        RNA_property_int_set_index(ptr, prop, array_index, (int)value);
                                else
                                        RNA_property_int_set(ptr, prop, (int)value);
                                break;
                        case PROP_FLOAT:
-                               if (RNA_property_array_length(prop))
+                               if (RNA_property_array_length(ptr, prop))
                                        RNA_property_float_set_index(ptr, prop, array_index, value);
                                else
                                        RNA_property_float_set(ptr, prop, value);
@@ -1263,7 +1290,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime)
                        dummy_strip.act= adt->action;
                        dummy_strip.remap= adt->remap;
                        
-                               // FIXME: what happens when we want to included F-Modifier access?
+                       /* action range is calculated taking F-Modifiers into account (which making new strips doesn't do due to the troublesome nature of that) */
                        calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1);
                        dummy_strip.start = dummy_strip.actstart;
                        dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ?  (dummy_strip.actstart + 1.0f): (dummy_strip.actend);
@@ -1423,7 +1450,6 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re
  * 'local' (i.e. belonging in the nearest ID-block that setting is related to, not a
  * standard 'root') block are overridden by a larger 'user'
  */
-// FIXME?: we currently go over entire 'main' database...
 void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
 {
        ID *id;
@@ -1447,8 +1473,11 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
         * when there are no actions, don't go over database and loop over heaps of datablocks, 
         * which should ultimately be empty, since it is not possible for now to have any animation 
         * without some actions, and drivers wouldn't get affected by any state changes
+        *
+        * however, if there are some curves, we will need to make sure that their 'ctime' property gets
+        * set correctly, so this optimisation must be skipped in that case...
         */
-       if (main->action.first == NULL) {
+       if ((main->action.first == NULL) && (main->curve.first == NULL)) {
                if (G.f & G_DEBUG)
                        printf("\tNo Actions, so no animation needs to be evaluated...\n");
                        
@@ -1482,6 +1511,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
                 * value of the curve gets set in case there's no animation for that
                 *      - it needs to be set before animation is evaluated just so that 
                 *        animation can successfully override...
+                *      - it shouldn't get set when calculating drivers...
                 */
        for (id= main->curve.first; id; id= id->next) {
                AnimData *adt= BKE_animdata_from_id(id);
index 7b894d79b45d5387063716857e0c262157a0ced8..c880925aa94643f6a44c9e743b560d6bc4dd89fc 100644 (file)
@@ -130,7 +130,6 @@ void free_bones (bArmature *arm)
 void free_armature(bArmature *arm)
 {
        if (arm) {
-               /*              unlink_armature(arm);*/
                free_bones(arm);
                
                /* free editmode data */
@@ -667,10 +666,10 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
        if(bone->segments > MAX_BBONE_SUBDIV)
                bone->segments= MAX_BBONE_SUBDIV;
        
-       forward_diff_bezier(0.0, h1[0],         h2[0],                  0.0,            data[0],        MAX_BBONE_SUBDIV, 4);
-       forward_diff_bezier(0.0, h1[1],         length + h2[1], length,         data[0]+1,      MAX_BBONE_SUBDIV, 4);
-       forward_diff_bezier(0.0, h1[2],         h2[2],                  0.0,            data[0]+2,      MAX_BBONE_SUBDIV, 4);
-       forward_diff_bezier(roll1, roll1 + 0.390464f*(roll2-roll1), roll2 - 0.390464f*(roll2-roll1),    roll2,  data[0]+3,      MAX_BBONE_SUBDIV, 4);
+       forward_diff_bezier(0.0, h1[0],         h2[0],                  0.0,            data[0],        MAX_BBONE_SUBDIV, 4*sizeof(float));
+       forward_diff_bezier(0.0, h1[1],         length + h2[1], length,         data[0]+1,      MAX_BBONE_SUBDIV, 4*sizeof(float));
+       forward_diff_bezier(0.0, h1[2],         h2[2],                  0.0,            data[0]+2,      MAX_BBONE_SUBDIV, 4*sizeof(float));
+       forward_diff_bezier(roll1, roll1 + 0.390464f*(roll2-roll1), roll2 - 0.390464f*(roll2-roll1),    roll2,  data[0]+3,      MAX_BBONE_SUBDIV, 4*sizeof(float));
        
        equalize_bezier(data[0], bone->segments);       // note: does stride 4!
        
@@ -1987,10 +1986,14 @@ void chan_calc_mat(bPoseChannel *chan)
        /* get scaling matrix */
        SizeToMat3(chan->size, smat);
        
-       /* rotations may either be quats or eulers (no rotation modes for now...) */
-       if (chan->rotmode) {
-               /* euler rotations (will cause gimble lock... no rotation order to solve that yet) */
-               EulToMat3(chan->eul, rmat);
+       /* rotations may either be quats, eulers (with various rotation orders), or axis-angle */
+       if (chan->rotmode > 0) {
+               /* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */
+               EulOToMat3(chan->eul, chan->rotmode, rmat);
+       }
+       else if (chan->rotmode == PCHAN_ROT_AXISANGLE) {
+               /* axis-angle - stored in quaternion data, but not really that great for 3D-changing orientations */
+               AxisAngleToMat3(&chan->quat[1], chan->quat[0], rmat);
        }
        else {
                /* quats are normalised before use to eliminate scaling issues */
index 746dc6c59ccfc4ed9853960fde6586bcd5b45d42..f261b020717a1b78a5bf7fe36c2863fec4174824 100644 (file)
@@ -626,8 +626,7 @@ void BKE_write_undo(bContext *C, char *name)
        }
 }
 
-/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation
- * Note, ALWAYS call sound_initialize_sounds after BKE_undo_step() */
+/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */
 void BKE_undo_step(bContext *C, int step)
 {
        
index d8926fc57536a4c47b4a16d290bad9d2315a72ca..18f065b59d90294f592fe03cb47b733986de7d14 100644 (file)
@@ -74,14 +74,15 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
        BoidSettings *boids = bbd->part->boids;
        ParticleEffectorCache *ec;
        Object *priority_ob = NULL;
+       BoidParticle *bpa = pa->boid;
        float vec[3] = {0.0f, 0.0f, 0.0f}, loc[3] = {0.0f, 0.0f, 0.0f};
        float mul = (rule->type == eBoidRuleType_Avoid ? 1.0 : -1.0);
-       float priority = 0.0f, len;
+       float priority = 0.0f, len = 0.0f;
        int ret = 0;
 
        /* first find out goal/predator with highest priority */
        /* if rule->ob specified use it */
-       if(gabr->ob && (rule->type != eBoidRuleType_Goal || gabr->ob != pa->stick_ob)) {
+       if(gabr->ob && (rule->type != eBoidRuleType_Goal || gabr->ob != bpa->ground)) {
                PartDeflect *pd = gabr->ob->pd;
                float vec_to_part[3];
 
@@ -104,7 +105,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
                        PartDeflect *pd = eob->pd;
 
                        /* skip current object */
-                       if(rule->type == eBoidRuleType_Goal && eob == pa->stick_ob)
+                       if(rule->type == eBoidRuleType_Goal && eob == bpa->ground)
                                continue;
 
                        if(pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f) {
@@ -169,10 +170,10 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
                                VECCOPY(bbd->goal_nor, nor);
                        }
                }
-               else if(rule->type == eBoidRuleType_Avoid && pa->boid->mode == eBoidMode_Climbing &&
+               else if(rule->type == eBoidRuleType_Avoid && bpa->data.mode == eBoidMode_Climbing &&
                        priority > 2.0f * gabr->fear_factor) {
                        /* detach from surface and try to fly away from danger */
-                       VECCOPY(vec_to_part, pa->r_ve);
+                       VECCOPY(vec_to_part, bpa->gravity);
                        VecMulf(vec_to_part, -1.0f);
                }
 
@@ -205,6 +206,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
        KDTreeNearest *ptn = NULL;
        ParticleEffectorCache *ec;
        ParticleTarget *pt;
+       BoidParticle *bpa = pa->boid;
        float vec[3] = {0.0f, 0.0f, 0.0f}, loc[3] = {0.0f, 0.0f, 0.0f};
        float co1[3], vel1[3], co2[3], vel2[3];
        float  len, t, inp, t_min = 2.0f;
@@ -231,7 +233,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
                                Object *eob = ec->ob;
 
                                /* don't check with current ground object */
-                               if(eob == pa->stick_ob)
+                               if(eob == bpa->ground)
                                        continue;
 
                                col.md = ( CollisionModifierData * ) ( modifiers_findByType ( eob, eModifierType_Collision ) );
@@ -558,18 +560,19 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 }
 static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, ParticleData *pa)
 {
+       BoidParticle *bpa = pa->boid;
        BoidRuleAverageSpeed *asbr = (BoidRuleAverageSpeed*)rule;
        float vec[3] = {0.0f, 0.0f, 0.0f};
 
        if(asbr->wander > 0.0f) {
                /* abuse pa->r_ave for wandering */
-               pa->r_ave[0] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
-               pa->r_ave[1] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
-               pa->r_ave[2] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
+               bpa->wander[0] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
+               bpa->wander[1] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
+               bpa->wander[2] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
 
-               Normalize(pa->r_ave);
+               Normalize(bpa->wander);
 
-               VECCOPY(vec, pa->r_ave);
+               VECCOPY(vec, bpa->wander);
 
                QuatMulVecf(pa->prev_state.rot, vec);
 
@@ -614,7 +617,8 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
        KDTreeNearest *ptn = NULL;
        ParticleTarget *pt;
        ParticleData *epars;
-       ParticleData *enemy_pa;
+       ParticleData *enemy_pa = NULL;
+       BoidParticle *bpa;
        /* friends & enemies */
        float closest_enemy[3] = {0.0f,0.0f,0.0f};
        float closest_dist = fbr->distance + 1.0f;
@@ -624,8 +628,10 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
 
        /* calculate own group strength */
        int neighbors = BLI_kdtree_range_search(bbd->psys->tree, fbr->distance, pa->prev_state.co, NULL, &ptn);
-       for(n=0; n<neighbors; n++)
-               health += bbd->psys->particles[ptn[n].index].boid->health;
+       for(n=0; n<neighbors; n++) {
+               bpa = bbd->psys->particles[ptn[n].index].boid;
+               health += bpa->data.health;
+       }
 
        f_strength += bbd->part->boids->strength * health;
 
@@ -642,7 +648,8 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
                        health = 0.0f;
 
                        for(n=0; n<neighbors; n++) {
-                               health += epars[ptn[n].index].boid->health;
+                               bpa = epars[ptn[n].index].boid;
+                               health += bpa->data.health;
 
                                if(n==0 && pt->mode==PTARGET_MODE_ENEMY && ptn[n].dist < closest_dist) {
                                        VECCOPY(closest_enemy, ptn[n].co);
@@ -674,7 +681,8 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
 
                        /* must face enemy to fight */
                        if(Inpf(pa->prev_state.ave, enemy_dir)>0.5f) {
-                               enemy_pa->boid->health -= bbd->part->boids->strength * bbd->timestep * ((1.0f-bbd->part->boids->accuracy)*damage + bbd->part->boids->accuracy);
+                               bpa = enemy_pa->boid;
+                               bpa->data.health -= bbd->part->boids->strength * bbd->timestep * ((1.0f-bbd->part->boids->accuracy)*damage + bbd->part->boids->accuracy);
                        }
                }
                else {
@@ -683,7 +691,8 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
                }
 
                /* check if boid doesn't want to fight */
-               if(pa->boid->health/bbd->part->boids->health * bbd->part->boids->aggression < e_strength / f_strength) {
+               bpa = pa->boid;
+               if(bpa->data.health/bbd->part->boids->health * bbd->part->boids->aggression < e_strength / f_strength) {
                        /* decide to flee */
                        if(closest_dist < fbr->flee_distance * fbr->distance) {
                                VecMulf(bbd->wanted_co, -1.0f);
@@ -721,18 +730,20 @@ static boid_rule_cb boid_rules[] = {
 
 static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData *pa)
 {
-       if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
-               val->max_speed = boids->land_max_speed * pa->boid->health/boids->health;
+       BoidParticle *bpa = pa->boid;
+
+       if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
+               val->max_speed = boids->land_max_speed * bpa->data.health/boids->health;
                val->max_acc = boids->land_max_acc * val->max_speed;
-               val->max_ave = boids->land_max_ave * M_PI * pa->boid->health/boids->health;
+               val->max_ave = boids->land_max_ave * M_PI * bpa->data.health/boids->health;
                val->min_speed = 0.0f; /* no minimum speed on land */
                val->personal_space = boids->land_personal_space;
-               val->jump_speed = boids->land_jump_speed * pa->boid->health/boids->health;
+               val->jump_speed = boids->land_jump_speed * bpa->data.health/boids->health;
        }
        else {
-               val->max_speed = boids->air_max_speed * pa->boid->health/boids->health;
+               val->max_speed = boids->air_max_speed * bpa->data.health/boids->health;
                val->max_acc = boids->air_max_acc * val->max_speed;
-               val->max_ave = boids->air_max_ave * M_PI * pa->boid->health/boids->health;
+               val->max_ave = boids->air_max_ave * M_PI * bpa->data.health/boids->health;
                val->min_speed = boids->air_min_speed * boids->air_max_speed;
                val->personal_space = boids->air_personal_space;
                val->jump_speed = 0.0f; /* no jumping in air */
@@ -740,11 +751,13 @@ static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData *
 }
 static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *ground_co, float *ground_nor)
 {
-       if(pa->boid->mode == eBoidMode_Climbing) {
+       BoidParticle *bpa = pa->boid;
+
+       if(bpa->data.mode == eBoidMode_Climbing) {
                SurfaceModifierData *surmd = NULL;
                float x[3], v[3];
 
-               surmd = (SurfaceModifierData *)modifiers_findByType ( pa->stick_ob, eModifierType_Surface );
+               surmd = (SurfaceModifierData *)modifiers_findByType ( bpa->ground, eModifierType_Surface );
 
                /* take surface velocity into account */
                effector_find_co(bbd->scene, pa->state.co, surmd, NULL, NULL, x, NULL, v, NULL);
@@ -753,7 +766,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro
                /* get actual position on surface */
                effector_find_co(bbd->scene, x, surmd, NULL, NULL, ground_co, ground_nor, NULL, NULL);
 
-               return pa->stick_ob;
+               return bpa->ground;
        }
        else {
                float zvec[3] = {0.0f, 0.0f, 2000.0f};
@@ -803,13 +816,15 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro
 }
 static int boid_rule_applies(ParticleData *pa, BoidSettings *boids, BoidRule *rule)
 {
+       BoidParticle *bpa = pa->boid;
+
        if(rule==NULL)
                return 0;
        
-       if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing) && rule->flag & BOIDRULE_ON_LAND)
+       if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing) && rule->flag & BOIDRULE_ON_LAND)
                return 1;
        
-       if(pa->boid->mode==eBoidMode_InAir && rule->flag & BOIDRULE_IN_AIR)
+       if(bpa->data.mode==eBoidMode_InAir && rule->flag & BOIDRULE_IN_AIR)
                return 1;
 
        return 0;
@@ -835,12 +850,13 @@ void boids_precalc_rules(ParticleSettings *part, float cfra)
 }
 static void boid_climb(BoidSettings *boids, ParticleData *pa, float *surface_co, float *surface_nor)
 {
+       BoidParticle *bpa = pa->boid;
        float nor[3], vel[3];
        VECCOPY(nor, surface_nor);
 
-       /* gather apparent gravity to r_ve */
-       VECADDFAC(pa->r_ve, pa->r_ve, surface_nor, -1.0);
-       Normalize(pa->r_ve);
+       /* gather apparent gravity */
+       VECADDFAC(bpa->gravity, bpa->gravity, surface_nor, -1.0);
+       Normalize(bpa->gravity);
 
        /* raise boid it's size from surface */
        VecMulf(nor, pa->size * boids->height);
@@ -877,16 +893,17 @@ static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val,
 }
 static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa) {
        BoidState *state = boids->states.first;
+       BoidParticle *bpa = pa->boid;
 
        for(; state; state=state->next) {
-               if(state->id==pa->boid->state_id)
+               if(state->id==bpa->data.state_id)
                        return state;
        }
 
        /* for some reason particle isn't at a valid state */
        state = boids->states.first;
        if(state)
-               pa->boid->state_id = state->id;
+               bpa->data.state_id = state->id;
 
        return state;
 }
@@ -902,9 +919,11 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
        BoidSettings *boids = bbd->part->boids;
        BoidValues val;
        BoidState *state = get_boid_state(boids, pa);
+       BoidParticle *bpa = pa->boid;
+       int rand;
        //BoidCondition *cond;
 
-       if(pa->boid->health <= 0.0f) {
+       if(bpa->data.health <= 0.0f) {
                pa->alive = PARS_DYING;
                return;
        }
@@ -922,7 +941,9 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
        bbd->wanted_co[0]=bbd->wanted_co[1]=bbd->wanted_co[2]=bbd->wanted_speed=0.0f;
 
        /* create random seed for every particle & frame */
-       BLI_srandom(bbd->psys->seed + p + (int)bbd->cfra + (int)(1000*pa->r_rot[0]));
+       BLI_srandom(bbd->psys->seed + p);
+       rand = BLI_rand();
+       BLI_srandom((int)bbd->cfra + rand);
 
        set_boid_values(&val, bbd->part->boids, pa);
 
@@ -939,7 +960,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
                case eBoidRulesetType_Random:
                {
                        /* use random rule for each particle (allways same for same particle though) */
-                       rule = BLI_findlink(&state->rules, (int)(1000.0f * pa->r_rot[1]) % BLI_countlist(&state->rules));
+                       rule = BLI_findlink(&state->rules, rand % BLI_countlist(&state->rules));
 
                        apply_boid_rule(bbd, rule, &val, pa, -1.0);
                }
@@ -969,7 +990,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
        }
 
        /* decide on jumping & liftoff */
-       if(pa->boid->mode == eBoidMode_OnLand) {
+       if(bpa->data.mode == eBoidMode_OnLand) {
                /* fuzziness makes boids capable of misjudgement */
                float mul = 1.0 + state->rule_fuzziness;
                
@@ -983,7 +1004,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
                        Normalize2(cvel);
 
                        if(Inp2f(cvel, dir) > 0.95 / mul)
-                               pa->boid->mode = eBoidMode_Liftoff;
+                               bpa->data.mode = eBoidMode_Liftoff;
                }
                else if(val.jump_speed > 0.0f) {
                        float jump_v[3];
@@ -1036,7 +1057,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
 
                        if(jump) {
                                VECCOPY(pa->prev_state.vel, jump_v);
-                               pa->boid->mode = eBoidMode_Falling;
+                               bpa->data.mode = eBoidMode_Falling;
                        }
                }
        }
@@ -1045,6 +1066,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
 void boid_body(BoidBrainData *bbd, ParticleData *pa)
 {
        BoidSettings *boids = bbd->part->boids;
+       BoidParticle *bpa = pa->boid;
        BoidValues val;
        float acc[3] = {0.0f, 0.0f, 0.0f}, tan_acc[3], nor_acc[3];
        float dvec[3], bvec[3];
@@ -1066,10 +1088,10 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                pa_mass*=pa->size;
 
        /* if boids can't fly they fall to the ground */
-       if((boids->options & BOID_ALLOW_FLIGHT)==0 && ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing)==0 && bbd->part->acc[2] != 0.0f)
-               pa->boid->mode = eBoidMode_Falling;
+       if((boids->options & BOID_ALLOW_FLIGHT)==0 && ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)==0 && bbd->part->acc[2] != 0.0f)
+               bpa->data.mode = eBoidMode_Falling;
 
-       if(pa->boid->mode == eBoidMode_Falling) {
+       if(bpa->data.mode == eBoidMode_Falling) {
                /* Falling boids are only effected by gravity. */
                acc[2] = bbd->part->acc[2];
        }
@@ -1079,14 +1101,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                float level = landing_level + 1.0f;
                float new_vel[3];
 
-               if(pa->boid->mode == eBoidMode_Liftoff) {
-                       pa->boid->mode = eBoidMode_InAir;
-                       pa->stick_ob = boid_find_ground(bbd, pa, ground_co, ground_nor);
+               if(bpa->data.mode == eBoidMode_Liftoff) {
+                       bpa->data.mode = eBoidMode_InAir;
+                       bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor);
                }
-               else if(pa->boid->mode == eBoidMode_InAir && boids->options & BOID_ALLOW_LAND) {
+               else if(bpa->data.mode == eBoidMode_InAir && boids->options & BOID_ALLOW_LAND) {
                        /* auto-leveling & landing if close to ground */
 
-                       pa->stick_ob = boid_find_ground(bbd, pa, ground_co, ground_nor);
+                       bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor);
                        
                        /* level = how many particle sizes above ground */
                        level = (pa->prev_state.co[2] - ground_co[2])/(2.0f * pa->size) - 0.5;
@@ -1097,7 +1119,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                                if(level < 1.0f) {
                                        bbd->wanted_co[0] = bbd->wanted_co[1] = bbd->wanted_co[2] = 0.0f;
                                        bbd->wanted_speed = 0.0f;
-                                       pa->boid->mode = eBoidMode_Falling;
+                                       bpa->data.mode = eBoidMode_Falling;
                                }
                                else if(level < landing_level) {
                                        bbd->wanted_speed *= (level - 1.0f)/landing_level;
@@ -1188,7 +1210,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
        /* account for effectors */
        do_effectors(p, pa, &pa->state, bbd->scene, bbd->ob, bbd->psys, pa->state.co, force, tvel, bbd->dfra, bbd->cfra);
 
-       if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
+       if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
                float length = Normalize(force);
 
                length = MAX2(0.0f, length - boids->land_stick_force);
@@ -1199,8 +1221,8 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
        VecAddf(acc, acc, force);
 
        /* store smoothed acceleration for nice banking etc. */
-       VECADDFAC(pa->boid->acc, pa->boid->acc, acc, dtime);
-       VecMulf(pa->boid->acc, 1.0f / (1.0f + dtime));
+       VECADDFAC(bpa->data.acc, bpa->data.acc, acc, dtime);
+       VecMulf(bpa->data.acc, 1.0f / (1.0f + dtime));
 
        /* integrate new location & velocity */
 
@@ -1218,32 +1240,32 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
 
        VECADDFAC(pa->state.vel, pa->state.vel, acc, dtime);
 
-       if(pa->boid->mode != eBoidMode_InAir)
-               pa->stick_ob = boid_find_ground(bbd, pa, ground_co, ground_nor);
+       if(bpa->data.mode != eBoidMode_InAir)
+               bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor);
 
        /* change modes, constrain movement & keep track of down vector */
-       switch(pa->boid->mode) {
+       switch(bpa->data.mode) {
                case eBoidMode_InAir:
                {
                        float grav[3] = {0.0f, 0.0f, bbd->part->acc[2] < 0.0f ? -1.0f : 0.0f};
 
                        /* don't take forward acceleration into account (better banking) */
-                       if(Inpf(pa->boid->acc, pa->state.vel) > 0.0f) {
-                               Projf(dvec, pa->boid->acc, pa->state.vel);
-                               VecSubf(dvec, pa->boid->acc, dvec);
+                       if(Inpf(bpa->data.acc, pa->state.vel) > 0.0f) {
+                               Projf(dvec, bpa->data.acc, pa->state.vel);
+                               VecSubf(dvec, bpa->data.acc, dvec);
                        }
                        else {
-                               VECCOPY(dvec, pa->boid->acc);
+                               VECCOPY(dvec, bpa->data.acc);
                        }
 
-                       /* gather apparent gravity to r_ve */
-                       VECADDFAC(pa->r_ve, grav, dvec, -boids->banking);
-                       Normalize(pa->r_ve);
+                       /* gather apparent gravity */
+                       VECADDFAC(bpa->gravity, grav, dvec, -boids->banking);
+                       Normalize(bpa->gravity);
 
                        /* stick boid on goal when close enough */
                        if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
-                               pa->boid->mode = eBoidMode_Climbing;
-                               pa->stick_ob = bbd->goal_ob;
+                               bpa->data.mode = eBoidMode_Climbing;
+                               bpa->ground = bbd->goal_ob;
                                boid_find_ground(bbd, pa, ground_co, ground_nor);
                                boid_climb(boids, pa, ground_co, ground_nor);
                        }
@@ -1251,7 +1273,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                        else if(boids->options & BOID_ALLOW_LAND && pa->state.co[2] <= ground_co[2] + pa->size * boids->height) {
                                pa->state.co[2] = ground_co[2] + pa->size * boids->height;
                                pa->state.vel[2] = 0.0f;
-                               pa->boid->mode = eBoidMode_OnLand;
+                               bpa->data.mode = eBoidMode_OnLand;
                        }
                        break;
                }
@@ -1259,15 +1281,15 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                {
                        float grav[3] = {0.0f, 0.0f, bbd->part->acc[2] < 0.0f ? -1.0f : 0.0f};
 
-                       /* gather apparent gravity to r_ve */
-                       VECADDFAC(pa->r_ve, pa->r_ve, grav, dtime);
-                       Normalize(pa->r_ve);
+                       /* gather apparent gravity */
+                       VECADDFAC(bpa->gravity, bpa->gravity, grav, dtime);
+                       Normalize(bpa->gravity);
 
                        if(boids->options & BOID_ALLOW_LAND) {
                                /* stick boid on goal when close enough */
                                if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
-                                       pa->boid->mode = eBoidMode_Climbing;
-                                       pa->stick_ob = bbd->goal_ob;
+                                       bpa->data.mode = eBoidMode_Climbing;
+                                       bpa->ground = bbd->goal_ob;
                                        boid_find_ground(bbd, pa, ground_co, ground_nor);
                                        boid_climb(boids, pa, ground_co, ground_nor);
                                }
@@ -1275,14 +1297,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                                else if(pa->state.co[2] <= ground_co[2] + 1.01 * pa->size * boids->height){
                                        pa->state.co[2] = ground_co[2] + pa->size * boids->height;
                                        pa->state.vel[2] = 0.0f;
-                                       pa->boid->mode = eBoidMode_OnLand;
+                                       bpa->data.mode = eBoidMode_OnLand;
                                }
                                /* if we're falling, can fly and want to go upwards lets fly */
                                else if(boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f)
-                                       pa->boid->mode = eBoidMode_InAir;
+                                       bpa->data.mode = eBoidMode_InAir;
                        }
                        else
-                               pa->boid->mode = eBoidMode_InAir;
+                               bpa->data.mode = eBoidMode_InAir;
                        break;
                }
                case eBoidMode_Climbing:
@@ -1308,14 +1330,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                {
                        /* stick boid on goal when close enough */
                        if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
-                               pa->boid->mode = eBoidMode_Climbing;
-                               pa->stick_ob = bbd->goal_ob;
+                               bpa->data.mode = eBoidMode_Climbing;
+                               bpa->ground = bbd->goal_ob;
                                boid_find_ground(bbd, pa, ground_co, ground_nor);
                                boid_climb(boids, pa, ground_co, ground_nor);
                        }
                        /* ground is too far away so boid falls */
                        else if(pa->state.co[2]-ground_co[2] > 1.1 * pa->size * boids->height)
-                               pa->boid->mode = eBoidMode_Falling;
+                               bpa->data.mode = eBoidMode_Falling;
                        else {
                                /* constrain to surface */
                                pa->state.co[2] = ground_co[2] + pa->size * boids->height;
@@ -1329,17 +1351,17 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                                VECCOPY(grav, ground_nor);
                                VecMulf(grav, -1.0f);
                                
-                               Projf(dvec, pa->boid->acc, pa->state.vel);
-                               VecSubf(dvec, pa->boid->acc, dvec);
+                               Projf(dvec, bpa->data.acc, pa->state.vel);
+                               VecSubf(dvec, bpa->data.acc, dvec);
 
-                               /* gather apparent gravity to r_ve */
-                               VECADDFAC(pa->r_ve, grav, dvec, -boids->banking);
-                               Normalize(pa->r_ve);
+                               /* gather apparent gravity */
+                               VECADDFAC(bpa->gravity, grav, dvec, -boids->banking);
+                               Normalize(bpa->gravity);
                        }
                        else {
-                               /* gather negative surface normal to r_ve */
-                               VECADDFAC(pa->r_ve, pa->r_ve, ground_nor, -1.0f);
-                               Normalize(pa->r_ve);
+                               /* gather negative surface normal */
+                               VECADDFAC(bpa->gravity, bpa->gravity, ground_nor, -1.0f);
+                               Normalize(bpa->gravity);
                        }
                        break;
                }
@@ -1347,29 +1369,29 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
 
        /* save direction to state.ave unless the boid is falling */
        /* (boids can't effect their direction when falling) */
-       if(pa->boid->mode!=eBoidMode_Falling && VecLength(pa->state.vel) > 0.1*pa->size) {
+       if(bpa->data.mode!=eBoidMode_Falling && VecLength(pa->state.vel) > 0.1*pa->size) {
                VECCOPY(pa->state.ave, pa->state.vel);
                Normalize(pa->state.ave);
        }
 
        /* apply damping */
-       if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing))
+       if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing))
                VecMulf(pa->state.vel, 1.0f - 0.2f*bbd->part->dampfac);
 
        /* calculate rotation matrix based on forward & down vectors */
-       if(pa->boid->mode == eBoidMode_InAir) {
+       if(bpa->data.mode == eBoidMode_InAir) {
                VECCOPY(mat[0], pa->state.ave);
 
-               Projf(dvec, pa->r_ve, pa->state.ave);
-               VecSubf(mat[2], pa->r_ve, dvec);
+               Projf(dvec, bpa->gravity, pa->state.ave);
+               VecSubf(mat[2], bpa->gravity, dvec);
                Normalize(mat[2]);
        }
        else {
-               Projf(dvec, pa->state.ave, pa->r_ve);
+               Projf(dvec, pa->state.ave, bpa->gravity);
                VecSubf(mat[0], pa->state.ave, dvec);
                Normalize(mat[0]);
 
-               VECCOPY(mat[2], pa->r_ve);
+               VECCOPY(mat[2], bpa->gravity);
        }
        VecMulf(mat[2], -1.0f);
        Crossf(mat[1], mat[2], mat[0]);
index eb3aefe7ee63a53dddf7b2c0c36eb77247574b22..5f0697f06ce539a40acb3f47b8c9755c38a674d1 100644 (file)
@@ -589,7 +589,7 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type)
        MEM_freeN(mat);
 
        /* update dag */
-       DAG_object_flush_update(scene, ob_new, OB_RECALC_DATA);
+       DAG_id_flush_update(&ob_new->id, OB_RECALC_DATA);
 
        return 1;
 }
index 612f6d2051d9aa7394e4ecd5936c1272116328e3..bce4e1120be5e036755ebbb362973443b89e3cfb 100644 (file)
@@ -75,6 +75,8 @@ Brush *add_brush(const char *name)
        brush->alpha= 0.2f;
        brush->size= 25;
        brush->spacing= 10.0f;
+       brush->smooth_stroke_radius= 75;
+       brush->smooth_stroke_factor= 0.9;
        brush->rate= 0.1f;
        brush->innerradius= 0.5f;
        brush->clone.alpha= 0.5;
@@ -407,23 +409,6 @@ float brush_sample_falloff(Brush *brush, float dist)
                return 0.0f;
 }
 
-float brush_sample_falloff_noalpha(Brush *brush, float dist)
-{
-       float outer, inner;
-
-       outer = brush->size >> 1;
-       inner = outer*brush->innerradius;
-
-       if (dist <= inner) {
-               return 1.0f;
-       }
-       else if ((dist < outer) && (inner < outer)) {
-               return 1.0f - sqrt((dist - inner)/(outer - inner));
-       }
-       else 
-               return 0.0f;
-}
-
 void brush_sample_tex(Brush *brush, float *xy, float *rgba)
 {
        MTex *mtex= brush->mtex[brush->texact];
index 706eece108cd1261ee8944d79ea00f172f5743a1..b20da0962a7931f9bc33b0eef2be7c600dae84bc 100644 (file)
@@ -1288,6 +1288,7 @@ typedef struct MultiresDM {
        CDDerivedMesh cddm;
 
        MultiresModifierData *mmd;
+       int local_mmd;
 
        int lvl, totlvl;
        float (*orco)[3];
@@ -1297,7 +1298,7 @@ typedef struct MultiresDM {
        IndexNode *vert_face_map_mem, *vert_edge_map_mem;
        int *face_offsets;
 
-       Mesh *me;
+       Object *ob;
        int modified;
 
        void (*update)(DerivedMesh*);
@@ -1309,14 +1310,19 @@ static void MultiresDM_release(DerivedMesh *dm)
        int mvert_layer;
 
        /* Before freeing, need to update the displacement map */
-       if(dm->needsFree && mrdm->modified)
-               mrdm->update(dm);
+       if(dm->needsFree && mrdm->modified) {
+               /* Check that mmd still exists */
+               if(!mrdm->local_mmd && BLI_findindex(&mrdm->ob->modifiers, mrdm->mmd) < 0)
+                       mrdm->mmd = NULL;
+               if(mrdm->mmd)
+                       mrdm->update(dm);
+       }
 
        /* If the MVert data is being used as the sculpt undo store, don't free it */
        mvert_layer = CustomData_get_layer_index(&dm->vertData, CD_MVERT);
        if(mvert_layer != -1) {
                CustomDataLayer *cd = &dm->vertData.layers[mvert_layer];
-               if(cd->data == mrdm->mmd->undo_verts)
+               if(mrdm->mmd && cd->data == mrdm->mmd->undo_verts)
                        cd->flag |= CD_FLAG_NOFREE;
        }
 
@@ -1348,7 +1354,8 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts
        dm = &mrdm->cddm.dm;
 
        mrdm->mmd = ms->mmd;
-       mrdm->me = ms->me;
+       mrdm->ob = ms->ob;
+       mrdm->local_mmd = ms->local_mmd;
 
        if(dm) {
                MDisps *disps;
@@ -1391,7 +1398,12 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts
 
 Mesh *MultiresDM_get_mesh(DerivedMesh *dm)
 {
-       return ((MultiresDM*)dm)->me;
+       return get_mesh(((MultiresDM*)dm)->ob);
+}
+
+Object *MultiresDM_get_object(DerivedMesh *dm)
+{
+       return ((MultiresDM*)dm)->ob;
 }
 
 void *MultiresDM_get_orco(DerivedMesh *dm)
@@ -1428,10 +1440,11 @@ void MultiresDM_set_update(DerivedMesh *dm, void (*update)(DerivedMesh*))
 ListBase *MultiresDM_get_vert_face_map(DerivedMesh *dm)
 {
        MultiresDM *mrdm = (MultiresDM*)dm;
+       Mesh *me = mrdm->ob->data;
 
        if(!mrdm->vert_face_map)
-               create_vert_face_map(&mrdm->vert_face_map, &mrdm->vert_face_map_mem, mrdm->me->mface,
-                                    mrdm->me->totvert, mrdm->me->totface);
+               create_vert_face_map(&mrdm->vert_face_map, &mrdm->vert_face_map_mem, me->mface,
+                                    me->totvert, me->totface);
 
        return mrdm->vert_face_map;
 }
@@ -1439,10 +1452,11 @@ ListBase *MultiresDM_get_vert_face_map(DerivedMesh *dm)
 ListBase *MultiresDM_get_vert_edge_map(DerivedMesh *dm)
 {
        MultiresDM *mrdm = (MultiresDM*)dm;
+       Mesh *me = mrdm->ob->data;
 
        if(!mrdm->vert_edge_map)
-               create_vert_edge_map(&mrdm->vert_edge_map, &mrdm->vert_edge_map_mem, mrdm->me->medge,
-                                    mrdm->me->totvert, mrdm->me->totedge);
+               create_vert_edge_map(&mrdm->vert_edge_map, &mrdm->vert_edge_map_mem, me->medge,
+                                    me->totvert, me->totedge);
 
        return mrdm->vert_edge_map;
 }
@@ -1450,6 +1464,7 @@ ListBase *MultiresDM_get_vert_edge_map(DerivedMesh *dm)
 int *MultiresDM_get_face_offsets(DerivedMesh *dm)
 {
        MultiresDM *mrdm = (MultiresDM*)dm;
+       Mesh *me = mrdm->ob->data;
        int i, accum = 0;
 
        if(!mrdm->face_offsets) {
@@ -1457,11 +1472,11 @@ int *MultiresDM_get_face_offsets(DerivedMesh *dm)
                int area = len * len;
                int t = 1 + len * 3 + area * 3, q = t + len + area;
 
-               mrdm->face_offsets = MEM_callocN(sizeof(int) * mrdm->me->totface, "mrdm face offsets");
-               for(i = 0; i < mrdm->me->totface; ++i) {
+               mrdm->face_offsets = MEM_callocN(sizeof(int) * me->totface, "mrdm face offsets");
+               for(i = 0; i < me->totface; ++i) {
                        mrdm->face_offsets[i] = accum;
 
-                       accum += (mrdm->me->mface[i].v4 ? q : t);
+                       accum += (me->mface[i].v4 ? q : t);
                }
        }
 
index 3acaaecb1e87fc95a3beb287fdd7d2b198f0e35b..d25c329f49fbace27fab1beca7ddcdb5c7199a4e 100644 (file)
@@ -347,7 +347,7 @@ void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr)
        BKE_ptcache_id_from_cloth(&pid, ob, clmd);
 
        // don't do anything as long as we're in editmode!
-       if(pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
+       if(pid.cache->edit && ob->mode & OB_MODE_PARTICLE_EDIT)
                return;
        
        BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_AFTER, framenr);
@@ -496,23 +496,32 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
        if(!do_init_cloth(ob, clmd, result, framenr))
                return result;
 
+       if(framenr == startframe) {
+               BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
+               do_init_cloth(ob, clmd, result, framenr);
+               cache->simframe= framenr;
+               cache->flag |= PTCACHE_SIMULATION_VALID;
+               cache->flag &= ~PTCACHE_REDO_NEEDED;
+               return result;
+       }
+
        /* try to read from cache */
        cache_result = BKE_ptcache_read_cache(&pid, (float)framenr, scene->r.frs_sec);
 
        if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
-               cache->flag |= PTCACHE_SIMULATION_VALID;
-               cache->simframe= framenr;
-
                implicit_set_positions(clmd);
                cloth_to_object (ob, clmd, result);
 
+               cache->simframe= framenr;
+               cache->flag |= PTCACHE_SIMULATION_VALID;
+
+               if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
+                       BKE_ptcache_write_cache(&pid, framenr);
+
                return result;
        }
        else if(cache_result==PTCACHE_READ_OLD) {
-               BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE);
-
                implicit_set_positions(clmd);
-
                cache->flag |= PTCACHE_SIMULATION_VALID;
        }
        else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {
@@ -523,38 +532,25 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
                return result;
        }
 
-       if(framenr == startframe) {
-               if(cache->flag & PTCACHE_REDO_NEEDED) {
-                       BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
-                       do_init_cloth(ob, clmd, result, framenr);
-               }
-               cache->flag |= PTCACHE_SIMULATION_VALID;
-               cache->simframe= framenr;
-
-               /* don't write cache on first frame, but on second frame write
-                * cache for frame 1 and 2 */
-       }
-       else {
-               /* if on second frame, write cache for first frame */
-               if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
-                       BKE_ptcache_write_cache(&pid, startframe);
-
-               clmd->sim_parms->timescale *= framenr - cache->simframe;
+       /* if on second frame, write cache for first frame */
+       if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
+               BKE_ptcache_write_cache(&pid, startframe);
 
-               /* do simulation */
-               cache->flag |= PTCACHE_SIMULATION_VALID;
-               cache->simframe= framenr;
+       clmd->sim_parms->timescale *= framenr - cache->simframe;
 
-               if(!do_step_cloth(ob, clmd, result, framenr)) {
-                       cache->flag &= ~PTCACHE_SIMULATION_VALID;
-                       cache->simframe= 0;
-                       cache->last_exact= 0;
-               }
-               else
-                       BKE_ptcache_write_cache(&pid, framenr);
+       /* do simulation */
+       cache->flag |= PTCACHE_SIMULATION_VALID;
+       cache->simframe= framenr;
 
-               cloth_to_object (ob, clmd, result);
+       if(!do_step_cloth(ob, clmd, result, framenr)) {
+               cache->flag &= ~PTCACHE_SIMULATION_VALID;
+               cache->simframe= 0;
+               cache->last_exact= 0;
        }
+       else
+               BKE_ptcache_write_cache(&pid, framenr);
+
+       cloth_to_object (ob, clmd, result);
 
        return result;
 }
index c122145c98fff64eca077cfbb687e202117ac1b0..37e9c93a108962885d928134ea6ff59ee3f2ca41 100644 (file)
@@ -591,7 +591,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
        ClothModifierData *clmd = ( ClothModifierData * ) md1;
        CollisionModifierData *collmd = ( CollisionModifierData * ) md2;
        MFace *face1=NULL, *face2 = NULL;
-#ifdef WITH_BULLET
+#ifdef USE_BULLET
        ClothVertex *verts1 = clmd->clothObject->verts;
 #endif
        double distance = 0;
@@ -669,7 +669,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
                                break;
                }
 
-#ifdef WITH_BULLET
+#ifdef USE_BULLET
                // calc distance + normal
                distance = plNearestPoints (
                        verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa,collpair->pb,collpair->vector );
index 26f9245abc763dbdaf0f4faeb376fa06e7224dec..8cd64ae2ece384ec6add48fe23dd9c39423444ae 100644 (file)
@@ -502,8 +502,8 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
        
        for(a=0; a<cuma->totpoint-1; a++, fp += 2*CM_RESOL) {
                correct_bezpart(bezt[a].vec[1], bezt[a].vec[2], bezt[a+1].vec[0], bezt[a+1].vec[1]);
-               forward_diff_bezier(bezt[a].vec[1][0], bezt[a].vec[2][0], bezt[a+1].vec[0][0], bezt[a+1].vec[1][0], fp, CM_RESOL-1, 2); 
-               forward_diff_bezier(bezt[a].vec[1][1], bezt[a].vec[2][1], bezt[a+1].vec[0][1], bezt[a+1].vec[1][1], fp+1, CM_RESOL-1, 2);
+               forward_diff_bezier(bezt[a].vec[1][0], bezt[a].vec[2][0], bezt[a+1].vec[0][0], bezt[a+1].vec[1][0], fp, CM_RESOL-1, 2*sizeof(float));   
+               forward_diff_bezier(bezt[a].vec[1][1], bezt[a].vec[2][1], bezt[a+1].vec[0][1], bezt[a+1].vec[1][1], fp+1, CM_RESOL-1, 2*sizeof(float));
        }
        
        /* store first and last handle for extrapolation, unit length */
index 88e73a00ba79b44567e3fbe545867f85b7784d1a..e5c0b3947de51d4890d200d0172bdb6191bf6a3b 100644 (file)
@@ -121,6 +121,7 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata,
                        if (ob) {
                                cob->ob = ob;
                                cob->type = datatype;
+                               cob->rotOrder = EULER_ORDER_DEFAULT; // TODO: when objects have rotation order too, use that
                                Mat4CpyMat4(cob->matrix, ob->obmat);
                        }
                        else
@@ -137,6 +138,15 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata,
                                cob->pchan = (bPoseChannel *)subdata;
                                cob->type = datatype;
                                
+                               if (cob->pchan->rotmode > 0) {
+                                       /* should be some type of Euler order */
+                                       cob->rotOrder= cob->pchan->rotmode; 
+                               }
+                               else {
+                                       /* Quats, so eulers should just use default order */
+                                       cob->rotOrder= EULER_ORDER_DEFAULT;
+                               }
+                               
                                /* matrix in world-space */
                                Mat4MulMat4(cob->matrix, cob->pchan->pose_mat, ob->obmat);
                        }
@@ -664,6 +674,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
  * (Hopefully all compilers will be happy with the lines with just a space on them. Those are
  *  really just to help this code easier to read)
  */
+// TODO: cope with getting rotation order...
 #define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list) \
        { \
                ct= MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget"); \
@@ -687,6 +698,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
  * (Hopefully all compilers will be happy with the lines with just a space on them. Those are
  *  really just to help this code easier to read)
  */
+// TODO: cope with getting rotation order...
 #define SINGLETARGETNS_GET_TARS(con, datatar, ct, list) \
        { \
                ct= MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget"); \
@@ -795,11 +807,11 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                
                /* extract components of both matrices */
                VECCOPY(loc, ct->matrix[3]);
-               Mat4ToEul(ct->matrix, eul);
+               Mat4ToEulO(ct->matrix, eul, ct->rotOrder);
                Mat4ToSize(ct->matrix, size);
                
                VECCOPY(loco, invmat[3]);
-               Mat4ToEul(invmat, eulo);
+               Mat4ToEulO(invmat, eulo, cob->rotOrder);
                Mat4ToSize(invmat, sizo);
                
                /* disable channels not enabled */
@@ -814,8 +826,8 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                if (!(data->flag & CHILDOF_SIZEZ)) size[2]= sizo[2]= 1.0f;
                
                /* make new target mat and offset mat */
-               LocEulSizeToMat4(ct->matrix, loc, eul, size);
-               LocEulSizeToMat4(invmat, loco, eulo, sizo);
+               LocEulOSizeToMat4(ct->matrix, loc, eul, size, ct->rotOrder);
+               LocEulOSizeToMat4(invmat, loco, eulo, sizo, cob->rotOrder);
                
                /* multiply target (parent matrix) by offset (parent inverse) to get 
                 * the effect of the parent that will be exherted on the owner
@@ -1150,7 +1162,7 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
        
        if (VALID_CONS_TARGET(ct)) {
                Curve *cu= ct->tar->data;
-               float q[4], vec[4], dir[3], quat[4], x1;
+               float q[4], vec[4], dir[3], quat[4], radius, x1;
                float totmat[4][4];
                float curvetime;
                
@@ -1162,21 +1174,30 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                 */
                
                /* only happens on reload file, but violates depsgraph still... fix! */
-               if (cu->path==NULL || cu->path->data==NULL) 
+               if (cu->path==NULL || cu->path->data==NULL)
                        makeDispListCurveTypes(cob->scene, ct->tar, 0);
                
                if (cu->path && cu->path->data) {
-                       curvetime= bsystem_time(cob->scene, ct->tar, (float)ctime, 0.0) - data->offset;
-                       
-#if 0 // XXX old animation system
-                       if (calc_ipo_spec(cu->ipo, CU_SPEED, &curvetime)==0) {
-                               curvetime /= cu->pathlen;
+                       if ((data->followflag & FOLLOWPATH_STATIC) == 0) { 
+                               /* animated position along curve depending on time */
+                               curvetime= bsystem_time(cob->scene, ct->tar, ctime, 0.0) - data->offset;
+                               
+                               /* ctime is now a proper var setting of Curve which gets set by Animato like any other var that's animated,
+                                * but this will only work if it actually is animated... 
+                                *
+                                * we firstly calculate the modulus of cu->ctime/cu->pathlen to clamp ctime within the 0.0 to 1.0 times pathlen
+                                * range, then divide this (the modulus) by pathlen to get a value between 0.0 and 1.0
+                                */
+                               curvetime= fmod(cu->ctime, cu->pathlen) / cu->pathlen;
                                CLAMP(curvetime, 0.0, 1.0);
                        }
-#endif // XXX old animation system
+                       else {
+                               /* fixed position along curve */
+                               curvetime= data->offset; // XXX might need a more sensible value
+                       }
                        
-                       if ( where_on_path(ct->tar, curvetime, vec, dir) ) {
-                               if (data->followflag) {
+                       if ( where_on_path(ct->tar, curvetime, vec, dir, NULL, &radius) ) {
+                               if (data->followflag & FOLLOWPATH_FOLLOW) {
                                        vectoquat(dir, (short) data->trackflag, (short) data->upflag, quat);
                                        
                                        Normalize(dir);
@@ -1189,6 +1210,14 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                                        
                                        QuatToMat4(quat, totmat);
                                }
+
+                               if (data->followflag & FOLLOWPATH_RADIUS) {
+                                       float tmat[4][4], rmat[4][4];
+                                       Mat4Scale(tmat, radius);
+                                       Mat4MulMat4(rmat, totmat, tmat);
+                                       Mat4CpyMat4(totmat, rmat);
+                               }
+
                                VECCOPY(totmat[3], vec);
                                
                                Mat4MulSerie(ct->matrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -1206,7 +1235,8 @@ static void followpath_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
        /* only evaluate if there is a target */
        if (VALID_CONS_TARGET(ct)) {
                float obmat[4][4];
-               float size[3], obsize[3];
+               float size[3];
+               bFollowPathConstraint *data= con->data;
                
                /* get Object local transform (loc/rot/size) to determine transformation from path */
                //object_to_mat4(ob, obmat);
@@ -1219,13 +1249,17 @@ static void followpath_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
                Mat4MulSerie(cob->matrix, ct->matrix, obmat, NULL, NULL, NULL, NULL, NULL, NULL);
                
                /* un-apply scaling caused by path */
-               Mat4ToSize(cob->matrix, obsize);
-               if (obsize[0])
-                       VecMulf(cob->matrix[0], size[0] / obsize[0]);
-               if (obsize[1])
-                       VecMulf(cob->matrix[1], size[1] / obsize[1]);
-               if (obsize[2])
-                       VecMulf(cob->matrix[2], size[2] / obsize[2]);
+               if ((data->followflag & FOLLOWPATH_RADIUS)==0) { /* XXX - assume that scale correction means that radius will have some scale error in it - Campbell */
+                       float obsize[3];
+
+                       Mat4ToSize(cob->matrix, obsize);
+                       if (obsize[0])
+                               VecMulf(cob->matrix[0], size[0] / obsize[0]);
+                       if (obsize[1])
+                               VecMulf(cob->matrix[1], size[1] / obsize[1]);
+                       if (obsize[2])
+                               VecMulf(cob->matrix[2], size[2] / obsize[2]);
+               }
        }
 }
 
@@ -1304,7 +1338,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
        VECCOPY(loc, cob->matrix[3]);
        Mat4ToSize(cob->matrix, size);
        
-       Mat4ToEul(cob->matrix, eul);
+       Mat4ToEulO(cob->matrix, eul, cob->rotOrder);
        
        /* eulers: radians to degrees! */
        eul[0] = (float)(eul[0] / M_PI * 180);
@@ -1339,7 +1373,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
        eul[1] = (float)(eul[1] / 180 * M_PI);
        eul[2] = (float)(eul[2] / 180 * M_PI);
        
-       LocEulSizeToMat4(cob->matrix, loc, eul, size);
+       LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
 }
 
 static bConstraintTypeInfo CTI_ROTLIMIT = {
@@ -1546,14 +1580,14 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                VECCOPY(loc, cob->matrix[3]);
                Mat4ToSize(cob->matrix, size);
                
-               Mat4ToEul(ct->matrix, eul);
-               Mat4ToEul(cob->matrix, obeul);
+               Mat4ToEulO(ct->matrix, eul, ct->rotOrder);
+               Mat4ToEulO(cob->matrix, obeul, cob->rotOrder);
                
                if ((data->flag & ROTLIKE_X)==0)
                        eul[0] = obeul[0];
                else {
                        if (data->flag & ROTLIKE_OFFSET)
-                               euler_rot(eul, obeul[0], 'x');
+                               eulerO_rot(eul, obeul[0], 'x', cob->rotOrder);
                        
                        if (data->flag & ROTLIKE_X_INVERT)
                                eul[0] *= -1;
@@ -1563,7 +1597,7 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                        eul[1] = obeul[1];
                else {
                        if (data->flag & ROTLIKE_OFFSET)
-                               euler_rot(eul, obeul[1], 'y');
+                               eulerO_rot(eul, obeul[1], 'y', cob->rotOrder);
                        
                        if (data->flag & ROTLIKE_Y_INVERT)
                                eul[1] *= -1;
@@ -1573,14 +1607,14 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
                        eul[2] = obeul[2];
                else {
                        if (data->flag & ROTLIKE_OFFSET)
-                               euler_rot(eul, obeul[2], 'z');
+                               eulerO_rot(eul, obeul[2], 'z', cob->rotOrder);
                        
                        if (data->flag & ROTLIKE_Z_INVERT)
                                eul[2] *= -1;
                }
                
                compatible_eul(eul, obeul);
-               LocEulSizeToMat4(cob->matrix, loc, eul, size);
+               LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
        }
 }
 
@@ -2843,7 +2877,7 @@ static void clampto_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
                 */
                
                /* only happens on reload file, but violates depsgraph still... fix! */
-               if (cu->path==NULL || cu->path->data==