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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt184
-rw-r--r--GNUmakefile5
-rw-r--r--SConstruct1
-rw-r--r--build_files/buildbot/master.cfg7
-rw-r--r--build_files/buildbot/master_unpack.py2
-rw-r--r--build_files/buildbot/slave_pack.py6
-rw-r--r--build_files/cmake/clang_array_check.py353
-rwxr-xr-xbuild_files/cmake/cmake_qtcreator_project.py8
-rw-r--r--build_files/cmake/cmake_static_check_clang_array.py77
-rw-r--r--build_files/cmake/cmake_static_check_cppcheck.py3
-rw-r--r--build_files/cmake/cmake_static_check_smatch.py3
-rw-r--r--build_files/cmake/cmake_static_check_sparse.py3
-rw-r--r--build_files/cmake/cmake_static_check_splint.py3
-rw-r--r--build_files/cmake/config/blender_lite.cmake1
-rw-r--r--build_files/cmake/macros.cmake6
-rw-r--r--build_files/cmake/project_source_info.py2
-rw-r--r--build_files/package_spec/rpm/blender.spec.in1
-rw-r--r--doc/guides/interface_API.txt16
-rw-r--r--doc/manpage/blender.14
-rw-r--r--doc/python_api/rst/bge.types.rst28
-rw-r--r--doc/python_api/rst/change_log.rst1499
-rw-r--r--doc/python_api/sphinx_changelog_gen.py13
-rw-r--r--doc/python_api/sphinx_doc_gen.py2
-rw-r--r--intern/cycles/blender/addon/ui.py2
-rw-r--r--intern/cycles/blender/blender_object.cpp17
-rw-r--r--intern/cycles/blender/blender_shader.cpp5
-rw-r--r--intern/cycles/blender/blender_sync.h2
-rw-r--r--intern/cycles/blender/blender_util.h4
-rw-r--r--intern/cycles/kernel/kernel_object.h24
-rw-r--r--intern/cycles/kernel/kernel_types.h2
-rw-r--r--intern/cycles/kernel/osl/background.cpp23
-rw-r--r--intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp16
-rw-r--r--intern/cycles/kernel/osl/bsdf_diffuse.cpp30
-rw-r--r--intern/cycles/kernel/osl/bsdf_microfacet.cpp74
-rw-r--r--intern/cycles/kernel/osl/bsdf_oren_nayar.cpp16
-rw-r--r--intern/cycles/kernel/osl/bsdf_phong.cpp34
-rw-r--r--intern/cycles/kernel/osl/bsdf_reflection.cpp14
-rw-r--r--intern/cycles/kernel/osl/bsdf_refraction.cpp16
-rw-r--r--intern/cycles/kernel/osl/bsdf_transparent.cpp12
-rw-r--r--intern/cycles/kernel/osl/bsdf_ward.cpp20
-rw-r--r--intern/cycles/kernel/osl/bsdf_westin.cpp34
-rw-r--r--intern/cycles/kernel/osl/bssrdf.cpp14
-rw-r--r--intern/cycles/kernel/osl/debug.cpp14
-rw-r--r--intern/cycles/kernel/osl/emissive.cpp12
-rw-r--r--intern/cycles/kernel/osl/osl_closures.cpp44
-rw-r--r--intern/cycles/kernel/osl/osl_closures.h44
-rw-r--r--intern/cycles/kernel/osl/osl_shader.cpp20
-rw-r--r--intern/cycles/kernel/osl/vol_subsurface.cpp20
-rw-r--r--intern/cycles/kernel/svm/svm_tex_coord.h24
-rw-r--r--intern/cycles/kernel/svm/svm_types.h13
-rw-r--r--intern/cycles/render/graph.cpp6
-rw-r--r--intern/cycles/render/nodes.cpp36
-rw-r--r--intern/cycles/render/nodes.h2
-rw-r--r--intern/cycles/render/object.cpp4
-rw-r--r--intern/cycles/render/object.h3
-rw-r--r--intern/dualcon/intern/octree.cpp169
-rw-r--r--intern/dualcon/intern/octree.h299
-rw-r--r--intern/opennl/intern/opennl.c15
-rw-r--r--intern/opennl/superlu/get_perm_c.c52
-rw-r--r--release/datafiles/startup.blendbin405076 -> 405076 bytes
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_process_msg.py2
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/rtl_preprocess.py37
-rw-r--r--release/scripts/modules/bpy/path.py4
-rw-r--r--release/scripts/modules/bpy_extras/mesh_utils.py2
-rw-r--r--release/scripts/modules/bpy_types.py8
-rw-r--r--release/scripts/modules/bpyml.py2
-rw-r--r--release/scripts/modules/console_python.py4
-rw-r--r--release/scripts/modules/console_shell.py4
-rw-r--r--release/scripts/modules/rna_info.py4
-rw-r--r--release/scripts/modules/rna_xml.py2
-rw-r--r--release/scripts/presets/interface_theme/ubuntu_ambiance.xml214
-rw-r--r--release/scripts/startup/bl_operators/add_mesh_torus.py8
-rw-r--r--release/scripts/startup/bl_operators/anim.py6
-rw-r--r--release/scripts/startup/bl_operators/clip.py14
-rw-r--r--release/scripts/startup/bl_operators/console.py2
-rw-r--r--release/scripts/startup/bl_operators/mesh.py2
-rw-r--r--release/scripts/startup/bl_operators/object.py12
-rw-r--r--release/scripts/startup/bl_operators/screen_play_rendered_anim.py2
-rw-r--r--release/scripts/startup/bl_operators/wm.py8
-rw-r--r--release/scripts/startup/bl_ui/__init__.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_animviz.py7
-rw-r--r--release/scripts/startup/bl_ui/properties_data_armature.py7
-rw-r--r--release/scripts/startup/bl_ui/properties_data_bone.py18
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py6
-rw-r--r--release/scripts/startup/bl_ui/properties_object_constraint.py1
-rw-r--r--release/scripts/startup/bl_ui/properties_particle.py31
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_cloth.py8
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py7
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_field.py7
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_smoke.py6
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_softbody.py6
-rw-r--r--release/scripts/startup/bl_ui/properties_render.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py10
-rw-r--r--release/scripts/startup/bl_ui/space_clip.py14
-rw-r--r--release/scripts/startup/bl_ui/space_console.py2
-rw-r--r--release/scripts/startup/bl_ui/space_info.py51
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py9
-rw-r--r--release/scripts/startup/bl_ui/space_userpref_keymap.py4
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py12
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py20
-rw-r--r--release/scripts/startup/keyingsets_builtins.py4
-rw-r--r--source/blender/CMakeLists.txt5
-rw-r--r--source/blender/avi/AVI_avi.h2
-rw-r--r--source/blender/avi/CMakeLists.txt20
-rw-r--r--source/blender/avi/intern/avi.c3
-rw-r--r--source/blender/avi/intern/avirgb.c (renamed from source/blender/avi/intern/avi_rgb.c)8
-rw-r--r--source/blender/avi/intern/avirgb.h (renamed from source/blender/avi/intern/avi_rgb.h)9
-rw-r--r--source/blender/avi/intern/codecs.c (renamed from source/blender/avi/intern/avi_codecs.c)8
-rw-r--r--source/blender/avi/intern/endian.c (renamed from source/blender/avi/intern/avi_endian.c)38
-rw-r--r--source/blender/avi/intern/endian.h (renamed from source/blender/avi/intern/avi_endian.h)12
-rw-r--r--source/blender/avi/intern/mjpeg.c (renamed from source/blender/avi/intern/avi_mjpeg.c)12
-rw-r--r--source/blender/avi/intern/mjpeg.h (renamed from source/blender/avi/intern/avi_mjpeg.h)5
-rw-r--r--source/blender/avi/intern/options.c (renamed from source/blender/avi/intern/avi_options.c)4
-rw-r--r--source/blender/avi/intern/rgb32.c (renamed from source/blender/avi/intern/avi_rgb32.c)9
-rw-r--r--source/blender/avi/intern/rgb32.h (renamed from source/blender/avi/intern/avi_rgb32.h)9
-rw-r--r--source/blender/blenfont/BLF_translation.h2
-rw-r--r--source/blender/blenkernel/BKE_anim.h4
-rw-r--r--source/blender/blenkernel/BKE_armature.h10
-rw-r--r--source/blender/blenkernel/BKE_blender.h4
-rw-r--r--source/blender/blenkernel/BKE_gpencil.h4
-rw-r--r--source/blender/blenkernel/BKE_mball.h4
-rw-r--r--source/blender/blenkernel/BKE_sequencer.h8
-rw-r--r--source/blender/blenkernel/CMakeLists.txt8
-rw-r--r--source/blender/blenkernel/intern/anim.c93
-rw-r--r--source/blender/blenkernel/intern/blender.c8
-rw-r--r--source/blender/blenkernel/intern/colortools.c6
-rw-r--r--source/blender/blenkernel/intern/customdata.c49
-rw-r--r--source/blender/blenkernel/intern/displist.c4
-rw-r--r--source/blender/blenkernel/intern/font.c8
-rw-r--r--source/blender/blenkernel/intern/gpencil.c12
-rw-r--r--source/blender/blenkernel/intern/ipo.c4
-rw-r--r--source/blender/blenkernel/intern/lattice.c5
-rw-r--r--source/blender/blenkernel/intern/mball.c29
-rw-r--r--source/blender/blenkernel/intern/modifier.c8
-rw-r--r--source/blender/blenkernel/intern/node.c9
-rw-r--r--source/blender/blenkernel/intern/object.c6
-rw-r--r--source/blender/blenkernel/intern/particle.c8
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c6
-rw-r--r--source/blender/blenkernel/intern/sequencer.c8
-rw-r--r--source/blender/blenkernel/intern/texture.c18
-rw-r--r--source/blender/blenkernel/intern/tracking.c13
-rw-r--r--source/blender/blenkernel/intern/writeavi.c22
-rw-r--r--source/blender/blenlib/BLI_endian_switch_inline.h80
-rw-r--r--source/blender/blenlib/BLI_lasso.h6
-rw-r--r--source/blender/blenlib/BLI_utildefines.h4
-rw-r--r--source/blender/blenlib/intern/lasso.c8
-rw-r--r--source/blender/blenloader/intern/readfile.c71
-rw-r--r--source/blender/blenloader/intern/writefile.c80
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c4
-rw-r--r--source/blender/collada/DocumentImporter.cpp6
-rw-r--r--source/blender/collada/DocumentImporter.h5
-rw-r--r--source/blender/collada/GeometryExporter.cpp4
-rw-r--r--source/blender/compositor/operations/COM_GlareStreaksOperation.cpp8
-rw-r--r--source/blender/compositor/operations/COM_TrackPositionOperation.h8
-rw-r--r--source/blender/editors/animation/anim_intern.h2
-rw-r--r--source/blender/editors/animation/anim_ops.c1
-rw-r--r--source/blender/editors/animation/keyframing.c125
-rw-r--r--source/blender/editors/armature/editarmature.c50
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c133
-rw-r--r--source/blender/editors/armature/meshlaplacian.c143
-rw-r--r--source/blender/editors/armature/poseSlide.c1
-rw-r--r--source/blender/editors/armature/poseobject.c12
-rw-r--r--source/blender/editors/curve/editcurve.c169
-rw-r--r--source/blender/editors/curve/editfont.c5
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c21
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c10
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c141
-rw-r--r--source/blender/editors/gpencil/gpencil_undo.c2
-rw-r--r--source/blender/editors/include/ED_anim_api.h36
-rw-r--r--source/blender/editors/include/ED_armature.h13
-rw-r--r--source/blender/editors/include/ED_mesh.h6
-rw-r--r--source/blender/editors/include/ED_object.h1
-rw-r--r--source/blender/editors/include/ED_particle.h2
-rw-r--r--source/blender/editors/include/ED_view3d.h52
-rw-r--r--source/blender/editors/include/UI_interface.h1
-rw-r--r--source/blender/editors/interface/interface.c80
-rw-r--r--source/blender/editors/interface/interface_handlers.c30
-rw-r--r--source/blender/editors/interface/interface_intern.h8
-rw-r--r--source/blender/editors/interface/interface_layout.c11
-rw-r--r--source/blender/editors/interface/interface_ops.c2
-rw-r--r--source/blender/editors/interface/interface_regions.c15
-rw-r--r--source/blender/editors/interface/interface_widgets.c120
-rw-r--r--source/blender/editors/mask/mask_select.c4
-rw-r--r--source/blender/editors/mesh/editface.c10
-rw-r--r--source/blender/editors/mesh/editmesh_add.c109
-rw-r--r--source/blender/editors/mesh/editmesh_bvh.c6
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c47
-rw-r--r--source/blender/editors/mesh/editmesh_rip.c2
-rw-r--r--source/blender/editors/mesh/editmesh_select.c37
-rw-r--r--source/blender/editors/mesh/editmesh_slide.c31
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c218
-rw-r--r--source/blender/editors/mesh/meshtools.c11
-rw-r--r--source/blender/editors/metaball/mball_edit.c79
-rw-r--r--source/blender/editors/object/object_add.c688
-rw-r--r--source/blender/editors/object/object_constraint.c179
-rw-r--r--source/blender/editors/object/object_edit.c36
-rw-r--r--source/blender/editors/object/object_intern.h4
-rw-r--r--source/blender/editors/object/object_ops.c4
-rw-r--r--source/blender/editors/object/object_transform.c8
-rw-r--r--source/blender/editors/object/object_vgroup.c566
-rw-r--r--source/blender/editors/physics/particle_edit.c106
-rw-r--r--source/blender/editors/physics/physics_fluid.c10
-rw-r--r--source/blender/editors/render/render_update.c44
-rw-r--r--source/blender/editors/screen/area.c51
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c15
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h2
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c19
-rw-r--r--source/blender/editors/sculpt_paint/paint_undo.c12
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c40
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c7
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h2
-rw-r--r--source/blender/editors/space_action/action_edit.c27
-rw-r--r--source/blender/editors/space_action/space_action.c4
-rw-r--r--source/blender/editors/space_clip/clip_draw.c5
-rw-r--r--source/blender/editors/space_clip/space_clip.c20
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c9
-rw-r--r--source/blender/editors/space_clip/tracking_select.c4
-rw-r--r--source/blender/editors/space_file/filelist.c4
-rw-r--r--source/blender/editors/space_graph/graph_edit.c33
-rw-r--r--source/blender/editors/space_image/image_edit.c2
-rw-r--r--source/blender/editors/space_image/space_image.c13
-rw-r--r--source/blender/editors/space_node/drawnode.c8
-rw-r--r--source/blender/editors/space_node/node_select.c4
-rw-r--r--source/blender/editors/space_node/space_node.c7
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c16
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c44
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c24
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c4
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c8
-rw-r--r--source/blender/editors/space_text/text_draw.c13
-rw-r--r--source/blender/editors/space_text/text_ops.c2
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c13
-rw-r--r--source/blender/editors/space_view3d/drawobject.c357
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c359
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c41
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c74
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c722
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c227
-rw-r--r--source/blender/editors/transform/transform.c122
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_conversions.c8
-rw-r--r--source/blender/editors/transform/transform_ops.c20
-rw-r--r--source/blender/editors/transform/transform_orientations.c6
-rw-r--r--source/blender/editors/transform/transform_snap.c53
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c4
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c149
-rw-r--r--source/blender/gpu/intern/gpu_material.c2
-rw-r--r--source/blender/imbuf/CMakeLists.txt8
-rw-r--r--source/blender/imbuf/intern/IMB_anim.h4
-rw-r--r--source/blender/imbuf/intern/anim_movie.c22
-rw-r--r--source/blender/imbuf/intern/indexer.c33
-rw-r--r--source/blender/imbuf/intern/util.c11
-rw-r--r--source/blender/makesdna/DNA_curve_types.h2
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h2
-rw-r--r--source/blender/makesdna/DNA_defs.h3
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h2
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h3
-rw-r--r--source/blender/makesdna/DNA_space_types.h4
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h7
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h414
-rw-r--r--source/blender/makesdna/intern/makesdna.c30
-rw-r--r--source/blender/makesrna/RNA_enum_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c4
-rw-r--r--source/blender/makesrna/intern/rna_curve.c11
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c2
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c335
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c8
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c29
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c14
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_object.c40
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c7
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c2
-rw-r--r--source/blender/makesrna/intern/rna_particle.c2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c8
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/makesrna/intern/rna_speaker.c5
-rw-r--r--source/blender/makesrna/intern/rna_texture.c2
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c24
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c5
-rw-r--r--source/blender/nodes/composite/node_composite_tree.c6
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_coord.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_output.c2
-rw-r--r--source/blender/python/rna_dump.py4
-rw-r--r--source/blender/render/intern/source/convertblender.c10
-rw-r--r--source/blender/render/intern/source/imagetexture.c33
-rw-r--r--source/blender/render/intern/source/occlusion.c17
-rw-r--r--source/blender/render/intern/source/pipeline.c12
-rw-r--r--source/blender/render/intern/source/pointdensity.c6
-rw-r--r--source/blender/render/intern/source/render_texture.c41
-rw-r--r--source/blender/render/intern/source/rendercore.c49
-rw-r--r--source/blender/render/intern/source/renderdatabase.c9
-rw-r--r--source/blender/render/intern/source/shadeinput.c14
-rw-r--r--source/blender/render/intern/source/shadeoutput.c47
-rw-r--r--source/blender/render/intern/source/sss.c4
-rw-r--r--source/blender/render/intern/source/zbuf.c4
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/WM_types.h19
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c8
-rw-r--r--source/blender/windowmanager/intern/wm_files.c7
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c30
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp24
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.h3
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Canvas.cpp22
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Canvas.h3
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RenderTools.cpp3
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_Dome.h2
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp86
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h33
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp3
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp31
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp14
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp22
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h7
-rw-r--r--source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.cpp3
-rw-r--r--source/gameengine/Rasterizer/RAS_ICanvas.h7
-rw-r--r--source/gameengine/Rasterizer/RAS_MaterialBucket.cpp6
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp2
-rw-r--r--source/tests/batch_import.py12
-rw-r--r--source/tests/bl_load_addons.py2
-rw-r--r--source/tests/bl_load_py_modules.py2
-rw-r--r--source/tests/bl_mesh_modifiers.py2
335 files changed, 3817 insertions, 8569 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ec75e9c782..a91b5a3bdac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,7 +206,6 @@ option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" OFF)
option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON)
# Audio/Video format support
-option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
@@ -255,9 +254,6 @@ set(CYCLES_CUDA_BINARIES_ARCH sm_13 sm_20 sm_21 sm_30 CACHE STRING "CUDA archite
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
-# LLVM
-option(WITH_LLVM "Use LLVM" OFF)
-
# disable for now, but plan to support on all platforms eventually
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
mark_as_advanced(WITH_MEM_JEMALLOC)
@@ -320,9 +316,6 @@ if(APPLE)
option(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
option(USE_QTKIT "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
option(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
- if(CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
- set(USE_QTKIT ON CACHE BOOL "ON" FORCE) # no Quicktime in 64bit
- endif()
endif()
@@ -378,11 +371,6 @@ if(WITH_CYCLES OR WITH_MOD_BOOLEAN)
set(WITH_BOOST ON)
endif()
-# auto enable llvm for cycles_osl
-if(WITH_CYCLES_OSL)
- set(WITH_LLVM ON CACHE BOOL "ON" FORCE)
-endif()
-
# don't store paths to libs for portable distribution
if(WITH_INSTALL_PORTABLE)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
@@ -716,56 +704,6 @@ if(UNIX AND NOT APPLE)
endif()
endif()
- if(WITH_LLVM)
- set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
- set(LLVM_VERSION "3.0" CACHE STRING "Version of LLVM to use" "")
- set(LLVM_STATIC YES)
- if(LLVM_DIRECTORY)
- set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
- else()
- set(LLVM_CONFIG llvm-config)
- endif()
- execute_process(COMMAND ${LLVM_CONFIG} --version
- OUTPUT_VARIABLE LLVM_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --prefix
- OUTPUT_VARIABLE LLVM_DIRECTORY
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --libdir
- OUTPUT_VARIABLE LLVM_LIB_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --includedir
- OUTPUT_VARIABLE LLVM_INCLUDES
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- find_library(LLVM_LIBRARY
- NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
- PATHS ${LLVM_LIB_DIR})
- message(STATUS "LLVM version = ${LLVM_VERSION}")
- message(STATUS "LLVM dir = ${LLVM_DIRECTORY}")
- message(STATUS "LLVM includes = ${LLVM_INCLUDES}")
- message(STATUS "LLVM lib dir = ${LLVM_LIB_DIR}")
-
- if(LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
- # ensure include directory is added (in case of non-standard locations
- include_directories(BEFORE "${LLVM_INCLUDES}")
- string(REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
- message(STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
- add_definitions("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
- if(LLVM_STATIC)
- # if static LLVM libraries were requested, use llvm-config to generate
- # the list of what libraries we need, and substitute that in the right
- # way for LLVM_LIBRARY.
- execute_process(COMMAND ${LLVM_CONFIG} --libfiles
- OUTPUT_VARIABLE LLVM_LIBRARY
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
- endif()
- message(STATUS "LLVM library = ${LLVM_LIBRARY}")
- else()
- message(FATAL_ERROR "LLVM not found.")
- endif()
- endif()
-
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
@@ -774,9 +712,8 @@ if(UNIX AND NOT APPLE)
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
- # Note: --whole-archive is needed to force loading of all symbols in liboslexec,
- # otherwise LLVM is missing the osl_allocate_closure_component function
- list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -Wl,--whole-archive ${OSL_LIB_EXEC} -Wl,--no-whole-archive ${OSL_LIB_QUERY})
+ # WARNING! depends on correct order of OSL libs linking
+ list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
@@ -1622,56 +1559,6 @@ elseif(APPLE)
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
endif()
- if(WITH_LLVM)
- set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
- set(LLVM_VERSION "3.1" CACHE STRING "Version of LLVM to use" "")
- set(LLVM_STATIC YES)
- if(LLVM_DIRECTORY)
- set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
- else()
- set(LLVM_CONFIG llvm-config)
- endif()
- execute_process(COMMAND ${LLVM_CONFIG} --version
- OUTPUT_VARIABLE LLVM_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --prefix
- OUTPUT_VARIABLE LLVM_DIRECTORY
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --libdir
- OUTPUT_VARIABLE LLVM_LIB_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --includedir
- OUTPUT_VARIABLE LLVM_INCLUDES
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- find_library(LLVM_LIBRARY
- NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
- PATHS ${LLVM_LIB_DIR})
- message(STATUS "LLVM version = ${LLVM_VERSION}")
- message(STATUS "LLVM dir = ${LLVM_DIRECTORY}")
- message(STATUS "LLVM includes = ${LLVM_INCLUDES}")
- message(STATUS "LLVM lib dir = ${LLVM_LIB_DIR}")
-
- if(LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
- # ensure include directory is added (in case of non-standard locations
- include_directories(BEFORE "${LLVM_INCLUDES}")
- string(REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
- message(STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
- add_definitions("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
- if(LLVM_STATIC)
- # if static LLVM libraries were requested, use llvm-config to generate
- # the list of what libraries we need, and substitute that in the right
- # way for LLVM_LIBRARY.
- execute_process(COMMAND ${LLVM_CONFIG} --libfiles
- OUTPUT_VARIABLE LLVM_LIBRARY
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
- endif()
- message(STATUS "LLVM library = ${LLVM_LIBRARY}")
- else()
- message(FATAL_ERROR "LLVM not found.")
- endif()
- endif()
-
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
@@ -1695,6 +1582,66 @@ elseif(APPLE)
endif()
include_directories(${OSL_INCLUDES})
+
+
+ # LLVM library setup, needed for osl
+
+ set(LLVM_DIRECTORY "${LIBDIR}/llvm")
+ set(LLVM_STATIC YES)
+ if (LLVM_DIRECTORY)
+ set (LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
+ else ()
+ set (LLVM_CONFIG llvm-config)
+ endif ()
+ execute_process (COMMAND ${LLVM_CONFIG} --version
+ OUTPUT_VARIABLE LLVM_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process (COMMAND ${LLVM_CONFIG} --prefix
+ OUTPUT_VARIABLE LLVM_DIRECTORY
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process (COMMAND ${LLVM_CONFIG} --libdir
+ OUTPUT_VARIABLE LLVM_LIB_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process (COMMAND ${LLVM_CONFIG} --includedir
+ OUTPUT_VARIABLE LLVM_INCLUDES
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ find_library ( LLVM_LIBRARY
+ NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
+ PATHS ${LLVM_LIB_DIR})
+ message (STATUS "LLVM version = ${LLVM_VERSION}")
+ message (STATUS "LLVM dir = ${LLVM_DIRECTORY}")
+ message (STATUS "LLVM includes = ${LLVM_INCLUDES}")
+ message (STATUS "LLVM lib dir = ${LLVM_LIB_DIR}")
+
+ if (LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
+ # ensure include directory is added (in case of non-standard locations
+ include_directories (BEFORE "${LLVM_INCLUDES}")
+ string (REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
+ message (STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
+ add_definitions ("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
+ if (LLVM_STATIC)
+ # if static LLVM libraries were requested, use llvm-config to generate
+ # the list of what libraries we need, and substitute that in the right
+ # way for LLVM_LIBRARY.
+ set (LLVM_LIBRARY "")
+ execute_process (COMMAND ${LLVM_CONFIG} --libs
+ OUTPUT_VARIABLE llvm_library_list
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string (REPLACE "-l" "" llvm_library_list ${llvm_library_list})
+ string (REPLACE " " ";" llvm_library_list ${llvm_library_list})
+ foreach (f ${llvm_library_list})
+ list (APPEND LLVM_LIBRARY "${LLVM_LIB_DIR}/lib${f}.a")
+ endforeach ()
+ endif ()
+ string (REPLACE ";" " " LLVM_LIBRARY "${LLVM_LIBRARY}")
+ message (STATUS "LLVM library = ${LLVM_LIBRARY}")
+ else ()
+ message (FATAL_ERROR "LLVM not found.")
+ endif ()
+ set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${LLVM_LIBRARY}")
+
+ # end LLVM library setup
+
endif()
set(EXETYPE MACOSX_BUNDLE)
@@ -1730,12 +1677,6 @@ if(WITH_CYCLES)
if(NOT WITH_BOOST)
message(FATAL_ERROR "Cycles reqires WITH_BOOST, the library may not have been found. Configure BOOST or disable WITH_CYCLES")
endif()
-
- if(WITH_CYCLES_OSL)
- if(NOT WITH_LLVM)
- message(FATAL_ERROR "Cycles OSL reqires WITH_LLVM, the library may not have been found. Configure LLVM or disable WITH_CYCLES_OSL")
- endif()
- endif()
endif()
@@ -2124,7 +2065,6 @@ if(FIRST_RUN)
info_cfg_option(WITH_OPENAL)
info_cfg_option(WITH_SDL)
info_cfg_option(WITH_JACK)
- info_cfg_option(WITH_CODEC_AVI)
info_cfg_option(WITH_CODEC_FFMPEG)
info_cfg_option(WITH_CODEC_SNDFILE)
diff --git a/GNUmakefile b/GNUmakefile
index 90d76dfe432..7b333a5fc77 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -171,7 +171,6 @@ help:
@echo ""
@echo "Static Source Code Checking (not associated with building blender)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
- @echo " * check_clang_array - run blender source through clang array checking script (C & C++)"
@echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)"
@echo " * check_smatch - run blenders source through smatch (C only)"
@@ -245,10 +244,6 @@ check_cppcheck:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; python3.2 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
-check_clang_array:
- $(CMAKE_CONFIG)
- cd $(BUILD_DIR) ; python3.2 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py
-
check_splint:
$(CMAKE_CONFIG)
cd $(BUILD_DIR) ; python3.2 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
diff --git a/SConstruct b/SConstruct
index 7b92a0cb25c..7676b44f759 100644
--- a/SConstruct
+++ b/SConstruct
@@ -366,7 +366,6 @@ else:
# TODO, make optional
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
-env['CPPFLAGS'].append('-DWITH_AVI')
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
B.root_build_dir = env['BF_BUILDDIR']
diff --git a/build_files/buildbot/master.cfg b/build_files/buildbot/master.cfg
index 1bd47303b2f..066c133d335 100644
--- a/build_files/buildbot/master.cfg
+++ b/build_files/buildbot/master.cfg
@@ -28,8 +28,8 @@ c['slavePortnum'] = 9989
from buildbot.changes.svnpoller import SVNPoller
c['change_source'] = SVNPoller(
- 'https://svn.blender.org/svnroot/bf-blender/trunk/',
- pollinterval=1200)
+ 'https://svn.blender.org/svnroot/bf-blender/trunk/',
+ pollinterval=1200)
# BUILDERS
#
@@ -137,8 +137,7 @@ c['schedulers'] = []
# builderNames=buildernames,
# periodicBuildTimer=24*60*60))
-c['schedulers'].append(timed.Nightly(
- name='nightly',
+c['schedulers'].append(timed.Nightly(name='nightly',
builderNames=buildernames,
hour=3,
minute=0))
diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py
index ecacf3bff6f..f67bd294496 100644
--- a/build_files/buildbot/master_unpack.py
+++ b/build_files/buildbot/master_unpack.py
@@ -112,7 +112,7 @@ branch = get_branch(packagename)
if platform == '':
sys.stderr.write('Failed to detect platform ' +
- 'from package: %r\n' % packagename)
+ 'from package: %r\n' % packagename)
sys.exit(1)
# extract
diff --git a/build_files/buildbot/slave_pack.py b/build_files/buildbot/slave_pack.py
index eafb25ac7b0..654efd72876 100644
--- a/build_files/buildbot/slave_pack.py
+++ b/build_files/buildbot/slave_pack.py
@@ -50,9 +50,9 @@ if builder.find('scons') != -1:
install_dir = os.path.join('..', 'install', builder)
scons_options += ['WITH_BF_NOBLENDER=True', 'WITH_BF_PLAYER=False',
- 'BF_BUILDDIR=' + build_dir,
- 'BF_INSTALLDIR=' + install_dir,
- 'WITHOUT_BF_INSTALL=True']
+ 'BF_BUILDDIR=' + build_dir,
+ 'BF_INSTALLDIR=' + install_dir,
+ 'WITHOUT_BF_INSTALL=True']
config = None
bits = None
diff --git a/build_files/cmake/clang_array_check.py b/build_files/cmake/clang_array_check.py
deleted file mode 100644
index 3070c27f769..00000000000
--- a/build_files/cmake/clang_array_check.py
+++ /dev/null
@@ -1,353 +0,0 @@
-# ---
-# * Licensed under the Apache License, Version 2.0 (the "License");
-# * you may not use this file except in compliance with the License.
-# * You may obtain a copy of the License at
-# *
-# * http://www.apache.org/licenses/LICENSE-2.0
-# ---
-# by Campbell Barton
-
-"""
-Invocation:
-
- export CLANG_BIND_DIR="/dsk/src/llvm/tools/clang/bindings/python"
- export CLANG_LIB_DIR="/opt/llvm/lib"
-
- python2 clang_array_check.py somefile.c -DSOME_DEFINE -I/some/include
-
-... defines and includes are optional
-
-"""
-
-# delay parsing functions until we need them
-USE_LAZY_INIT = True
-
-# -----------------------------------------------------------------------------
-# predefined function/arg sizes, handy sometimes, but not complete...
-
-defs_precalc = {
- "glColor3bv": {0: 3},
- "glColor4bv": {0: 4},
-
- "glColor3ubv": {0: 3},
- "glColor4ubv": {0: 4},
-
- "glColor4usv": {0: 3},
- "glColor4usv": {0: 4},
-
- "glColor3fv": {0: 3},
- "glColor4fv": {0: 4},
-
- "glColor3dv": {0: 3},
- "glColor4dv": {0: 4},
-
- "glVertex2fv": {0: 2},
- "glVertex3fv": {0: 3},
- "glVertex4fv": {0: 4},
-
- "glEvalCoord1fv": {0: 1},
- "glEvalCoord1dv": {0: 1},
- "glEvalCoord2fv": {0: 2},
- "glEvalCoord2dv": {0: 2},
-
- "glRasterPos2dv": {0: 2},
- "glRasterPos3dv": {0: 3},
- "glRasterPos4dv": {0: 4},
-
- "glRasterPos2fv": {0: 2},
- "glRasterPos3fv": {0: 3},
- "glRasterPos4fv": {0: 4},
-
- "glRasterPos2sv": {0: 2},
- "glRasterPos3sv": {0: 3},
- "glRasterPos4sv": {0: 4},
-
- "glTexCoord2fv": {0: 2},
- "glTexCoord3fv": {0: 3},
- "glTexCoord4fv": {0: 4},
-
- "glTexCoord2dv": {0: 2},
- "glTexCoord3dv": {0: 3},
- "glTexCoord4dv": {0: 4},
-
- "glNormal3fv": {0: 3},
- "glNormal3dv": {0: 3},
- "glNormal3bv": {0: 3},
- "glNormal3iv": {0: 3},
- "glNormal3sv": {0: 3},
-}
-
-# -----------------------------------------------------------------------------
-
-import sys
-
-if 0:
- # Examples with LLVM as the root dir: '/dsk/src/llvm'
-
- # path containing 'clang/__init__.py'
- CLANG_BIND_DIR = "/dsk/src/llvm/tools/clang/bindings/python"
-
- # path containing libclang.so
- CLANG_LIB_DIR = "/opt/llvm/lib"
-else:
- import os
- CLANG_BIND_DIR = os.environ.get("CLANG_BIND_DIR")
- CLANG_LIB_DIR = os.environ.get("CLANG_LIB_DIR")
-
- if CLANG_BIND_DIR is None:
- print("$CLANG_BIND_DIR python binding dir not set")
- if CLANG_LIB_DIR is None:
- print("$CLANG_LIB_DIR clang lib dir not set")
-
-sys.path.append(CLANG_BIND_DIR)
-
-import clang
-import clang.cindex
-from clang.cindex import (CursorKind,
- TypeKind,
- TokenKind)
-
-clang.cindex.Config.set_library_path(CLANG_LIB_DIR)
-
-index = clang.cindex.Index.create()
-
-args = sys.argv[2:]
-# print(args)
-
-tu = index.parse(sys.argv[1], args)
-print('Translation unit: %s' % tu.spelling)
-
-# -----------------------------------------------------------------------------
-
-
-def function_parm_wash_tokens(parm):
- # print(parm.kind)
- assert parm.kind in (CursorKind.PARM_DECL,
- CursorKind.VAR_DECL, # XXX, double check this
- CursorKind.FIELD_DECL,
- )
-
- """
- Return tolens without trailing commads and 'const'
- """
-
- tokens = [t for t in parm.get_tokens()]
- if not tokens:
- return tokens
-
- #if tokens[-1].kind == To
- # remove trailing char
- if tokens[-1].kind == TokenKind.PUNCTUATION:
- if tokens[-1].spelling in (",", ")", ";"):
- tokens.pop()
- #else:
- # print(tokens[-1].spelling)
-
- t_new = []
- for t in tokens:
- t_kind = t.kind
- t_spelling = t.spelling
- ok = True
- if t_kind == TokenKind.KEYWORD:
- if t_spelling in ("const", "restrict", "volatile"):
- ok = False
- elif t_spelling.startswith("__"):
- ok = False # __restrict
- elif t_kind in (TokenKind.COMMENT, ):
- ok = False
-
- # Use these
- elif t_kind in (TokenKind.LITERAL,
- TokenKind.PUNCTUATION,
- TokenKind.IDENTIFIER):
- # use but ignore
- pass
-
- else:
- print("Unknown!", t_kind, t_spelling)
-
- # if its OK we will add
- if ok:
- t_new.append(t)
- return t_new
-
-
-def parm_size(node_child):
- tokens = function_parm_wash_tokens(node_child)
-
- # print(" ".join([t.spelling for t in tokens]))
-
- # NOT PERFECT CODE, EXTRACT SIZE FROM TOKENS
- if len(tokens) >= 3: # foo [ 1 ]
- if ((tokens[-3].kind == TokenKind.PUNCTUATION and tokens[-3].spelling == "[") and
- (tokens[-2].kind == TokenKind.LITERAL and tokens[-2].spelling.isdigit()) and
- (tokens[-1].kind == TokenKind.PUNCTUATION and tokens[-1].spelling == "]")):
- # ---
- return int(tokens[-2].spelling)
- return -1
-
-
-def function_get_arg_sizes(node):
- # Return a dict if (index: size) items
- # {arg_indx: arg_array_size, ... ]
- arg_sizes = {}
-
- if 1: # node.spelling == "BM_vert_create", for debugging
- node_parms = [node_child for node_child in node.get_children()
- if node_child.kind == CursorKind.PARM_DECL]
-
- for i, node_child in enumerate(node_parms):
-
- # print(node_child.kind, node_child.spelling)
- #print(node_child.type.kind, node_child.spelling) # TypeKind.POINTER
-
- if node_child.type.kind == TypeKind.POINTER:
- pointee = node_child.type.get_pointee()
- if pointee.is_pod():
- size = parm_size(node_child)
- if size != -1:
- arg_sizes[i] = size
-
- return arg_sizes
-
-
-# -----------------------------------------------------------------------------
-_defs = {}
-
-
-def lookup_function_size_def(func_id):
- if USE_LAZY_INIT:
- result = _defs.get(func_id, {})
- if type(result) != dict:
- result = _defs[func_id] = function_get_arg_sizes(result)
- return result
- else:
- return _defs.get(func_id, {})
-
-# -----------------------------------------------------------------------------
-
-
-def file_check_arg_sizes(tu):
-
- # main checking function
- def validate_arg_size(node):
- """
- Loop over args and validate sizes for args we KNOW the size of.
- """
- assert node.kind == CursorKind.CALL_EXPR
-
- if 0:
- print("---",
- " <~> ".join(
- [" ".join([t.spelling for t in C.get_tokens()])
- for C in node.get_children()]
- ))
- # print(node.location)
-
- # first child is the function call, skip that.
- children = list(node.get_children())
-
- if not children:
- return # XXX, look into this, happens on C++
-
- func = children[0]
-
- # get the func declaration!
- # works but we can better scan for functions ahead of time.
- if 0:
- func_dec = func.get_definition()
- if func_dec:
- print("FD", " ".join([t.spelling for t in func_dec.get_tokens()]))
- else:
- # HRMP'f - why does this fail?
- print("AA", " ".join([t.spelling for t in node.get_tokens()]))
- else:
- args_size_definition = () # dummy
-
- # get the key
- tok = list(func.get_tokens())
- if tok:
- func_id = tok[0].spelling
- args_size_definition = lookup_function_size_def(func_id)
-
- if not args_size_definition:
- return
-
- children = children[1:]
- for i, node_child in enumerate(children):
- children = list(node_child.get_children())
-
- # skip if we dont have an index...
- size_def = args_size_definition.get(i, -1)
-
- if size_def == -1:
- continue
-
- #print([c.kind for c in children])
- # print(" ".join([t.spelling for t in node_child.get_tokens()]))
-
- if len(children) == 1:
- arg = children[0]
- if arg.kind in (CursorKind.DECL_REF_EXPR,
- CursorKind.UNEXPOSED_EXPR):
-
- if arg.type.kind == TypeKind.POINTER:
- dec = arg.get_definition()
- if dec:
- size = parm_size(dec)
-
- # size == 0 is for 'float *a'
- if size != -1 and size != 0:
-
- # nice print!
- if 0:
- print("".join([t.spelling for t in func.get_tokens()]),
- i,
- " ".join([t.spelling for t in dec.get_tokens()]))
-
- # testing
- # size_def = 100
- if size < size_def and size != 1:
- location = node.location
- print("%s:%d:%d: argument %d is size %d, should be %d" %
- (location.file,
- location.line,
- location.column,
- i + 1, size, size_def
- ))
-
- # we dont really care what we are looking at, just scan entire file for
- # function calls.
-
- def recursive_func_call_check(node):
- if node.kind == CursorKind.CALL_EXPR:
- validate_arg_size(node)
-
- for c in node.get_children():
- recursive_func_call_check(c)
-
- recursive_func_call_check(tu.cursor)
-
-
-# -- first pass, cache function definitions sizes
-
-# PRINT FUNC DEFINES
-def recursive_arg_sizes(node, ):
- # print(node.kind, node.spelling)
- if node.kind == CursorKind.FUNCTION_DECL:
- if USE_LAZY_INIT:
- args_sizes = node
- else:
- args_sizes = function_get_arg_sizes(node)
- #if args_sizes:
- # print(node.spelling, args_sizes)
- _defs[node.spelling] = args_sizes
- # print("adding", node.spelling)
- for c in node.get_children():
- recursive_arg_sizes(c)
-# cache function sizes
-recursive_arg_sizes(tu.cursor)
-_defs.update(defs_precalc)
-
-# --- second pass, check against def's
-file_check_arg_sizes(tu)
diff --git a/build_files/cmake/cmake_qtcreator_project.py b/build_files/cmake/cmake_qtcreator_project.py
index 83ea761e2d1..32d20489e6a 100755
--- a/build_files/cmake/cmake_qtcreator_project.py
+++ b/build_files/cmake/cmake_qtcreator_project.py
@@ -105,13 +105,7 @@ def create_qtc_project_main():
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
f = open(qtc_cfg, 'w')
- f.write("// ADD PREDEFINED MACROS TO %s_custom.config!\n" % FILE_NAME)
- qtc_custom_cfg = os.path.join(PROJECT_DIR, "%s_custom.config" % FILE_NAME)
- if os.path.exists(qtc_custom_cfg):
- fc = open(qtc_custom_cfg, 'r')
- f.write(fc.read())
- fc.close()
- f.write("\n")
+ f.write("// ADD PREDEFINED MACROS HERE!\n")
defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines]
if sys.platform != "win32":
defines_final += cmake_compiler_defines()
diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py
deleted file mode 100644
index 941407170ff..00000000000
--- a/build_files/cmake/cmake_static_check_clang_array.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env python3.2
-
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# Contributor(s): Campbell Barton
-#
-# ***** END GPL LICENSE BLOCK *****
-
-# <pep8 compliant>
-
-import project_source_info
-import subprocess
-import sys
-import os
-
-CHECKER_IGNORE_PREFIX = [
- "extern",
- "intern/moto",
- "blender/intern/opennl",
- ]
-
-CHECKER_BIN = "python2"
-
-CHECKER_ARGS = [
- os.path.join(os.path.dirname(__file__), "clang_array_check.py"),
- # not sure why this is needed, but it is.
- "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
- ]
-
-
-def main():
- source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
-
- check_commands = []
- for c, inc_dirs, defs in source_info:
- cmd = ([CHECKER_BIN] +
- CHECKER_ARGS +
- [c] +
- [("-I%s" % i) for i in inc_dirs] +
- [("-D%s" % d) for d in defs]
- )
-
- check_commands.append((c, cmd))
-
- process_functions = []
-
- def my_process(i, c, cmd):
- percent = 100.0 * (i / (len(check_commands) - 1))
- percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
-
- sys.stdout.flush()
- sys.stdout.write("%s " % percent_str)
-
- return subprocess.Popen(cmd)
-
- for i, (c, cmd) in enumerate(check_commands):
- process_functions.append((my_process, (i, c, cmd)))
-
- project_source_info.queue_processes(process_functions)
-
-
-if __name__ == "__main__":
- main()
diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py
index c458e8ede11..c340ca5c458 100644
--- a/build_files/cmake/cmake_static_check_cppcheck.py
+++ b/build_files/cmake/cmake_static_check_cppcheck.py
@@ -30,7 +30,6 @@ import os
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
- "blender/intern/opennl",
]
CHECKER_BIN = "cppcheck"
@@ -55,7 +54,7 @@ def main():
[c] +
[("-I%s" % i) for i in inc_dirs] +
[("-D%s" % d) for d in defs]
- )
+ )
check_commands.append((c, cmd))
diff --git a/build_files/cmake/cmake_static_check_smatch.py b/build_files/cmake/cmake_static_check_smatch.py
index 5681d2ae5ed..779945b030a 100644
--- a/build_files/cmake/cmake_static_check_smatch.py
+++ b/build_files/cmake/cmake_static_check_smatch.py
@@ -25,7 +25,6 @@
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
- "blender/intern/opennl",
]
CHECKER_BIN = "smatch"
@@ -50,7 +49,7 @@ def main():
[c] +
[("-I%s" % i) for i in inc_dirs] +
[("-D%s" % d) for d in defs]
- )
+ )
check_commands.append((c, cmd))
diff --git a/build_files/cmake/cmake_static_check_sparse.py b/build_files/cmake/cmake_static_check_sparse.py
index 4f4eb838dd5..db1b14e7acb 100644
--- a/build_files/cmake/cmake_static_check_sparse.py
+++ b/build_files/cmake/cmake_static_check_sparse.py
@@ -25,7 +25,6 @@
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
- "blender/intern/opennl",
]
CHECKER_BIN = "sparse"
@@ -48,7 +47,7 @@ def main():
[c] +
[("-I%s" % i) for i in inc_dirs] +
[("-D%s" % d) for d in defs]
- )
+ )
check_commands.append((c, cmd))
diff --git a/build_files/cmake/cmake_static_check_splint.py b/build_files/cmake/cmake_static_check_splint.py
index 7be28c01af8..f538fa612d0 100644
--- a/build_files/cmake/cmake_static_check_splint.py
+++ b/build_files/cmake/cmake_static_check_splint.py
@@ -25,7 +25,6 @@
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
- "blender/intern/opennl",
]
CHECKER_BIN = "splint"
@@ -80,7 +79,7 @@ def main():
[c] +
[("-I%s" % i) for i in inc_dirs] +
[("-D%s" % d) for d in defs]
- )
+ )
check_commands.append((c, cmd))
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index de3cfd166b7..ae07743191b 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -10,7 +10,6 @@ set(WITH_SYSTEM_GLEW ON CACHE FORCE BOOL)
set(WITH_BUILDINFO OFF CACHE FORCE BOOL)
set(WITH_BULLET OFF CACHE FORCE BOOL)
-set(WITH_CODEC_AVI OFF CACHE FORCE BOOL)
set(WITH_CODEC_FFMPEG OFF CACHE FORCE BOOL)
set(WITH_CODEC_SNDFILE OFF CACHE FORCE BOOL)
set(WITH_CYCLES OFF CACHE FORCE BOOL)
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 750903b12d7..43cfb31c03c 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -244,9 +244,6 @@ macro(SETUP_LIBDIRS)
link_directories(${PCRE_LIBPATH})
link_directories(${EXPAT_LIBPATH})
endif()
- if(WITH_LLVM)
- link_directories(${LLVM_LIB_DIR})
- endif()
if(WITH_MEM_JEMALLOC)
link_directories(${JEMALLOC_LIBPATH})
endif()
@@ -385,9 +382,6 @@ macro(setup_liblinks
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
- if(WITH_LLVM)
- target_link_libraries(${target} ${LLVM_LIBRARY})
- endif()
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
endif()
diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py
index 17a9327a358..ed17ec5bac4 100644
--- a/build_files/cmake/project_source_info.py
+++ b/build_files/cmake/project_source_info.py
@@ -85,7 +85,7 @@ def makefile_log():
print("running make with --dry-run ...")
process = subprocess.Popen(["make", "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
stdout=subprocess.PIPE,
- )
+ )
while process.poll():
time.sleep(1)
diff --git a/build_files/package_spec/rpm/blender.spec.in b/build_files/package_spec/rpm/blender.spec.in
index a95fce80103..85a689031a3 100644
--- a/build_files/package_spec/rpm/blender.spec.in
+++ b/build_files/package_spec/rpm/blender.spec.in
@@ -76,7 +76,6 @@ fi || :
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/%{name}/%{blender_api}/datafiles/fonts
-%{_datadir}/%{name}/%{blender_api}/datafiles/colormanagement
%{_datadir}/%{name}/%{blender_api}/scripts
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/applications/%{name}.desktop
diff --git a/doc/guides/interface_API.txt b/doc/guides/interface_API.txt
index 5f0fbc85ff8..5f601dd3ebc 100644
--- a/doc/guides/interface_API.txt
+++ b/doc/guides/interface_API.txt
@@ -50,7 +50,7 @@ Contents
- It works with only OpenGL calls, for the full 100%. This means that it has some quirks
built-in to work with all OS's and OpenGL versions. Especially frontbuffer drawing is
a continuous point of attention. Buttons can be drawn with any window matrix. However,
- errors can still occur when buttons are created in windows with non-standard glViewports.
+ errors can still occor when buttons are created in windows with non-standard glViewports.
- The code was written to replace the old 1.8 button system, but under high pressure. Quite
some button methods from the old system were copied for that reason.
@@ -95,7 +95,7 @@ blender/source/blender/src/toolbox.c (extra GUI elements built on top of this AP
All GUI elements are collected in uiBlocks, which in turn are linked together in a list that's
part of a Blender Area-window.
- uiBlock *block = uiNewBlock(&curarea->uiblocks, "stuff", UI_EMBOSSX, UI_HELV, curarea->win);
+ uiBlock *block= uiNewBlock(&curarea->uiblocks, "stuff", UI_EMBOSSX, UI_HELV, curarea->win);
The next code example makes a new block, and puts it in the list of blocks of the current active
Area:
@@ -221,7 +221,7 @@ void uiBlockSetButmFunc(uiBlock *block, void (*menufunc)(void *arg, int event),
void uiAutoBlock(uiBlock *block, float minx, float miny, float sizex, float sizey, UI_BLOCK_ROWS)
Sets the buttons in this block to automatically align, and fit within boundaries.
- Internally it allows multiple colums or rows as well. Only 'row order' has been implemented.
+ Internally it allows multiple collums or rows as well. Only 'row order' has been implemented.
The uiDefBut definitions don't need coordinates as input here, but instead:
- first value (x1) to indicate row number
- width and height values (if filled in) will be used to define a relative width/height.
@@ -346,7 +346,7 @@ type:
without returnvalues, the first item gets value 0 (incl. title!)
Example: "Do something %t| turn left %2| turn right %1| nothing %0"
-11. COLOR
+11. COL
A special button that only visualizes a RGB value
In 'retval' you can put a code, which is used to identify for sliders if it needs
redraws while using the sliders. Check button '5'.
@@ -363,7 +363,7 @@ uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon,
float min, float max, float a1, float a2, char *tip)
Same syntax and types available as previous uiDefBut, but now with an icon code
- instead of a name. The icons are numbered in resources.c
+ instead of a name. THe icons are numbered in resources.c
uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str,
short x1, short y1, short x2, short y2, float *poin,
@@ -397,9 +397,9 @@ void uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str,
static uiBlock *info_file_importmenu(void *arg_unused)
{
uiBlock *block;
- short yco = 0, xco = 20;
+ short yco= 0, xco = 20;
- block = uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSW, UI_HELV, G.curscreen->mainwin);
+ block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSW, UI_HELV, G.curscreen->mainwin);
uiBlockSetXOfs(block, -40); // offset to parent button
/* flags are defines */
@@ -409,7 +409,7 @@ void uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str,
uiDefButS(block, TOG|BIT|2, 0, "Two Sided", xco, yco-=20, 75, 19, &U.vrmlflag, 0.0, 0.0, 0, 0, "");
uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50); /* checks for fontsize */
+ uiTextBoundsBlock(block, 50); // checks for fontsize
return block;
}
diff --git a/doc/manpage/blender.1 b/doc/manpage/blender.1
index e7164fcb96b..c7a762f08c7 100644
--- a/doc/manpage/blender.1
+++ b/doc/manpage/blender.1
@@ -1,4 +1,4 @@
-.TH "BLENDER" "1" "October 04, 2012" "Blender Blender 2\&.64 (sub 0)"
+.TH "BLENDER" "1" "July 19, 2012" "Blender Blender 2\&.63 (sub 14)"
.SH NAME
blender \- a 3D modelling and rendering package
@@ -15,7 +15,7 @@ Use Blender to create TV commercials, to make technical visualizations, business
http://www.blender.org
.SH OPTIONS
-Blender 2.64 (sub 0)
+Blender 2.63 (sub 14)
Usage: blender [args ...] [file] [args ...]
.br
.SS "Render Options:"
diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst
index a173137e50c..f4374f7f355 100644
--- a/doc/python_api/rst/bge.types.rst
+++ b/doc/python_api/rst/bge.types.rst
@@ -333,8 +333,7 @@ Types
.. attribute:: useContinue
- The actions continue option, True or False. When True, the action will always play from where last left off,
- otherwise negative events to this actuator will reset it to its start frame.
+ The actions continue option, True or False. When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame.
:type: boolean
@@ -880,8 +879,7 @@ Types
.. note::
- Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError,
- if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
+ Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
KX_GameObject can be subclassed to extend functionality. For example:
@@ -988,24 +986,6 @@ Types
The object's parent object. (read-only).
:type: :class:`KX_GameObject` or None
-
- .. attribute:: group_children
-
- Returns the list of group members if the object is a group object, otherwise None is returned.
-
- :type: :class:`CListValue` of :class:`KX_GameObject` or None
-
- .. attribute:: group_parent
-
- Returns the group object that the object belongs to or None if the object is not part of a group.
-
- :type: :class:`KX_GameObject` or None
-
- .. attribute:: scene
-
- The object's scene. (read-only).
-
- :type: :class:`KX_Scene` or None
.. attribute:: visible
@@ -4566,9 +4546,7 @@ Types
.. data:: KX_ACT_ARMATURE_RUN
- Just make sure the armature will be updated on the next graphic frame.
- This is the only persistent mode of the actuator:
- it executes automatically once per frame until stopped by a controller
+ Just make sure the armature will be updated on the next graphic frame. This is the only persistent mode of the actuator: it executes automatically once per frame until stopped by a controller
:value: 0
diff --git a/doc/python_api/rst/change_log.rst b/doc/python_api/rst/change_log.rst
index c1f3c2e4267..4d8f9a5171e 100644
--- a/doc/python_api/rst/change_log.rst
+++ b/doc/python_api/rst/change_log.rst
@@ -2397,1502 +2397,3 @@ Removed
* **ffmpeg_packetsize**
* **ffmpeg_video_bitrate**
-2.62 to 2.63
-============
-
-bpy.types.ThemeView3D
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeView3D.camera`
-* :class:`bpy.types.ThemeView3D.empty`
-
-bpy.types.KeyingSet
--------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.KeyingSet.bl_description`
-* :class:`bpy.types.KeyingSet.bl_idname`
-
-Renamed
-^^^^^^^
-
-* **name** -> :class:`bpy.types.KeyingSet.bl_label`
-
-bpy.types.BlendDataScenes
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.BlendDataScenes.tag`
-
-bpy.types.RenderEngine
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.RenderEngine.camera_override`
-
-bpy.types.BackgroundImage
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.BackgroundImage.show_on_foreground`
-
-bpy.types.CyclesRenderSettings
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CyclesRenderSettings.preview_active_layer`
-* :class:`bpy.types.CyclesRenderSettings.sample_clamp`
-
-bpy.types.ToolSettings
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ToolSettings.double_threshold`
-
-bpy.types.Image
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Image.render_slot`
-
-bpy.types.MovieTrackingStabilization
-------------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MovieTrackingStabilization.filter_type`
-
-bpy.types.DomainFluidSettings
------------------------------
-
-Removed
-^^^^^^^
-
-* **viscosity_preset**
-
-bpy.types.ParticleSettings
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ParticleSettings.use_rotations`
-
-bpy.types.SceneGameData
------------------------
-
-Renamed
-^^^^^^^
-
-* **dome_tesselation** -> :class:`bpy.types.SceneGameData.dome_tessellation`
-
-bpy.types.RegionView3D
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.RegionView3D.update`
-
-bpy.types.Scene
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Scene.active_layer`
-
-bpy.types.ShaderNodeTexEnvironment
-----------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ShaderNodeTexEnvironment.projection`
-
-bpy.types.UserPreferencesEdit
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UserPreferencesEdit.fcurve_unselected_alpha`
-
-bpy.types.MeshTextureFace
--------------------------
-
-Removed
-^^^^^^^
-
-* **pin_uv**
-* **select_uv**
-
-bpy.types.Menu
---------------
-
-Function Arguments
-^^^^^^^^^^^^^^^^^^
-
-* :class:`bpy.types.Menu.path_menu` (self, searchpaths, operator, props_default, filter_ext), *was (self, searchpaths, operator, props_default)*
-
-bpy.types.CompositorNodeDistanceMatte
--------------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeDistanceMatte.channel`
-
-bpy.types.KeyingSetInfo
------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.KeyingSetInfo.bl_description`
-
-bpy.types.KeyingSets
---------------------
-
-Function Arguments
-^^^^^^^^^^^^^^^^^^
-
-* :class:`bpy.types.KeyingSets.new` (idname, name), *was (name)*
-
-bpy.types.CompositorNodeOutputFile
-----------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeOutputFile.active_input`
-* :class:`bpy.types.CompositorNodeOutputFile.active_input_index`
-* :class:`bpy.types.CompositorNodeOutputFile.base_path`
-
-Removed
-^^^^^^^
-
-* **filepath**
-* **frame_end**
-* **frame_start**
-
-Renamed
-^^^^^^^
-
-* **image_settings** -> :class:`bpy.types.CompositorNodeOutputFile.format`
-
-bpy.types.CyclesCameraSettings
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CyclesCameraSettings.aperture_fstop`
-* :class:`bpy.types.CyclesCameraSettings.aperture_type`
-
-bpy.types.Struct
-----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Struct.translation_context`
-
-bpy.types.ThemeSequenceEditor
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeSequenceEditor.movieclip_strip`
-* :class:`bpy.types.ThemeSequenceEditor.preview_back`
-
-bpy.types.TexMapping
---------------------
-
-Renamed
-^^^^^^^
-
-* **location** -> :class:`bpy.types.TexMapping.translation`
-
-bpy.types.ArmatureActuator
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ArmatureActuator.influence`
-
-bpy.types.ThemeTextEditor
--------------------------
-
-Removed
-^^^^^^^
-
-* **scroll_bar**
-
-bpy.types.ThemeUserInterface
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeUserInterface.wcol_tooltip`
-
-bpy.types.MeshEdge
-------------------
-
-Removed
-^^^^^^^
-
-* **is_fgon**
-
-bpy.types.Brush
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Brush.sculpt_capabilities`
-
-Renamed
-^^^^^^^
-
-* **use_space_atten** -> :class:`bpy.types.Brush.use_space_attenuation`
-
-bpy.types.ShaderNodeMapping
----------------------------
-
-Renamed
-^^^^^^^
-
-* **location** -> :class:`bpy.types.ShaderNodeMapping.translation`
-
-bpy.types.Mesh
---------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Mesh.auto_texspace`
-* :class:`bpy.types.Mesh.calc_tessface`
-* :class:`bpy.types.Mesh.loops`
-* :class:`bpy.types.Mesh.polygons`
-* :class:`bpy.types.Mesh.tessface_uv_textures`
-* :class:`bpy.types.Mesh.tessface_vertex_colors`
-* :class:`bpy.types.Mesh.tessfaces`
-* :class:`bpy.types.Mesh.unit_test_compare`
-* :class:`bpy.types.Mesh.uv_layer_clone`
-* :class:`bpy.types.Mesh.uv_layer_clone_index`
-* :class:`bpy.types.Mesh.uv_layer_stencil`
-* :class:`bpy.types.Mesh.uv_layer_stencil_index`
-* :class:`bpy.types.Mesh.uv_layers`
-
-Removed
-^^^^^^^
-
-* **faces**
-* **layers_float**
-* **layers_string**
-
-Renamed
-^^^^^^^
-
-* **layers_int** -> :class:`bpy.types.Mesh.polygon_layers_float`
-* **layers_int** -> :class:`bpy.types.Mesh.polygon_layers_int`
-* **layers_int** -> :class:`bpy.types.Mesh.polygon_layers_string`
-
-Function Arguments
-^^^^^^^^^^^^^^^^^^
-
-* :class:`bpy.types.Mesh.update` (calc_edges, calc_tessface), *was (calc_edges)*
-
-bpy.types.Key
--------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Key.eval_time`
-
-bpy.types.LatticeModifier
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.LatticeModifier.strength`
-
-bpy.types.UserPreferencesView
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UserPreferencesView.quit_dialog`
-
-
-2.63 to 2.64
-============
-
-bpy.types.CyclesLampSettings
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CyclesLampSettings.samples`
-
-bpy.types.Histogram
--------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Histogram.show_line`
-
-bpy.types.ThemeView3D
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeView3D.bone_pose_active`
-* :class:`bpy.types.ThemeView3D.skin_root`
-
-bpy.types.GameObjectSettings
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.GameObjectSettings.fall_speed`
-* :class:`bpy.types.GameObjectSettings.jump_speed`
-* :class:`bpy.types.GameObjectSettings.step_height`
-
-
-bpy.types.BlendData
--------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.BlendData.masks`
-
-
-bpy.types.TextureNodeMixRGB
----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.TextureNodeMixRGB.use_clamp`
-
-bpy.types.SmokeCollSettings
----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SmokeCollSettings.collision_type`
-
-bpy.types.CompositorNodes
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodes.active`
-
-bpy.types.RenderEngine
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.RenderEngine.resolution_x`
-* :class:`bpy.types.RenderEngine.resolution_y`
-* :class:`bpy.types.RenderEngine.tile_x`
-* :class:`bpy.types.RenderEngine.tile_y`
-
-Function Arguments
-^^^^^^^^^^^^^^^^^^
-
-* :class:`bpy.types.RenderEngine.begin_result` (x, y, w, h, layer), *was (x, y, w, h)*
-* :class:`bpy.types.RenderEngine.end_result` (result, cancel), *was (result)*
-
-bpy.types.BackgroundImage
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.BackgroundImage.draw_depth`
-* :class:`bpy.types.BackgroundImage.frame_method`
-
-bpy.types.SmokeDomainSettings
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SmokeDomainSettings.cell_size`
-* :class:`bpy.types.SmokeDomainSettings.density`
-* :class:`bpy.types.SmokeDomainSettings.domain_resolution`
-* :class:`bpy.types.SmokeDomainSettings.scale`
-* :class:`bpy.types.SmokeDomainSettings.start_point`
-
-bpy.types.CyclesRenderSettings
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CyclesRenderSettings.aa_samples`
-* :class:`bpy.types.CyclesRenderSettings.ao_samples`
-* :class:`bpy.types.CyclesRenderSettings.blur_glossy`
-* :class:`bpy.types.CyclesRenderSettings.diffuse_samples`
-* :class:`bpy.types.CyclesRenderSettings.glossy_samples`
-* :class:`bpy.types.CyclesRenderSettings.mesh_light_samples`
-* :class:`bpy.types.CyclesRenderSettings.preview_aa_samples`
-* :class:`bpy.types.CyclesRenderSettings.preview_start_resolution`
-* :class:`bpy.types.CyclesRenderSettings.progressive`
-* :class:`bpy.types.CyclesRenderSettings.transmission_samples`
-
-Removed
-^^^^^^^
-
-* **blur_caustics**
-* **debug_min_size**
-
-bpy.types.ActionGroup
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ActionGroup.color_set`
-* :class:`bpy.types.ActionGroup.colors`
-
-Removed
-^^^^^^^
-
-* **custom_color**
-
-bpy.types.WipeSequence
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.WipeSequence.input_1`
-* :class:`bpy.types.WipeSequence.input_count`
-
-bpy.types.ToolSettings
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ToolSettings.snap_node_element`
-* :class:`bpy.types.ToolSettings.use_proportional_edit_mask`
-
-bpy.types.ThemeClipEditor
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeClipEditor.space_list`
-* :class:`bpy.types.ThemeClipEditor.strips`
-* :class:`bpy.types.ThemeClipEditor.strips_selected`
-
-bpy.types.Image
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Image.colorspace_settings`
-* :class:`bpy.types.Image.frame_duration`
-* :class:`bpy.types.Image.gl_touch`
-* :class:`bpy.types.Image.scale`
-* :class:`bpy.types.Image.view_as_render`
-
-
-bpy.types.ThemeDopeSheet
-------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeDopeSheet.summary`
-
-bpy.types.MovieClipUser
------------------------
-
-Renamed
-^^^^^^^
-
-* **current_frame** -> :class:`bpy.types.MovieClipUser.frame_current`
-
-bpy.types.TransformSequence
----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.TransformSequence.input_1`
-* :class:`bpy.types.TransformSequence.input_count`
-
-bpy.types.ImageSequence
------------------------
-
-Removed
-^^^^^^^
-
-* **color_balance**
-* **use_color_balance**
-
-bpy.types.DupliObject
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.DupliObject.index`
-* :class:`bpy.types.DupliObject.particle_index`
-
-bpy.types.RenderSettings
-------------------------
-
-Removed
-^^^^^^^
-
-* **use_color_management**
-* **use_radiosity**
-
-bpy.types.Curve
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Curve.bevel_factor_end`
-* :class:`bpy.types.Curve.bevel_factor_start`
-
-bpy.types.MovieClip
--------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MovieClip.colorspace_settings`
-* :class:`bpy.types.MovieClip.frame_duration`
-* :class:`bpy.types.MovieClip.frame_offset`
-* :class:`bpy.types.MovieClip.frame_start`
-
-bpy.types.CompositorNodeTree
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeTree.chunk_size`
-* :class:`bpy.types.CompositorNodeTree.edit_quality`
-* :class:`bpy.types.CompositorNodeTree.render_quality`
-* :class:`bpy.types.CompositorNodeTree.two_pass`
-* :class:`bpy.types.CompositorNodeTree.use_opencl`
-
-bpy.types.SpaceUVEditor
------------------------
-
-Removed
-^^^^^^^
-
-* **cursor_location**
-* **pivot_point**
-
-bpy.types.RemeshModifier
-------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.RemeshModifier.use_smooth_shade`
-
-bpy.types.CurveMapping
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CurveMapping.update`
-
-bpy.types.CompositorNodeMixRGB
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeMixRGB.use_clamp`
-
-bpy.types.ParticleSettings
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ParticleSettings.use_scale_dupli`
-
-bpy.types.SceneGameData
------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SceneGameData.deactivation_angular_threshold`
-* :class:`bpy.types.SceneGameData.deactivation_linear_threshold`
-* :class:`bpy.types.SceneGameData.deactivation_time`
-
-bpy.types.SoundSequence
------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SoundSequence.show_waveform`
-
-bpy.types.Scene
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Scene.display_settings`
-* :class:`bpy.types.Scene.sequence_editor_clear`
-* :class:`bpy.types.Scene.sequence_editor_create`
-* :class:`bpy.types.Scene.sequencer_colorspace_settings`
-* :class:`bpy.types.Scene.view_settings`
-
-Removed
-^^^^^^^
-
-* **collada_export**
-
-bpy.types.Armature
-------------------
-
-Removed
-^^^^^^^
-
-* **use_deform_envelopes**
-* **use_deform_preserve_volume**
-* **use_deform_vertex_groups**
-
-bpy.types.MeshUVLoopLayer
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MeshUVLoopLayer.name`
-
-bpy.types.CurveMap
-------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CurveMap.evaluate`
-
-bpy.types.ShaderNodeTexEnvironment
-----------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ShaderNodeTexEnvironment.image_user`
-
-bpy.types.SolidifyModifier
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SolidifyModifier.use_flip_normals`
-
-bpy.types.TextureNodeMath
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.TextureNodeMath.use_clamp`
-
-bpy.types.SceneRenderLayer
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SceneRenderLayer.layers_exclude`
-* :class:`bpy.types.SceneRenderLayer.samples`
-
-bpy.types.CompositorNodeViewer
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeViewer.center_x`
-* :class:`bpy.types.CompositorNodeViewer.center_y`
-* :class:`bpy.types.CompositorNodeViewer.tile_order`
-
-bpy.types.ClothCollisionSettings
---------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ClothCollisionSettings.vertex_group_self_collisions`
-
-bpy.types.SpeedControlSequence
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpeedControlSequence.input_1`
-* :class:`bpy.types.SpeedControlSequence.input_count`
-
-bpy.types.ActionConstraint
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ActionConstraint.use_bone_object_action`
-
-bpy.types.CompositorNodeScale
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeScale.frame_method`
-* :class:`bpy.types.CompositorNodeScale.offset_x`
-* :class:`bpy.types.CompositorNodeScale.offset_y`
-
-bpy.types.SpaceDopeSheetEditor
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpaceDopeSheetEditor.show_group_colors`
-
-bpy.types.MetaSequence
-----------------------
-
-Removed
-^^^^^^^
-
-* **color_balance**
-* **use_color_balance**
-
-bpy.types.ShaderNodeMixRGB
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ShaderNodeMixRGB.use_clamp`
-
-bpy.types.FollowTrackConstraint
--------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.FollowTrackConstraint.frame_method`
-
-bpy.types.EffectSequence
-------------------------
-
-Removed
-^^^^^^^
-
-* **color_balance**
-* **use_color_balance**
-
-bpy.types.ThemeNLAEditor
-------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeNLAEditor.active_action`
-* :class:`bpy.types.ThemeNLAEditor.active_action_unset`
-* :class:`bpy.types.ThemeNLAEditor.meta_strips`
-* :class:`bpy.types.ThemeNLAEditor.meta_strips_selected`
-* :class:`bpy.types.ThemeNLAEditor.sound_strips`
-* :class:`bpy.types.ThemeNLAEditor.sound_strips_selected`
-* :class:`bpy.types.ThemeNLAEditor.transition_strips`
-* :class:`bpy.types.ThemeNLAEditor.transition_strips_selected`
-* :class:`bpy.types.ThemeNLAEditor.tweak`
-* :class:`bpy.types.ThemeNLAEditor.tweak_duplicate`
-
-Removed
-^^^^^^^
-
-* **bars**
-* **bars_selected**
-
-bpy.types.SculptCapabilities
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SculptCapabilities.has_overlay`
-* :class:`bpy.types.SculptCapabilities.has_texture_angle`
-* :class:`bpy.types.SculptCapabilities.has_texture_angle_source`
-
-bpy.types.ImageFormatSettings
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ImageFormatSettings.display_settings`
-* :class:`bpy.types.ImageFormatSettings.view_settings`
-
-
-bpy.types.Property
-------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Property.is_library_editable`
-
-bpy.types.MovieTrackingTrack
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MovieTrackingTrack.grease_pencil`
-* :class:`bpy.types.MovieTrackingTrack.motion_model`
-* :class:`bpy.types.MovieTrackingTrack.use_alpha_preview`
-* :class:`bpy.types.MovieTrackingTrack.use_brute`
-* :class:`bpy.types.MovieTrackingTrack.use_mask`
-* :class:`bpy.types.MovieTrackingTrack.use_normalization`
-
-Removed
-^^^^^^^
-
-* **pattern_max**
-* **pattern_min**
-* **pyramid_levels**
-* **search_max**
-* **search_min**
-* **tracker**
-
-bpy.types.CompositorNodeBlur
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeBlur.use_variable_size`
-
-bpy.types.Object
-----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Object.dm_info`
-* :class:`bpy.types.Object.is_deform_modified`
-* :class:`bpy.types.Object.layers_local_view`
-
-Renamed
-^^^^^^^
-
-* **animation_visualisation** -> :class:`bpy.types.Object.animation_visualization`
-
-bpy.types.UserPreferencesSystem
--------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UserPreferencesSystem.use_gpu_mipmap`
-
-Removed
-^^^^^^^
-
-* **compute_device**
-* **compute_device_type**
-
-bpy.types.Sequence
-------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Sequence.modifiers`
-* :class:`bpy.types.Sequence.use_linear_modifiers`
-
-Removed
-^^^^^^^
-
-* **input_1**
-* **input_2**
-* **input_3**
-* **input_count**
-* **waveform**
-
-bpy.types.ConsoleLine
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ConsoleLine.type`
-
-bpy.types.Region
-----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Region.view2d`
-* :class:`bpy.types.Region.x`
-* :class:`bpy.types.Region.y`
-
-bpy.types.SpaceClipEditor
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpaceClipEditor.grease_pencil_source`
-* :class:`bpy.types.SpaceClipEditor.mask`
-* :class:`bpy.types.SpaceClipEditor.mask_draw_type`
-* :class:`bpy.types.SpaceClipEditor.pivot_point`
-* :class:`bpy.types.SpaceClipEditor.show_graph_hidden`
-* :class:`bpy.types.SpaceClipEditor.show_graph_only_selected`
-* :class:`bpy.types.SpaceClipEditor.show_mask_smooth`
-* :class:`bpy.types.SpaceClipEditor.show_seconds`
-
-bpy.types.NodeSocket
---------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.NodeSocket.hide`
-* :class:`bpy.types.NodeSocket.is_linked`
-
-bpy.types.MovieClipSequence
----------------------------
-
-Removed
-^^^^^^^
-
-* **color_balance**
-* **use_color_balance**
-
-bpy.types.Node
---------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Node.color`
-* :class:`bpy.types.Node.hide`
-* :class:`bpy.types.Node.mute`
-* :class:`bpy.types.Node.select`
-* :class:`bpy.types.Node.show_options`
-* :class:`bpy.types.Node.show_preview`
-* :class:`bpy.types.Node.use_custom_color`
-
-bpy.types.SceneSequence
------------------------
-
-Removed
-^^^^^^^
-
-* **color_balance**
-* **use_color_balance**
-
-bpy.types.CompositorNodeOutputFile
-----------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeOutputFile.file_slots`
-* :class:`bpy.types.CompositorNodeOutputFile.layer_slots`
-
-Removed
-^^^^^^^
-
-* **active_input**
-
-bpy.types.ObjectBase
---------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ObjectBase.layers_local_view`
-
-bpy.types.CyclesCameraSettings
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CyclesCameraSettings.fisheye_fov`
-* :class:`bpy.types.CyclesCameraSettings.fisheye_lens`
-* :class:`bpy.types.CyclesCameraSettings.panorama_type`
-
-bpy.types.CompositorNodeDefocus
--------------------------------
-
-Removed
-^^^^^^^
-
-* **samples**
-
-bpy.types.KeyMapItems
----------------------
-
-Function Arguments
-^^^^^^^^^^^^^^^^^^
-
-* :class:`bpy.types.KeyMapItems.new` (idname, type, value, any, shift, ctrl, alt, oskey, key_modifier, head), *was (idname, type, value, any, shift, ctrl, alt, oskey, key_modifier)*
-
-bpy.types.CollisionSettings
----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CollisionSettings.stickiness`
-
-Removed
-^^^^^^^
-
-* **stickness**
-
-bpy.types.GlowSequence
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.GlowSequence.input_1`
-* :class:`bpy.types.GlowSequence.input_count`
-
-bpy.types.MouseSensor
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MouseSensor.use_pulse`
-
-bpy.types.MovieSequence
------------------------
-
-Removed
-^^^^^^^
-
-* **color_balance**
-* **use_color_balance**
-
-bpy.types.Pose
---------------
-
-Renamed
-^^^^^^^
-
-* **animation_visualisation** -> :class:`bpy.types.Pose.animation_visualization`
-
-bpy.types.ThemeSequenceEditor
------------------------------
-
-Removed
-^^^^^^^
-
-* **plugin_strip**
-
-bpy.types.IMAGE_UV_sculpt
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.IMAGE_UV_sculpt.prop_unified_weight`
-
-bpy.types.SpaceImageEditor
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpaceImageEditor.cursor_location`
-* :class:`bpy.types.SpaceImageEditor.mask`
-* :class:`bpy.types.SpaceImageEditor.mask_draw_type`
-* :class:`bpy.types.SpaceImageEditor.mode`
-* :class:`bpy.types.SpaceImageEditor.pivot_point`
-* :class:`bpy.types.SpaceImageEditor.show_mask_smooth`
-* :class:`bpy.types.SpaceImageEditor.show_maskedit`
-
-Removed
-^^^^^^^
-
-* **curve**
-* **use_grease_pencil**
-* **use_image_paint**
-
-bpy.types.UserPreferencesFilePaths
-----------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UserPreferencesFilePaths.i18n_branches_directory`
-
-Removed
-^^^^^^^
-
-* **sequence_plugin_directory**
-* **texture_plugin_directory**
-
-bpy.types.CompositorNodeDilateErode
------------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeDilateErode.edge`
-* :class:`bpy.types.CompositorNodeDilateErode.falloff`
-* :class:`bpy.types.CompositorNodeDilateErode.type`
-
-bpy.types.ScrewModifier
------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ScrewModifier.use_smooth_shade`
-
-bpy.types.SpaceNodeEditor
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpaceNodeEditor.cursor_location`
-* :class:`bpy.types.SpaceNodeEditor.edit_tree`
-* :class:`bpy.types.SpaceNodeEditor.show_highlight`
-* :class:`bpy.types.SpaceNodeEditor.use_hidden_preview`
-
-bpy.types.SpaceView3D
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpaceView3D.layers_local_view`
-* :class:`bpy.types.SpaceView3D.show_backface_culling`
-
-bpy.types.Area
---------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Area.x`
-* :class:`bpy.types.Area.y`
-
-bpy.types.RenderLayer
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.RenderLayer.layers_exclude`
-
-bpy.types.MovieTracking
------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MovieTracking.dopesheet`
-
-bpy.types.MovieTrackingSettings
--------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MovieTrackingSettings.default_motion_model`
-* :class:`bpy.types.MovieTrackingSettings.use_default_brute`
-* :class:`bpy.types.MovieTrackingSettings.use_default_mask`
-* :class:`bpy.types.MovieTrackingSettings.use_default_normalization`
-* :class:`bpy.types.MovieTrackingSettings.use_tripod_solver`
-
-Removed
-^^^^^^^
-
-* **default_pyramid_levels**
-* **default_tracker**
-
-bpy.types.CompositorNodeIDMask
-------------------------------
-
-Renamed
-^^^^^^^
-
-* **use_smooth_mask** -> :class:`bpy.types.CompositorNodeIDMask.use_antialiasing`
-
-bpy.types.UserPreferencesInput
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UserPreferencesInput.ndof_orbit_sensitivity`
-* :class:`bpy.types.UserPreferencesInput.ndof_view_rotate_method`
-
-bpy.types.Brush
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Brush.mask_tool`
-* :class:`bpy.types.Brush.weight`
-
-bpy.types.SpaceSequenceEditor
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpaceSequenceEditor.overlay_type`
-
-Removed
-^^^^^^^
-
-* **use_grease_pencil**
-
-bpy.types.MovieTrackingMarkers
-------------------------------
-
-Function Arguments
-^^^^^^^^^^^^^^^^^^
-
-* :class:`bpy.types.MovieTrackingMarkers.find_frame` (frame, exact), *was (frame)*
-
-bpy.types.UILayout
-------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UILayout.template_colormanaged_view_settings`
-* :class:`bpy.types.UILayout.template_colorspace_settings`
-
-Function Arguments
-^^^^^^^^^^^^^^^^^^
-
-* :class:`bpy.types.UILayout.template_image_settings` (image_settings, color_management), *was (image_settings)*
-
-bpy.types.ID
-------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ID.is_library_indirect`
-
-bpy.types.SpaceGraphEditor
---------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.SpaceGraphEditor.show_group_colors`
-
-bpy.types.Mesh
---------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Mesh.skin_vertices`
-
-Removed
-^^^^^^^
-
-* **sticky**
-
-bpy.types.ShaderNodes
----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ShaderNodes.active`
-
-bpy.types.ColorSequence
------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ColorSequence.input_count`
-
-bpy.types.ShaderNodeMath
-------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ShaderNodeMath.use_clamp`
-
-bpy.types.Paint
----------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Paint.input_samples`
-
-bpy.types.ShaderNodeTexImage
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ShaderNodeTexImage.image_user`
-* :class:`bpy.types.ShaderNodeTexImage.projection`
-* :class:`bpy.types.ShaderNodeTexImage.projection_blend`
-
-bpy.types.UserPreferencesView
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UserPreferencesView.use_mouse_depth_cursor`
-
-Renamed
-^^^^^^^
-
-* **use_mouse_auto_depth** -> :class:`bpy.types.UserPreferencesView.use_mouse_depth_navigate`
-
-bpy.types.CompositorNodeMath
-----------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CompositorNodeMath.use_clamp`
-
-bpy.types.Material
-------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.Material.use_uv_project`
-
-bpy.types.ThemeNodeEditor
--------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.ThemeNodeEditor.frame_node`
-* :class:`bpy.types.ThemeNodeEditor.node_active`
-* :class:`bpy.types.ThemeNodeEditor.node_selected`
-
-bpy.types.Camera
-----------------
-
-Removed
-^^^^^^^
-
-* **use_panorama**
-
-bpy.types.UnifiedPaintSettings
-------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.UnifiedPaintSettings.use_unified_weight`
-* :class:`bpy.types.UnifiedPaintSettings.weight`
-
-bpy.types.TextureNodes
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.TextureNodes.active`
-
-bpy.types.MovieTrackingMarker
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.MovieTrackingMarker.pattern_bound_box`
-* :class:`bpy.types.MovieTrackingMarker.pattern_corners`
-* :class:`bpy.types.MovieTrackingMarker.search_max`
-* :class:`bpy.types.MovieTrackingMarker.search_min`
-
-bpy.types.CyclesWorldSettings
------------------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.CyclesWorldSettings.samples`
-
-bpy.types.LatticePoint
-----------------------
-
-Added
-^^^^^
-
-* :class:`bpy.types.LatticePoint.select`
diff --git a/doc/python_api/sphinx_changelog_gen.py b/doc/python_api/sphinx_changelog_gen.py
index afc253940d4..3ded1035123 100644
--- a/doc/python_api/sphinx_changelog_gen.py
+++ b/doc/python_api/sphinx_changelog_gen.py
@@ -28,15 +28,15 @@ blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
# create changelog
blender --background --python doc/python_api/sphinx_changelog_gen.py -- \
- --api_from blender_2_63_0.py \
- --api_to blender_2_64_0.py \
+ --api_from blender_2_56_1.py \
+ --api_to blender_2_57_0.py \
--api_out changes.rst
# Api comparison can also run without blender
-python doc/python_api/sphinx_changelog_gen.py -- \
- --api_from blender_api_2_63_0.py \
- --api_to blender_api_2_64_0.py \
+python doc/python_api/sphinx_changelog_gen.py \
+ --api_from blender_api_2_56_6.py \
+ --api_to blender_api_2_57.py \
--api_out changes.rst
# Save the latest API dump in this folder, renaming it with its revision.
@@ -307,8 +307,6 @@ def api_changelog(api_from, api_to, api_out):
fout.close()
- print("Written: %r" % api_out)
-
def main():
import sys
@@ -349,7 +347,6 @@ def main():
args = parser.parse_args(argv) # In this example we wont use the args
if not argv:
- print("No args given!")
parser.print_help()
return
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 0e6ef764116..186f67b0df6 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -399,7 +399,7 @@ SPHINX_THEMES = {'bf': ['blender-org'], # , 'naiad',
available_themes = SPHINX_THEMES['bf'] + SPHINX_THEMES['sphinx']
if ARGS.sphinx_theme not in available_themes:
- print("Please choose a theme among: %s" % ', '.join(available_themes))
+ print ("Please choose a theme among: %s" % ', '.join(available_themes))
sys.exit()
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 4f4b0371839..8d39b09ab0e 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -955,7 +955,7 @@ def draw_device(self, context):
elif device_type == 'OPENCL' and cscene.feature_set == 'EXPERIMENTAL':
layout.prop(cscene, "device")
- if engine.with_osl() and (cscene.device == 'CPU' or device_type == 'None'):
+ if cscene.feature_set == 'EXPERIMENTAL' and cscene.device == 'CPU' and engine.with_osl():
layout.prop(cscene, "shading_system")
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 27301026d35..8fbb223cbc5 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -194,10 +194,8 @@ void BlenderSync::sync_background_light()
/* Object */
-void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::DupliObject b_dupli_ob, Transform& tfm, uint layer_flag, int motion, int particle_id)
+void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm, uint layer_flag, int motion, int particle_id)
{
- BL::Object b_ob = (b_dupli_ob ? b_dupli_ob.object() : b_parent);
-
/* light is handled separately */
if(object_is_light(b_ob)) {
if(!motion)
@@ -276,15 +274,6 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::DupliObject
object->visibility &= ~PATH_RAY_CAMERA;
}
- if (b_dupli_ob) {
- object->dupli_generated = get_float3(b_dupli_ob.orco());
- object->dupli_uv = get_float2(b_dupli_ob.uv());
- }
- else {
- object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
- object->dupli_uv = make_float2(0.0f, 0.0f);
- }
-
object->particle_id = particle_id;
object->tag_update(scene);
@@ -339,7 +328,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
bool dup_hide = (b_v3d)? b_dup_ob.hide(): b_dup_ob.hide_render();
if(!(b_dup->hide() || dup_hide)) {
- sync_object(*b_ob, b_index, *b_dup, tfm, ob_layer, motion, b_dup->particle_index() + particle_offset);
+ sync_object(*b_ob, b_index, b_dup_ob, tfm, ob_layer, motion, b_dup->particle_index() + particle_offset);
}
++b_index;
@@ -357,7 +346,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
if(!hide) {
/* object itself */
Transform tfm = get_transform(b_ob->matrix_world());
- sync_object(*b_ob, 0, PointerRNA_NULL, tfm, ob_layer, motion, 0);
+ sync_object(*b_ob, 0, *b_ob, tfm, ob_layer, motion, 0);
}
particle_offset += num_particles;
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index b6d5cc623bb..ebf8bb45420 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -490,10 +490,7 @@ static ShaderNode *add_node(BL::BlendData b_data, BL::Scene b_scene, ShaderGraph
break;
}
case BL::ShaderNode::type_TEX_COORD: {
- BL::ShaderNodeTexCoord b_tex_coord_node(b_node);
- TextureCoordinateNode *tex_coord = new TextureCoordinateNode();
- tex_coord->from_dupli = b_tex_coord_node.from_dupli();
- node = tex_coord;
+ node = new TextureCoordinateNode();
break;
}
case BL::ShaderNode::type_TEX_SKY: {
diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h
index ce563087b4a..27f6b6ee4ee 100644
--- a/intern/cycles/blender/blender_sync.h
+++ b/intern/cycles/blender/blender_sync.h
@@ -81,7 +81,7 @@ private:
void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
Mesh *sync_mesh(BL::Object b_ob, bool object_updated);
- void sync_object(BL::Object b_parent, int b_index, BL::DupliObject b_dupli_object, Transform& tfm, uint layer_flag, int motion, int particle_id);
+ void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint layer_flag, int motion, int particle_id);
void sync_light(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm);
void sync_background_light();
void sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion);
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index da8f30ea169..46fbead9bc1 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -36,7 +36,7 @@ struct RenderResult;
ID *rna_Object_to_mesh(void *_self, void *reports, void *scene, int apply_modifiers, int settings);
void rna_Main_meshes_remove(void *bmain, void *reports, void *mesh);
-void rna_Object_create_duplilist(void *ob, void *reports, void *sce, int settings);
+void rna_Object_create_duplilist(void *ob, void *reports, void *sce);
void rna_Object_free_duplilist(void *ob);
void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values);
void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values);
@@ -84,7 +84,7 @@ static inline void object_remove_mesh(BL::BlendData data, BL::Mesh mesh)
static inline void object_create_duplilist(BL::Object self, BL::Scene scene)
{
- rna_Object_create_duplilist(self.ptr.data, NULL, scene.ptr.data, 2);
+ rna_Object_create_duplilist(self.ptr.data, NULL, scene.ptr.data);
}
static inline void object_free_duplilist(BL::Object self)
diff --git a/intern/cycles/kernel/kernel_object.h b/intern/cycles/kernel/kernel_object.h
index 01da5050c8d..222ade504cc 100644
--- a/intern/cycles/kernel/kernel_object.h
+++ b/intern/cycles/kernel/kernel_object.h
@@ -23,8 +23,7 @@ enum ObjectTransform {
OBJECT_INVERSE_TRANSFORM = 3,
OBJECT_PROPERTIES = 6,
OBJECT_TRANSFORM_MOTION_PRE = 8,
- OBJECT_TRANSFORM_MOTION_POST = 12,
- OBJECT_DUPLI = 16
+ OBJECT_TRANSFORM_MOTION_POST = 12
};
__device_inline Transform object_fetch_transform(KernelGlobals *kg, int object, float time, enum ObjectTransform type)
@@ -165,27 +164,6 @@ __device_inline uint object_particle_id(KernelGlobals *kg, int object)
return __float_as_int(f.w);
}
-__device_inline float3 object_dupli_generated(KernelGlobals *kg, int object)
-{
- if(object == ~0)
- return make_float3(0.0f, 0.0f, 0.0f);
-
- int offset = object*OBJECT_SIZE + OBJECT_DUPLI;
- float4 f = kernel_tex_fetch(__objects, offset);
- return make_float3(f.x, f.y, f.z);
-}
-
-__device_inline float3 object_dupli_uv(KernelGlobals *kg, int object)
-{
- if(object == ~0)
- return make_float3(0.0f, 0.0f, 0.0f);
-
- int offset = object*OBJECT_SIZE + OBJECT_DUPLI;
- float4 f = kernel_tex_fetch(__objects, offset + 1);
- return make_float3(f.x, f.y, 0.0f);
-}
-
-
__device int shader_pass_id(KernelGlobals *kg, ShaderData *sd)
{
return kernel_tex_fetch(__shader_flag, (sd->shader & SHADER_MASK)*2 + 1);
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 48e271a9f3f..ce21ab994f0 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -29,7 +29,7 @@
CCL_NAMESPACE_BEGIN
/* constants */
-#define OBJECT_SIZE 18
+#define OBJECT_SIZE 16
#define LIGHT_SIZE 4
#define FILTER_TABLE_SIZE 256
#define RAMP_TABLE_SIZE 256
diff --git a/intern/cycles/kernel/osl/background.cpp b/intern/cycles/kernel/osl/background.cpp
index 6290eed0af8..81812a46b6c 100644
--- a/intern/cycles/kernel/osl/background.cpp
+++ b/intern/cycles/kernel/osl/background.cpp
@@ -85,25 +85,16 @@ public:
}
};
-
-ClosureParam *closure_background_params()
-{
- static ClosureParam params[] = {
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(GenericBackgroundClosure)
- };
- return params;
-}
+ClosureParam closure_background_params[] = {
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(GenericBackgroundClosure)
+};
CLOSURE_PREPARE(closure_background_prepare, GenericBackgroundClosure)
-ClosureParam *closure_holdout_params()
-{
- static ClosureParam params[] = {
- CLOSURE_FINISH_PARAM(HoldoutClosure)
- };
- return params;
-}
+ClosureParam closure_holdout_params[] = {
+ CLOSURE_FINISH_PARAM(HoldoutClosure)
+};
CLOSURE_PREPARE(closure_holdout_prepare, HoldoutClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp b/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp
index a1904d7f5d7..2c545ca55e7 100644
--- a/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp
+++ b/intern/cycles/kernel/osl/bsdf_ashikhmin_velvet.cpp
@@ -173,16 +173,12 @@ public:
-ClosureParam *bsdf_ashikhmin_velvet_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(AshikhminVelvetClosure, m_N),
- CLOSURE_FLOAT_PARAM(AshikhminVelvetClosure, m_sigma),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(AshikhminVelvetClosure)
- };
- return params;
-}
+ClosureParam bsdf_ashikhmin_velvet_params[] = {
+ CLOSURE_VECTOR_PARAM(AshikhminVelvetClosure, m_N),
+ CLOSURE_FLOAT_PARAM(AshikhminVelvetClosure, m_sigma),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(AshikhminVelvetClosure)
+};
CLOSURE_PREPARE(bsdf_ashikhmin_velvet_prepare, AshikhminVelvetClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_diffuse.cpp b/intern/cycles/kernel/osl/bsdf_diffuse.cpp
index 1e06d3b583f..582ac01d959 100644
--- a/intern/cycles/kernel/osl/bsdf_diffuse.cpp
+++ b/intern/cycles/kernel/osl/bsdf_diffuse.cpp
@@ -168,25 +168,17 @@ public:
}
};
-ClosureParam *bsdf_diffuse_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(DiffuseClosure, m_N),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(DiffuseClosure)
- };
- return params;
-}
-
-ClosureParam *bsdf_translucent_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(TranslucentClosure, m_N),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(TranslucentClosure)
- };
- return params;
-}
+ClosureParam bsdf_diffuse_params[] = {
+ CLOSURE_VECTOR_PARAM(DiffuseClosure, m_N),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(DiffuseClosure)
+};
+
+ClosureParam bsdf_translucent_params[] = {
+ CLOSURE_VECTOR_PARAM(TranslucentClosure, m_N),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(TranslucentClosure)
+};
CLOSURE_PREPARE(bsdf_diffuse_prepare, DiffuseClosure)
CLOSURE_PREPARE(bsdf_translucent_prepare, TranslucentClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_microfacet.cpp b/intern/cycles/kernel/osl/bsdf_microfacet.cpp
index 8446dbbe982..09730d8c3e1 100644
--- a/intern/cycles/kernel/osl/bsdf_microfacet.cpp
+++ b/intern/cycles/kernel/osl/bsdf_microfacet.cpp
@@ -503,51 +503,35 @@ public:
-ClosureParam *bsdf_microfacet_ggx_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<0>, m_N),
- CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<0>, m_ag),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<0>)
- };
- return params;
-}
-
-ClosureParam *bsdf_microfacet_ggx_refraction_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<1>, m_N),
- CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_ag),
- CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_eta),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<1>)
- };
- return params;
-}
-
-ClosureParam *bsdf_microfacet_beckmann_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<0>, m_N),
- CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<0>, m_ab),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<0>)
- };
- return params;
-}
-
-ClosureParam *bsdf_microfacet_beckmann_refraction_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<1>, m_N),
- CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_ab),
- CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_eta),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<1>)
- };
- return params;
-}
+ClosureParam bsdf_microfacet_ggx_params[] = {
+ CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<0>, m_N),
+ CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<0>, m_ag),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<0>)
+};
+
+ClosureParam bsdf_microfacet_ggx_refraction_params[] = {
+ CLOSURE_VECTOR_PARAM(MicrofacetGGXClosure<1>, m_N),
+ CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_ag),
+ CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure<1>, m_eta),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(MicrofacetGGXClosure<1>)
+};
+
+ClosureParam bsdf_microfacet_beckmann_params[] = {
+ CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<0>, m_N),
+ CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<0>, m_ab),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<0>)
+};
+
+ClosureParam bsdf_microfacet_beckmann_refraction_params[] = {
+ CLOSURE_VECTOR_PARAM(MicrofacetBeckmannClosure<1>, m_N),
+ CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_ab),
+ CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure<1>, m_eta),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(MicrofacetBeckmannClosure<1>)
+};
CLOSURE_PREPARE(bsdf_microfacet_ggx_prepare, MicrofacetGGXClosure<0>)
CLOSURE_PREPARE(bsdf_microfacet_ggx_refraction_prepare, MicrofacetGGXClosure<1>)
diff --git a/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp b/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp
index 2a00100c256..83d0e583695 100644
--- a/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp
+++ b/intern/cycles/kernel/osl/bsdf_oren_nayar.cpp
@@ -125,16 +125,12 @@ private:
}
};
-ClosureParam *bsdf_oren_nayar_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(OrenNayarClosure, m_N),
- CLOSURE_FLOAT_PARAM(OrenNayarClosure, m_sigma),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(OrenNayarClosure)
- };
- return params;
-}
+ClosureParam bsdf_oren_nayar_params[] = {
+ CLOSURE_VECTOR_PARAM(OrenNayarClosure, m_N),
+ CLOSURE_FLOAT_PARAM(OrenNayarClosure, m_sigma),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(OrenNayarClosure)
+};
CLOSURE_PREPARE(bsdf_oren_nayar_prepare, OrenNayarClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_phong.cpp b/intern/cycles/kernel/osl/bsdf_phong.cpp
index 1f430cc6f5d..57745079d33 100644
--- a/intern/cycles/kernel/osl/bsdf_phong.cpp
+++ b/intern/cycles/kernel/osl/bsdf_phong.cpp
@@ -258,28 +258,18 @@ public:
-ClosureParam *bsdf_phong_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(PhongClosure, m_N),
- CLOSURE_FLOAT_PARAM (PhongClosure, m_exponent),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(PhongClosure)
- };
- return params;
-}
-
-ClosureParam *bsdf_phong_ramp_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM (PhongRampClosure, m_N),
- CLOSURE_FLOAT_PARAM (PhongRampClosure, m_exponent),
- CLOSURE_COLOR_ARRAY_PARAM(PhongRampClosure, m_colors, PhongRampClosure::MAXCOLORS),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM (PhongRampClosure)
- };
- return params;
-}
+ClosureParam bsdf_phong_params[] = {
+ CLOSURE_VECTOR_PARAM(PhongClosure, m_N),
+ CLOSURE_FLOAT_PARAM (PhongClosure, m_exponent),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(PhongClosure) };
+
+ClosureParam bsdf_phong_ramp_params[] = {
+ CLOSURE_VECTOR_PARAM (PhongRampClosure, m_N),
+ CLOSURE_FLOAT_PARAM (PhongRampClosure, m_exponent),
+ CLOSURE_COLOR_ARRAY_PARAM(PhongRampClosure, m_colors, PhongRampClosure::MAXCOLORS),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM (PhongRampClosure) };
CLOSURE_PREPARE(bsdf_phong_prepare, PhongClosure)
CLOSURE_PREPARE(bsdf_phong_ramp_prepare, PhongRampClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_reflection.cpp b/intern/cycles/kernel/osl/bsdf_reflection.cpp
index 1b85ec146d3..7041b4ced6f 100644
--- a/intern/cycles/kernel/osl/bsdf_reflection.cpp
+++ b/intern/cycles/kernel/osl/bsdf_reflection.cpp
@@ -97,15 +97,11 @@ public:
}
};
-ClosureParam *bsdf_reflection_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(ReflectionClosure, m_N),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(ReflectionClosure)
- };
- return params;
-}
+ClosureParam bsdf_reflection_params[] = {
+ CLOSURE_VECTOR_PARAM(ReflectionClosure, m_N),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(ReflectionClosure)
+};
CLOSURE_PREPARE(bsdf_reflection_prepare, ReflectionClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_refraction.cpp b/intern/cycles/kernel/osl/bsdf_refraction.cpp
index 76ee53f7929..f56ad7b127c 100644
--- a/intern/cycles/kernel/osl/bsdf_refraction.cpp
+++ b/intern/cycles/kernel/osl/bsdf_refraction.cpp
@@ -108,16 +108,12 @@ public:
}
};
-ClosureParam *bsdf_refraction_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(RefractionClosure, m_N),
- CLOSURE_FLOAT_PARAM(RefractionClosure, m_eta),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(RefractionClosure)
- };
- return params;
-}
+ClosureParam bsdf_refraction_params[] = {
+ CLOSURE_VECTOR_PARAM(RefractionClosure, m_N),
+ CLOSURE_FLOAT_PARAM(RefractionClosure, m_eta),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(RefractionClosure)
+};
CLOSURE_PREPARE(bsdf_refraction_prepare, RefractionClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_transparent.cpp b/intern/cycles/kernel/osl/bsdf_transparent.cpp
index 29cef8e192f..acde92530a2 100644
--- a/intern/cycles/kernel/osl/bsdf_transparent.cpp
+++ b/intern/cycles/kernel/osl/bsdf_transparent.cpp
@@ -87,14 +87,10 @@ public:
-ClosureParam *bsdf_transparent_params()
-{
- static ClosureParam params[] = {
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(TransparentClosure)
- };
- return params;
-}
+ClosureParam bsdf_transparent_params[] = {
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(TransparentClosure)
+};
CLOSURE_PREPARE(bsdf_transparent_prepare, TransparentClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_ward.cpp b/intern/cycles/kernel/osl/bsdf_ward.cpp
index 9d8d2fc4b76..4aacbc4ffc3 100644
--- a/intern/cycles/kernel/osl/bsdf_ward.cpp
+++ b/intern/cycles/kernel/osl/bsdf_ward.cpp
@@ -211,18 +211,14 @@ public:
-ClosureParam *bsdf_ward_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(WardClosure, m_N),
- CLOSURE_VECTOR_PARAM(WardClosure, m_T),
- CLOSURE_FLOAT_PARAM(WardClosure, m_ax),
- CLOSURE_FLOAT_PARAM(WardClosure, m_ay),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(WardClosure)
- };
- return params;
-}
+ClosureParam bsdf_ward_params[] = {
+ CLOSURE_VECTOR_PARAM(WardClosure, m_N),
+ CLOSURE_VECTOR_PARAM(WardClosure, m_T),
+ CLOSURE_FLOAT_PARAM(WardClosure, m_ax),
+ CLOSURE_FLOAT_PARAM(WardClosure, m_ay),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(WardClosure)
+};
CLOSURE_PREPARE(bsdf_ward_prepare, WardClosure)
diff --git a/intern/cycles/kernel/osl/bsdf_westin.cpp b/intern/cycles/kernel/osl/bsdf_westin.cpp
index 6716376ad3e..a476e8045f7 100644
--- a/intern/cycles/kernel/osl/bsdf_westin.cpp
+++ b/intern/cycles/kernel/osl/bsdf_westin.cpp
@@ -222,27 +222,19 @@ public:
-ClosureParam *bsdf_westin_backscatter_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(WestinBackscatterClosure, m_N),
- CLOSURE_FLOAT_PARAM(WestinBackscatterClosure, m_roughness),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(WestinBackscatterClosure)
- };
- return params;
-}
-
-ClosureParam *bsdf_westin_sheen_params()
-{
- static ClosureParam params[] = {
- CLOSURE_VECTOR_PARAM(WestinSheenClosure, m_N),
- CLOSURE_FLOAT_PARAM(WestinSheenClosure, m_edginess),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(WestinSheenClosure)
- };
- return params;
-}
+ClosureParam bsdf_westin_backscatter_params[] = {
+ CLOSURE_VECTOR_PARAM(WestinBackscatterClosure, m_N),
+ CLOSURE_FLOAT_PARAM(WestinBackscatterClosure, m_roughness),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(WestinBackscatterClosure)
+};
+
+ClosureParam bsdf_westin_sheen_params[] = {
+ CLOSURE_VECTOR_PARAM(WestinSheenClosure, m_N),
+ CLOSURE_FLOAT_PARAM(WestinSheenClosure, m_edginess),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(WestinSheenClosure)
+};
CLOSURE_PREPARE(bsdf_westin_backscatter_prepare, WestinBackscatterClosure)
CLOSURE_PREPARE(bsdf_westin_sheen_prepare, WestinSheenClosure)
diff --git a/intern/cycles/kernel/osl/bssrdf.cpp b/intern/cycles/kernel/osl/bssrdf.cpp
index 889e8a54796..b195cf513cd 100644
--- a/intern/cycles/kernel/osl/bssrdf.cpp
+++ b/intern/cycles/kernel/osl/bssrdf.cpp
@@ -94,15 +94,11 @@ public:
-ClosureParam *closure_bssrdf_cubic_params()
-{
- static ClosureParam params[] = {
- CLOSURE_COLOR_PARAM(BSSRDFCubicClosure, m_radius),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(BSSRDFCubicClosure)
- };
- return params;
-}
+ClosureParam closure_bssrdf_cubic_params[] = {
+ CLOSURE_COLOR_PARAM(BSSRDFCubicClosure, m_radius),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(BSSRDFCubicClosure)
+};
CLOSURE_PREPARE(closure_bssrdf_cubic_prepare, BSSRDFCubicClosure)
diff --git a/intern/cycles/kernel/osl/debug.cpp b/intern/cycles/kernel/osl/debug.cpp
index ee5fb30371a..768a9100e8a 100644
--- a/intern/cycles/kernel/osl/debug.cpp
+++ b/intern/cycles/kernel/osl/debug.cpp
@@ -69,15 +69,11 @@ public:
};
-ClosureParam *closure_debug_params()
-{
- static ClosureParam params[] = {
- CLOSURE_STRING_PARAM(DebugClosure, m_tag),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(DebugClosure)
- };
- return params;
-}
+ClosureParam closure_debug_params[] = {
+ CLOSURE_STRING_PARAM(DebugClosure, m_tag),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(DebugClosure)
+};
CLOSURE_PREPARE(closure_debug_prepare, DebugClosure)
diff --git a/intern/cycles/kernel/osl/emissive.cpp b/intern/cycles/kernel/osl/emissive.cpp
index 3ee57cbe6b6..0a582c3f558 100644
--- a/intern/cycles/kernel/osl/emissive.cpp
+++ b/intern/cycles/kernel/osl/emissive.cpp
@@ -97,14 +97,10 @@ public:
-ClosureParam *closure_emission_params()
-{
- static ClosureParam params[] = {
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(GenericEmissiveClosure)
- };
- return params;
-}
+ClosureParam closure_emission_params[] = {
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(GenericEmissiveClosure)
+};
CLOSURE_PREPARE(closure_emission_prepare, GenericEmissiveClosure)
diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp
index 9e99d4d2480..a1a108a1b1d 100644
--- a/intern/cycles/kernel/osl/osl_closures.cpp
+++ b/intern/cycles/kernel/osl/osl_closures.cpp
@@ -64,28 +64,28 @@ static void register_closure(OSL::ShadingSystem *ss, const char *name, int id, O
void OSLShader::register_closures(OSL::ShadingSystem *ss)
{
- register_closure(ss, "diffuse", OSL_CLOSURE_BSDF_DIFFUSE_ID, bsdf_diffuse_params(), bsdf_diffuse_prepare);
- register_closure(ss, "oren_nayar", OSL_CLOSURE_BSDF_OREN_NAYAR_ID, bsdf_oren_nayar_params(), bsdf_oren_nayar_prepare);
- register_closure(ss, "translucent", OSL_CLOSURE_BSDF_TRANSLUCENT_ID, bsdf_translucent_params(), bsdf_translucent_prepare);
- register_closure(ss, "reflection", OSL_CLOSURE_BSDF_REFLECTION_ID, bsdf_reflection_params(), bsdf_reflection_prepare);
- register_closure(ss, "refraction", OSL_CLOSURE_BSDF_REFRACTION_ID, bsdf_refraction_params(), bsdf_refraction_prepare);
- register_closure(ss, "transparent", OSL_CLOSURE_BSDF_TRANSPARENT_ID, bsdf_transparent_params(), bsdf_transparent_prepare);
- register_closure(ss, "microfacet_ggx", OSL_CLOSURE_BSDF_MICROFACET_GGX_ID, bsdf_microfacet_ggx_params(), bsdf_microfacet_ggx_prepare);
- register_closure(ss, "microfacet_ggx_refraction", OSL_CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, bsdf_microfacet_ggx_refraction_params(), bsdf_microfacet_ggx_refraction_prepare);
- register_closure(ss, "microfacet_beckmann", OSL_CLOSURE_BSDF_MICROFACET_BECKMANN_ID, bsdf_microfacet_beckmann_params(), bsdf_microfacet_beckmann_prepare);
- register_closure(ss, "microfacet_beckmann_refraction", OSL_CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, bsdf_microfacet_beckmann_refraction_params(), bsdf_microfacet_beckmann_refraction_prepare);
- register_closure(ss, "ward", OSL_CLOSURE_BSDF_WARD_ID, bsdf_ward_params(), bsdf_ward_prepare);
- register_closure(ss, "phong", OSL_CLOSURE_BSDF_PHONG_ID, bsdf_phong_params(), bsdf_phong_prepare);
- register_closure(ss, "phong_ramp", OSL_CLOSURE_BSDF_PHONG_RAMP_ID, bsdf_phong_ramp_params(), bsdf_phong_ramp_prepare);
- register_closure(ss, "ashikhmin_velvet", OSL_CLOSURE_BSDF_ASHIKHMIN_VELVET_ID, bsdf_ashikhmin_velvet_params(), bsdf_ashikhmin_velvet_prepare);
- register_closure(ss, "westin_backscatter", OSL_CLOSURE_BSDF_WESTIN_BACKSCATTER_ID, bsdf_westin_backscatter_params(), bsdf_westin_backscatter_prepare);
- register_closure(ss, "westin_sheen", OSL_CLOSURE_BSDF_WESTIN_SHEEN_ID, bsdf_westin_sheen_params(), bsdf_westin_sheen_prepare);
- register_closure(ss, "bssrdf_cubic", OSL_CLOSURE_BSSRDF_CUBIC_ID, closure_bssrdf_cubic_params(), closure_bssrdf_cubic_prepare);
- register_closure(ss, "emission", OSL_CLOSURE_EMISSION_ID, closure_emission_params(), closure_emission_prepare);
- register_closure(ss, "debug", OSL_CLOSURE_DEBUG_ID, closure_debug_params(), closure_debug_prepare);
- register_closure(ss, "background", OSL_CLOSURE_BACKGROUND_ID, closure_background_params(), closure_background_prepare);
- register_closure(ss, "holdout", OSL_CLOSURE_HOLDOUT_ID, closure_holdout_params(), closure_holdout_prepare);
- register_closure(ss, "subsurface", OSL_CLOSURE_SUBSURFACE_ID, closure_subsurface_params(), closure_subsurface_prepare);
+ register_closure(ss, "diffuse", OSL_CLOSURE_BSDF_DIFFUSE_ID, bsdf_diffuse_params, bsdf_diffuse_prepare);
+ register_closure(ss, "oren_nayar", OSL_CLOSURE_BSDF_OREN_NAYAR_ID, bsdf_oren_nayar_params, bsdf_oren_nayar_prepare);
+ register_closure(ss, "translucent", OSL_CLOSURE_BSDF_TRANSLUCENT_ID, bsdf_translucent_params, bsdf_translucent_prepare);
+ register_closure(ss, "reflection", OSL_CLOSURE_BSDF_REFLECTION_ID, bsdf_reflection_params, bsdf_reflection_prepare);
+ register_closure(ss, "refraction", OSL_CLOSURE_BSDF_REFRACTION_ID, bsdf_refraction_params, bsdf_refraction_prepare);
+ register_closure(ss, "transparent", OSL_CLOSURE_BSDF_TRANSPARENT_ID, bsdf_transparent_params, bsdf_transparent_prepare);
+ register_closure(ss, "microfacet_ggx", OSL_CLOSURE_BSDF_MICROFACET_GGX_ID, bsdf_microfacet_ggx_params, bsdf_microfacet_ggx_prepare);
+ register_closure(ss, "microfacet_ggx_refraction", OSL_CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, bsdf_microfacet_ggx_refraction_params, bsdf_microfacet_ggx_refraction_prepare);
+ register_closure(ss, "microfacet_beckmann", OSL_CLOSURE_BSDF_MICROFACET_BECKMANN_ID, bsdf_microfacet_beckmann_params, bsdf_microfacet_beckmann_prepare);
+ register_closure(ss, "microfacet_beckmann_refraction", OSL_CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, bsdf_microfacet_beckmann_refraction_params, bsdf_microfacet_beckmann_refraction_prepare);
+ register_closure(ss, "ward", OSL_CLOSURE_BSDF_WARD_ID, bsdf_ward_params, bsdf_ward_prepare);
+ register_closure(ss, "phong", OSL_CLOSURE_BSDF_PHONG_ID, bsdf_phong_params, bsdf_phong_prepare);
+ register_closure(ss, "phong_ramp", OSL_CLOSURE_BSDF_PHONG_RAMP_ID, bsdf_phong_ramp_params, bsdf_phong_ramp_prepare);
+ register_closure(ss, "ashikhmin_velvet", OSL_CLOSURE_BSDF_ASHIKHMIN_VELVET_ID, bsdf_ashikhmin_velvet_params, bsdf_ashikhmin_velvet_prepare);
+ register_closure(ss, "westin_backscatter", OSL_CLOSURE_BSDF_WESTIN_BACKSCATTER_ID, bsdf_westin_backscatter_params, bsdf_westin_backscatter_prepare);
+ register_closure(ss, "westin_sheen", OSL_CLOSURE_BSDF_WESTIN_SHEEN_ID, bsdf_westin_sheen_params, bsdf_westin_sheen_prepare);
+ register_closure(ss, "bssrdf_cubic", OSL_CLOSURE_BSSRDF_CUBIC_ID, closure_bssrdf_cubic_params, closure_bssrdf_cubic_prepare);
+ register_closure(ss, "emission", OSL_CLOSURE_EMISSION_ID, closure_emission_params, closure_emission_prepare);
+ register_closure(ss, "debug", OSL_CLOSURE_DEBUG_ID, closure_debug_params, closure_debug_prepare);
+ register_closure(ss, "background", OSL_CLOSURE_BACKGROUND_ID, closure_background_params, closure_background_prepare);
+ register_closure(ss, "holdout", OSL_CLOSURE_HOLDOUT_ID, closure_holdout_params, closure_holdout_prepare);
+ register_closure(ss, "subsurface", OSL_CLOSURE_SUBSURFACE_ID, closure_subsurface_params, closure_subsurface_prepare);
}
CCL_NAMESPACE_END
diff --git a/intern/cycles/kernel/osl/osl_closures.h b/intern/cycles/kernel/osl/osl_closures.h
index a69af45672d..00794183ca5 100644
--- a/intern/cycles/kernel/osl/osl_closures.h
+++ b/intern/cycles/kernel/osl/osl_closures.h
@@ -64,28 +64,28 @@ enum {
OSL_CLOSURE_SUBSURFACE_ID
};
-OSL::ClosureParam *bsdf_diffuse_params();
-OSL::ClosureParam *bsdf_oren_nayar_params();
-OSL::ClosureParam *bsdf_translucent_params();
-OSL::ClosureParam *bsdf_reflection_params();
-OSL::ClosureParam *bsdf_refraction_params();
-OSL::ClosureParam *bsdf_transparent_params();
-OSL::ClosureParam *bsdf_microfacet_ggx_params();
-OSL::ClosureParam *bsdf_microfacet_ggx_refraction_params();
-OSL::ClosureParam *bsdf_microfacet_beckmann_params();
-OSL::ClosureParam *bsdf_microfacet_beckmann_refraction_params();
-OSL::ClosureParam *bsdf_ward_params();
-OSL::ClosureParam *bsdf_phong_params();
-OSL::ClosureParam *bsdf_phong_ramp_params();
-OSL::ClosureParam *bsdf_ashikhmin_velvet_params();
-OSL::ClosureParam *bsdf_westin_backscatter_params();
-OSL::ClosureParam *bsdf_westin_sheen_params();
-OSL::ClosureParam *closure_bssrdf_cubic_params();
-OSL::ClosureParam *closure_emission_params();
-OSL::ClosureParam *closure_debug_params();
-OSL::ClosureParam *closure_background_params();
-OSL::ClosureParam *closure_holdout_params();
-OSL::ClosureParam *closure_subsurface_params();
+extern OSL::ClosureParam bsdf_diffuse_params[];
+extern OSL::ClosureParam bsdf_oren_nayar_params[];
+extern OSL::ClosureParam bsdf_translucent_params[];
+extern OSL::ClosureParam bsdf_reflection_params[];
+extern OSL::ClosureParam bsdf_refraction_params[];
+extern OSL::ClosureParam bsdf_transparent_params[];
+extern OSL::ClosureParam bsdf_microfacet_ggx_params[];
+extern OSL::ClosureParam bsdf_microfacet_ggx_refraction_params[];
+extern OSL::ClosureParam bsdf_microfacet_beckmann_params[];
+extern OSL::ClosureParam bsdf_microfacet_beckmann_refraction_params[];
+extern OSL::ClosureParam bsdf_ward_params[];
+extern OSL::ClosureParam bsdf_phong_params[];
+extern OSL::ClosureParam bsdf_phong_ramp_params[];
+extern OSL::ClosureParam bsdf_ashikhmin_velvet_params[];
+extern OSL::ClosureParam bsdf_westin_backscatter_params[];
+extern OSL::ClosureParam bsdf_westin_sheen_params[];
+extern OSL::ClosureParam closure_bssrdf_cubic_params[];
+extern OSL::ClosureParam closure_emission_params[];
+extern OSL::ClosureParam closure_debug_params[];
+extern OSL::ClosureParam closure_background_params[];
+extern OSL::ClosureParam closure_holdout_params[];
+extern OSL::ClosureParam closure_subsurface_params[];
void bsdf_diffuse_prepare(OSL::RendererServices *, int id, void *data);
void bsdf_oren_nayar_prepare(OSL::RendererServices *, int id, void *data);
diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp
index ea508dcb660..98ede0e4f60 100644
--- a/intern/cycles/kernel/osl/osl_shader.cpp
+++ b/intern/cycles/kernel/osl/osl_shader.cpp
@@ -139,27 +139,15 @@ static void flatten_surface_closure_tree(ShaderData *sd, bool no_glossy,
float sample_weight = fabsf(average(weight)) * albedo;
sc.sample_weight = sample_weight;
+ sc.type = CLOSURE_BSDF_ID;
/* scattering flags */
- if (scattering == OSL::Labels::DIFFUSE) {
+ if (scattering == OSL::Labels::DIFFUSE)
sd->flag |= SD_BSDF | SD_BSDF_HAS_EVAL;
- sc.type = CLOSURE_BSDF_DIFFUSE_ID;
- }
- else if (scattering == OSL::Labels::GLOSSY) {
+ else if (scattering == OSL::Labels::GLOSSY)
sd->flag |= SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_GLOSSY;
- sc.type = CLOSURE_BSDF_GLOSSY_ID;
- }
- else if (scattering == OSL::Labels::STRAIGHT) {
+ else
sd->flag |= SD_BSDF;
- sc.type = CLOSURE_BSDF_TRANSPARENT_ID;
- }
- else {
- /* todo: we don't actually have a way to determine if
- * this closure will reflect/transmit. could add our own
- * own scattering flag that do give this info */
- sd->flag |= SD_BSDF;
- sc.type = CLOSURE_BSDF_GLOSSY_ID;
- }
/* add */
sd->closure[sd->num_closure++] = sc;
diff --git a/intern/cycles/kernel/osl/vol_subsurface.cpp b/intern/cycles/kernel/osl/vol_subsurface.cpp
index 5845428ed43..818a057b6cc 100644
--- a/intern/cycles/kernel/osl/vol_subsurface.cpp
+++ b/intern/cycles/kernel/osl/vol_subsurface.cpp
@@ -122,18 +122,14 @@ public:
-ClosureParam *closure_subsurface_params()
-{
- static ClosureParam params[] = {
- CLOSURE_FLOAT_PARAM(SubsurfaceClosure, m_eta),
- CLOSURE_FLOAT_PARAM(SubsurfaceClosure, m_g),
- CLOSURE_COLOR_PARAM(SubsurfaceClosure, m_mfp),
- CLOSURE_COLOR_PARAM(SubsurfaceClosure, m_albedo),
- CLOSURE_STRING_KEYPARAM("label"),
- CLOSURE_FINISH_PARAM(SubsurfaceClosure)
- };
- return params;
-}
+ClosureParam closure_subsurface_params[] = {
+ CLOSURE_FLOAT_PARAM(SubsurfaceClosure, m_eta),
+ CLOSURE_FLOAT_PARAM(SubsurfaceClosure, m_g),
+ CLOSURE_COLOR_PARAM(SubsurfaceClosure, m_mfp),
+ CLOSURE_COLOR_PARAM(SubsurfaceClosure, m_albedo),
+ CLOSURE_STRING_KEYPARAM("label"),
+ CLOSURE_FINISH_PARAM(SubsurfaceClosure)
+};
CLOSURE_PREPARE(closure_subsurface_prepare, SubsurfaceClosure)
diff --git a/intern/cycles/kernel/svm/svm_tex_coord.h b/intern/cycles/kernel/svm/svm_tex_coord.h
index 6bd8f2ac69c..fbaf253177d 100644
--- a/intern/cycles/kernel/svm/svm_tex_coord.h
+++ b/intern/cycles/kernel/svm/svm_tex_coord.h
@@ -92,14 +92,6 @@ __device void svm_node_tex_coord(KernelGlobals *kg, ShaderData *sd, float *stack
data = sd->I;
break;
}
- case NODE_TEXCO_DUPLI_GENERATED: {
- data = object_dupli_generated(kg, sd->object);
- break;
- }
- case NODE_TEXCO_DUPLI_UV: {
- data = object_dupli_uv(kg, sd->object);
- break;
- }
}
stack_store_float3(stack, out_offset, data);
@@ -149,14 +141,6 @@ __device void svm_node_tex_coord_bump_dx(KernelGlobals *kg, ShaderData *sd, floa
data = sd->I;
break;
}
- case NODE_TEXCO_DUPLI_GENERATED: {
- data = object_dupli_generated(kg, sd->object);
- break;
- }
- case NODE_TEXCO_DUPLI_UV: {
- data = object_dupli_uv(kg, sd->object);
- break;
- }
}
stack_store_float3(stack, out_offset, data);
@@ -209,14 +193,6 @@ __device void svm_node_tex_coord_bump_dy(KernelGlobals *kg, ShaderData *sd, floa
data = sd->I;
break;
}
- case NODE_TEXCO_DUPLI_GENERATED: {
- data = object_dupli_generated(kg, sd->object);
- break;
- }
- case NODE_TEXCO_DUPLI_UV: {
- data = object_dupli_uv(kg, sd->object);
- break;
- }
}
stack_store_float3(stack, out_offset, data);
diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h
index ee423573cdf..c82eafc790a 100644
--- a/intern/cycles/kernel/svm/svm_types.h
+++ b/intern/cycles/kernel/svm/svm_types.h
@@ -43,7 +43,6 @@ typedef enum NodeType {
NODE_TEX_IMAGE_BOX,
NODE_TEX_SKY,
NODE_GEOMETRY,
- NODE_GEOMETRY_DUPLI,
NODE_LIGHT_PATH,
NODE_VALUE_F,
NODE_VALUE_V,
@@ -150,9 +149,7 @@ typedef enum NodeTexCoord {
NODE_TEXCO_OBJECT,
NODE_TEXCO_CAMERA,
NODE_TEXCO_WINDOW,
- NODE_TEXCO_REFLECTION,
- NODE_TEXCO_DUPLI_GENERATED,
- NODE_TEXCO_DUPLI_UV
+ NODE_TEXCO_REFLECTION
} NodeTexCoord;
typedef enum NodeMix {
@@ -287,18 +284,16 @@ typedef enum ClosureType {
CLOSURE_BSDF_DIFFUSE_ID,
CLOSURE_BSDF_OREN_NAYAR_ID,
- CLOSURE_BSDF_GLOSSY_ID,
CLOSURE_BSDF_REFLECTION_ID,
CLOSURE_BSDF_MICROFACET_GGX_ID,
CLOSURE_BSDF_MICROFACET_BECKMANN_ID,
CLOSURE_BSDF_WARD_ID,
- CLOSURE_BSDF_ASHIKHMIN_VELVET_ID,
CLOSURE_BSDF_WESTIN_SHEEN_ID,
- CLOSURE_BSDF_TRANSMISSION_ID,
CLOSURE_BSDF_TRANSLUCENT_ID,
CLOSURE_BSDF_REFRACTION_ID,
CLOSURE_BSDF_WESTIN_BACKSCATTER_ID,
+ CLOSURE_BSDF_ASHIKHMIN_VELVET_ID,
CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID,
CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID,
CLOSURE_BSDF_GLASS_ID,
@@ -322,8 +317,8 @@ typedef enum ClosureType {
/* watch this, being lazy with memory usage */
#define CLOSURE_IS_BSDF(type) (type <= CLOSURE_BSDF_TRANSPARENT_ID)
#define CLOSURE_IS_BSDF_DIFFUSE(type) (type >= CLOSURE_BSDF_DIFFUSE_ID && type <= CLOSURE_BSDF_OREN_NAYAR_ID)
-#define CLOSURE_IS_BSDF_GLOSSY(type) (type >= CLOSURE_BSDF_GLOSSY_ID && type <= CLOSURE_BSDF_WESTIN_SHEEN_ID)
-#define CLOSURE_IS_BSDF_TRANSMISSION(type) (type >= CLOSURE_BSDF_TRANSMISSION_ID && type <= CLOSURE_BSDF_GLASS_ID)
+#define CLOSURE_IS_BSDF_GLOSSY(type) (type >= CLOSURE_BSDF_REFLECTION_ID && type <= CLOSURE_BSDF_WESTIN_SHEEN_ID)
+#define CLOSURE_IS_BSDF_TRANSMISSION(type) (type >= CLOSURE_BSDF_TRANSLUCENT_ID && type <= CLOSURE_BSDF_GLASS_ID)
#define CLOSURE_IS_VOLUME(type) (type >= CLOSURE_VOLUME_ID && type <= CLOSURE_VOLUME_ISOTROPIC_ID)
#define CLOSURE_IS_EMISSION(type) (type == CLOSURE_EMISSION_ID)
#define CLOSURE_IS_HOLDOUT(type) (type == CLOSURE_HOLDOUT_ID)
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 62758128a73..20fbfa0cf27 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -181,14 +181,14 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to)
assert(from && to);
if(to->link) {
- fprintf(stderr, "Cycles shader graph connect: input already connected.\n");
+ fprintf(stderr, "ShaderGraph connect: input already connected.\n");
return;
}
if(from->type != to->type) {
/* for closures we can't do automatic conversion */
if(from->type == SHADER_SOCKET_CLOSURE || to->type == SHADER_SOCKET_CLOSURE) {
- fprintf(stderr, "Cycles shader graph connect: can only connect closure to closure "
+ fprintf(stderr, "ShaderGraph connect: can only connect closure to closure "
"(ShaderNode:%s, ShaderOutput:%s , type:%d -> to ShaderNode:%s, ShaderInput:%s, type:%d).\n",
from->parent->name.c_str(), from->name, (int)from->type,
to->parent->name.c_str(), to->name, (int)to->type);
@@ -363,7 +363,7 @@ void ShaderGraph::break_cycles(ShaderNode *node, vector<bool>& visited, vector<b
if(on_stack[depnode->id]) {
/* break cycle */
disconnect(input);
- fprintf(stderr, "Cycles shader graph: detected cycle in graph, connection removed.\n");
+ fprintf(stderr, "ShaderGraph: detected cycle in graph, connection removed.\n");
}
else if(!visited[depnode->id]) {
/* visit dependencies */
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 4e16eea2774..eabb97e7238 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1644,18 +1644,14 @@ TextureCoordinateNode::TextureCoordinateNode()
add_output("Camera", SHADER_SOCKET_POINT);
add_output("Window", SHADER_SOCKET_POINT);
add_output("Reflection", SHADER_SOCKET_NORMAL);
-
- from_dupli = false;
}
void TextureCoordinateNode::attributes(AttributeRequestSet *attributes)
{
- if(!from_dupli) {
- if(!output("Generated")->links.empty())
- attributes->add(ATTR_STD_GENERATED);
- if(!output("UV")->links.empty())
- attributes->add(ATTR_STD_UV);
- }
+ if(!output("Generated")->links.empty())
+ attributes->add(ATTR_STD_GENERATED);
+ if(!output("UV")->links.empty())
+ attributes->add(ATTR_STD_UV);
ShaderNode::attributes(attributes);
}
@@ -1685,15 +1681,9 @@ void TextureCoordinateNode::compile(SVMCompiler& compiler)
compiler.add_node(geom_node, NODE_GEOM_P, out->stack_offset);
}
else {
- if(from_dupli) {
- compiler.stack_assign(out);
- compiler.add_node(texco_node, NODE_TEXCO_DUPLI_GENERATED, out->stack_offset);
- }
- else {
- int attr = compiler.attribute(ATTR_STD_GENERATED);
- compiler.stack_assign(out);
- compiler.add_node(attr_node, attr, out->stack_offset, NODE_ATTR_FLOAT3);
- }
+ int attr = compiler.attribute(ATTR_STD_GENERATED);
+ compiler.stack_assign(out);
+ compiler.add_node(attr_node, attr, out->stack_offset, NODE_ATTR_FLOAT3);
}
}
@@ -1705,15 +1695,9 @@ void TextureCoordinateNode::compile(SVMCompiler& compiler)
out = output("UV");
if(!out->links.empty()) {
- if(from_dupli) {
- compiler.stack_assign(out);
- compiler.add_node(texco_node, NODE_TEXCO_DUPLI_UV, out->stack_offset);
- }
- else {
- int attr = compiler.attribute(ATTR_STD_UV);
- compiler.stack_assign(out);
- compiler.add_node(attr_node, attr, out->stack_offset, NODE_ATTR_FLOAT3);
- }
+ int attr = compiler.attribute(ATTR_STD_UV);
+ compiler.stack_assign(out);
+ compiler.add_node(attr_node, attr, out->stack_offset, NODE_ATTR_FLOAT3);
}
out = output("Object");
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index e8e584dd8ef..82bead7e41a 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -284,8 +284,6 @@ class TextureCoordinateNode : public ShaderNode {
public:
SHADER_NODE_CLASS(TextureCoordinateNode)
void attributes(AttributeRequestSet *attributes);
-
- bool from_dupli;
};
class LightPathNode : public ShaderNode {
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index d78a82d589a..7389b239627 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -235,10 +235,6 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene
}
}
- /* dupli object coords */
- objects[offset+16] = make_float4(ob->dupli_generated[0], ob->dupli_generated[1], ob->dupli_generated[2], 0.0f);
- objects[offset+17] = make_float4(ob->dupli_uv[0], ob->dupli_uv[1], 0.0f, 0.0f);
-
/* object flag */
if(ob->use_holdout)
flag |= SD_HOLDOUT_MASK;
diff --git a/intern/cycles/render/object.h b/intern/cycles/render/object.h
index e2c3ad4e071..88677d79dff 100644
--- a/intern/cycles/render/object.h
+++ b/intern/cycles/render/object.h
@@ -49,9 +49,6 @@ public:
bool use_motion;
bool use_holdout;
- float3 dupli_generated;
- float2 dupli_uv;
-
int particle_id;
Object();
diff --git a/intern/dualcon/intern/octree.cpp b/intern/dualcon/intern/octree.cpp
index 49c50c8240d..c74f8bf2f46 100644
--- a/intern/dualcon/intern/octree.cpp
+++ b/intern/dualcon/intern/octree.cpp
@@ -384,22 +384,22 @@ InternalNode *Octree::addTriangle(InternalNode *node, CubeTriangleIsect *p, int
/* Pruning using intersection test */
if (subp->isIntersecting()) {
- if (!node->has_child(i)) {
+ if (!hasChild(node, i)) {
if (height == 1)
node = addLeafChild(node, i, count, createLeaf(0));
else
node = addInternalChild(node, i, count, createInternal(0));
}
- Node *chd = node->get_child(count);
+ Node *chd = getChild(node, count);
if (node->is_child_leaf(i))
- node->set_child(count, (Node *)updateCell(&chd->leaf, subp));
+ setChild(node, count, (Node *)updateCell(&chd->leaf, subp));
else
- node->set_child(count, (Node *)addTriangle(&chd->internal, subp, height - 1));
+ setChild(node, count, (Node *)addTriangle(&chd->internal, subp, height - 1));
}
}
- if (node->has_child(i))
+ if (hasChild(node, i))
count++;
}
@@ -450,11 +450,11 @@ void Octree::preparePrimalEdgesMask(InternalNode *node)
{
int count = 0;
for (int i = 0; i < 8; i++) {
- if (node->has_child(i)) {
+ if (hasChild(node, i)) {
if (node->is_child_leaf(i))
- createPrimalEdgesMask(&node->get_child(count)->leaf);
+ createPrimalEdgesMask(&getChild(node, count)->leaf);
else
- preparePrimalEdgesMask(&node->get_child(count)->internal);
+ preparePrimalEdgesMask(&getChild(node, count)->internal);
count++;
}
@@ -487,7 +487,7 @@ Node *Octree::trace(Node *newnode, int *st, int len, int depth, PathList *& path
// Get children paths
int chdleaf[8];
- newnode->internal.fill_children(chd, chdleaf);
+ fillChildren(&newnode->internal, chd, chdleaf);
// int count = 0;
for (i = 0; i < 8; i++) {
@@ -510,7 +510,7 @@ Node *Octree::trace(Node *newnode, int *st, int len, int depth, PathList *& path
int df[2] = {depth - 1, depth - 1};
int *nstf[2];
- newnode->internal.fill_children(chd, chdleaf);
+ fillChildren(&newnode->internal, chd, chdleaf);
for (i = 0; i < 12; i++) {
int c[2] = {cellProcFaceMask[i][0], cellProcFaceMask[i][1]};
@@ -590,7 +590,7 @@ void Octree::findPaths(Node *node[2], int leaf[2], int depth[2], int *st[2], int
for (j = 0; j < 2; j++) {
if (!leaf[j]) {
- node[j]->internal.fill_children(chd[j], chdleaf[j]);
+ fillChildren(&node[j]->internal, chd[j], chdleaf[j]);
int len = (dimen >> (maxDepth - depth[j] + 1));
for (i = 0; i < 8; i++) {
@@ -966,10 +966,10 @@ Node *Octree::patch(Node *newnode, int st[3], int len, PathList *rings)
st[1] + len * vertmap[i][1],
st[2] + len * vertmap[i][2]
};
- patch(newnode->internal.get_child(count), nori, len, zlists[i]);
+ patch(getChild(&newnode->internal, count), nori, len, zlists[i]);
}
- if (newnode->internal.has_child(i)) {
+ if (hasChild(&newnode->internal, i)) {
count++;
}
}
@@ -1408,16 +1408,16 @@ Node *Octree::locateCell(InternalNode *node, int st[3], int len, int ori[3], int
rst[1] = st[1] + vertmap[ind][1] * len;
rst[2] = st[2] + vertmap[ind][2] * len;
- if (node->has_child(ind)) {
- int count = node->get_child_count(ind);
- Node *chd = node->get_child(count);
+ if (hasChild(node, ind)) {
+ int count = getChildCount(node, ind);
+ Node *chd = getChild(node, count);
if (node->is_child_leaf(ind)) {
rleaf = chd;
rlen = len;
}
else {
// Recur
- node->set_child(count, locateCell(&chd->internal, rst, len, ori, dir, side, rleaf, rst, rlen));
+ setChild(node, count, locateCell(&chd->internal, rst, len, ori, dir, side, rleaf, rst, rlen));
}
}
else {
@@ -1724,7 +1724,7 @@ void Octree::buildSigns(unsigned char table[], Node *node, int isLeaf, int sg, i
// Internal node
Node *chd[8];
int leaf[8];
- node->internal.fill_children(chd, leaf);
+ fillChildren(&node->internal, chd, leaf);
// Get the signs at the corners of the first cube
rvalue[0] = sg;
@@ -1784,8 +1784,8 @@ void Octree::clearProcessBits(Node *node, int height)
// Internal cell, recur
int count = 0;
for (i = 0; i < 8; i++) {
- if (node->internal.has_child(i)) {
- clearProcessBits(node->internal.get_child(count), height - 1);
+ if (hasChild(&node->internal, i)) {
+ clearProcessBits(getChild(&node->internal, count), height - 1);
count++;
}
}
@@ -2016,13 +2016,13 @@ int Octree::floodFill(Node *node, int st[3], int len, int height, int threshold)
int count = 0;
len >>= 1;
for (i = 0; i < 8; i++) {
- if (node->internal.has_child(i)) {
+ if (hasChild((InternalNode *)node, i)) {
int nst[3];
nst[0] = st[0] + vertmap[i][0] * len;
nst[1] = st[1] + vertmap[i][1] * len;
nst[2] = st[2] + vertmap[i][2] * len;
- int d = floodFill(node->internal.get_child(count), nst, len, height - 1, threshold);
+ int d = floodFill(getChild((InternalNode *)node, count), nst, len, height - 1, threshold);
if (d > maxtotal) {
maxtotal = d;
}
@@ -2062,9 +2062,9 @@ void Octree::writeOut()
void Octree::countIntersection(Node *node, int height, int& nedge, int& ncell, int& nface)
{
if (height > 0) {
- int total = node->internal.get_num_children();
+ int total = getNumChildren(&node->internal);
for (int i = 0; i < total; i++) {
- countIntersection(node->internal.get_child(i), height - 1, nedge, ncell, nface);
+ countIntersection(getChild(&node->internal, i), height - 1, nedge, ncell, nface);
}
}
else {
@@ -2128,32 +2128,8 @@ static void solve_least_squares(const float halfA[], const float b[],
rvalue[i] = result(i);
}
-static void mass_point(float mp[3], const float pts[12][3], const int parity[12])
-{
- int ec = 0;
-
- for (int i = 0; i < 12; i++) {
- if (parity[i]) {
- const float *p = pts[i];
-
- mp[0] += p[0];
- mp[1] += p[1];
- mp[2] += p[2];
-
- ec++;
- }
- }
-
- if (ec == 0) {
- return;
- }
- mp[0] /= ec;
- mp[1] /= ec;
- mp[2] /= ec;
-}
-
static void minimize(float rvalue[3], float mp[3], const float pts[12][3],
- const float norms[12][3], const int parity[12])
+ const float norms[12][3], const int parity[12])
{
float ata[6] = {0, 0, 0, 0, 0, 0};
float atb[3] = {0, 0, 0};
@@ -2199,51 +2175,34 @@ static void minimize(float rvalue[3], float mp[3], const float pts[12][3],
solve_least_squares(ata, atb, mp, rvalue);
}
-void Octree::computeMinimizer(const LeafNode *leaf, int st[3], int len,
- float rvalue[3]) const
+void Octree::computeMinimizer(LeafNode *leaf, int st[3], int len, float rvalue[3])
{
// First, gather all edge intersections
float pts[12][3], norms[12][3];
int parity[12];
fillEdgeIntersections(leaf, st, len, pts, norms, parity);
- switch (mode) {
- case DUALCON_CENTROID:
+ // Next, construct QEF and minimizer
+ float mp[3] = {0, 0, 0};
+ minimize(rvalue, mp, pts, norms, parity);
+
+ /* Restraining the location of the minimizer */
+ float nh1 = hermite_num * len;
+ float nh2 = (1 + hermite_num) * len;
+ if ((mode == DUALCON_MASS_POINT || mode == DUALCON_CENTROID) ||
+ (rvalue[0] < st[0] - nh1 || rvalue[1] < st[1] - nh1 || rvalue[2] < st[2] - nh1 ||
+ rvalue[0] > st[0] + nh2 || rvalue[1] > st[1] + nh2 || rvalue[2] > st[2] + nh2)) {
+ if (mode == DUALCON_CENTROID) {
+ // Use centroids
rvalue[0] = (float) st[0] + len / 2;
rvalue[1] = (float) st[1] + len / 2;
rvalue[2] = (float) st[2] + len / 2;
- break;
-
- case DUALCON_MASS_POINT:
- rvalue[0] = rvalue[1] = rvalue[2] = 0;
- mass_point(rvalue, pts, parity);
- break;
-
- default: {
- // Sharp features */
-
- // construct QEF and minimizer
- float mp[3] = {0, 0, 0};
- minimize(rvalue, mp, pts, norms, parity);
-
- /* Restraining the location of the minimizer */
- float nh1 = hermite_num * len;
- float nh2 = (1 + hermite_num) * len;
-
- if (rvalue[0] < st[0] - nh1 ||
- rvalue[1] < st[1] - nh1 ||
- rvalue[2] < st[2] - nh1 ||
-
- rvalue[0] > st[0] + nh2 ||
- rvalue[1] > st[1] + nh2 ||
- rvalue[2] > st[2] + nh2)
- {
- // Use mass point instead
- rvalue[0] = mp[0];
- rvalue[1] = mp[1];
- rvalue[2] = mp[2];
- }
- break;
+ }
+ else {
+ // Use mass point instead
+ rvalue[0] = mp[0];
+ rvalue[1] = mp[1];
+ rvalue[2] = mp[2];
}
}
}
@@ -2294,13 +2253,13 @@ void Octree::generateMinimizer(Node *node, int st[3], int len, int height, int&
int count = 0;
len >>= 1;
for (i = 0; i < 8; i++) {
- if (node->internal.has_child(i)) {
+ if (hasChild(&node->internal, i)) {
int nst[3];
nst[0] = st[0] + vertmap[i][0] * len;
nst[1] = st[1] + vertmap[i][1] * len;
nst[2] = st[2] + vertmap[i][2] * len;
- generateMinimizer(node->internal.get_child(count),
+ generateMinimizer(getChild(&node->internal, count),
nst, len, height - 1, offset);
count++;
}
@@ -2385,9 +2344,9 @@ void Octree::edgeProcContour(Node *node[4], int leaf[4], int depth[4], int maxde
Node *chd[4][8];
for (j = 0; j < 4; j++) {
for (i = 0; i < 8; i++) {
- chd[j][i] = ((!leaf[j]) && node[j]->internal.has_child(i)) ?
- node[j]->internal.get_child(
- node[j]->internal.get_child_count(i)) : NULL;
+ chd[j][i] = ((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal,
+ getChildCount(&node[j]->internal, i)) : NULL;
}
}
@@ -2432,9 +2391,9 @@ void Octree::faceProcContour(Node *node[2], int leaf[2], int depth[2], int maxde
Node *chd[2][8];
for (j = 0; j < 2; j++) {
for (i = 0; i < 8; i++) {
- chd[j][i] = ((!leaf[j]) && node[j]->internal.has_child(i)) ?
- node[j]->internal.get_child(
- node[j]->internal.get_child_count(i)) : NULL;
+ chd[j][i] = ((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal,
+ getChildCount(&node[j]->internal, i)) : NULL;
}
}
@@ -2501,8 +2460,9 @@ void Octree::cellProcContour(Node *node, int leaf, int depth)
// Fill children nodes
Node *chd[8];
for (i = 0; i < 8; i++) {
- chd[i] = ((!leaf) && node->internal.has_child(i)) ?
- node->internal.get_child(node->internal.get_child_count(i)) : NULL;
+ chd[i] = ((!leaf) && hasChild(&node->internal, i)) ?
+ getChild(&node->internal,
+ getChildCount(&node->internal, i)) : NULL;
}
// 8 Cell calls
@@ -2579,8 +2539,8 @@ void Octree::edgeProcParity(Node *node[4], int leaf[4], int depth[4], int maxdep
Node *chd[4][8];
for (j = 0; j < 4; j++) {
for (i = 0; i < 8; i++) {
- chd[j][i] = ((!leaf[j]) && node[j]->internal.has_child(i)) ?
- node[j]->internal.get_child( node[j]->internal.get_child_count(i)) : NULL;
+ chd[j][i] = ((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal, getChildCount(&node[j]->internal, i)) : NULL;
}
}
@@ -2629,9 +2589,9 @@ void Octree::faceProcParity(Node *node[2], int leaf[2], int depth[2], int maxdep
Node *chd[2][8];
for (j = 0; j < 2; j++) {
for (i = 0; i < 8; i++) {
- chd[j][i] = ((!leaf[j]) && node[j]->internal.has_child(i)) ?
- node[j]->internal.get_child(
- node[j]->internal.get_child_count(i)) : NULL;
+ chd[j][i] = ((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal,
+ getChildCount(&node[j]->internal, i)) : NULL;
}
}
@@ -2698,8 +2658,9 @@ void Octree::cellProcParity(Node *node, int leaf, int depth)
// Fill children nodes
Node *chd[8];
for (i = 0; i < 8; i++) {
- chd[i] = ((!leaf) && node->internal.has_child(i)) ?
- node->internal.get_child(node->internal.get_child_count(i)) : NULL;
+ chd[i] = ((!leaf) && hasChild((InternalNode *)node, i)) ?
+ getChild((InternalNode *)node,
+ getChildCount((InternalNode *)node, i)) : NULL;
}
// 8 Cell calls
@@ -2842,7 +2803,3 @@ const int dirEdge[3][4] = {
{7, 6, 5, 4},
{11, 10, 9, 8}
};
-
-int InternalNode::numChildrenTable[256];
-int InternalNode::childrenCountTable[256][8];
-int InternalNode::childrenIndexTable[256][8];
diff --git a/intern/dualcon/intern/octree.h b/intern/dualcon/intern/octree.h
index 6cbdc9fb3d8..550d584baa7 100644
--- a/intern/dualcon/intern/octree.h
+++ b/intern/dualcon/intern/octree.h
@@ -56,18 +56,12 @@
#define EDGE_FLOATS 4
union Node;
-struct LeafNode;
struct InternalNode {
- /* Initialized in Octree::BuildTable */
- static int numChildrenTable[256];
- static int childrenCountTable[256][8];
- static int childrenIndexTable[256][8];
-
- /* Bit N indicates whether child N exists or not */
- unsigned char has_child_bitfield;
- /* Bit N indicates whether child N is a leaf or not */
- unsigned char child_is_leaf_bitfield;
+ /* Treat as bitfield, bit N indicates whether child N exists or not */
+ unsigned char has_child;
+ /* Treat as bitfield, bit N indicates whether child N is a leaf or not */
+ unsigned char child_is_leaf;
/* Can have up to eight children */
Node *children[0];
@@ -75,78 +69,7 @@ struct InternalNode {
/// Test if child is leaf
int is_child_leaf(int index) const
{
- return (child_is_leaf_bitfield >> index) & 1;
- }
-
- /// If child index exists
- int has_child(int index) const
- {
- return (has_child_bitfield >> index) & 1;
- }
-
- /// Get the pointer to child index
- Node *get_child(int count)
- {
- return children[count];
- }
-
- const Node *get_child(int count) const
- {
- return children[count];
- }
-
- /// Get total number of children
- int get_num_children() const
- {
- return numChildrenTable[has_child_bitfield];
- }
-
- /// Get the count of children
- int get_child_count(int index) const
- {
- return childrenCountTable[has_child_bitfield][index];
- }
- int get_child_index(int count)
- {
- return childrenIndexTable[has_child_bitfield][count];
- }
- const int *get_child_counts() const
- {
- return childrenCountTable[has_child_bitfield];
- }
-
- /// Get all children
- void fill_children(Node *children[8], int leaf[8])
- {
- int count = 0;
- for (int i = 0; i < 8; i++) {
- leaf[i] = is_child_leaf(i);
- if (has_child(i)) {
- children[i] = get_child(count);
- count++;
- }
- else {
- children[i] = NULL;
- leaf[i] = 0;
- }
- }
- }
-
- /// Sets the child pointer
- void set_child(int count, Node *chd)
- {
- children[count] = chd;
- }
- void set_internal_child(int index, int count, InternalNode *chd)
- {
- set_child(count, (Node *)chd);
- has_child_bitfield |= (1 << index);
- }
- void set_leaf_child(int index, int count, LeafNode *chd)
- {
- set_child(count, (Node *)chd);
- has_child_bitfield |= (1 << index);
- child_is_leaf_bitfield |= (1 << index);
+ return (child_is_leaf >> index) & 1;
}
};
@@ -422,8 +345,7 @@ class Octree
void countIntersection(Node *node, int height, int& nedge, int& ncell, int& nface);
void generateMinimizer(Node * node, int st[3], int len, int height, int& offset);
- void computeMinimizer(const LeafNode * leaf, int st[3], int len,
- float rvalue[3]) const;
+ void computeMinimizer(LeafNode * leaf, int st[3], int len, float rvalue[3]);
/**
* Traversal functions to generate polygon model
* op: 0 for counting, 1 for writing OBJ, 2 for writing OFF, 3 for writing PLY
@@ -443,6 +365,9 @@ class Octree
/************ Operators for all nodes ************/
/// Lookup table
+ int numChildrenTable[256];
+ int childrenCountTable[256][8];
+ int childrenIndexTable[256][8];
int numEdgeTable[8];
int edgeCountTable[8][3];
@@ -450,12 +375,12 @@ class Octree
void buildTable()
{
for (int i = 0; i < 256; i++) {
- InternalNode::numChildrenTable[i] = 0;
+ numChildrenTable[i] = 0;
int count = 0;
for (int j = 0; j < 8; j++) {
- InternalNode::numChildrenTable[i] += ((i >> j) & 1);
- InternalNode::childrenCountTable[i][j] = count;
- InternalNode::childrenIndexTable[i][count] = j;
+ numChildrenTable[i] += ((i >> j) & 1);
+ childrenCountTable[i][j] = count;
+ childrenIndexTable[i][count] = j;
count += ((i >> j) & 1);
}
}
@@ -477,15 +402,15 @@ class Octree
return getSign(&node->leaf, index);
}
else {
- if (node->internal.has_child(index)) {
- return getSign(node->internal.get_child(node->internal.get_child_count(index)),
+ if (hasChild(&node->internal, index)) {
+ return getSign(getChild(&node->internal, getChildCount(&node->internal, index)),
height - 1,
index);
}
else {
- return getSign(node->internal.get_child(0),
+ return getSign(getChild(&node->internal, 0),
height - 1,
- 7 - node->internal.get_child_index(0));
+ 7 - getChildIndex(&node->internal, 0));
}
}
}
@@ -544,7 +469,7 @@ class Octree
leaf->signs |= ((sign & 1) << index);
}
- int getSignMask(const LeafNode *leaf) const
+ int getSignMask(const LeafNode *leaf)
{
return leaf->signs;
}
@@ -611,7 +536,7 @@ class Octree
}
/// Get edge parity
- int getEdgeParity(const LeafNode *leaf, int index) const
+ int getEdgeParity(LeafNode *leaf, int index)
{
assert(index >= 0 && index <= 11);
@@ -672,8 +597,7 @@ class Octree
leaf->primary_edge_intersections |= (1 << pindex);
}
-
- int getStoredEdgesParity(const LeafNode *leaf, int pindex) const
+ int getStoredEdgesParity(LeafNode *leaf, int pindex)
{
assert(pindex <= 2 && pindex >= 0);
@@ -728,7 +652,7 @@ class Octree
InternalNode *parent = locateParent(node, len, st, count);
// Update
- parent->set_child(count, (Node *)leaf);
+ setChild(parent, count, (Node *)leaf);
}
void updateParent(InternalNode *node, int len, int st[3])
@@ -743,14 +667,14 @@ class Octree
InternalNode *parent = locateParent(len, st, count);
// UPdate
- parent->set_child(count, (Node *)node);
+ setChild(parent, count, (Node *)node);
}
/// Find edge intersection on a given edge
- int getEdgeIntersectionByIndex(int st[3], int index, float pt[3], int check) const
+ int getEdgeIntersectionByIndex(int st[3], int index, float pt[3], int check)
{
// First, locat the leaf
- const LeafNode *leaf;
+ LeafNode *leaf;
if (check) {
leaf = locateLeafCheck(st);
}
@@ -773,7 +697,7 @@ class Octree
}
/// Retrieve number of edges intersected
- int getPrimalEdgesMask(const LeafNode *leaf) const
+ int getPrimalEdgesMask(LeafNode *leaf)
{
return leaf->primary_edge_intersections;
}
@@ -786,7 +710,7 @@ class Octree
}
/// Get the count for a primary edge
- int getEdgeCount(const LeafNode *leaf, int index) const
+ int getEdgeCount(LeafNode *leaf, int index)
{
return edgeCountTable[getPrimalEdgesMask(leaf)][index];
}
@@ -820,7 +744,7 @@ class Octree
}
/// Retrieve edge intersection
- float getEdgeOffset(const LeafNode *leaf, int count) const
+ float getEdgeOffset(LeafNode *leaf, int count)
{
return leaf->edge_intersections[4 * count];
}
@@ -910,11 +834,10 @@ class Octree
}
/// Retrieve complete edge intersection
- void getEdgeIntersectionByIndex(const LeafNode *leaf, int index, int st[3],
- int len, float pt[3], float nm[3]) const
+ void getEdgeIntersectionByIndex(LeafNode *leaf, int index, int st[3], int len, float pt[3], float nm[3])
{
int count = getEdgeCount(leaf, index);
- const float *pts = leaf->edge_intersections;
+ float *pts = leaf->edge_intersections;
float off = pts[4 * count];
@@ -942,8 +865,7 @@ class Octree
return off;
}
- void fillEdgeIntersections(const LeafNode *leaf, int st[3], int len,
- float pts[12][3], float norms[12][3]) const
+ void fillEdgeIntersections(LeafNode *leaf, int st[3], int len, float pts[12][3], float norms[12][3])
{
int i;
// int stt[3] = {0, 0, 0};
@@ -968,7 +890,7 @@ class Octree
nst[i] += len;
// int nstt[3] = {0, 0, 0};
// nstt[i] += 1;
- const LeafNode *node = locateLeaf(nst);
+ LeafNode *node = locateLeaf(nst);
if (e1) {
// getEdgeIntersectionByIndex(node, femask[i][0], nstt, 1, pts[fmask[i][0]], norms[fmask[i][0]]);
@@ -990,7 +912,7 @@ class Octree
nst[i] -= len;
// int nstt[3] = {1, 1, 1};
// nstt[i] -= 1;
- const LeafNode *node = locateLeaf(nst);
+ LeafNode *node = locateLeaf(nst);
// getEdgeIntersectionByIndex(node, eemask[i], nstt, 1, pts[emask[i]], norms[emask[i]]);
getEdgeIntersectionByIndex(node, eemask[i], nst, len, pts[emask[i]], norms[emask[i]]);
@@ -999,9 +921,7 @@ class Octree
}
- void fillEdgeIntersections(const LeafNode *leaf, int st[3], int len,
- float pts[12][3], float norms[12][3],
- int parity[12]) const
+ void fillEdgeIntersections(LeafNode *leaf, int st[3], int len, float pts[12][3], float norms[12][3], int parity[12])
{
int i;
for (i = 0; i < 12; i++) {
@@ -1028,7 +948,7 @@ class Octree
nst[i] += len;
// int nstt[3] = {0, 0, 0};
// nstt[i] += 1;
- const LeafNode *node = locateLeafCheck(nst);
+ LeafNode *node = locateLeafCheck(nst);
if (node == NULL) {
continue;
}
@@ -1059,7 +979,7 @@ class Octree
nst[i] -= len;
// int nstt[3] = {1, 1, 1};
// nstt[i] -= 1;
- const LeafNode *node = locateLeafCheck(nst);
+ LeafNode *node = locateLeafCheck(nst);
if (node == NULL) {
continue;
}
@@ -1168,20 +1088,7 @@ class Octree
int index = (((st[0] >> i) & 1) << 2) |
(((st[1] >> i) & 1) << 1) |
(((st[2] >> i) & 1));
- node = node->internal.get_child(node->internal.get_child_count(index));
- }
-
- return &node->leaf;
- }
-
- const LeafNode *locateLeaf(int st[3]) const
- {
- const Node *node = root;
- for (int i = GRID_DIMENSION - 1; i > GRID_DIMENSION - maxDepth - 1; i--) {
- int index = (((st[0] >> i) & 1) << 2) |
- (((st[1] >> i) & 1) << 1) |
- (((st[2] >> i) & 1));
- node = node->internal.get_child(node->internal.get_child_count(index));
+ node = getChild(&node->internal, getChildCount(&node->internal, index));
}
return &node->leaf;
@@ -1195,7 +1102,8 @@ class Octree
index = (((st[0] & i) ? 4 : 0) |
((st[1] & i) ? 2 : 0) |
((st[2] & i) ? 1 : 0));
- node = node->internal.get_child(node->internal.get_child_count(index));
+ node = getChild(&node->internal,
+ getChildCount(&node->internal, index));
}
return &node->leaf;
@@ -1208,26 +1116,10 @@ class Octree
int index = (((st[0] >> i) & 1) << 2) |
(((st[1] >> i) & 1) << 1) |
(((st[2] >> i) & 1));
- if (!node->internal.has_child(index)) {
- return NULL;
- }
- node = node->internal.get_child(node->internal.get_child_count(index));
- }
-
- return &node->leaf;
- }
-
- const LeafNode *locateLeafCheck(int st[3]) const
- {
- const Node *node = root;
- for (int i = GRID_DIMENSION - 1; i > GRID_DIMENSION - maxDepth - 1; i--) {
- int index = (((st[0] >> i) & 1) << 2) |
- (((st[1] >> i) & 1) << 1) |
- (((st[2] >> i) & 1));
- if (!node->internal.has_child(index)) {
+ if (!hasChild(&node->internal, index)) {
return NULL;
}
- node = node->internal.get_child(node->internal.get_child_count(index));
+ node = getChild(&node->internal, getChildCount(&node->internal, index));
}
return &node->leaf;
@@ -1243,10 +1135,10 @@ class Octree
((st[1] & i) ? 2 : 0) |
((st[2] & i) ? 1 : 0));
pre = node;
- node = &node->get_child(node->get_child_count(index))->internal;
+ node = &getChild(node, getChildCount(node, index))->internal;
}
- count = pre->get_child_count(index);
+ count = getChildCount(pre, index);
return pre;
}
@@ -1260,21 +1152,88 @@ class Octree
((st[1] & i) ? 2 : 0) |
((st[2] & i) ? 1 : 0));
pre = node;
- node = &node->get_child(node->get_child_count(index))->internal;
+ node = (InternalNode *)getChild(node, getChildCount(node, index));
}
- count = pre->get_child_count(index);
+ count = getChildCount(pre, index);
return pre;
}
/************ Operators for internal nodes ************/
+ /// If child index exists
+ int hasChild(InternalNode *node, int index)
+ {
+ return (node->has_child >> index) & 1;
+ }
+
+ /// Get the pointer to child index
+ Node *getChild(InternalNode *node, int count)
+ {
+ return node->children[count];
+ };
+
+ /// Get total number of children
+ int getNumChildren(InternalNode *node)
+ {
+ return numChildrenTable[node->has_child];
+ }
+
+ /// Get the count of children
+ int getChildCount(InternalNode *node, int index)
+ {
+ return childrenCountTable[node->has_child][index];
+ }
+ int getChildIndex(InternalNode *node, int count)
+ {
+ return childrenIndexTable[node->has_child][count];
+ }
+ int *getChildCounts(InternalNode *node)
+ {
+ return childrenCountTable[node->has_child];
+ }
+
+ /// Get all children
+ void fillChildren(InternalNode *node, Node *children[8], int leaf[8])
+ {
+ int count = 0;
+ for (int i = 0; i < 8; i++) {
+ leaf[i] = node->is_child_leaf(i);
+ if (hasChild(node, i)) {
+ children[i] = getChild(node, count);
+ count++;
+ }
+ else {
+ children[i] = NULL;
+ leaf[i] = 0;
+ }
+ }
+ }
+
+ /// Sets the child pointer
+ void setChild(InternalNode *node, int count, Node *chd)
+ {
+ node->children[count] = chd;
+ }
+ void setInternalChild(InternalNode *node, int index, int count, InternalNode *chd)
+ {
+ setChild(node, count, (Node *)chd);
+ node->has_child |= (1 << index);
+ }
+ void setLeafChild(InternalNode *node, int index, int count, LeafNode *chd)
+ {
+ setChild(node, count, (Node *)chd);
+ node->has_child |= (1 << index);
+ node->child_is_leaf |= (1 << index);
+ }
/// Add a kid to an existing internal node
+ /// Fix me: can we do this without wasting memory ?
+ /// Fixed: using variable memory
InternalNode *addChild(InternalNode *node, int index, Node *child, int aLeaf)
{
// Create new internal node
- int num = node->get_num_children();
+ int num = getNumChildren(node);
InternalNode *rnode = createInternal(num + 1);
// Establish children
@@ -1283,19 +1242,19 @@ class Octree
for (i = 0; i < 8; i++) {
if (i == index) {
if (aLeaf) {
- rnode->set_leaf_child(i, count2, &child->leaf);
+ setLeafChild(rnode, i, count2, &child->leaf);
}
else {
- rnode->set_internal_child(i, count2, &child->internal);
+ setInternalChild(rnode, i, count2, &child->internal);
}
count2++;
}
- else if (node->has_child(i)) {
+ else if (hasChild(node, i)) {
if (node->is_child_leaf(i)) {
- rnode->set_leaf_child(i, count2, &node->get_child(count1)->leaf);
+ setLeafChild(rnode, i, count2, &getChild(node, count1)->leaf);
}
else {
- rnode->set_internal_child(i, count2, &node->get_child(count1)->internal);
+ setInternalChild(rnode, i, count2, &getChild(node, count1)->internal);
}
count1++;
count2++;
@@ -1310,8 +1269,8 @@ class Octree
InternalNode *createInternal(int length)
{
InternalNode *inode = (InternalNode *)alloc[length]->allocate();
- inode->has_child_bitfield = 0;
- inode->child_is_leaf_bitfield = 0;
+ inode->has_child = 0;
+ inode->child_is_leaf = 0;
return inode;
}
@@ -1342,21 +1301,21 @@ class Octree
InternalNode *addLeafChild(InternalNode *par, int index, int count,
LeafNode *leaf)
{
- int num = par->get_num_children() + 1;
+ int num = getNumChildren(par) + 1;
InternalNode *npar = createInternal(num);
*npar = *par;
if (num == 1) {
- npar->set_leaf_child(index, 0, leaf);
+ setLeafChild(npar, index, 0, leaf);
}
else {
int i;
for (i = 0; i < count; i++) {
- npar->set_child(i, par->get_child(i));
+ setChild(npar, i, getChild(par, i));
}
- npar->set_leaf_child(index, count, leaf);
+ setLeafChild(npar, index, count, leaf);
for (i = count + 1; i < num; i++) {
- npar->set_child(i, par->get_child(i - 1));
+ setChild(npar, i, getChild(par, i - 1));
}
}
@@ -1367,21 +1326,21 @@ class Octree
InternalNode *addInternalChild(InternalNode *par, int index, int count,
InternalNode *node)
{
- int num = par->get_num_children() + 1;
+ int num = getNumChildren(par) + 1;
InternalNode *npar = createInternal(num);
*npar = *par;
if (num == 1) {
- npar->set_internal_child(index, 0, node);
+ setInternalChild(npar, index, 0, node);
}
else {
int i;
for (i = 0; i < count; i++) {
- npar->set_child(i, par->get_child(i));
+ setChild(npar, i, getChild(par, i));
}
- npar->set_internal_child(index, count, node);
+ setInternalChild(npar, index, count, node);
for (i = count + 1; i < num; i++) {
- npar->set_child(i, par->get_child(i - 1));
+ setChild(npar, i, getChild(par, i - 1));
}
}
diff --git a/intern/opennl/intern/opennl.c b/intern/opennl/intern/opennl.c
index f9c63e9ecf6..71809cc7480 100644
--- a/intern/opennl/intern/opennl.c
+++ b/intern/opennl/intern/opennl.c
@@ -137,14 +137,14 @@ static void __nl_should_not_have_reached(char* file, int line) {
/************************************************************************************/
/* memory management */
-#define __NL_NEW(T) (T*)(calloc(1, sizeof(T)))
-#define __NL_NEW_ARRAY(T,NB) (T*)(calloc(MAX(NB, 1),sizeof(T)))
+#define __NL_NEW(T) (T*)(calloc(1, sizeof(T)))
+#define __NL_NEW_ARRAY(T,NB) (T*)(calloc((NB),sizeof(T)))
#define __NL_RENEW_ARRAY(T,x,NB) (T*)(realloc(x,(NB)*sizeof(T)))
-#define __NL_DELETE(x) if(x) free(x); x = NULL
-#define __NL_DELETE_ARRAY(x) if(x) free(x); x = NULL
+#define __NL_DELETE(x) free(x); x = NULL
+#define __NL_DELETE_ARRAY(x) free(x); x = NULL
-#define __NL_CLEAR(T, x) memset(x, 0, sizeof(T))
-#define __NL_CLEAR_ARRAY(T,x,NB) if(NB) memset(x, 0, (NB)*sizeof(T))
+#define __NL_CLEAR(T, x) memset(x, 0, sizeof(T))
+#define __NL_CLEAR_ARRAY(T,x,NB) memset(x, 0, (NB)*sizeof(T))
/************************************************************************************/
/* Dynamic arrays for sparse row/columns */
@@ -1042,9 +1042,6 @@ static NLboolean __nlFactorize_SUPERLU(__NLContext *context, NLint *permutation)
NLuint n = context->n;
NLuint nnz = __nlSparseMatrixNNZ(M); /* number of non-zero coeffs */
- /*if(n > 10)
- n = 10;*/
-
/* Compressed Row Storage matrix representation */
NLint *xa = __NL_NEW_ARRAY(NLint, n+1);
NLfloat *rhs = __NL_NEW_ARRAY(NLfloat, n);
diff --git a/intern/opennl/superlu/get_perm_c.c b/intern/opennl/superlu/get_perm_c.c
index 59889645988..320fe3471f4 100644
--- a/intern/opennl/superlu/get_perm_c.c
+++ b/intern/opennl/superlu/get_perm_c.c
@@ -173,19 +173,17 @@ getata(
/* Flag the diagonal so it's not included in the B matrix */
marker[j] = j;
- if ( *atanz ) {
- for (i = colptr[j]; i < colptr[j+1]; ++i) {
- /* A_kj is nonzero, add pattern of column T_*k to B_*j */
- k = rowind[i];
- for (ti = t_colptr[k]; ti < t_colptr[k+1]; ++ti) {
- trow = t_rowind[ti];
- if ( marker[trow] != j ) {
- marker[trow] = j;
- b_rowind[num_nz++] = trow;
- }
- }
- }
+ for (i = colptr[j]; i < colptr[j+1]; ++i) {
+ /* A_kj is nonzero, add pattern of column T_*k to B_*j */
+ k = rowind[i];
+ for (ti = t_colptr[k]; ti < t_colptr[k+1]; ++ti) {
+ trow = t_rowind[ti];
+ if ( marker[trow] != j ) {
+ marker[trow] = j;
+ b_rowind[num_nz++] = trow;
}
+ }
+ }
}
b_colptr[n] = num_nz;
@@ -307,23 +305,21 @@ at_plus_a(
marker[j] = j;
/* Add pattern of column A_*k to B_*j */
- if (*bnz) {
- for (i = colptr[j]; i < colptr[j+1]; ++i) {
- k = rowind[i];
- if ( marker[k] != j ) {
- marker[k] = j;
- (*b_rowind)[num_nz++] = k;
- }
- }
+ for (i = colptr[j]; i < colptr[j+1]; ++i) {
+ k = rowind[i];
+ if ( marker[k] != j ) {
+ marker[k] = j;
+ (*b_rowind)[num_nz++] = k;
+ }
+ }
- /* Add pattern of column T_*k to B_*j */
- for (i = t_colptr[j]; i < t_colptr[j+1]; ++i) {
- k = t_rowind[i];
- if ( marker[k] != j ) {
- marker[k] = j;
- (*b_rowind)[num_nz++] = k;
- }
- }
+ /* Add pattern of column T_*k to B_*j */
+ for (i = t_colptr[j]; i < t_colptr[j+1]; ++i) {
+ k = t_rowind[i];
+ if ( marker[k] != j ) {
+ marker[k] = j;
+ (*b_rowind)[num_nz++] = k;
+ }
}
}
(*b_colptr)[n] = num_nz;
diff --git a/release/datafiles/startup.blend b/release/datafiles/startup.blend
index 8b0e052fad8..3db58b8fb69 100644
--- a/release/datafiles/startup.blend
+++ b/release/datafiles/startup.blend
Binary files differ
diff --git a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
index cf545840b6f..33d3be63b0b 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
@@ -298,7 +298,7 @@ def dump_messages_pytext(messages, check_ctxt):
# check it has a 'text' argument
for (arg_pos, (arg_kw, arg)) in enumerate(func.parameters.items()):
if ((arg_kw in translate_kw) and
- (arg.is_output is False) and
+ (arg.is_output == False) and
(arg.type == 'STRING')):
func_translate_args.setdefault(func_id, []).append((arg_kw,
diff --git a/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py b/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py
index d28f87cf042..5ee5c71be8b 100755
--- a/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py
+++ b/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py
@@ -34,7 +34,6 @@
import sys
import ctypes
-import re
try:
import settings
@@ -88,64 +87,44 @@ FRIBIDI_FLAGS_ARABIC = FRIBIDI_FLAG_SHAPE_ARAB_PRES | \
FRIBIDI_FLAG_SHAPE_ARAB_LIGA
-MENU_DETECT_REGEX = re.compile("%x\\d+\\|")
-
-
##### Kernel processing funcs. #####
def protect_format_seq(msg):
"""
Find some specific escaping/formating sequences (like \", %s, etc.,
and protect them from any modification!
"""
-# LRM = "\u200E"
-# RLM = "\u200F"
LRE = "\u202A"
- RLE = "\u202B"
PDF = "\u202C"
- LRO = "\u202D"
- RLO = "\u202E"
- uctrl = {LRE, RLE, PDF, LRO, RLO}
# Most likely incomplete, but seems to cover current needs.
format_codes = set("tslfd")
digits = set(".0123456789")
- if not msg:
- return msg
- elif MENU_DETECT_REGEX.search(msg):
- # An ugly "menu" message, just force it whole LRE if not yet done.
- if msg[0] not in {LRE, LRO}:
- msg = LRE + msg
-
idx = 0
ret = []
ln = len(msg)
while idx < ln:
dlt = 1
-# # If we find a control char, skip any additional protection!
-# if msg[idx] in uctrl:
-# ret.append(msg[idx:])
-# break
# \" or \'
if idx < (ln - 1) and msg[idx] == '\\' and msg[idx + 1] in "\"\'":
dlt = 2
- # %x12|
- elif idx < (ln - 2) and msg[idx] == '%' and msg[idx + 1] in "x" and msg[idx + 2] in digits:
+ # %x12
+ elif idx < (ln - 2) and msg[idx] == '%' and msg[idx + 1] in "x" and \
+ msg[idx + 2] in digits:
dlt = 2
- while (idx + dlt) < ln and msg[idx + dlt] in digits:
- dlt += 1
- if (idx + dlt) < ln and msg[idx + dlt] is '|':
+ while (idx + dlt + 1) < ln and msg[idx + dlt + 1] in digits:
dlt += 1
# %.4f
elif idx < (ln - 3) and msg[idx] == '%' and msg[idx + 1] in digits:
dlt = 2
- while (idx + dlt) < ln and msg[idx + dlt] in digits:
+ while (idx + dlt + 1) < ln and msg[idx + dlt + 1] in digits:
dlt += 1
- if (idx + dlt) < ln and msg[idx + dlt] in format_codes:
+ if (idx + dlt + 1) < ln and msg[idx + dlt + 1] in format_codes:
dlt += 1
else:
dlt = 1
# %s
- elif idx < (ln - 1) and msg[idx] == '%' and msg[idx + 1] in format_codes:
+ elif idx < (ln - 1) and msg[idx] == '%' and \
+ msg[idx + 1] in format_codes:
dlt = 2
if dlt > 1:
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index d32b69b501c..41fe052c434 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -264,8 +264,8 @@ def module_names(path, recursive=False):
if recursive:
for mod_name, mod_path in module_names(directory, True):
modules.append(("%s.%s" % (filename, mod_name),
- mod_path,
- ))
+ mod_path,
+ ))
return modules
diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py
index ad3cf8c08ec..ad0fe06b68b 100644
--- a/release/scripts/modules/bpy_extras/mesh_utils.py
+++ b/release/scripts/modules/bpy_extras/mesh_utils.py
@@ -232,7 +232,7 @@ def edge_loops_from_tessfaces(mesh, tessfaces=None, seams=()):
ed_adj = edges[context_loop[-1]]
if len(ed_adj) != 2:
# the original edge had 2 other edges
- if other_dir and flipped is False:
+ if other_dir and flipped == False:
flipped = True # only flip the list once
context_loop.reverse()
ed_adj[:] = []
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 4cd823d9184..9ad9a7affc3 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -689,10 +689,10 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
files = []
for directory in searchpaths:
files.extend([(f, os.path.join(directory, f))
- for f in os.listdir(directory)
- if (not f.startswith("."))
- if ((filter_ext is None) or
- (filter_ext(os.path.splitext(f)[1])))
+ for f in os.listdir(directory)
+ if (not f.startswith("."))
+ if ((filter_ext is None) or
+ (filter_ext(os.path.splitext(f)[1])))
])
files.sort()
diff --git a/release/scripts/modules/bpyml.py b/release/scripts/modules/bpyml.py
index e942006010b..42d2bf94fba 100644
--- a/release/scripts/modules/bpyml.py
+++ b/release/scripts/modules/bpyml.py
@@ -160,7 +160,7 @@ if __name__ == "__main__":
from bpyml_test import *
draw = [
- ui()[
+ ui()[
split()[
column()[
prop(data='context.scene.render', property='use_stamp_time', text='Time'),
diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py
index 18d448b764f..582a1c6ae14 100644
--- a/release/scripts/modules/console_python.py
+++ b/release/scripts/modules/console_python.py
@@ -30,7 +30,7 @@ _BPY_MAIN_OWN = True
def add_scrollback(text, text_type):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
- type=text_type)
+ type=text_type)
def replace_help(namespace):
@@ -195,7 +195,7 @@ def execute(context):
# insert a new blank line
bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
+ remove_duplicates=True)
# Insert the output into the editor
# not quite correct because the order might have changed,
diff --git a/release/scripts/modules/console_shell.py b/release/scripts/modules/console_shell.py
index 42348f453cd..8beff24eedb 100644
--- a/release/scripts/modules/console_shell.py
+++ b/release/scripts/modules/console_shell.py
@@ -26,7 +26,7 @@ language_id = "shell"
def add_scrollback(text, text_type):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
- type=text_type)
+ type=text_type)
def shell_run(text):
@@ -57,7 +57,7 @@ def execute(context):
# insert a new blank line
bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
+ remove_duplicates=True)
sc.prompt = os.getcwd() + PROMPT
return {'FINISHED'}
diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py
index 6f4b63fc99a..0ef2ac5164d 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -249,7 +249,7 @@ class InfoPropertyRNA:
def get_arg_default(self, force=True):
default = self.default_str
- if default and (force or self.is_required is False):
+ if default and (force or self.is_required == False):
return "%s=%s" % (self.identifier, default)
return self.identifier
@@ -493,7 +493,7 @@ def BuildRNAInfo():
# Arrange so classes are always defined in the correct order
deps_ok = False
- while deps_ok is False:
+ while deps_ok == False:
deps_ok = True
rna_done = set()
diff --git a/release/scripts/modules/rna_xml.py b/release/scripts/modules/rna_xml.py
index fc8e3125228..2ea978419b9 100644
--- a/release/scripts/modules/rna_xml.py
+++ b/release/scripts/modules/rna_xml.py
@@ -250,7 +250,7 @@ def xml2rna(root_xml,
if value_xml.startswith("#"):
# read hexidecimal value as float array
value_xml_split = value_xml[1:]
- value_xml_coerce = [int(value_xml_split[i:i + 2], 16) / 255 for i in range(0, len(value_xml_split), 2)]
+ value_xml_coerce = [int(value_xml_split[i:i + 2], 16) / 255 for i in range(0, len(value_xml_split), 2)]
del value_xml_split
else:
value_xml_split = value_xml.split()
diff --git a/release/scripts/presets/interface_theme/ubuntu_ambiance.xml b/release/scripts/presets/interface_theme/ubuntu_ambiance.xml
index 05075f06239..902e2384f28 100644
--- a/release/scripts/presets/interface_theme/ubuntu_ambiance.xml
+++ b/release/scripts/presets/interface_theme/ubuntu_ambiance.xml
@@ -1,47 +1,47 @@
<bpy>
<Theme>
<view_3d>
- <ThemeView3D object_active="#f47421"
+ <ThemeView3D object_active="#f58032"
editmesh_active="#ffffff80"
act_spline="#ee4000"
- handle_align="#93237f"
- handle_sel_align="#f47421"
- handle_auto="#00c59a"
- handle_sel_auto="#f47421"
+ handle_align="#862074"
+ handle_sel_align="#f090a0"
+ handle_auto="#909000"
+ handle_sel_auto="#f0ff40"
bone_pose="#50c8ff"
bone_pose_active="#8cffff"
bone_solid="#c8c8c8"
bundle_solid="#c8c8c8"
- camera="#159dce"
- camera_path="#7dbd00"
+ camera="#000000"
+ camera_path="#000000"
frame_current="#60c040"
edge_crease="#ce33b8"
extra_edge_len="#200000"
edge_seam="#db4100"
- edge_select="#f47421"
+ edge_select="#f68d46"
edge_sharp="#ff4c00"
edge_facesel="#4b4b4b"
empty="#93237f"
face="#75757512"
extra_face_angle="#002000"
extra_face_area="#0059ee"
- face_dot="#f47421"
+ face_dot="#ff8500"
facedot_size="3"
normal="#19b6ee"
- face_select="#f474213c"
- handle_free="#a5ca00"
- handle_sel_free="#f47421"
+ face_select="#ff85003c"
+ handle_free="#000000"
+ handle_sel_free="#000000"
grid="#3c3b37"
- lamp="#ffffff34"
+ lamp="#00000028"
lastsel_point="#ffffff"
nurb_uline="#909000"
nurb_vline="#862074"
nurb_sel_uline="#f0ff40"
nurb_sel_vline="#d15d85"
- object_grouped="#117211"
- object_grouped_active="#65d665"
+ object_grouped="#083008"
+ object_grouped_active="#55bb55"
object_selected="#f15800"
- outline_width="2"
+ outline_width="1"
panel="#a5a5a57f"
skin_root="#000000"
speaker="#93237f"
@@ -50,20 +50,20 @@
handle_sel_vect="#82c036"
vertex="#c96cb8"
vertex_normal="#19b6ee"
- vertex_select="#f47421"
+ vertex_select="#f15800"
vertex_size="2"
- wire="#93237f">
+ wire="#862074">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
button_text="#9c9c9c"
button_text_hi="#ffffff"
button_title="#9c9c9c"
- text="#9c9c9c"
+ text="#000000"
text_hi="#ffffff"
- title="#9c9c9c"
+ title="#000000"
back="#131311">
</ThemeSpaceGeneric>
</space>
@@ -71,7 +71,7 @@
</view_3d>
<clip_editor>
<ThemeClipEditor active_marker="#ffffff"
- frame_current="#f47421"
+ frame_current="#c07100"
disabled_marker="#7f0000"
grid="#302e2c"
handle_vertex="#000000"
@@ -86,16 +86,16 @@
strips="#0c0a0a"
strips_selected="#ff8c00">
<space>
- <ThemeSpaceGeneric header="#464541"
- header_text="#9c9c9c"
+ <ThemeSpaceGeneric header="#3c3b37"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
- button_text="#ffffff"
+ button_text="#000000"
button_text_hi="#ffffff"
- button_title="#9c9c9c"
- text="#9c9c9c"
+ button_title="#000000"
+ text="#000000"
text_hi="#ffffff"
- title="#9c9c9c"
+ title="#000000"
back="#131311">
</ThemeSpaceGeneric>
</space>
@@ -109,14 +109,14 @@
</ThemeClipEditor>
</clip_editor>
<console>
- <ThemeConsole cursor="#f47421"
- line_error="#ff0000"
- line_info="#f47421"
- line_input="#19b6ee"
- line_output="#97f500">
+ <ThemeConsole cursor="#dc5a00"
+ line_error="#dc0000"
+ line_info="#85aa00"
+ line_input="#828282"
+ line_output="#f58032">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
button_text="#000000"
@@ -133,7 +133,7 @@
<dopesheet_editor>
<ThemeDopeSheet active_channels_group="#a2b15c"
channel_group="#4f6549"
- channels="#9c9c9c"
+ channels="#74736e"
channels_selected="#6592f5"
frame_current="#f58032"
dopesheet_channel="#64486e"
@@ -143,26 +143,26 @@
long_key_selected="#f47421"
summary="#00000000"
value_sliders="#000000"
- view_sliders="#9c9c9c">
+ view_sliders="#969696">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#cacaca"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
- button_text="#9c9c9c"
+ button_text="#000000"
button_text_hi="#ffffff"
- button_title="#9c9c9c"
- text="#e7e7e7"
+ button_title="#000000"
+ text="#000000"
text_hi="#ffffff"
- title="#9c9c9c"
+ title="#000000"
back="#131311">
</ThemeSpaceGeneric>
</space>
<space_list>
<ThemeSpaceListGeneric list="#3c3b37"
- list_text="#e2e2e2"
- list_text_hi="#f47421"
- list_title="#ffffff">
+ list_text="#000000"
+ list_text_hi="#ffffff"
+ list_title="#dddddd">
</ThemeSpaceListGeneric>
</space_list>
</ThemeDopeSheet>
@@ -175,8 +175,8 @@
selected_file="#6b395a"
tiles="#3c3b37">
<space>
- <ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ <ThemeSpaceGeneric header="#3c3b37"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#727272"
button_text="#000000"
@@ -199,50 +199,50 @@
</file_browser>
<graph_editor>
<ThemeGraphEditor active_channels_group="#87b17d"
- handle_align="#93237f"
- handle_sel_align="#f49600"
- handle_auto="#00c59a"
- handle_sel_auto="#f49600"
- handle_auto_clamped="#03aa60"
- handle_sel_auto_clamped="#f49600"
+ handle_align="#803060"
+ handle_sel_align="#f090a0"
+ handle_auto="#909000"
+ handle_sel_auto="#f0ff40"
+ handle_auto_clamped="#994030"
+ handle_sel_auto_clamped="#f0af90"
channel_group="#4f6549"
channels_region="#707070"
frame_current="#f58032"
dopesheet_channel="#695c6e"
dopesheet_subchannel="#7c8996"
- handle_free="#a5ca00"
- handle_sel_free="#f49600"
+ handle_free="#000000"
+ handle_sel_free="#000000"
grid="#3c3b37"
- handle_vertex="#bbbbbb"
- handle_vertex_select="#f49600"
- handle_vertex_size="4"
- lastsel_point="#fafafa"
+ handle_vertex="#000000"
+ handle_vertex_select="#f47421"
+ handle_vertex_size="3"
+ lastsel_point="#000000"
panel="#ffffff"
handle_vect="#409030"
handle_sel_vect="#40c030"
- vertex="#ffffff"
- vertex_select="#f49600"
- vertex_size="4"
+ vertex="#000000"
+ vertex_select="#ff8500"
+ vertex_size="3"
window_sliders="#95948f">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
- button_text="#9c9c9c"
+ button_text="#c3c2bc"
button_text_hi="#ffffff"
- button_title="#9c9c9c"
- text="#e9e9e9"
+ button_title="#9e9d98"
+ text="#000000"
text_hi="#ffffff"
- title="#9c9c9c"
+ title="#000000"
back="#131311">
</ThemeSpaceGeneric>
</space>
<space_list>
<ThemeSpaceListGeneric list="#3c3b37"
- list_text="#e2e2e2"
- list_text_hi="#f47421"
- list_title="#ffffff">
+ list_text="#000000"
+ list_text_hi="#ffffff"
+ list_title="#000000">
</ThemeSpaceListGeneric>
</space_list>
</ThemeGraphEditor>
@@ -265,7 +265,7 @@
vertex_size="3">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
button_text="#b9b9b9"
@@ -301,16 +301,16 @@
<ThemeLogicEditor panel="#acacac">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
- button="#353430"
+ button="#131311"
button_text="#acacac"
button_text_hi="#ffffff"
button_title="#7d7d7d"
text="#acacac"
text_hi="#ffffff"
title="#000000"
- back="#29001b">
+ back="#131311">
</ThemeSpaceGeneric>
</space>
</ThemeLogicEditor>
@@ -333,7 +333,7 @@
view_sliders="#969696">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
button_text="#000000"
@@ -369,7 +369,7 @@
wire="#f45b00">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#353430"
button_text="#acacac"
@@ -395,7 +395,7 @@
selected_highlight="#6a3859">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
button_text="#000000"
@@ -413,7 +413,7 @@
<ThemeProperties panel="#3c3b37">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
button_text="#000000"
@@ -444,32 +444,32 @@
window_sliders="#a0a0a0">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
- button_text="#acacac"
+ button_text="#000000"
button_text_hi="#ffffff"
- button_title="#acacac"
- text="#acacac"
+ button_title="#000000"
+ text="#000000"
text_hi="#ffffff"
- title="#acacac"
+ title="#000000"
back="#191919">
</ThemeSpaceGeneric>
</space>
</ThemeSequenceEditor>
</sequence_editor>
<text_editor>
- <ThemeTextEditor cursor="#f47421"
- syntax_special="#33a500"
+ <ThemeTextEditor cursor="#df5106"
+ syntax_special="#8c8c28"
line_numbers_background="#3c3b37"
- selected_text="#641f44"
- syntax_builtin="#d6ff01"
+ selected_text="#ffffff"
+ syntax_builtin="#df3ac2"
syntax_comment="#249d60"
- syntax_numbers="#972144"
- syntax_string="#6e00ff">
+ syntax_numbers="#3c68ff"
+ syntax_string="#aa2694">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#191919"
button_text="#95948f"
@@ -488,13 +488,13 @@
grid="#272727">
<space>
<ThemeSpaceGeneric header="#464541"
- header_text="#acacac"
+ header_text="#000000"
header_text_hi="#ffffff"
button="#3c3b37"
- button_text="#9c9c9c"
+ button_text="#000000"
button_text_hi="#ffffff"
- button_title="#9c9c9c"
- text="#9c9c9c"
+ button_title="#000000"
+ text="#949494"
text_hi="#ffffff"
title="#000000"
back="#131311">
@@ -532,13 +532,13 @@
<wcol_menu_back>
<ThemeWidgetColors inner="#131312db"
inner_sel="#2d2d2de6"
- item="#6a3859ff"
+ item="#cbc3bbff"
outline="#0d0d0d"
shadedown="-20"
shadetop="25"
show_shaded="FALSE"
- text="#dddddd"
- text_sel="#dddddd">
+ text="#7a7a7a"
+ text_sel="#ffffff">
</ThemeWidgetColors>
</wcol_menu_back>
<wcol_menu_item>
@@ -574,7 +574,7 @@
shadetop="20"
show_shaded="TRUE"
text="#dfdbcf"
- text_sel="#f47421">
+ text_sel="#fffbed">
</ThemeWidgetColors>
</wcol_num>
<wcol_option>
@@ -615,7 +615,7 @@
shadetop="25"
show_shaded="FALSE"
text="#dddddd"
- text_sel="#ffffff">
+ text_sel="#fff7fb">
</ThemeWidgetColors>
</wcol_pulldown>
<wcol_radio>
@@ -627,7 +627,7 @@
shadetop="5"
show_shaded="TRUE"
text="#dfdbcf"
- text_sel="#dfdbcf">
+ text_sel="#ffffff">
</ThemeWidgetColors>
</wcol_radio>
<wcol_regular>
@@ -639,16 +639,16 @@
shadetop="21"
show_shaded="TRUE"
text="#dfdfdf"
- text_sel="#dfdfdf">
+ text_sel="#ffffff">
</ThemeWidgetColors>
</wcol_regular>
<wcol_scroll>
- <ThemeWidgetColors inner="#000000b4"
+ <ThemeWidgetColors inner="#020202b4"
inner_sel="#646464c6"
- item="#2e2d2aff"
- outline="#000000"
- shadedown="-10"
- shadetop="10"
+ item="#2c2b28ff"
+ outline="#0d0d0d"
+ shadedown="-5"
+ shadetop="5"
show_shaded="TRUE"
text="#cbc3bb"
text_sel="#ffffff">
@@ -685,7 +685,7 @@
shadetop="-10"
show_shaded="TRUE"
text="#dfdbcf"
- text_sel="#ffffff">
+ text_sel="#fffaec">
</ThemeWidgetColors>
</wcol_text>
<wcol_toggle>
@@ -721,7 +721,7 @@
shadetop="25"
show_shaded="FALSE"
text="#ffffff"
- text_sel="#ff5d0d">
+ text_sel="#ffffff">
</ThemeWidgetColors>
</wcol_tooltip>
</ThemeUserInterface>
diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py
index 7da4d8a480d..6c48ae72e4b 100644
--- a/release/scripts/startup/bl_operators/add_mesh_torus.py
+++ b/release/scripts/startup/bl_operators/add_mesh_torus.py
@@ -49,9 +49,9 @@ def add_torus(major_rad, minor_rad, major_seg, minor_seg):
angle = 2 * pi * minor_index / minor_seg
vec = quat * Vector((major_rad + (cos(angle) * minor_rad),
- 0.0,
- (sin(angle) * minor_rad),
- ))
+ 0.0,
+ (sin(angle) * minor_rad),
+ ))
verts.extend(vec[:])
@@ -133,7 +133,7 @@ class AddTorus(Operator, object_utils.AddObjectHelper):
)
def execute(self, context):
- if self.use_abso is True:
+ if self.use_abso == True:
extra_helper = (self.abso_major_rad - self.abso_minor_rad) * 0.5
self.major_radius = self.abso_minor_rad + extra_helper
self.minor_radius = extra_helper
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index 902c7007fb9..c5fc3c50f3f 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -214,7 +214,7 @@ class BakeAction(Operator):
'OBJECT' in self.bake_types,
self.clear_constraints,
True,
- )
+ )
if action is None:
self.report({'INFO'}, "Nothing to bake")
@@ -252,8 +252,8 @@ class ClearUselessActions(Operator):
for action in bpy.data.actions:
# if only user is "fake" user...
- if ((self.only_unused is False) or
- (action.use_fake_user and action.users == 1)):
+ if ((self.only_unused is False) or
+ (action.use_fake_user and action.users == 1)):
# if it has F-Curves, then it's a "action library"
# (i.e. walk, wave, jump, etc.)
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index 70967a01d1c..c45d2f2e702 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -57,7 +57,7 @@ def CLIP_set_viewport_background(context, all_screens, clip, clip_user):
space_v3d.show_background_images = True
CLIP_spaces_walk(context, all_screens, 'VIEW_3D', 'VIEW_3D',
- set_background, clip, clip_user)
+ set_background, clip, clip_user)
def CLIP_camera_for_clip(context, clip):
@@ -329,7 +329,7 @@ object's movement caused by this constraint"""
if not con:
self.report({'ERROR'},
- "Motion Tracking constraint to be converted not found")
+ "Motion Tracking constraint to be converted not found")
return {'CANCELLED'}
@@ -341,7 +341,7 @@ object's movement caused by this constraint"""
if not clip:
self.report({'ERROR'},
- "Movie clip to use tracking data from isn't set")
+ "Movie clip to use tracking data from isn't set")
return {'CANCELLED'}
@@ -461,9 +461,9 @@ class CLIP_OT_setup_tracking_scene(Operator):
scene.camera = camob
camob.matrix_local = (Matrix.Translation((7.481, -6.508, 5.344)) *
- Matrix.Rotation(0.815, 4, 'Z') *
- Matrix.Rotation(0.011, 4, 'Y') *
- Matrix.Rotation(1.109, 4, 'X'))
+ Matrix.Rotation(0.815, 4, 'Z') *
+ Matrix.Rotation(0.011, 4, 'Y') *
+ Matrix.Rotation(1.109, 4, 'X'))
return camob
@@ -629,7 +629,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
if need_stabilization:
tree.links.new(distortion.outputs["Image"],
- stabilize.inputs["Image"])
+ stabilize.inputs["Image"])
tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"])
else:
tree.links.new(distortion.outputs["Image"], scale.inputs["Image"])
diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py
index 307165a4d18..fd95da02b28 100644
--- a/release/scripts/startup/bl_operators/console.py
+++ b/release/scripts/startup/bl_operators/console.py
@@ -129,6 +129,6 @@ class ConsoleLanguage(Operator):
# insert a new blank line
bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
+ remove_duplicates=True)
return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py
index df21349da47..3dc25d84aca 100644
--- a/release/scripts/startup/bl_operators/mesh.py
+++ b/release/scripts/startup/bl_operators/mesh.py
@@ -92,7 +92,7 @@ class MeshMirrorUV(Operator):
puvs[i] = tuple(uv.uv for uv in uv_loops[lstart:lend])
puvs_cpy[i] = tuple(uv.copy() for uv in puvs[i])
puvsel[i] = (False not in
- (uv.select for uv in uv_loops[lstart:lend]))
+ (uv.select for uv in uv_loops[lstart:lend]))
# Vert idx of the poly.
vidxs[i] = tuple(l.vertex_index for l in loops[lstart:lend])
# As we have no poly.center yet...
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index 4e90f2e8585..5000d718182 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -408,13 +408,13 @@ class ShapeTransfer(Operator):
n2loc_to = v2_to + target_normals[i2] * edlen_to
pt = barycentric_transform(orig_shape_coords[i1],
- v2, v1, n1loc,
- v2_to, v1_to, n1loc_to)
+ v2, v1, n1loc,
+ v2_to, v1_to, n1loc_to)
median_coords[i1].append(pt)
pt = barycentric_transform(orig_shape_coords[i2],
- v1, v2, n2loc,
- v1_to, v2_to, n2loc_to)
+ v1, v2, n2loc,
+ v1_to, v2_to, n2loc_to)
median_coords[i2].append(pt)
# apply the offsets to the new shape
@@ -507,7 +507,7 @@ class JoinUVs(Operator):
if obj_other != obj and obj_other.type == 'MESH':
mesh_other = obj_other.data
if mesh_other != mesh:
- if mesh_other.tag is False:
+ if mesh_other.tag == False:
mesh_other.tag = True
if len(mesh_other.loops) != nbr_loops:
@@ -520,7 +520,7 @@ class JoinUVs(Operator):
len(mesh_other.polygons),
nbr_loops,
),
- )
+ )
else:
uv_other = mesh_other.uv_layers.active
if not uv_other:
diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index 694412e51d7..32658d353d9 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -89,7 +89,7 @@ class PlayRenderedAnim(Operator):
if player_path == "":
player_path = guess_player_path(preset)
- if is_movie is False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
+ if is_movie == False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
# replace the number with '#'
file_a = rd.frame_path(frame=0)
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index eac90a8b091..07d4096632f 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -608,9 +608,9 @@ class WM_OT_context_collection_boolean_set(Operator):
except:
continue
- if value_orig is True:
+ if value_orig == True:
is_set = True
- elif value_orig is False:
+ elif value_orig == False:
pass
else:
self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" %
@@ -1028,7 +1028,7 @@ class WM_OT_properties_edit(Operator):
min = rna_min
max = rna_max
description = StringProperty(
- name="Tooltip",
+ name="Tip",
)
def execute(self, context):
@@ -1583,7 +1583,7 @@ class WM_OT_addon_enable(Operator):
"version %d.%d.%d and might not "
"function (correctly), "
"though it is enabled") %
- info_ver)
+ info_ver)
return {'FINISHED'}
else:
return {'CANCELLED'}
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 09d866c2ae5..847807029fa 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -95,7 +95,7 @@ def register():
items = [('All', "All", ""),
('Enabled', "Enabled", ""),
('Disabled', "Disabled", ""),
- ]
+ ]
items_unique = set()
@@ -120,7 +120,7 @@ def register():
items=[('OFFICIAL', "Official", "Officially supported"),
('COMMUNITY', "Community", "Maintained by community developers"),
('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"),
- ],
+ ],
name="Support",
description="Display support level",
default={'OFFICIAL', 'COMMUNITY'},
diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py
index 8308c7fc425..2d15c534e9f 100644
--- a/release/scripts/startup/bl_ui/properties_animviz.py
+++ b/release/scripts/startup/bl_ui/properties_animviz.py
@@ -65,13 +65,10 @@ class MotionPathButtonsPanel():
sub.prop(mpath, "frame_start", text="From")
sub.prop(mpath, "frame_end", text="To")
- sub = col.row(align=True)
if bones:
- sub.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA')
- sub.operator("pose.paths_clear", text="", icon='X')
+ col.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA')
else:
- sub.operator("object.paths_update", text="Update Paths", icon='OBJECT_DATA')
- sub.operator("object.paths_clear", text="", icon='X')
+ col.operator("object.paths_update", text="Update Paths", icon='OBJECT_DATA')
else:
sub = col.column(align=True)
sub.label(text="Nothing to show yet...", icon='ERROR')
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index 50c34be1414..e194d7a1370 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -285,9 +285,10 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
row.prop(itasc, "damping_max", text="Damp", slider=True)
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
-from bl_ui.properties_animviz import (MotionPathButtonsPanel,
- OnionSkinButtonsPanel,
- )
+from bl_ui.properties_animviz import (
+ MotionPathButtonsPanel,
+ OnionSkinButtonsPanel,
+ )
class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py
index 1e70483864c..e6d9affee93 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -251,52 +251,52 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
split.active = pchan.is_in_ik_chain
row = split.row()
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
- row.active = pchan.lock_ik_x is False and pchan.is_in_ik_chain
+ row.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_x", text="Limit")
- sub.active = pchan.lock_ik_x is False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_x", text="")
sub.prop(pchan, "ik_max_x", text="")
- sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_x == False and pchan.use_ik_limit_x and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y")
split.active = pchan.is_in_ik_chain
row = split.row()
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
- row.active = pchan.lock_ik_y is False and pchan.is_in_ik_chain
+ row.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_y", text="Limit")
- sub.active = pchan.lock_ik_y is False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_y", text="")
sub.prop(pchan, "ik_max_y", text="")
- sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_y == False and pchan.use_ik_limit_y and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z")
split.active = pchan.is_in_ik_chain
sub = split.row()
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
- sub.active = pchan.lock_ik_z is False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_z", text="Limit")
- sub.active = pchan.lock_ik_z is False and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_z", text="")
sub.prop(pchan, "ik_max_z", text="")
- sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and pchan.is_in_ik_chain
+ sub.active = pchan.lock_ik_z == False and pchan.use_ik_limit_z and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
split.label(text="Stretch:")
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 0398cb36b18..ed390be49f5 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -397,7 +397,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = layout.column()
- if md.use_mirror_merge is True:
+ if md.use_mirror_merge == True:
col.prop(md, "merge_threshold")
col.label(text="Mirror Object:")
col.prop(md, "mirror_object", text="")
@@ -559,7 +559,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
row = col.row()
- row.active = (md.object is None or md.use_object_screw_offset is False)
+ row.active = (md.object is None or md.use_object_screw_offset == False)
row.prop(md, "screw_offset")
row = col.row()
row.active = (md.object is not None)
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 8a668b5d95b..f2c631b7ab1 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -290,8 +290,10 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
row.prop(ob, "slow_parent_offset", text="Offset")
-from bl_ui.properties_animviz import (MotionPathButtonsPanel,
- OnionSkinButtonsPanel)
+from bl_ui.properties_animviz import (
+ MotionPathButtonsPanel,
+ OnionSkinButtonsPanel,
+ )
class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py
index fba7bd8712a..3d671a0d1b7 100644
--- a/release/scripts/startup/bl_ui/properties_object_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_object_constraint.py
@@ -212,7 +212,6 @@ class ConstraintButtonsPanel():
def FOLLOW_PATH(self, context, layout, con):
self.target_template(layout, con)
- layout.operator("constraint.followpath_path_animate", text="Animate Path", icon='ANIM_DATA')
split = layout.split()
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index f29589faa2d..aa0ea1d2d9e 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -21,11 +21,12 @@ import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from bl_ui.properties_physics_common import (point_cache_ui,
- effector_weights_ui,
- basic_force_field_settings_ui,
- basic_force_field_falloff_ui,
- )
+from bl_ui.properties_physics_common import (
+ point_cache_ui,
+ effector_weights_ui,
+ basic_force_field_settings_ui,
+ basic_force_field_falloff_ui,
+ )
def particle_panel_enabled(context, psys):
@@ -51,7 +52,7 @@ def particle_panel_poll(cls, context):
if not settings:
return False
- return settings.is_fluid is False and (engine in cls.COMPAT_ENGINES)
+ return settings.is_fluid == False and (engine in cls.COMPAT_ENGINES)
def particle_get_settings(context):
@@ -132,13 +133,13 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
split = layout.split(percentage=0.32)
col = split.column()
col.label(text="Name:")
- if part.is_fluid is False:
+ if part.is_fluid == False:
col.label(text="Settings:")
col.label(text="Type:")
col = split.column()
col.prop(psys, "name", text="")
- if part.is_fluid is False:
+ if part.is_fluid == False:
row = col.row()
row.enabled = particle_panel_enabled(context, psys)
row.template_ID(psys, "settings", new="particle.new")
@@ -278,7 +279,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
cloth = psys.cloth.settings
- layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
+ layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked == False
split = layout.split()
@@ -812,7 +813,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
sub.active = (part.use_strand_primitive is False)
sub.prop(part, "use_render_adaptive")
sub = col.column()
- sub.active = part.use_render_adaptive or part.use_strand_primitive is True
+ sub.active = part.use_render_adaptive or part.use_strand_primitive == True
sub.prop(part, "adaptive_angle")
sub = col.column()
sub.active = (part.use_render_adaptive is True and part.use_strand_primitive is False)
@@ -830,9 +831,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
row = layout.row()
col = row.column()
- if part.type == 'HAIR' and part.use_strand_primitive is True and part.child_type == 'INTERPOLATED':
+ if part.type == 'HAIR' and part.use_strand_primitive == True and part.child_type == 'INTERPOLATED':
layout.prop(part, "use_simplify")
- if part.use_simplify is True:
+ if part.use_simplify == True:
row = layout.row()
row.prop(part, "simplify_refsize")
row.prop(part, "simplify_rate")
@@ -840,7 +841,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
row = layout.row()
row.prop(part, "use_simplify_viewport")
sub = row.row()
- sub.active = part.use_simplify_viewport is True
+ sub.active = part.use_simplify_viewport == True
sub.prop(part, "simplify_viewport")
elif part.render_type == 'OBJECT':
@@ -987,11 +988,11 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
if part.draw_percentage != 100 and psys is not None:
if part.type == 'HAIR':
- if psys.use_hair_dynamics and psys.point_cache.is_baked is False:
+ if psys.use_hair_dynamics and psys.point_cache.is_baked == False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
else:
phystype = part.physics_type
- if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked is False:
+ if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked == False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
row = layout.row()
diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index e5db1eec37e..33b977b5f04 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -20,8 +20,10 @@
import bpy
from bpy.types import Menu, Panel
-from bl_ui.properties_physics_common import (point_cache_ui,
- effector_weights_ui)
+from bl_ui.properties_physics_common import (
+ point_cache_ui,
+ effector_weights_ui,
+ )
def cloth_panel_enabled(md):
@@ -176,7 +178,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
ob = context.object
cloth = context.cloth.settings
- layout.active = (cloth.use_stiffness_scale and cloth_panel_enabled(md))
+ layout.active = cloth.use_stiffness_scale and cloth_panel_enabled(md)
split = layout.split()
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 00a35b233da..7f824d94431 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -160,7 +160,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
col = split.column()
- if cache.is_baked is True:
+ if cache.is_baked == True:
col.operator("ptcache.free_bake", text="Free Bake")
else:
col.operator("ptcache.bake", text="Bake").bake = True
diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
index fa37e9cd10f..db0794d8a8a 100644
--- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
+++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
@@ -20,9 +20,10 @@
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (point_cache_ui,
- effector_weights_ui,
- )
+from bl_ui.properties_physics_common import (
+ point_cache_ui,
+ effector_weights_ui,
+ )
class PhysicButtonsPanel():
diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py
index 6b5612d7836..569037cb0da 100644
--- a/release/scripts/startup/bl_ui/properties_physics_field.py
+++ b/release/scripts/startup/bl_ui/properties_physics_field.py
@@ -20,9 +20,10 @@
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (basic_force_field_settings_ui,
- basic_force_field_falloff_ui,
- )
+from bl_ui.properties_physics_common import (
+ basic_force_field_settings_ui,
+ basic_force_field_falloff_ui,
+ )
class PhysicButtonsPanel():
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index acbaad4f961..1b333f1e505 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -20,8 +20,10 @@
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (point_cache_ui,
- effector_weights_ui)
+from bl_ui.properties_physics_common import (
+ point_cache_ui,
+ effector_weights_ui,
+ )
class PhysicButtonsPanel():
diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py
index a69e7955de5..b043c1f9b68 100644
--- a/release/scripts/startup/bl_ui/properties_physics_softbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py
@@ -20,8 +20,10 @@
import bpy
from bpy.types import Panel
-from bl_ui.properties_physics_common import (point_cache_ui,
- effector_weights_ui)
+from bl_ui.properties_physics_common import (
+ point_cache_ui,
+ effector_weights_ui,
+ )
def softbody_panel_enabled(md):
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 544462e1242..74f4c719cd5 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -225,7 +225,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
# TODO: Change the following to iterate over existing presets
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
- if custom_framerate is True:
+ if custom_framerate == True:
fps_label_text = "Custom (" + str(fps_rate) + " fps)"
else:
fps_label_text = str(fps_rate) + " fps"
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 9e6bfe6889e..46a17675c91 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -111,14 +111,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
engine = context.scene.render.engine
if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")):
return False
- return ((context.material or
- context.world or
- context.lamp or
- context.brush or
- context.texture or
- context.particle_system or
- isinstance(context.space_data.pin_id, ParticleSettings)) and
- (engine in cls.COMPAT_ENGINES))
+ return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, ParticleSettings))
+ and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index f7b9f59b066..b0e8a847084 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -311,8 +311,8 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
col = layout.column(align=True)
col.active = not settings.use_tripod_solver
- col.prop(tracking_object, "keyframe_a")
- col.prop(tracking_object, "keyframe_b")
+ col.prop(settings, "keyframe_a")
+ col.prop(settings, "keyframe_b")
col = layout.column(align=True)
col.active = (tracking_object.is_camera and
@@ -891,12 +891,6 @@ class CLIP_MT_view(Menu):
layout.operator("clip.view_zoom_ratio",
text=text).ratio = a / b
else:
- if sc.view == 'GRAPH':
- layout.operator_context = 'INVOKE_REGION_PREVIEW'
- layout.operator("clip.graph_center_current_frame")
- layout.operator("clip.graph_view_all")
- layout.operator_context = 'INVOKE_DEFAULT'
-
layout.prop(sc, "show_seconds")
layout.separator()
@@ -948,7 +942,7 @@ class CLIP_MT_track(Menu):
props.action = 'UPTO'
props = layout.operator("clip.clear_track_path",
- text="Clear Track Path")
+ text="Clear Track Path")
props.action = 'ALL'
layout.separator()
@@ -963,7 +957,7 @@ class CLIP_MT_track(Menu):
layout.separator()
props = layout.operator("clip.track_markers",
- text="Track Frame Backwards")
+ text="Track Frame Backwards")
props.backwards = True
props = layout.operator("clip.track_markers", text="Track Backwards")
diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py
index 5ff179902a3..7ded4954f80 100644
--- a/release/scripts/startup/bl_ui/space_console.py
+++ b/release/scripts/startup/bl_ui/space_console.py
@@ -86,7 +86,7 @@ class CONSOLE_MT_language(Menu):
def add_scrollback(text, text_type):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
- type=text_type)
+ type=text_type)
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 9ab2a772df0..de58b5d1aaf 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -192,7 +192,7 @@ class INFO_MT_mesh_add(Menu):
def draw(self, context):
layout = self.layout
- layout.operator_context = 'EXEC_REGION_WIN'
+ layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane")
layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube")
layout.operator("mesh.primitive_circle_add", icon='MESH_CIRCLE', text="Circle")
@@ -203,7 +203,7 @@ class INFO_MT_mesh_add(Menu):
layout.separator()
layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid")
layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey")
- layout.operator("mesh.primitive_torus_add", icon='MESH_TORUS', text="Torus")
+ layout.operator("mesh.primitive_torus_add", text="Torus", icon='MESH_TORUS')
class INFO_MT_curve_add(Menu):
@@ -213,7 +213,7 @@ class INFO_MT_curve_add(Menu):
def draw(self, context):
layout = self.layout
- layout.operator_context = 'EXEC_REGION_WIN'
+ layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle")
layout.operator("curve.primitive_nurbs_curve_add", icon='CURVE_NCURVE', text="Nurbs Curve")
@@ -221,22 +221,6 @@ class INFO_MT_curve_add(Menu):
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
-class INFO_MT_surface_add(Menu):
- bl_idname = "INFO_MT_surface_add"
- bl_label = "Surface"
-
- def draw(self, context):
- layout = self.layout
-
- layout.operator_context = 'EXEC_REGION_WIN'
- layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
- layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
- layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text="NURBS Surface")
- layout.operator("surface.primitive_nurbs_surface_cylinder_add", icon='SURFACE_NCYLINDER', text="NURBS Cylinder")
- layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
- layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus")
-
-
class INFO_MT_edit_curve_add(Menu):
bl_idname = "INFO_MT_edit_curve_add"
bl_label = "Add"
@@ -245,7 +229,7 @@ class INFO_MT_edit_curve_add(Menu):
is_surf = context.active_object.type == 'SURFACE'
layout = self.layout
- layout.operator_context = 'EXEC_REGION_WIN'
+ layout.operator_context = 'INVOKE_REGION_WIN'
if is_surf:
INFO_MT_surface_add.draw(self, context)
@@ -253,6 +237,22 @@ class INFO_MT_edit_curve_add(Menu):
INFO_MT_curve_add.draw(self, context)
+class INFO_MT_surface_add(Menu):
+ bl_idname = "INFO_MT_surface_add"
+ bl_label = "Surface"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator_context = 'INVOKE_REGION_WIN'
+ layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
+ layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
+ layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text="NURBS Surface")
+ layout.operator("surface.primitive_nurbs_surface_cylinder_add", icon='SURFACE_NCYLINDER', text="NURBS Cylinder")
+ layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
+ layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus")
+
+
class INFO_MT_armature_add(Menu):
bl_idname = "INFO_MT_armature_add"
bl_label = "Armature"
@@ -260,7 +260,7 @@ class INFO_MT_armature_add(Menu):
def draw(self, context):
layout = self.layout
- layout.operator_context = 'EXEC_REGION_WIN'
+ layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
@@ -284,18 +284,23 @@ class INFO_MT_add(Menu):
#layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
+# layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
layout.separator()
layout.menu("INFO_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
+ # XXX Quick fix for [#32764].
+ layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
- layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY')
+ layout.operator("object.add", text="Empty", icon='OUTLINER_OB_EMPTY').type = 'EMPTY'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.separator()
layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
layout.separator()
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
+# layout.operator_context = 'EXEC_AREA'
layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
layout.separator()
@@ -303,7 +308,7 @@ class INFO_MT_add(Menu):
layout.separator()
if(len(bpy.data.groups) > 10):
- layout.operator_context = 'INVOKE_REGION_WIN'
+ layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY')
else:
layout.operator_menu_enum("object.group_instance_add", "group", text="Group Instance", icon='OUTLINER_OB_EMPTY')
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index df30c3ee9ae..64bf1e29348 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -324,7 +324,6 @@ class USERPREF_PT_edit(Panel):
col.separator()
col.prop(edit, "use_auto_keying", text="Auto Keyframing:")
- col.prop(edit, "use_auto_keying_warning")
sub = col.column()
@@ -1085,10 +1084,10 @@ class USERPREF_PT_addons(Panel):
continue
# check if addon should be visible with current filters
- if ((filter == "All") or
- (filter == info["category"]) or
- (filter == "Enabled" and is_enabled) or
- (filter == "Disabled" and not is_enabled)):
+ if ((filter == "All") or
+ (filter == info["category"]) or
+ (filter == "Enabled" and is_enabled) or
+ (filter == "Disabled" and not is_enabled)):
if search and search not in info["name"].lower():
if info["author"]:
diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py
index da498268b9b..6646da4a91a 100644
--- a/release/scripts/startup/bl_ui/space_userpref_keymap.py
+++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py
@@ -218,8 +218,8 @@ class InputKeyMapPanel:
layout.context_pointer_set("keymap", km)
filtered_items = [kmi for kmi in km.keymap_items
- if (filter_text in kmi.idname.lower() or
- filter_text in kmi.name.lower())]
+ if filter_text in kmi.idname.lower() or
+ filter_text in kmi.name.lower()]
if filtered_items:
col = layout.column()
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index d5648a6d3a2..1786c19ebdf 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -223,8 +223,8 @@ class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
layout.separator()
obj = context.object
- if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
- obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
+ if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
+ obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
if context.edit_object and context.edit_object.type == 'ARMATURE':
@@ -580,7 +580,7 @@ class VIEW3D_MT_select_edit_mesh(Menu):
layout.separator()
layout.operator("mesh.select_by_number_vertices", text="By Number of Verts")
- if context.scene.tool_settings.mesh_select_mode[2] is False:
+ if context.scene.tool_settings.mesh_select_mode[2] == False:
layout.operator("mesh.select_non_manifold", text="Non Manifold")
layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
layout.operator_menu_enum("mesh.select_similar", "type", text="Similar")
@@ -807,8 +807,7 @@ class VIEW3D_MT_object_animation(Menu):
layout = self.layout
layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
- layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframes...")
- layout.operator("anim.keyframe_clear_v3d", text="Clear Keyframes...")
+ layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
layout.separator()
@@ -1247,7 +1246,6 @@ class VIEW3D_MT_paint_weight(Menu):
layout.operator("object.vertex_group_clean", text="Clean")
layout.operator("object.vertex_group_levels", text="Levels")
layout.operator("object.vertex_group_blend", text="Blend")
- layout.operator("object.vertex_group_limit_total", text="Limit Total")
layout.operator("object.vertex_group_fix", text="Fix Deforms")
layout.separator()
@@ -2283,7 +2281,7 @@ class VIEW3D_PT_view3d_properties(Panel):
if lock_object.type == 'ARMATURE':
col.prop_search(view, "lock_bone", lock_object.data,
"edit_bones" if lock_object.mode == 'EDIT'
- else "bones",
+ else "bones",
text="")
else:
col.prop(view, "lock_cursor", text="Lock to Cursor")
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index b0b8401fe02..1b67b30d17a 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -520,8 +520,8 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
row = col.row(align=True)
ups = toolsettings.unified_paint_settings
- if ((ups.use_unified_size and ups.use_locked_size) or
- ((not ups.use_unified_size) and brush.use_locked_size)):
+ if ((ups.use_unified_size and ups.use_locked_size) or
+ ((not ups.use_unified_size) and brush.use_locked_size)):
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
else:
@@ -707,8 +707,8 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
- return (settings and settings.brush and
- (context.sculpt_object or context.image_paint_object))
+ return (settings and settings.brush and (context.sculpt_object or
+ context.image_paint_object))
def draw(self, context):
layout = self.layout
@@ -747,12 +747,10 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
- return (settings and
- settings.brush and
- (context.sculpt_object or
- context.vertex_paint_object or
- context.weight_paint_object or
- context.image_paint_object))
+ return (settings and settings.brush and (context.sculpt_object or
+ context.vertex_paint_object or
+ context.weight_paint_object or
+ context.image_paint_object))
def draw(self, context):
layout = self.layout
@@ -967,8 +965,6 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
col.operator("object.vertex_group_clean", text="Clean")
col.operator("object.vertex_group_levels", text="Levels")
col.operator("object.vertex_group_blend", text="Blend")
- col.operator("object.vertex_group_transfer_weight", text="Transfer weight")
- col.operator("object.vertex_group_limit_total", text="Limit Total")
col.operator("object.vertex_group_fix", text="Fix Deforms")
diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py
index 6ad87375738..b7693880f9c 100644
--- a/release/scripts/startup/keyingsets_builtins.py
+++ b/release/scripts/startup/keyingsets_builtins.py
@@ -360,10 +360,10 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
# add rotation properties if they will
if bone.lock_rotations_4d:
# can check individually
- if (bone.lock_rotation == (False, False, False)) and (bone.lock_rotation_w is False):
+ if (bone.lock_rotation == (False, False, False)) and (bone.lock_rotation_w == False):
ksi.addProp(ks, bone, prop)
else:
- if bone.lock_rotation_w is False:
+ if bone.lock_rotation_w == False:
ksi.addProp(ks, bone, prop, 0) # w = 0
for i in range(3):
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index ae3f3dce396..92785804b01 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -101,6 +101,7 @@ add_subdirectory(blenloader)
add_subdirectory(ikplugin)
add_subdirectory(gpu)
add_subdirectory(imbuf)
+add_subdirectory(avi)
add_subdirectory(nodes)
add_subdirectory(modifiers)
add_subdirectory(makesdna)
@@ -123,10 +124,6 @@ if(WITH_IMAGE_CINEON)
add_subdirectory(imbuf/intern/cineon)
endif()
-if(WITH_CODEC_AVI)
- add_subdirectory(avi)
-endif()
-
if(WITH_CODEC_QUICKTIME)
add_subdirectory(quicktime)
endif()
diff --git a/source/blender/avi/AVI_avi.h b/source/blender/avi/AVI_avi.h
index 4dc52970119..bdfdbc117ed 100644
--- a/source/blender/avi/AVI_avi.h
+++ b/source/blender/avi/AVI_avi.h
@@ -178,7 +178,7 @@ typedef struct _AviStreamRec {
} AviStreamRec;
typedef struct _AviMovie {
- FILE *fp;
+ FILE *fp;
int type;
#define AVI_MOVIE_READ 0
diff --git a/source/blender/avi/CMakeLists.txt b/source/blender/avi/CMakeLists.txt
index 292206d8cb9..79422dff917 100644
--- a/source/blender/avi/CMakeLists.txt
+++ b/source/blender/avi/CMakeLists.txt
@@ -35,19 +35,19 @@ set(INC_SYS
set(SRC
intern/avi.c
- intern/avi_rgb.c
- intern/avi_codecs.c
- intern/avi_endian.c
- intern/avi_mjpeg.c
- intern/avi_options.c
- intern/avi_rgb32.c
+ intern/avirgb.c
+ intern/codecs.c
+ intern/endian.c
+ intern/mjpeg.c
+ intern/options.c
+ intern/rgb32.c
AVI_avi.h
intern/avi_intern.h
- intern/avi_rgb.h
- intern/avi_endian.h
- intern/avi_mjpeg.h
- intern/avi_rgb32.h
+ intern/avirgb.h
+ intern/endian.h
+ intern/mjpeg.h
+ intern/rgb32.h
)
blender_add_lib(bf_avi "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 15d8702a5ec..2845b2f95c9 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -32,6 +32,7 @@
* This is external code.
*/
+
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
@@ -48,7 +49,7 @@
#include "AVI_avi.h"
#include "avi_intern.h"
-#include "avi_endian.h"
+#include "endian.h"
static int AVI_DEBUG = 0;
static char DEBUG_FCC[4];
diff --git a/source/blender/avi/intern/avi_rgb.c b/source/blender/avi/intern/avirgb.c
index 61587e15e61..7a95972845a 100644
--- a/source/blender/avi/intern/avi_rgb.c
+++ b/source/blender/avi/intern/avirgb.c
@@ -26,19 +26,19 @@
*
*/
-/** \file blender/avi/intern/avi_rgb.c
+/** \file blender/avi/intern/avirgb.c
* \ingroup avi
*
* This is external code. Converts rgb-type avi-s.
*/
+
+#include "AVI_avi.h"
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
-
-#include "AVI_avi.h"
-#include "avi_rgb.h"
+#include "avirgb.h"
/* implementation */
diff --git a/source/blender/avi/intern/avi_rgb.h b/source/blender/avi/intern/avirgb.h
index 773166e9fab..20211d6ab2d 100644
--- a/source/blender/avi/intern/avi_rgb.h
+++ b/source/blender/avi/intern/avirgb.h
@@ -25,14 +25,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/avi/intern/avi_rgb.h
+/** \file blender/avi/intern/avirgb.h
* \ingroup avi
*/
-#ifndef __AVI_RGB_H__
-#define __AVI_RGB_H__
-void *avi_converter_from_avi_rgb(AviMovie *movie, int stream, unsigned char *buffer, int *size);
-void *avi_converter_to_avi_rgb(AviMovie *movie, int stream, unsigned char *buffer, int *size);
+void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size);
+void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size);
-#endif /* __AVI_RGB_H__ */
diff --git a/source/blender/avi/intern/avi_codecs.c b/source/blender/avi/intern/codecs.c
index e43826064a6..01e228d570e 100644
--- a/source/blender/avi/intern/avi_codecs.c
+++ b/source/blender/avi/intern/codecs.c
@@ -25,7 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/avi/intern/avi_codecs.c
+/** \file blender/avi/intern/codecs.c
* \ingroup avi
*
* This is external code. Identify and convert different avi-files.
@@ -35,9 +35,9 @@
#include "AVI_avi.h"
#include "avi_intern.h"
-#include "avi_rgb.h"
-#include "avi_mjpeg.h"
-#include "avi_rgb32.h"
+#include "avirgb.h"
+#include "mjpeg.h"
+#include "rgb32.h"
void *avi_format_convert(AviMovie *movie, int stream, void *buffer, AviFormat from, AviFormat to, int *size)
{
diff --git a/source/blender/avi/intern/avi_endian.c b/source/blender/avi/intern/endian.c
index 70add8bd90f..c9b95d25810 100644
--- a/source/blender/avi/intern/avi_endian.c
+++ b/source/blender/avi/intern/endian.c
@@ -26,7 +26,7 @@
*
*/
-/** \file blender/avi/intern/avi_endian.c
+/** \file blender/avi/intern/endian.c
* \ingroup avi
*
* This is external code. Streams bytes to output depending on the
@@ -36,10 +36,9 @@
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
-
+#include <stdio.h>
#include "AVI_avi.h"
-#include "avi_endian.h"
+#include "endian.h"
#include "avi_intern.h"
#ifdef __BIG_ENDIAN__
@@ -47,22 +46,31 @@
#endif
#ifdef __BIG_ENDIAN__
-
-/* copied from BLI_endian_switch_inline.h */
static void invert(int *num)
{
- int tval = *val;
- *val = ((tval >> 24)) |
- ((tval << 8) & 0x00ff0000) |
- ((tval >> 8) & 0x0000ff00) |
- ((tval << 24));
+ int new = 0, i, j;
+
+ for (j = 0; j < 4; j++) {
+ for (i = 0; i < 8; i++) {
+ new |= ((*num >> (j * 8 + i)) & 1) << ((3 - j) * 8 + i);
+ }
+ }
+
+ *num = new;
}
-static void sinvert(short int *val)
+static void sinvert(short int *num)
{
- short tval = *val;
- *val = (tval >> 8) |
- (tval << 8);
+ short int new = 0;
+ int i, j;
+
+ for (j = 0; j < 2; j++) {
+ for (i = 0; i < 8; i++) {
+ new |= ((*num >> (j * 8 + i)) & 1) << ((1 - j) * 8 + i);
+ }
+ }
+
+ *num = new;
}
static void Ichunk(AviChunk *chunk)
diff --git a/source/blender/avi/intern/avi_endian.h b/source/blender/avi/intern/endian.h
index 8cea283a553..7ef49cb1699 100644
--- a/source/blender/avi/intern/avi_endian.h
+++ b/source/blender/avi/intern/endian.h
@@ -25,14 +25,17 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/avi/intern/avi_endian.h
+/** \file blender/avi/intern/endian.h
* \ingroup avi
*
* This is external code.
*/
-#ifndef __AVI_ENDIAN_H__
-#define __AVI_ENDIAN_H__
+#ifndef __ENDIAN_H__
+#define __ENDIAN_H__
+
+#include <stdio.h>
+#include "AVI_avi.h"
#define AVI_RAW 0
#define AVI_CHUNK 1
@@ -45,4 +48,5 @@
void awrite(AviMovie *movie, void *datain, int block, int size, FILE *fp, int type);
-#endif /* __AVI_ENDIAN_H__ */
+#endif
+
diff --git a/source/blender/avi/intern/avi_mjpeg.c b/source/blender/avi/intern/mjpeg.c
index b98e03d6a19..a700284bf68 100644
--- a/source/blender/avi/intern/avi_mjpeg.c
+++ b/source/blender/avi/intern/mjpeg.c
@@ -26,23 +26,21 @@
*
*/
-/** \file blender/avi/intern/avi_mjpeg.c
+/** \file blender/avi/intern/mjpeg.c
* \ingroup avi
*
* This is external code. Converts between avi and mpeg/jpeg.
*/
-#include <stdlib.h>
-#include <string.h>
#include "AVI_avi.h"
-
-#include "MEM_guardedalloc.h"
-
+#include <stdlib.h>
+#include <string.h>
#include "jpeglib.h"
#include "jerror.h"
+#include "MEM_guardedalloc.h"
-#include "avi_mjpeg.h"
+#include "mjpeg.h"
#define PADUP(num, amt) ((num + (amt - 1)) & ~(amt - 1))
diff --git a/source/blender/avi/intern/avi_mjpeg.h b/source/blender/avi/intern/mjpeg.h
index 6ae0e56ffa4..75649891f2b 100644
--- a/source/blender/avi/intern/avi_mjpeg.h
+++ b/source/blender/avi/intern/mjpeg.h
@@ -25,14 +25,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/avi/intern/avi_mjpeg.h
+/** \file blender/avi/intern/mjpeg.h
* \ingroup avi
*/
-#ifndef __AVI_MJPEG_H__
-#define __AVI_MJPEG_H__
void *avi_converter_from_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size);
void *avi_converter_to_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size);
-#endif /* __AVI_MJPEG_H__ */
diff --git a/source/blender/avi/intern/avi_options.c b/source/blender/avi/intern/options.c
index f7759a1099f..7de91318ecf 100644
--- a/source/blender/avi/intern/avi_options.c
+++ b/source/blender/avi/intern/options.c
@@ -26,7 +26,7 @@
*
*/
-/** \file blender/avi/intern/avi_options.c
+/** \file blender/avi/intern/options.c
* \ingroup avi
*
* This is external code. Sets some compression related options
@@ -35,7 +35,7 @@
#include "AVI_avi.h"
#include "avi_intern.h"
-#include "avi_endian.h"
+#include "endian.h"
#ifdef WIN32
# include "BLI_winstuff.h"
diff --git a/source/blender/avi/intern/avi_rgb32.c b/source/blender/avi/intern/rgb32.c
index 5c7a4889d97..84630f09fe5 100644
--- a/source/blender/avi/intern/avi_rgb32.c
+++ b/source/blender/avi/intern/rgb32.c
@@ -26,19 +26,18 @@
*
*/
-/** \file blender/avi/intern/avi_rgb32.c
+/** \file blender/avi/intern/rgb32.c
* \ingroup avi
*
* This is external code. Converts between rgb32 and avi.
*/
+
+#include "AVI_avi.h"
#include <stdlib.h>
#include <string.h>
-
#include "MEM_guardedalloc.h"
-
-#include "AVI_avi.h"
-#include "avi_rgb32.h"
+#include "rgb32.h"
void *avi_converter_from_rgb32(AviMovie *movie, int stream, unsigned char *buffer, int *size)
{
diff --git a/source/blender/avi/intern/avi_rgb32.h b/source/blender/avi/intern/rgb32.h
index 523f9e795fd..55f9771a4df 100644
--- a/source/blender/avi/intern/avi_rgb32.h
+++ b/source/blender/avi/intern/rgb32.h
@@ -25,14 +25,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/avi/intern/avi_rgb32.h
+/** \file blender/avi/intern/rgb32.h
* \ingroup avi
*/
-#ifndef __AVI_RGB32_H__
-#define __AVI_RGB32_H__
-void *avi_converter_from_rgb32(AviMovie *movie, int stream, unsigned char *buffer, int *size);
-void *avi_converter_to_rgb32(AviMovie *movie, int stream, unsigned char *buffer, int *size);
+void *avi_converter_from_rgb32 (AviMovie *movie, int stream, unsigned char *buffer, int *size);
+void *avi_converter_to_rgb32 (AviMovie *movie, int stream, unsigned char *buffer, int *size);
-#endif /* __AVI_RGB32_H__ */
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index 278c45dac52..56eabf4bb43 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -97,8 +97,6 @@ const char *BLF_translate_do_tooltip(const char *contex, const char *msgid);
/* Default context for operator names/labels. */
#define BLF_I18NCONTEXT_OPERATOR_DEFAULT "Operator"
-/* Audio disambiguation context. */
-#define BLF_I18NCONTEXT_AUDIO "Audio"
#endif /* __BLF_TRANSLATION_H__ */
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h
index 11537964e32..f506c67a36c 100644
--- a/source/blender/blenkernel/BKE_anim.h
+++ b/source/blender/blenkernel/BKE_anim.h
@@ -65,8 +65,8 @@ int where_on_path(struct Object *ob, float ctime, float vec[4], float dir[3], fl
/* ---------------------------------------------------- */
/* Dupli-Geometry */
-struct ListBase *object_duplilist_ex(struct Scene *sce, struct Object *ob, int update, int for_render);
-struct ListBase *object_duplilist(struct Scene *sce, struct Object *ob, int for_render);
+struct ListBase *object_duplilist_ex(struct Scene *sce, struct Object *ob, int update);
+struct ListBase *object_duplilist(struct Scene *sce, struct Object *ob);
void free_object_duplilist(struct ListBase *lb);
int count_duplilist(struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 6b9de47836e..a3f3beefbaf 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -131,14 +131,8 @@ typedef struct Mat4 {
Mat4 *b_bone_spline_setup(struct bPoseChannel *pchan, int rest);
/* like EBONE_VISIBLE */
-#define PBONE_VISIBLE(arm, bone) ( \
- CHECK_TYPE_INLINE(arm, bArmature), \
- CHECK_TYPE_INLINE(bone, Bone), \
- (((bone)->layer & (arm)->layer) && !((bone)->flag & BONE_HIDDEN_P)) \
- )
-
-#define PBONE_SELECTABLE(arm, bone) \
- (PBONE_VISIBLE(arm, bone) && !((bone)->flag & BONE_UNSELECTABLE))
+#define PBONE_VISIBLE(arm, bone) (((bone)->layer & (arm)->layer) && !((bone)->flag & BONE_HIDDEN_P))
+#define PBONE_SELECTABLE(arm, bone) (PBONE_VISIBLE(arm, bone) && !((bone)->flag & BONE_UNSELECTABLE))
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index e1c79f8d6c1..d94128aa88d 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 264
-#define BLENDER_SUBVERSION 2
+#define BLENDER_SUBVERSION 0
/* 262 was the last editmesh release but its has compatibility code for bmesh data,
* so set the minversion to 2.61 */
@@ -53,7 +53,7 @@ extern "C" {
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR a
/* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE alpha
+#define BLENDER_VERSION_CYCLE release
extern char versionstr[]; /* from blender.c */
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 3cb20ead39e..f3223fb4af1 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -44,7 +44,7 @@ void free_gpencil_layers(struct ListBase *list);
void BKE_gpencil_free(struct bGPdata *gpd);
struct bGPDframe *gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe);
-struct bGPDlayer *gpencil_layer_addnew(struct bGPdata *gpd, const char *name, int setactive);
+struct bGPDlayer *gpencil_layer_addnew(struct bGPdata *gpd);
struct bGPdata *gpencil_data_addnew(const char name[]);
struct bGPDframe *gpencil_frame_duplicate(struct bGPDframe *src);
@@ -62,6 +62,6 @@ struct bGPDframe *gpencil_layer_getframe(struct bGPDlayer *gpl, int cframe, shor
void gpencil_layer_delframe(struct bGPDlayer *gpl, struct bGPDframe *gpf);
struct bGPDlayer *gpencil_layer_getactive(struct bGPdata *gpd);
void gpencil_layer_setactive(struct bGPdata *gpd, struct bGPDlayer *active);
-void gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl);
+void gpencil_layer_delactive(struct bGPdata *gpd);
#endif /* __BKE_GPENCIL_H__ */
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h
index 7a0eea1b009..0a611b34245 100644
--- a/source/blender/blenkernel/BKE_mball.h
+++ b/source/blender/blenkernel/BKE_mball.h
@@ -63,8 +63,4 @@ void BKE_mball_translate(struct MetaBall *mb, const float offset[3]);
struct MetaElem *BKE_mball_element_add(struct MetaBall *mb, const int type);
-void BKE_mball_select_all(struct MetaBall *mb);
-void BKE_mball_deselect_all(struct MetaBall *mb);
-void BKE_mball_select_swap(struct MetaBall *mb);
-
#endif
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index 80431682d6f..cecff2d9516 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -73,17 +73,15 @@ void BKE_sequence_iterator_end(SeqIterator *iter);
SeqIterator iter; \
for (BKE_sequence_iterator_begin(ed, &iter, 1); \
iter.valid; \
- BKE_sequence_iterator_next(&iter)) \
- { \
+ BKE_sequence_iterator_next(&iter)) { \
_seq = iter.seq;
-
+
#define SEQ_BEGIN(ed, _seq) \
{ \
SeqIterator iter; \
for (BKE_sequence_iterator_begin(ed, &iter, 0); \
iter.valid; \
- BKE_sequence_iterator_next(&iter)) \
- { \
+ BKE_sequence_iterator_next(&iter)) { \
_seq = iter.seq;
#define SEQ_END \
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 2a1ff49881f..efdb80433c6 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -25,6 +25,7 @@
set(INC
.
+ ../avi
../blenfont
../blenlib
../blenloader
@@ -291,13 +292,6 @@ if(WITH_IMAGE_HDR)
add_definitions(-DWITH_HDR)
endif()
-if(WITH_CODEC_AVI)
- list(APPEND INC
- ../avi
- )
- add_definitions(-DWITH_AVI)
-endif()
-
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../quicktime
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 58d20fff2bc..ec15e2ea87f 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -75,7 +75,7 @@
/* forward declarations */
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index,
- int level, short flag);
+ int level, short animated, short update);
/* ******************************************************************** */
/* Animation Visualization */
@@ -700,11 +700,7 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
/* ******************************************************************** */
/* Dupli-Geometry */
-#define DUPLILIST_DO_UPDATE 1
-#define DUPLILIST_FOR_RENDER 2
-#define DUPLILIST_ANIMATED 4
-
-static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], int lay, int index, int par_index, int type, short flag)
+static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], int lay, int index, int par_index, int type, short animated)
{
DupliObject *dob = MEM_callocN(sizeof(DupliObject), "dupliobject");
@@ -716,14 +712,14 @@ static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], i
dob->index = index;
dob->particle_index = par_index;
dob->type = type;
- dob->animated = (type == OB_DUPLIGROUP) && (flag & DUPLILIST_ANIMATED);
+ dob->animated = (type == OB_DUPLIGROUP) && animated;
ob->lay = lay;
return dob;
}
static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_index,
- int level, short flag)
+ int level, short animated, short update)
{
DupliObject *dob;
Group *group;
@@ -739,14 +735,13 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_inde
/* handles animated groups, and */
/* we need to check update for objects that are not in scene... */
- if (flag & DUPLILIST_DO_UPDATE) {
+ if (update) {
/* note: update is optional because we don't always need object
* transformations to be correct. Also fixes bug [#29616]. */
group_handle_recalc_and_update(scene, ob, group);
}
- if (group_is_animated(ob, group))
- flag |= DUPLILIST_ANIMATED;
+ animated = animated || group_is_animated(ob, group);
for (go = group->gobject.first; go; go = go->next) {
/* note, if you check on layer here, render goes wrong... it still deforms verts and uses parent imat */
@@ -762,7 +757,7 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_inde
mult_m4_m4m4(mat, ob->obmat, go->ob->obmat);
}
- dob = new_dupli_object(lb, go->ob, mat, ob->lay, 0, par_index, OB_DUPLIGROUP, flag);
+ dob = new_dupli_object(lb, go->ob, mat, ob->lay, 0, par_index, OB_DUPLIGROUP, animated);
/* check the group instance and object layers match, also that the object visible flags are ok. */
if ((dob->origlay & group->layer) == 0 ||
@@ -777,14 +772,14 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_inde
if (go->ob->transflag & OB_DUPLI) {
copy_m4_m4(dob->ob->obmat, dob->mat);
- object_duplilist_recursive(&group->id, scene, go->ob, lb, ob->obmat, par_index, level + 1, flag);
+ object_duplilist_recursive(&group->id, scene, go->ob, lb, ob->obmat, par_index, level + 1, animated, update);
copy_m4_m4(dob->ob->obmat, dob->omat);
}
}
}
}
-static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_index, int level, short flag)
+static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_index, int level, short animated)
{
extern int enable_cu_speed; /* object.c */
Object copyob;
@@ -832,7 +827,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_ind
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, (float)scene->r.cfra, ADT_RECALC_ANIM); /* ob-eval will do drivers, so we don't need to do them */
BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
- dob = new_dupli_object(lb, ob, ob->obmat, ob->lay, scene->r.cfra, par_index, OB_DUPLIFRAMES, flag);
+ dob = new_dupli_object(lb, ob, ob->obmat, ob->lay, scene->r.cfra, par_index, OB_DUPLIFRAMES, animated);
copy_m4_m4(dob->omat, copyob.obmat);
}
}
@@ -856,7 +851,8 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_ind
typedef struct VertexDupliData {
ID *id; /* scene or group, for recursive loops */
int level;
- short flag;
+ short animated;
+ short update;
ListBase *lb;
float pmat[4][4];
float obmat[4][4]; /* Only used for dupliverts inside dupligroups, where the ob->obmat is modified */
@@ -900,7 +896,7 @@ static void vertex_dupli__mapFunc(void *userData, int index, const float co[3],
origlay = vdd->ob->lay;
- dob = new_dupli_object(vdd->lb, vdd->ob, obmat, vdd->par->lay, index, vdd->par_index, OB_DUPLIVERTS, vdd->flag);
+ dob = new_dupli_object(vdd->lb, vdd->ob, obmat, vdd->par->lay, index, vdd->par_index, OB_DUPLIVERTS, vdd->animated);
/* restore the original layer so that each dupli will have proper dob->origlay */
vdd->ob->lay = origlay;
@@ -912,13 +908,13 @@ static void vertex_dupli__mapFunc(void *userData, int index, const float co[3],
float tmpmat[4][4];
copy_m4_m4(tmpmat, vdd->ob->obmat);
copy_m4_m4(vdd->ob->obmat, obmat); /* pretend we are really this mat */
- object_duplilist_recursive((ID *)vdd->id, vdd->scene, vdd->ob, vdd->lb, obmat, vdd->par_index, vdd->level + 1, vdd->flag);
+ object_duplilist_recursive((ID *)vdd->id, vdd->scene, vdd->ob, vdd->lb, obmat, vdd->par_index, vdd->level + 1, vdd->animated, vdd->update);
copy_m4_m4(vdd->ob->obmat, tmpmat);
}
}
static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int par_index,
- int level, short flag)
+ int level, short animated, short update)
{
Object *ob, *ob_iter;
Mesh *me = par->data;
@@ -946,7 +942,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
else
dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH);
- if (flag & DUPLILIST_FOR_RENDER) {
+ if (G.is_rendering) {
vdd.orco = (float(*)[3])BKE_mesh_orco_verts_get(par);
BKE_mesh_orco_verts_transform(me, vdd.orco, me->totvert, 0);
}
@@ -996,7 +992,8 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
vdd.id = id;
vdd.level = level;
- vdd.flag = flag;
+ vdd.animated = animated;
+ vdd.update = update;
vdd.lb = lb;
vdd.ob = ob;
vdd.scene = scene;
@@ -1042,7 +1039,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
}
static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int par_index,
- int level, short flag)
+ int level, short animated, short update)
{
Object *ob, *ob_iter;
Base *base = NULL;
@@ -1079,7 +1076,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
mloop = dm->getLoopArray(dm);
mvert = dm->getVertArray(dm);
- if (flag & DUPLILIST_FOR_RENDER) {
+ if (G.is_rendering) {
+
orco = (float(*)[3])BKE_mesh_orco_verts_get(par);
BKE_mesh_orco_verts_transform(me, orco, me->totvert, 0);
mloopuv = me->mloopuv;
@@ -1184,8 +1182,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
copy_m4_m4(tmat, obmat);
mul_m4_m4m3(obmat, tmat, mat);
- dob = new_dupli_object(lb, ob, obmat, par->lay, a, par_index, OB_DUPLIFACES, (flag & DUPLILIST_ANIMATED));
- if (flag & DUPLILIST_FOR_RENDER) {
+ dob = new_dupli_object(lb, ob, obmat, par->lay, a, par_index, OB_DUPLIFACES, animated);
+ if (G.is_rendering) {
w = 1.0f / (float)mp->totloop;
if (orco) {
@@ -1207,7 +1205,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
float tmpmat[4][4];
copy_m4_m4(tmpmat, ob->obmat);
copy_m4_m4(ob->obmat, obmat); /* pretend we are really this mat */
- object_duplilist_recursive((ID *)id, scene, ob, lb, ob->obmat, par_index, level + 1, flag);
+ object_duplilist_recursive((ID *)id, scene, ob, lb, ob->obmat, par_index, level + 1, animated, update);
copy_m4_m4(ob->obmat, tmpmat);
}
}
@@ -1228,7 +1226,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
}
static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int UNUSED(par_index), ParticleSystem *psys,
- int level, short flag)
+ int level, short animated, short update)
{
GroupObject *go;
Object *ob = NULL, **oblist = NULL, obcopy, *obcopylist = NULL;
@@ -1311,7 +1309,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
/* gather list of objects or single object */
if (part->ren_as == PART_DRAW_GR) {
- if (flag & DUPLILIST_DO_UPDATE) {
+ if (update) {
group_handle_recalc_and_update(scene, par, part->dup_group);
}
@@ -1454,9 +1452,9 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
else
copy_m4_m4(mat, tmat);
- dob = new_dupli_object(lb, go->ob, mat, par->lay, counter, index, OB_DUPLIPARTS, (flag & DUPLILIST_ANIMATED));
+ dob = new_dupli_object(lb, go->ob, mat, par->lay, counter, index, OB_DUPLIPARTS, animated);
copy_m4_m4(dob->omat, obcopylist[b].obmat);
- if (flag & DUPLILIST_FOR_RENDER)
+ if (G.is_rendering)
psys_get_dupli_texture(psys, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
}
}
@@ -1514,9 +1512,9 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
if (part->draw & PART_DRAW_GLOBAL_OB)
add_v3_v3v3(mat[3], mat[3], vec);
- dob = new_dupli_object(lb, ob, mat, ob->lay, counter, index, GS(id->name) == ID_GR ? OB_DUPLIGROUP : OB_DUPLIPARTS, (flag & DUPLILIST_ANIMATED));
+ dob = new_dupli_object(lb, ob, mat, ob->lay, counter, index, GS(id->name) == ID_GR ? OB_DUPLIGROUP : OB_DUPLIPARTS, animated);
copy_m4_m4(dob->omat, oldobmat);
- if (flag & DUPLILIST_FOR_RENDER)
+ if (G.is_rendering)
psys_get_dupli_texture(psys, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
}
@@ -1568,7 +1566,7 @@ static Object *find_family_object(Object **obar, char *family, char ch)
}
-static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int par_index, int level, short flag)
+static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int par_index, int level, short animated)
{
Object *ob, *obar[256] = {NULL};
Curve *cu;
@@ -1607,7 +1605,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int par_inde
copy_m4_m4(obmat, par->obmat);
copy_v3_v3(obmat[3], vec);
- new_dupli_object(lb, ob, obmat, par->lay, a, par_index, OB_DUPLIVERTS, flag);
+ new_dupli_object(lb, ob, obmat, par->lay, a, par_index, OB_DUPLIVERTS, animated);
}
}
@@ -1617,7 +1615,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int par_inde
/* ------------- */
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index,
- int level, short flag)
+ int level, short animated, short update)
{
if ((ob->transflag & OB_DUPLI) == 0)
return;
@@ -1637,31 +1635,31 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
if (ob->transflag & OB_DUPLIPARTS) {
ParticleSystem *psys = ob->particlesystem.first;
for (; psys; psys = psys->next)
- new_particle_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, psys, level + 1, flag);
+ new_particle_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, psys, level + 1, animated, update);
}
else if (ob->transflag & OB_DUPLIVERTS) {
if (ob->type == OB_MESH) {
- vertex_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, flag);
+ vertex_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, animated, update);
}
else if (ob->type == OB_FONT) {
if (GS(id->name) == ID_SCE) { /* TODO - support dupligroups */
- font_duplilist(duplilist, scene, ob, par_index, level + 1, flag);
+ font_duplilist(duplilist, scene, ob, par_index, level + 1, animated);
}
}
}
else if (ob->transflag & OB_DUPLIFACES) {
if (ob->type == OB_MESH)
- face_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, flag);
+ face_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, animated, update);
}
else if (ob->transflag & OB_DUPLIFRAMES) {
if (GS(id->name) == ID_SCE) { /* TODO - support dupligroups */
- frames_duplilist(duplilist, scene, ob, par_index, level + 1, flag);
+ frames_duplilist(duplilist, scene, ob, par_index, level + 1, animated);
}
}
else if (ob->transflag & OB_DUPLIGROUP) {
DupliObject *dob;
- group_duplilist(duplilist, scene, ob, par_index, level + 1, flag); /* now recursive */
+ group_duplilist(duplilist, scene, ob, par_index, level + 1, animated, update); /* now recursive */
if (level == 0) {
for (dob = duplilist->first; dob; dob = dob->next)
@@ -1673,24 +1671,19 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
/* Returns a list of DupliObject
* note; group dupli's already set transform matrix. see note in group_duplilist() */
-ListBase *object_duplilist_ex(Scene *sce, Object *ob, int update, int for_render)
+ListBase *object_duplilist_ex(Scene *sce, Object *ob, int update)
{
ListBase *duplilist = MEM_mallocN(sizeof(ListBase), "duplilist");
- int flag = 0;
-
- if(update) flag |= DUPLILIST_DO_UPDATE;
- if(for_render) flag |= DUPLILIST_FOR_RENDER;
-
duplilist->first = duplilist->last = NULL;
- object_duplilist_recursive((ID *)sce, sce, ob, duplilist, NULL, 0, 0, flag);
+ object_duplilist_recursive((ID *)sce, sce, ob, duplilist, NULL, 0, 0, 0, update);
return duplilist;
}
/* note: previously updating was always done, this is why it defaults to be on
* but there are likely places it can be called without updating */
-ListBase *object_duplilist(Scene *sce, Object *ob, int for_render)
+ListBase *object_duplilist(Scene *sce, Object *ob)
{
- return object_duplilist_ex(sce, ob, TRUE, for_render);
+ return object_duplilist_ex(sce, ob, TRUE);
}
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 197e38ac778..99b788e80ce 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -621,9 +621,7 @@ void BKE_undo_step(bContext *C, int step)
}
else if (step == 1) {
/* curundo should never be NULL, after restart or load file it should call undo_save */
- if (curundo == NULL || curundo->prev == NULL) {
- // XXX error("No undo available");
- }
+ if (curundo == NULL || curundo->prev == NULL) ; // XXX error("No undo available");
else {
if (G.debug & G_DEBUG) printf("undo %s\n", curundo->name);
curundo = curundo->prev;
@@ -633,9 +631,7 @@ void BKE_undo_step(bContext *C, int step)
else {
/* curundo has to remain current situation! */
- if (curundo == NULL || curundo->next == NULL) {
- // XXX error("No redo available");
- }
+ if (curundo == NULL || curundo->next == NULL) ; // XXX error("No redo available");
else {
read_undosave(C, curundo->next);
curundo = curundo->next;
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 1bd5786debd..b66bd1fd32b 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1289,9 +1289,9 @@ void BKE_color_managed_display_settings_copy(ColorManagedDisplaySettings *new_se
void BKE_color_managed_view_settings_init(ColorManagedViewSettings *settings)
{
/* OCIO_TODO: use default view transform here when OCIO is completely integrated
- * and proper versioning stuff is added.
- * for now use NONE to be compatible with all current files
- */
+ * and proper versioning stuff is added.
+ * for now use NONE to be compatible with all current files
+ */
BLI_strncpy(settings->view_transform, "Default", sizeof(settings->view_transform));
settings->gamma = 1.0f;
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index efcc00c401d..de55751f2ec 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2866,9 +2866,7 @@ void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if (!(mask & CD_TYPE_AS_MASK(layer->type))) {
- /* pass */
- }
+ if (!(mask & CD_TYPE_AS_MASK(layer->type))) ;
else if ((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) {
if (typeInfo->free)
typeInfo->free(layer->data, totelem, typeInfo->size);
@@ -2894,15 +2892,10 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if (!(mask & CD_TYPE_AS_MASK(layer->type))) {
- /* pass */
- }
- else if (layer->flag & CD_FLAG_IN_MEMORY) {
- /* pass */
- }
- else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) {
+ if (!(mask & CD_TYPE_AS_MASK(layer->type))) ;
+ else if (layer->flag & CD_FLAG_IN_MEMORY) ;
+ else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read)
update = 1;
- }
}
if (!update)
@@ -2920,23 +2913,15 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if (!(mask & CD_TYPE_AS_MASK(layer->type))) {
- /* pass */
- }
- else if (layer->flag & CD_FLAG_IN_MEMORY) {
- /* pass */
- }
+ if (!(mask & CD_TYPE_AS_MASK(layer->type))) ;
+ else if (layer->flag & CD_FLAG_IN_MEMORY) ;
else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) {
blay = cdf_layer_find(cdf, layer->type, layer->name);
if (blay) {
if (cdf_read_layer(cdf, blay)) {
- if (typeInfo->read(cdf, layer->data, totelem)) {
- /* pass */
- }
- else {
- break;
- }
+ if (typeInfo->read(cdf, layer->data, totelem)) ;
+ else break;
layer->flag |= CD_FLAG_IN_MEMORY;
}
else
@@ -2967,12 +2952,9 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
- if (!(mask & CD_TYPE_AS_MASK(layer->type))) {
- /* pass */
- }
- else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write) {
+ if (!(mask & CD_TYPE_AS_MASK(layer->type))) ;
+ else if ((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write)
update = 1;
- }
}
if (!update)
@@ -3013,16 +2995,11 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
blay = cdf_layer_find(cdf, layer->type, layer->name);
if (cdf_write_layer(cdf, blay)) {
- if (typeInfo->write(cdf, layer->data, totelem)) {
- /* pass */
- }
- else {
- break;
- }
+ if (typeInfo->write(cdf, layer->data, totelem)) ;
+ else break;
}
- else {
+ else
break;
- }
}
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 10c9f30f5ee..64959fd3aa1 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -299,9 +299,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
else
resolu = nu->resolu;
- if (!BKE_nurb_check_valid_u(nu)) {
- /* pass */
- }
+ if (!BKE_nurb_check_valid_u(nu)) ;
else if (nu->type == CU_BEZIER) {
/* count */
len = 0;
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 06b21fbbd29..8b35974ea62 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -928,12 +928,8 @@ makebreak:
* 3: curs down */
ct = chartransdata + cu->pos;
- if ((mode == FO_CURSUP || mode == FO_PAGEUP) && ct->linenr == 0) {
- /* pass */
- }
- else if ((mode == FO_CURSDOWN || mode == FO_PAGEDOWN) && ct->linenr == lnr) {
- /* pass */
- }
+ if ((mode == FO_CURSUP || mode == FO_PAGEUP) && ct->linenr == 0) ;
+ else if ((mode == FO_CURSDOWN || mode == FO_PAGEDOWN) && ct->linenr == lnr) ;
else {
switch (mode) {
case FO_CURSUP: lnr = ct->linenr - 1; break;
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 76b00ffdb1c..2ec5801746c 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -87,7 +87,6 @@ void free_gpencil_frames(bGPDlayer *gpl)
free_gpencil_strokes(gpf);
BLI_freelinkN(&gpl->frames, gpf);
}
- gpl->actframe = NULL;
}
/* Free all of the gp-layers for a viewport (list should be &gpd->layers or so) */
@@ -164,7 +163,7 @@ bGPDframe *gpencil_frame_addnew(bGPDlayer *gpl, int cframe)
}
/* add a new gp-layer and make it the active layer */
-bGPDlayer *gpencil_layer_addnew(bGPdata *gpd, const char *name, int setactive)
+bGPDlayer *gpencil_layer_addnew(bGPdata *gpd)
{
bGPDlayer *gpl;
@@ -183,12 +182,11 @@ bGPDlayer *gpencil_layer_addnew(bGPdata *gpd, const char *name, int setactive)
gpl->thickness = 3;
/* auto-name */
- strcpy(gpl->info, name);
+ strcpy(gpl->info, "GP_Layer");
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
/* make this one the active one */
- if (setactive)
- gpencil_layer_setactive(gpd, gpl);
+ gpencil_layer_setactive(gpd, gpl);
/* return layer */
return gpl;
@@ -511,8 +509,10 @@ void gpencil_layer_setactive(bGPdata *gpd, bGPDlayer *active)
}
/* delete the active gp-layer */
-void gpencil_layer_delete(bGPdata *gpd, bGPDlayer *gpl)
+void gpencil_layer_delactive(bGPdata *gpd)
{
+ bGPDlayer *gpl = gpencil_layer_getactive(gpd);
+
/* error checking */
if (ELEM(NULL, gpd, gpl))
return;
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 5216aefab58..953ee673f6b 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1757,13 +1757,13 @@ void do_versions_ipos_to_animato(Main *main)
{
/* If we have any empty action actuators, assume they were
- * converted IPO Actuators using the object IPO */
+ converted IPO Actuators using the object IPO */
bActuator *act;
bActionActuator *aa;
for (act = ob->actuators.first; act; act = act->next) {
/* Any actuators set to ACT_IPO at this point are actually Action Actuators that
- * need this converted IPO to finish converting the actuator. */
+ need this converted IPO to finish converting the actuator. */
if (act->type == ACT_IPO) {
aa = (bActionActuator *)act->data;
aa->act = ob->adt->action;
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index bb871f0cfd4..17e4103c7d3 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -879,10 +879,9 @@ void outside_lattice(Lattice *lt)
for (v = 0; v < lt->pntsv; v++) {
for (u = 0; u < lt->pntsu; u++, bp++) {
- if (u == 0 || v == 0 || w == 0 || u == lt->pntsu - 1 || v == lt->pntsv - 1 || w == lt->pntsw - 1) {
- /* pass */
- }
+ if (u == 0 || v == 0 || w == 0 || u == lt->pntsu - 1 || v == lt->pntsv - 1 || w == lt->pntsw - 1) ;
else {
+
bp->hide = 1;
bp->f1 &= ~SELECT;
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 592101fbd31..a6a7c045353 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -2396,32 +2396,3 @@ void BKE_mball_translate(MetaBall *mb, const float offset[3])
add_v3_v3(&ml->x, offset);
}
}
-
-/* *** select funcs *** */
-void BKE_mball_select_all(struct MetaBall *mb)
-{
- MetaElem *ml;
-
- for (ml = mb->editelems->first; ml; ml = ml->next) {
- ml->flag |= SELECT;
- }
-}
-
-void BKE_mball_deselect_all(MetaBall *mb)
-{
- MetaElem *ml;
-
- for (ml = mb->editelems->first; ml; ml = ml->next) {
- ml->flag &= ~SELECT;
- }
-}
-
-void BKE_mball_select_swap(struct MetaBall *mb)
-{
- MetaElem *ml;
-
- for (ml = mb->editelems->first; ml; ml = ml->next) {
- ml->flag ^= SELECT;
- }
-}
-
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index f072ed4009e..28de80a7157 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -574,12 +574,10 @@ int modifiers_isCorrectableDeformed(Object *ob)
ModifierData *md = modifiers_getVirtualModifierList(ob);
for (; md; md = md->next) {
- if (ob->mode == OB_MODE_EDIT && (md->mode & eModifierMode_Editmode) == 0) {
- /* pass */
- }
- else if (modifier_isCorrectableDeformed(md)) {
+ if (ob->mode == OB_MODE_EDIT && (md->mode & eModifierMode_Editmode) == 0) ;
+ else
+ if (modifier_isCorrectableDeformed(md))
return 1;
- }
}
return 0;
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 60cb1049a35..8cede4f51a5 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -326,13 +326,10 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp)
ntype->initfunc(ntree, node, ntemp);
/* initialize the node name with the node label.
- * note: do this after the initfunc so nodes get their data set which may be used in naming
+ * note: do this after the initfunc so nodes get
+ * their data set which may be used in naming
* (node groups for example) */
- /* XXX Do not use nodeLabel() here, it returns translated content, which should *only* be used
- * in UI, *never* in data...
- * This solution may be a bit rougher than nodeLabel()'s returned string, but it's simpler
- * than adding a "no translate" flag to this func (and labelfunc() as well). */
- BLI_strncpy(node->name, node->typeinfo->name, NODE_MAXSTR);
+ BLI_strncpy(node->name, nodeLabel(node), NODE_MAXSTR);
nodeUniqueName(ntree, node);
ntree->update |= NTREE_UPDATE_NODES;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 65ab97e0dad..ab261e79dfc 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2261,7 +2261,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const short u
Curve *cu = ob->data;
/* Use the object bounding box so that modifier output
- * gets taken into account */
+ gets taken into account */
if (ob->bb)
bb = *(ob->bb);
else {
@@ -2362,7 +2362,7 @@ int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_ma
ListBase *lb;
DupliObject *dob;
- lb = object_duplilist(scene, ob, FALSE);
+ lb = object_duplilist(scene, ob);
for (dob = lb->first; dob; dob = dob->next) {
if ((use_hidden == FALSE) && (dob->no_draw != 0)) {
/* pass */
@@ -2439,7 +2439,7 @@ void BKE_scene_foreach_display_point(
ListBase *lb;
DupliObject *dob;
- lb = object_duplilist(scene, ob, FALSE);
+ lb = object_duplilist(scene, ob);
for (dob = lb->first; dob; dob = dob->next) {
if (dob->no_draw == 0) {
BKE_object_foreach_display_point(dob->ob, dob->mat, func_cb, user_data);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 89dadcd8dd5..e8af794eaea 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -97,8 +97,8 @@ int count_particles(ParticleSystem *psys)
int tot = 0;
LOOP_SHOWN_PARTICLES {
- if (pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN) == 0) {}
- else if (pa->alive == PARS_DEAD && (part->flag & PART_DIED) == 0) {}
+ if (pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN) == 0) ;
+ else if (pa->alive == PARS_DEAD && (part->flag & PART_DIED) == 0) ;
else tot++;
}
return tot;
@@ -110,8 +110,8 @@ int count_particles_mod(ParticleSystem *psys, int totgr, int cur)
int tot = 0;
LOOP_SHOWN_PARTICLES {
- if (pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN) == 0) {}
- else if (pa->alive == PARS_DEAD && (part->flag & PART_DIED) == 0) {}
+ if (pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN) == 0) ;
+ else if (pa->alive == PARS_DEAD && (part->flag & PART_DIED) == 0) ;
else if (p % totgr == cur) tot++;
}
return tot;
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 8c0d19ba1fd..0d01bb33fc5 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1030,7 +1030,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
ListBase *lb_dupli_ob;
/* don't update the dupli groups, we only wan't their pid's */
- if ((lb_dupli_ob = object_duplilist_ex(scene, ob, FALSE, FALSE))) {
+ if ((lb_dupli_ob = object_duplilist_ex(scene, ob, FALSE))) {
DupliObject *dob;
for (dob= lb_dupli_ob->first; dob; dob= dob->next) {
if (dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 96e64f30156..a6556096d70 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -754,7 +754,7 @@ int BKE_scene_base_iter_next(Scene **scene, int val, Base **base, Object **ob)
* this enters eternal loop because of
* makeDispListMBall getting called inside of group_duplilist */
if ((*base)->object->dup_group == NULL) {
- duplilist = object_duplilist((*scene), (*base)->object, FALSE);
+ duplilist = object_duplilist((*scene), (*base)->object);
dupob = duplilist->first;
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 33519483843..eaf3ec384c8 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -609,9 +609,9 @@ static void makeGammaTables(float gamma)
/* The end of the table should match 1.0 carefully. In order to avoid
* rounding errors, we just set this explicitly. The last segment may
- * have a different length than the other segments, but our
- * interpolation is insensitive to that
- */
+ * have a different length than the other segments, but our
+ * interpolation is insensitive to that
+ */
color_domain_table[RE_GAMMA_TABLE_SIZE] = 1.0;
gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 49ed7f80be3..f531caac919 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3973,10 +3973,10 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad
sound = sound_new_file(bmain, seq_load->path); /* handles relative paths */
if (sound == NULL || sound->playback_handle == NULL) {
-#if 0
+ /*
if (op)
BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
-#endif
+ */
return NULL;
}
@@ -3985,10 +3985,10 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad
if (info.specs.channels == AUD_CHANNELS_INVALID) {
sound_delete(bmain, sound);
-#if 0
+ /*
if (op)
BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
-#endif
+ */
return NULL;
}
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 9dd83181521..bdd9b424f3b 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -1073,21 +1073,19 @@ void set_current_material_texture(Material *ma, Tex *newtex)
{
Tex *tex = NULL;
bNode *node;
+
+ if (ma && ma->use_nodes && ma->nodetree) {
+ node = nodeGetActiveID(ma->nodetree, ID_TE);
- if ((ma->use_nodes && ma->nodetree) &&
- (node = nodeGetActiveID(ma->nodetree, ID_TE)))
- {
- tex = (Tex *)node->id;
- id_us_min(&tex->id);
- if (newtex) {
+ if (node) {
+ tex = (Tex *)node->id;
+ id_us_min(&tex->id);
node->id = &newtex->id;
id_us_plus(&newtex->id);
- }
- else {
- node->id = NULL;
+ ma = NULL;
}
}
- else {
+ if (ma) {
int act = (int)ma->texact;
tex = (ma->mtex[act]) ? ma->mtex[act]->tex : NULL;
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 7d2fd520c37..c9d7ec3964f 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -169,6 +169,8 @@ void BKE_tracking_settings_init(MovieTracking *tracking)
tracking->settings.default_minimum_correlation = 0.75;
tracking->settings.default_pattern_size = 11;
tracking->settings.default_search_size = 61;
+ tracking->settings.keyframe1 = 1;
+ tracking->settings.keyframe2 = 30;
tracking->settings.dist = 1;
tracking->settings.object_distance = 1;
@@ -1177,8 +1179,6 @@ MovieTrackingObject *BKE_tracking_object_add(MovieTracking *tracking, const char
tracking->objectnr = BLI_countlist(&tracking->objects) - 1;
object->scale = 1.0f;
- object->keyframe1 = 1;
- object->keyframe2 = 30;
BKE_tracking_object_unique_name(tracking, object);
@@ -2755,11 +2755,10 @@ static int reconstruct_refine_intrinsics_get_flags(MovieTracking *tracking, Movi
return flags;
}
-static int reconstruct_count_tracks_on_both_keyframes(MovieTracking *tracking, MovieTrackingObject *object)
+static int reconstruct_count_tracks_on_both_keyframes(MovieTracking *tracking, ListBase *tracksbase)
{
- ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object);
int tot = 0;
- int frame1 = object->keyframe1, frame2 = object->keyframe2;
+ int frame1 = tracking->settings.keyframe1, frame2 = tracking->settings.keyframe2;
MovieTrackingTrack *track;
track = tracksbase->first;
@@ -2780,11 +2779,13 @@ static int reconstruct_count_tracks_on_both_keyframes(MovieTracking *tracking, M
int BKE_tracking_reconstruction_check(MovieTracking *tracking, MovieTrackingObject *object, char *error_msg, int error_size)
{
#ifdef WITH_LIBMV
+ ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object);
+
if (tracking->settings.motion_flag & TRACKING_MOTION_MODAL) {
/* TODO: check for number of tracks? */
return TRUE;
}
- else if (reconstruct_count_tracks_on_both_keyframes(tracking, object) < 8) {
+ else if (reconstruct_count_tracks_on_both_keyframes(tracking, tracksbase) < 8) {
BLI_strncpy(error_msg, "At least 8 common tracks on both of keyframes are needed for reconstruction",
error_size);
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index 9f29cb8b137..dab44b5463c 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -47,11 +47,7 @@
#include "BKE_report.h"
#include "BKE_writeavi.h"
-
-/* ********************** general blender movie support ***************************** */
-
-#ifdef WITH_AVI
-# include "AVI_avi.h"
+#include "AVI_avi.h"
/* callbacks */
static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *reports);
@@ -59,31 +55,30 @@ static void end_avi(void);
static int append_avi(RenderData *rd, int start_frame, int frame, int *pixels,
int rectx, int recty, ReportList *reports);
static void filepath_avi(char *string, RenderData *rd);
-#endif /* WITH_AVI */
+
+/* ********************** general blender movie support ***************************** */
#ifdef WITH_QUICKTIME
-# include "quicktime_export.h"
+#include "quicktime_export.h"
#endif
#ifdef WITH_FFMPEG
-# include "BKE_writeffmpeg.h"
+#include "BKE_writeffmpeg.h"
#endif
#include "BKE_writeframeserver.h"
bMovieHandle *BKE_movie_handle_get(const char imtype)
{
- static bMovieHandle mh = {0};
+ static bMovieHandle mh;
/* set the default handle, as builtin */
-#ifdef WITH_AVI
mh.start_movie = start_avi;
mh.append_movie = append_avi;
mh.end_movie = end_avi;
mh.get_next_frame = NULL;
mh.get_movie_path = filepath_avi;
-#endif
-
+
/* do the platform specific handles */
#ifdef WITH_QUICKTIME
if (imtype == R_IMF_IMTYPE_QUICKTIME) {
@@ -119,8 +114,6 @@ bMovieHandle *BKE_movie_handle_get(const char imtype)
/* ****************************************************************** */
-#ifdef WITH_AVI
-
static AviMovie *avi = NULL;
static void filepath_avi(char *string, RenderData *rd)
@@ -226,7 +219,6 @@ static void end_avi(void)
MEM_freeN(avi);
avi = NULL;
}
-#endif /* WITH_AVI */
/* similar to BKE_makepicstring() */
void BKE_movie_filepath_get(char *string, RenderData *rd)
diff --git a/source/blender/blenlib/BLI_endian_switch_inline.h b/source/blender/blenlib/BLI_endian_switch_inline.h
index 6aa0405861e..b747da3b738 100644
--- a/source/blender/blenlib/BLI_endian_switch_inline.h
+++ b/source/blender/blenlib/BLI_endian_switch_inline.h
@@ -32,63 +32,85 @@
* \ingroup bli
*/
-/* note: using a temp char to switch endian is a lot slower,
- * use bit shifting instead. */
-/* *** 16 *** */
BLI_INLINE void BLI_endian_switch_int16(short *val)
{
- short tval = *val;
- *val = (tval >> 8) |
- (tval << 8);
+ char *p_i = (char *)val;
+ char s_i;
+ s_i = p_i[0];
+ p_i[0] = p_i[1];
+ p_i[1] = s_i;
}
+
BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val)
{
- BLI_endian_switch_int16((short *)val);
-}
+ char *p_i = (char *)val;
+ char s_i;
+ s_i = p_i[0];
+ p_i[0] = p_i[1];
+ p_i[1] = s_i;
+}
-/* *** 32 *** */
BLI_INLINE void BLI_endian_switch_int32(int *val)
{
- int tval = *val;
- *val = ((tval >> 24)) |
- ((tval << 8) & 0x00ff0000) |
- ((tval >> 8) & 0x0000ff00) |
- ((tval << 24));
+ char *p_i = (char *)val;
+ char s_i;
+ s_i = p_i[0]; p_i[0] = p_i[3]; p_i[3] = s_i;
+ s_i = p_i[1]; p_i[1] = p_i[2]; p_i[2] = s_i;
}
+
BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val)
{
- BLI_endian_switch_int32((int *)val);
+ char *p_i = (char *)val;
+ char s_i;
+
+ s_i = p_i[0]; p_i[0] = p_i[3]; p_i[3] = s_i;
+ s_i = p_i[1]; p_i[1] = p_i[2]; p_i[2] = s_i;
}
+
BLI_INLINE void BLI_endian_switch_float(float *val)
{
- BLI_endian_switch_int32((int *)val);
-}
+ char *p_i = (char *)val;
+ char s_i;
+ s_i = p_i[0]; p_i[0] = p_i[3]; p_i[3] = s_i;
+ s_i = p_i[1]; p_i[1] = p_i[2]; p_i[2] = s_i;
+}
-/* *** 64 *** */
BLI_INLINE void BLI_endian_switch_int64(int64_t *val)
{
- int64_t tval = *val;
- *val = ((tval >> 56)) |
- ((tval << 40) & 0x00ff000000000000l) |
- ((tval << 24) & 0x0000ff0000000000l) |
- ((tval << 8) & 0x000000ff00000000l) |
- ((tval >> 8) & 0x00000000ff000000l) |
- ((tval >> 24) & 0x0000000000ff0000l) |
- ((tval >> 40) & 0x000000000000ff00l) |
- ((tval << 56));
+ char *p_i = (char *)val;
+ char s_i;
+
+ s_i = p_i[0]; p_i[0] = p_i[7]; p_i[7] = s_i;
+ s_i = p_i[1]; p_i[1] = p_i[6]; p_i[6] = s_i;
+ s_i = p_i[2]; p_i[2] = p_i[5]; p_i[5] = s_i;
+ s_i = p_i[3]; p_i[3] = p_i[4]; p_i[4] = s_i;
}
+
BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val)
{
- BLI_endian_switch_int64((int64_t *)val);
+ char *p_i = (char *)val;
+ char s_i;
+
+ s_i = p_i[0]; p_i[0] = p_i[7]; p_i[7] = s_i;
+ s_i = p_i[1]; p_i[1] = p_i[6]; p_i[6] = s_i;
+ s_i = p_i[2]; p_i[2] = p_i[5]; p_i[5] = s_i;
+ s_i = p_i[3]; p_i[3] = p_i[4]; p_i[4] = s_i;
}
+
BLI_INLINE void BLI_endian_switch_double(double *val)
{
- BLI_endian_switch_int64((int64_t *)val);
+ char *p_i = (char *)val;
+ char s_i;
+
+ s_i = p_i[0]; p_i[0] = p_i[7]; p_i[7] = s_i;
+ s_i = p_i[1]; p_i[1] = p_i[6]; p_i[6] = s_i;
+ s_i = p_i[2]; p_i[2] = p_i[5]; p_i[5] = s_i;
+ s_i = p_i[3]; p_i[3] = p_i[4]; p_i[4] = s_i;
}
#endif /* __BLI_ENDIAN_SWITCH_INLINE_H__ */
diff --git a/source/blender/blenlib/BLI_lasso.h b/source/blender/blenlib/BLI_lasso.h
index a7e90a51e86..85a000b000c 100644
--- a/source/blender/blenlib/BLI_lasso.h
+++ b/source/blender/blenlib/BLI_lasso.h
@@ -34,8 +34,8 @@
struct rcti;
-void BLI_lasso_boundbox(struct rcti *rect, const int mcords[][2], const short moves);
-int BLI_lasso_is_point_inside(const int mcords[][2], const short moves, const int sx, const int sy, const int error_value);
-int BLI_lasso_is_edge_inside(const int mcords[][2], const short moves, int x0, int y0, int x1, int y1, const int error_value);
+void BLI_lasso_boundbox(struct rcti *rect, int mcords[][2], short moves);
+int BLI_lasso_is_point_inside(int mcords[][2], short moves, const int sx, const int sy, const int error_value);
+int BLI_lasso_is_edge_inside(int mcords[][2], short moves, int x0, int y0, int x1, int y1, const int error_value);
#endif
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 5321de4393b..29097a4c6c3 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -128,10 +128,6 @@
#endif
#endif
-/* can be used in simple macros */
-#define CHECK_TYPE_INLINE(val, type) \
- ((void)(((type *)0) != (val)))
-
#ifndef SWAP
# define SWAP(type, a, b) { \
type sw_ap; \
diff --git a/source/blender/blenlib/intern/lasso.c b/source/blender/blenlib/intern/lasso.c
index 5cd8bb813a1..7df4da80e16 100644
--- a/source/blender/blenlib/intern/lasso.c
+++ b/source/blender/blenlib/intern/lasso.c
@@ -37,7 +37,7 @@
#include "BLI_lasso.h" /* own include */
-void BLI_lasso_boundbox(rcti *rect, const int mcords[][2], const short moves)
+void BLI_lasso_boundbox(rcti *rect, int mcords[][2], short moves)
{
short a;
@@ -53,14 +53,14 @@ void BLI_lasso_boundbox(rcti *rect, const int mcords[][2], const short moves)
}
-int BLI_lasso_is_point_inside(const int mcords[][2], const short moves,
+int BLI_lasso_is_point_inside(int mcords[][2], short moves,
const int sx, const int sy,
const int error_value)
{
/* we do the angle rule, define that all added angles should be about zero or (2 * PI) */
float angletot = 0.0, dot, ang, cross, fp1[2], fp2[2];
int a;
- const int *p1, *p2;
+ int *p1, *p2;
if (sx == error_value) {
return 0;
@@ -100,7 +100,7 @@ int BLI_lasso_is_point_inside(const int mcords[][2], const short moves,
}
/* edge version for lasso select. we assume boundbox check was done */
-int BLI_lasso_is_edge_inside(const int mcords[][2], const short moves,
+int BLI_lasso_is_edge_inside(int mcords[][2], short moves,
int x0, int y0, int x1, int y1,
const int error_value)
{
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 606fd48dc2b..6b06f1cc96d 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -206,7 +206,7 @@
* - join all Mains
* - link all LibBlocks and indirect pointers to libblocks
* - initialize FileGlobal and copy pointers to Global
- */
+*/
/* also occurs in library.c */
/* GS reads the memory pointed at in a specific ordering. There are,
@@ -3841,6 +3841,35 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
direct_link_customdata(fd, &mesh->ldata, mesh->totloop);
direct_link_customdata(fd, &mesh->pdata, mesh->totpoly);
+
+#ifdef USE_BMESH_FORWARD_COMPAT
+ /* NEVER ENABLE THIS CODE INTO BMESH!
+ * THIS IS FOR LOADING BMESH INTO OLDER FILES ONLY */
+ mesh->mpoly = newdataadr(fd, mesh->mpoly);
+ mesh->mloop = newdataadr(fd, mesh->mloop);
+
+ direct_link_customdata(fd, &mesh->pdata, mesh->totpoly);
+ direct_link_customdata(fd, &mesh->ldata, mesh->totloop);
+
+ if (mesh->mpoly) {
+ /* be clever and load polygons as mfaces */
+ mesh->totface= BKE_mesh_mpoly_to_mface(&mesh->fdata, &mesh->ldata, &mesh->pdata,
+ mesh->totface, mesh->totloop, mesh->totpoly);
+
+ CustomData_free(&mesh->pdata, mesh->totpoly);
+ memset(&mesh->pdata, 0, sizeof(CustomData));
+ mesh->totpoly = 0;
+
+ CustomData_free(&mesh->ldata, mesh->totloop);
+ memset(&mesh->ldata, 0, sizeof(CustomData));
+ mesh->totloop = 0;
+
+ mesh_update_customdata_pointers(mesh);
+ }
+
+#endif
+
+
mesh->bb = NULL;
mesh->edit_btmesh = NULL;
@@ -7038,15 +7067,6 @@ static void do_version_ntree_keying_despill_balance(void *UNUSED(data), ID *UNUS
}
}
-static void do_version_ntree_tex_coord_from_dupli_264(void *UNUSED(data), ID *UNUSED(id), bNodeTree *ntree)
-{
- bNode *node;
-
- for (node = ntree->nodes.first; node; node = node->next)
- if (node->type == SH_NODE_TEX_COORD)
- node->flag |= NODE_OPTIONS;
-}
-
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -8004,37 +8024,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 1)) {
- bNodeTreeType *ntreetype = ntreeGetType(NTREE_SHADER);
- bNodeTree *ntree;
-
- if (ntreetype && ntreetype->foreach_nodetree)
- ntreetype->foreach_nodetree(main, NULL, do_version_ntree_tex_coord_from_dupli_264);
-
- for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
- if (ntree->type==NTREE_SHADER)
- do_version_ntree_tex_coord_from_dupli_264(NULL, NULL, ntree);
- }
-
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 2)) {
- MovieClip *clip;
-
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
- MovieTracking *tracking = &clip->tracking;
- MovieTrackingObject *tracking_object;
-
- for (tracking_object = tracking->objects.first;
- tracking_object;
- tracking_object = tracking_object->next)
- {
- if (tracking_object->keyframe1 == 0 && tracking_object->keyframe2 == 0) {
- tracking_object->keyframe1 = tracking->settings.keyframe1;
- tracking_object->keyframe2 = tracking->settings.keyframe2;
- }
- }
- }
- }
-
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 536376ac577..b8d63b3c5d5 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -30,46 +30,46 @@
/*
- * FILEFORMAT: IFF-style structure (but not IFF compatible!)
- *
- * start file:
- * BLENDER_V100 12 bytes (versie 1.00)
- * V = big endian, v = little endian
- * _ = 4 byte pointer, - = 8 byte pointer
- *
- * datablocks: also see struct BHead
- * <bh.code> 4 chars
- * <bh.len> int, len data after BHead
- * <bh.old> void, old pointer
- * <bh.SDNAnr> int
- * <bh.nr> int, in case of array: amount of structs
- * data
- * ...
- * ...
- *
- * Almost all data in Blender are structures. Each struct saved
- * gets a BHead header. With BHead the struct can be linked again
- * and compared with StructDNA .
- *
- * WRITE
- *
- * Preferred writing order: (not really a must, but why would you do it random?)
- * Any case: direct data is ALWAYS after the lib block
- *
- * (Local file data)
- * - for each LibBlock
- * - write LibBlock
- * - write associated direct data
- * (External file data)
- * - per library
- * - write library block
- * - per LibBlock
- * - write the ID of LibBlock
- * - write TEST (128x128, blend file preview, optional)
- * - write FileGlobal (some global vars)
- * - write SDNA
- * - write USER if filename is ~/X.XX/config/startup.blend
- */
+FILEFORMAT: IFF-style structure (but not IFF compatible!)
+
+start file:
+ BLENDER_V100 12 bytes (versie 1.00)
+ V = big endian, v = little endian
+ _ = 4 byte pointer, - = 8 byte pointer
+
+datablocks: also see struct BHead
+ <bh.code> 4 chars
+ <bh.len> int, len data after BHead
+ <bh.old> void, old pointer
+ <bh.SDNAnr> int
+ <bh.nr> int, in case of array: amount of structs
+ data
+ ...
+ ...
+
+Almost all data in Blender are structures. Each struct saved
+gets a BHead header. With BHead the struct can be linked again
+and compared with StructDNA .
+
+WRITE
+
+Preferred writing order: (not really a must, but why would you do it random?)
+Any case: direct data is ALWAYS after the lib block
+
+(Local file data)
+- for each LibBlock
+ - write LibBlock
+ - write associated direct data
+(External file data)
+- per library
+ - write library block
+ - per LibBlock
+ - write the ID of LibBlock
+- write TEST (128x128, blend file preview, optional)
+- write FileGlobal (some global vars)
+- write SDNA
+- write USER if filename is ~/X.XX/config/startup.blend
+*/
#include <math.h>
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 225ea6c2ef6..a72bfe47127 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -499,7 +499,7 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
BMEdge *e = lwalk->cur, *nexte = NULL;
BMLoop *l;
BMVert *v;
- int i = 0;
+ int i;
owalk = *lwalk;
BMW_state_remove(walker);
@@ -534,7 +534,7 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
}
else if (l) { /* NORMAL EDGE WITH FACES */
int vert_edge_tot;
- int stopi = 0;
+ int stopi;
v = BM_edge_other_vert(e, lwalk->lastv);
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index f37f065b03b..4d4f26561e3 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -88,8 +88,8 @@ extern "C" {
/*
- * COLLADA Importer limitations:
- * - no multiple scene import, all objects are added to active scene
+ COLLADA Importer limitations:
+ - no multiple scene import, all objects are added to active scene
*/
// #define COLLADA_DEBUG
@@ -878,7 +878,7 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
}
break;
/* XXX correct way to do following four is probably to get also render
- * size and determine proper settings from that somehow */
+ size and determine proper settings from that somehow */
case COLLADAFW::Camera::ASPECTRATIO_AND_X:
case COLLADAFW::Camera::SINGLE_X:
case COLLADAFW::Camera::X_AND_Y:
diff --git a/source/blender/collada/DocumentImporter.h b/source/blender/collada/DocumentImporter.h
index e878a5a5b48..13f23b23388 100644
--- a/source/blender/collada/DocumentImporter.h
+++ b/source/blender/collada/DocumentImporter.h
@@ -78,9 +78,8 @@ public:
void write_profile_COMMON(COLLADAFW::EffectCommon*, Material*);
void translate_anim_recursive(COLLADAFW::Node*, COLLADAFW::Node*, Object*);
- /**
- * This method will be called if an error in the loading process occurred and the loader cannot
- * continue to load. The writer should undo all operations that have been performed.
+ /** This method will be called if an error in the loading process occurred and the loader cannot
+ continue to load. The writer should undo all operations that have been performed.
\param errorMessage A message containing informations about the error that occurred.
*/
void cancel(const COLLADAFW::String& errorMessage);
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
index e2332b7cd55..27700444ba9 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -358,8 +358,8 @@ void GeometryExporter::createVertsSource(std::string geom_id, Mesh *me)
param.push_back("X");
param.push_back("Y");
param.push_back("Z");
- /* main function, it creates <source id = "">, <float_array id = ""
- * count = ""> */
+ /*main function, it creates <source id = "">, <float_array id = ""
+ count = ""> */
source.prepareToAppendValues();
//appends data to <float_array>
int i = 0;
diff --git a/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp b/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp
index 60d37fb8145..9125783c222 100644
--- a/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp
+++ b/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp
@@ -81,9 +81,11 @@ void GlareStreaksOperation::generateGlare(float *data, MemoryBuffer *inputTile,
float *sourcebuffer = tsrc->getBuffer();
float factor = 1.f / (float)(6 - settings->iter);
- for (int i = 0; i < size4; i += 4) {
- madd_v3_v3fl(&data[i], &sourcebuffer[i], factor);
- data[i + 3] = 1.0f;
+ for (int i = 0; i < size4; i++) {
+ data[i] += sourcebuffer[i] * factor;
+ }
+ for (int i = 0; i < size; i++) {
+ data[i * 4 + 3] = 1.0f;
}
tdst->clear();
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.h b/source/blender/compositor/operations/COM_TrackPositionOperation.h
index b934719a92b..3a9e6f25cd9 100644
--- a/source/blender/compositor/operations/COM_TrackPositionOperation.h
+++ b/source/blender/compositor/operations/COM_TrackPositionOperation.h
@@ -35,8 +35,8 @@
#include "BLI_listbase.h"
/**
- * Class with implementation of green screen gradient rasterization
- */
+ * Class with implementation of green screen gradient rasterization
+ */
class TrackPositionOperation : public NodeOperation {
protected:
enum {
@@ -58,8 +58,8 @@ protected:
float m_relativePos[2];
/**
- * Determine the output resolution. The resolution is retrieved from the Renderer
- */
+ * Determine the output resolution. The resolution is retrieved from the Renderer
+ */
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
public:
diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h
index bc07bf091de..cf84eb04b10 100644
--- a/source/blender/editors/animation/anim_intern.h
+++ b/source/blender/editors/animation/anim_intern.h
@@ -50,9 +50,7 @@ void ANIM_OT_keyframe_delete(struct wmOperatorType *ot);
* required for each space.
*/
void ANIM_OT_keyframe_insert_menu(struct wmOperatorType *ot);
-
void ANIM_OT_keyframe_delete_v3d(struct wmOperatorType *ot);
-void ANIM_OT_keyframe_clear_v3d(struct wmOperatorType *ot);
/* Keyframe managment operators for UI buttons (RMB menu). */
void ANIM_OT_keyframe_insert_button(struct wmOperatorType *ot);
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index f2711ec3bb5..e24a4d49a05 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -290,7 +290,6 @@ void ED_operatortypes_anim(void)
WM_operatortype_append(ANIM_OT_keyframe_delete);
WM_operatortype_append(ANIM_OT_keyframe_insert_menu);
WM_operatortype_append(ANIM_OT_keyframe_delete_v3d);
- WM_operatortype_append(ANIM_OT_keyframe_clear_v3d);
WM_operatortype_append(ANIM_OT_keyframe_insert_button);
WM_operatortype_append(ANIM_OT_keyframe_delete_button);
WM_operatortype_append(ANIM_OT_keyframe_clear_button);
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 0454e88e320..1791d84d90b 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1186,9 +1186,10 @@ static int modify_key_op_poll(bContext *C)
/* if Outliner, don't allow in some views */
if (so) {
- if (ELEM5(so->outlinevis, SO_GROUPS, SO_LIBRARIES, SO_SEQUENCE, SO_USERDEF, SO_KEYMAP)) {
+ if (ELEM4(so->outlinevis, SO_GROUPS, SO_LIBRARIES, SO_VERSE_SESSION, SO_VERSE_SESSION))
+ return 0;
+ if (ELEM3(so->outlinevis, SO_SEQUENCE, SO_USERDEF, SO_KEYMAP))
return 0;
- }
}
/* TODO: checks for other space types can be added here */
@@ -1439,122 +1440,46 @@ void ANIM_OT_keyframe_delete(wmOperatorType *ot)
}
/* Delete Key Operator ------------------------ */
-/* NOTE: Although this version is simpler than the more generic version for KeyingSets,
- * it is more useful for animators working in the 3D view.
+
+/* XXX WARNING:
+ * This is currently just a basic operator, which work in 3d-view context on objects only.
+ * Should this be kept? It does have advantages over a version which requires selecting a keyingset to use...
+ * -- Joshua Leung, Jan 2009
*/
-static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op))
-{
- Main *bmain = CTX_data_main(C);
-
- CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
- {
- /* just those in active action... */
- if ((ob->adt) && (ob->adt->action)) {
- AnimData *adt = ob->adt;
- bAction *act = adt->action;
- FCurve *fcu, *fcn;
-
- for (fcu = act->curves.first; fcu; fcu = fcn) {
- short can_delete = FALSE;
-
- fcn = fcu->next;
-
- /* in pose mode, only delete the F-Curve if it belongs to a selected bone */
- if (ob->mode & OB_MODE_POSE) {
- if ((fcu->rna_path) && strstr(fcu->rna_path, "pose.bones[")) {
- bPoseChannel *pchan;
- char *bone_name;
-
- /* get bone-name, and check if this bone is selected */
- bone_name = BLI_str_quoted_substrN(fcu->rna_path, "pose.bones[");
- pchan = BKE_pose_channel_find_name(ob->pose, bone_name);
- if (bone_name) MEM_freeN(bone_name);
-
- /* delete if bone is selected*/
- if ((pchan) && (pchan->bone)) {
- if (pchan->bone->flag & BONE_SELECTED)
- can_delete = TRUE;
- }
- }
- }
- else {
- /* object mode - all of Object's F-Curves are affected */
- can_delete = TRUE;
- }
-
- /* delete F-Curve completely */
- if (can_delete) {
- ANIM_fcurve_delete_from_animdata(NULL, adt, fcu);
- }
- }
- }
-
- /* update... */
- ob->recalc |= OB_RECALC_OB;
- }
- CTX_DATA_END;
-
- /* send updates */
- DAG_ids_flush_update(bmain, 0);
- WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
-
- return OPERATOR_FINISHED;
-}
-
-void ANIM_OT_keyframe_clear_v3d(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Remove Animation";
- ot->description = "Remove all keyframe animation for selected objects";
- ot->idname = "ANIM_OT_keyframe_clear_v3d";
-
- /* callbacks */
- ot->invoke = WM_operator_confirm;
- ot->exec = clear_anim_v3d_exec;
-
- ot->poll = ED_operator_areaactive;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
-
static int delete_key_v3d_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- float cfra = (float)CFRA;
+ float cfra = (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
+ // XXX more comprehensive tests will be needed
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
- ID *id = &ob->id;
- int success = 0;
+ ID *id = (ID *)ob;
+ FCurve *fcu, *fcn;
+ short success = 0;
- /* just those in active action... */
+ /* loop through all curves in animdata and delete keys on this frame */
if ((ob->adt) && (ob->adt->action)) {
AnimData *adt = ob->adt;
bAction *act = adt->action;
- FCurve *fcu, *fcn;
for (fcu = act->curves.first; fcu; fcu = fcn) {
fcn = fcu->next;
-
- /* delete keyframes on current frame
- * WARNING: this can delete the next F-Curve, hence the "fcn" copying
- */
success += delete_keyframe(op->reports, id, NULL, NULL, fcu->rna_path, fcu->array_index, cfra, 0);
}
}
- /* report success (or failure) */
- BKE_reportf(op->reports, RPT_INFO, "Object '%s' successfully had %d keyframes removed", id->name + 2, success);
+ BKE_reportf(op->reports, RPT_INFO, "Ob '%s' - Successfully had %d keyframes removed", id->name + 2, success);
+
ob->recalc |= OB_RECALC_OB;
}
CTX_DATA_END;
/* send updates */
DAG_ids_flush_update(bmain, 0);
+
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
return OPERATOR_FINISHED;
@@ -1564,7 +1489,7 @@ void ANIM_OT_keyframe_delete_v3d(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Delete Keyframe";
- ot->description = "Remove keyframes on current frame for selected objects";
+ ot->description = "Remove keyframes on current frame for selected object";
ot->idname = "ANIM_OT_keyframe_delete_v3d";
/* callbacks */
@@ -1587,7 +1512,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
PointerRNA ptr = {{NULL}};
PropertyRNA *prop = NULL;
char *path;
- float cfra = (float)CFRA;
+ float cfra = (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
short success = 0;
int a, index, length, all = RNA_boolean_get(op->ptr, "all");
short flag = 0;
@@ -1758,20 +1683,20 @@ static int clear_key_button_exec(bContext *C, wmOperator *op)
if (ptr.id.data && ptr.data && prop) {
path = RNA_path_from_ID_to_property(&ptr, prop);
-
+
if (path) {
if (all) {
length = RNA_property_array_length(&ptr, prop);
-
+
if (length) index = 0;
else length = 1;
}
else
length = 1;
-
+
for (a = 0; a < length; a++)
success += clear_keyframe(op->reports, ptr.id.data, NULL, NULL, path, index + a, 0);
-
+
MEM_freeN(path);
}
else if (G.debug & G_DEBUG)
@@ -1785,9 +1710,9 @@ static int clear_key_button_exec(bContext *C, wmOperator *op)
if (success) {
/* send updates */
uiContextAnimUpdate(C);
-
+
DAG_ids_flush_update(bmain, 0);
-
+
/* send notifiers that keyframes have been changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index ffdced3262f..b8b89785e17 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -661,9 +661,7 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
/* helpful warnings... */
/* TODO: add warnings to be careful about actions, applying deforms first, etc. */
if (ob->adt && ob->adt->action)
- BKE_report(op->reports, RPT_WARNING,
- "Actions on this armature will be destroyed by this new rest pose as the "
- "transforms stored are relative to the old rest pose");
+ BKE_report(op->reports, RPT_WARNING, "Actions on this armature will be destroyed by this new rest pose as the transforms stored are relative to the old rest pose");
/* Get editbones of active armature to alter */
ED_armature_to_edit(ob);
@@ -1593,8 +1591,7 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot)
/* does bones and points */
/* note that BONE ROOT only gets drawn for root bones (or without IK) */
-static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2],
- ListBase *edbo, int findunsel, int *selmask)
+static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2], ListBase *edbo, int findunsel, int *selmask)
{
EditBone *ebone;
rcti rect;
@@ -1834,7 +1831,7 @@ void ED_armature_deselect_all_visible(Object *obedit)
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
/* first and foremost, bone must be visible and selected */
- if (EBONE_SELECTABLE(arm, ebone)) {
+ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
}
}
@@ -2559,8 +2556,7 @@ void updateDuplicateSubtarget(EditBone *dupBone, ListBase *editbones, Object *ob
}
-EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase *editbones,
- Object *src_ob, Object *dst_ob)
+EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase *editbones, Object *src_ob, Object *dst_ob)
{
EditBone *eBone = MEM_mallocN(sizeof(EditBone), "addup_editbone");
@@ -3040,8 +3036,7 @@ static void bones_merge(Object *obedit, EditBone *start, EditBone *end, EditBone
newbone->parent = start->parent;
/* TODO, copy more things to the new bone */
- newbone->flag = start->flag & (BONE_HINGE | BONE_NO_DEFORM | BONE_NO_SCALE |
- BONE_NO_CYCLICOFFSET | BONE_NO_LOCAL_LOCATION | BONE_DONE);
+ newbone->flag = start->flag & (BONE_HINGE | BONE_NO_DEFORM | BONE_NO_SCALE | BONE_NO_CYCLICOFFSET | BONE_NO_LOCAL_LOCATION | BONE_DONE);
/* step 2a: reparent any side chains which may be parented to any bone in the chain of bones to merge
* - potentially several tips for side chains leading to some tree exist...
@@ -3362,17 +3357,12 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
if (EBONE_VISIBLE(arm, ebone)) {
/* we extrude per definition the tip */
do_extrude = FALSE;
- if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED)) {
+ if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED))
do_extrude = TRUE;
- }
else if (ebone->flag & BONE_ROOTSEL) {
/* but, a bone with parent deselected we do the root... */
- if (ebone->parent && (ebone->parent->flag & BONE_TIPSEL)) {
- /* pass */
- }
- else {
- do_extrude = 2;
- }
+ if (ebone->parent && (ebone->parent->flag & BONE_TIPSEL)) ;
+ else do_extrude = 2;
}
if (do_extrude) {
@@ -4116,7 +4106,7 @@ static void select_similar_length(bArmature *arm, EditBone *ebone_act, const flo
const float len_max = ebone_act->length * (1.0f + thresh);
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
- if (EBONE_SELECTABLE(arm, ebone)) {
+ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
if ((ebone->length >= len_min) &&
(ebone->length <= len_max))
{
@@ -4133,7 +4123,7 @@ static void select_similar_direction(bArmature *arm, EditBone *ebone_act, const
sub_v3_v3v3(dir_act, ebone_act->head, ebone_act->tail);
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
- if (EBONE_SELECTABLE(arm, ebone)) {
+ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
float dir[3];
sub_v3_v3v3(dir, ebone->head, ebone->tail);
@@ -4149,7 +4139,7 @@ static void select_similar_layer(bArmature *arm, EditBone *ebone_act)
EditBone *ebone;
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
- if (EBONE_SELECTABLE(arm, ebone)) {
+ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
if (ebone->layer & ebone_act->layer) {
ED_armature_edit_bone_select(ebone);
}
@@ -4171,7 +4161,7 @@ static void select_similar_prefix(bArmature *arm, EditBone *ebone_act)
/* Find matches */
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
- if (EBONE_SELECTABLE(arm, ebone)) {
+ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
char prefix_other[MAX_VGROUP_NAME];
BKE_deform_split_prefix(ebone->name, prefix_other, body_tmp);
if (!strcmp(prefix_act, prefix_other)) {
@@ -4195,7 +4185,7 @@ static void select_similar_suffix(bArmature *arm, EditBone *ebone_act)
/* Find matches */
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
- if (EBONE_SELECTABLE(arm, ebone)) {
+ if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE) == 0) {
char suffix_other[MAX_VGROUP_NAME];
BKE_deform_split_suffix(ebone->name, body_tmp, suffix_other);
if (!strcmp(suffix_act, suffix_other)) {
@@ -4280,7 +4270,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
for (curbone = arm->edbo->first; curbone; curbone = curbone->next) {
/* only work on bone if it is visible and its selection can change */
- if (EBONE_SELECTABLE(arm, curbone)) {
+ if (EBONE_VISIBLE(arm, curbone) && (curbone->flag & BONE_UNSELECTABLE) == 0) {
if (curbone == arm->act_edbone) {
if (direction == BONE_SELECT_PARENT) {
if (curbone->parent == NULL) continue;
@@ -4300,7 +4290,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
chbone = editbone_get_child(arm, curbone, 1);
if (chbone == NULL) continue;
- if (EBONE_SELECTABLE(arm, chbone)) {
+ if (EBONE_VISIBLE(arm, chbone) && (chbone->flag & BONE_UNSELECTABLE) == 0) {
chbone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
arm->act_edbone = chbone;
@@ -4486,8 +4476,7 @@ void ARMATURE_OT_align(wmOperatorType *ot)
/* ***************** Pose tools ********************* */
-/* XXX bone_looper is only to be used when we want to access settings
- * (i.e. editability/visibility/selected) that context doesn't offer */
+// XXX bone_looper is only to be used when we want to access settings (i.e. editability/visibility/selected) that context doesn't offer
static int bone_looper(Object *ob, Bone *bone, void *data,
int (*bone_func)(Object *, Bone *, void *))
{
@@ -4517,8 +4506,7 @@ static int bone_looper(Object *ob, Bone *bone, void *data,
/* called from editview.c, for mode-less pose selection */
/* assumes scene obact and basact is still on old situation */
-int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, short hits,
- short extend, short deselect, short toggle)
+int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, short hits, short extend, short deselect, short toggle)
{
Object *ob = base->object;
Bone *nearBone;
@@ -4764,9 +4752,7 @@ static void add_vgroups__mapFunc(void *userData, int index, const float co[3],
copy_v3_v3(verts[index], co);
}
-static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], int numbones, Bone **bonelist,
- bDeformGroup **dgrouplist, bDeformGroup **dgroupflip,
- float (*root)[3], float (*tip)[3], int *selected, float scale)
+static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], int numbones, Bone **bonelist, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected, float scale)
{
/* Create vertex group weights from envelopes */
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 68d8a8d721e..f3f985fa97d 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -41,8 +41,6 @@
#include "BLI_graph.h"
#include "BLI_ghash.h"
-#include "BLF_translation.h"
-
#include "BKE_context.h"
#include "BKE_sketch.h"
@@ -177,7 +175,7 @@ void BIF_makeListTemplates(const bContext *C)
const char *BIF_listTemplates(const bContext *UNUSED(C))
{
GHashIterator ghi;
- const char *menu_header = IFACE_("Template %t|None %x0|");
+ char menu_header[] = "Template%t|None%x0|";
char *p;
if (TEMPLATES_MENU != NULL) {
@@ -196,7 +194,7 @@ const char *BIF_listTemplates(const bContext *UNUSED(C))
Object *ob = BLI_ghashIterator_getValue(&ghi);
int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi));
- p += sprintf(p, "|%s %%x%i", ob->id.name + 2, key);
+ p += sprintf(p, "|%s%%x%i", ob->id.name + 2, key);
BLI_ghashIterator_step(&ghi);
}
@@ -646,17 +644,16 @@ static SK_Point *sk_snapPointStroke(bContext *C, SK_Stroke *stk, int mval[2], in
short pval[2];
int pdist;
- if (ED_view3d_project_short_global(ar, stk->points[i].p, pval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
+ ED_view3d_project_short_noclip(ar, stk->points[i].p, pval);
- pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]);
+ pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]);
- if (pdist < *dist) {
- *dist = pdist;
- pt = stk->points + i;
+ if (pdist < *dist) {
+ *dist = pdist;
+ pt = stk->points + i;
- if (index != NULL) {
- *index = i;
- }
+ if (index != NULL) {
+ *index = i;
}
}
}
@@ -682,24 +679,7 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
{
copy_v3_v3(vec, bone->head);
mul_m4_v3(ob->obmat, vec);
- if (ED_view3d_project_short_noclip(ar, vec, pval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
-
- pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]);
-
- if (pdist < *dist)
- {
- *dist = pdist;
- pt = &boneSnap;
- copy_v3_v3(pt->p, vec);
- pt->type = PT_EXACT;
- }
- }
- }
-
-
- copy_v3_v3(vec, bone->tail);
- mul_m4_v3(ob->obmat, vec);
- if (ED_view3d_project_short_noclip(ar, vec, pval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
+ ED_view3d_project_short_noclip(ar, vec, pval);
pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]);
@@ -711,6 +691,21 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
pt->type = PT_EXACT;
}
}
+
+
+ copy_v3_v3(vec, bone->tail);
+ mul_m4_v3(ob->obmat, vec);
+ ED_view3d_project_short_noclip(ar, vec, pval);
+
+ pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]);
+
+ if (pdist < *dist)
+ {
+ *dist = pdist;
+ pt = &boneSnap;
+ copy_v3_v3(pt->p, vec);
+ pt->type = PT_EXACT;
+ }
}
return pt;
@@ -910,9 +905,9 @@ static void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end,
for (i = start; i <= end; i++) {
float ray_start[3], ray_normal[3];
float delta = len_v3v3(stk->points[i].p, stk->points[i + 1].p);
- float pval[2] = {0, 0};
+ float pval[2];
- ED_view3d_project_float_global(ar, stk->points[i].p, pval, V3D_PROJ_TEST_NOP);
+ ED_view3d_project_float(ar, stk->points[i].p, pval);
ED_view3d_win_to_ray(ar, v3d, pval, ray_start, ray_normal);
mul_v3_fl(ray_normal, distance * progress / length);
@@ -939,14 +934,10 @@ static void sk_projectDrawPoint(bContext *C, float vec[3], SK_Stroke *stk, SK_Dr
initgrabz(ar->regiondata, fp[0], fp[1], fp[2]);
/* method taken from editview.c - mouse_cursor() */
- if (ED_view3d_project_short_global(ar, fp, cval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- VECSUB2D(mval_f, cval, dd->mval);
- ED_view3d_win_to_delta(ar, mval_f, dvec);
- sub_v3_v3v3(vec, fp, dvec);
- }
- else {
- zero_v3(vec);
- }
+ ED_view3d_project_short_noclip(ar, fp, cval);
+ VECSUB2D(mval_f, cval, dd->mval);
+ ED_view3d_win_to_delta(ar, mval_f, dvec);
+ sub_v3_v3v3(vec, fp, dvec);
}
static int sk_getStrokeDrawPoint(bContext *C, SK_Point *pt, SK_Sketch *UNUSED(sketch), SK_Stroke *stk, SK_DrawData *dd)
@@ -1462,8 +1453,8 @@ static int sk_getSelfIntersections(bContext *C, ListBase *list, SK_Stroke *gestu
float s_p2[3] = {0, 0, 0};
int g_i;
- ED_view3d_project_float_global(ar, gesture->points[s_i].p, s_p1, V3D_PROJ_TEST_NOP);
- ED_view3d_project_float_global(ar, gesture->points[s_i + 1].p, s_p2, V3D_PROJ_TEST_NOP);
+ ED_view3d_project_float(ar, gesture->points[s_i].p, s_p1);
+ ED_view3d_project_float(ar, gesture->points[s_i + 1].p, s_p2);
/* start checking from second next, because two consecutive cannot intersect */
for (g_i = s_i + 2; g_i < gesture->nb_points - 1; g_i++) {
@@ -1472,8 +1463,8 @@ static int sk_getSelfIntersections(bContext *C, ListBase *list, SK_Stroke *gestu
float vi[3];
float lambda;
- ED_view3d_project_float_global(ar, gesture->points[g_i].p, g_p1, V3D_PROJ_TEST_NOP);
- ED_view3d_project_float_global(ar, gesture->points[g_i + 1].p, g_p2, V3D_PROJ_TEST_NOP);
+ ED_view3d_project_float(ar, gesture->points[g_i].p, g_p1);
+ ED_view3d_project_float(ar, gesture->points[g_i + 1].p, g_p2);
if (isect_line_line_strict_v3(s_p1, s_p2, g_p1, g_p2, vi, &lambda)) {
SK_Intersection *isect = MEM_callocN(sizeof(SK_Intersection), "Intersection");
@@ -1540,8 +1531,8 @@ static int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, S
float s_p2[3] = {0, 0, 0};
int g_i;
- ED_view3d_project_float_global(ar, stk->points[s_i].p, s_p1, V3D_PROJ_TEST_NOP);
- ED_view3d_project_float_global(ar, stk->points[s_i + 1].p, s_p2, V3D_PROJ_TEST_NOP);
+ ED_view3d_project_float(ar, stk->points[s_i].p, s_p1);
+ ED_view3d_project_float(ar, stk->points[s_i + 1].p, s_p2);
for (g_i = 0; g_i < gesture->nb_points - 1; g_i++) {
float g_p1[3] = {0, 0, 0};
@@ -1549,8 +1540,8 @@ static int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, S
float vi[3];
float lambda;
- ED_view3d_project_float_global(ar, gesture->points[g_i].p, g_p1, V3D_PROJ_TEST_NOP);
- ED_view3d_project_float_global(ar, gesture->points[g_i + 1].p, g_p2, V3D_PROJ_TEST_NOP);
+ ED_view3d_project_float(ar, gesture->points[g_i].p, g_p1);
+ ED_view3d_project_float(ar, gesture->points[g_i + 1].p, g_p2);
if (isect_line_line_strict_v3(s_p1, s_p2, g_p1, g_p2, vi, &lambda)) {
SK_Intersection *isect = MEM_callocN(sizeof(SK_Intersection), "Intersection");
@@ -1726,8 +1717,8 @@ void sk_applyCommandGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UN
SK_Intersection *isect;
int command = 1;
-/* XXX */
-/* command = pupmenu("Action %t|Flatten %x1|Straighten %x2|Polygonize %x3"); */
+// XXX
+// command = pupmenu("Action %t|Flatten %x1|Straighten %x2|Polygonize %x3");
if (command < 1) return;
for (isect = gest->intersections.first; isect; isect = isect->next) {
@@ -1793,35 +1784,33 @@ int sk_detectMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *UNUSED(sketc
short start_val[2], end_val[2];
short dist;
- if ((ED_view3d_project_short_global(ar, gest->stk->points[0].p, start_val, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) &&
- (ED_view3d_project_short_global(ar, sk_lastStrokePoint(gest->stk)->p, end_val, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK))
- {
+ ED_view3d_project_short_noclip(ar, gest->stk->points[0].p, start_val);
+ ED_view3d_project_short_noclip(ar, sk_lastStrokePoint(gest->stk)->p, end_val);
- dist = MAX2(ABS(start_val[0] - end_val[0]), ABS(start_val[1] - end_val[1]));
+ dist = MAX2(ABS(start_val[0] - end_val[0]), ABS(start_val[1] - end_val[1]));
- /* if gesture is a circle */
- if (dist <= 20) {
- SK_Intersection *isect;
+ /* if gesture is a circle */
+ if (dist <= 20) {
+ SK_Intersection *isect;
- /* check if it circled around an exact point */
- for (isect = gest->intersections.first; isect; isect = isect->next) {
- /* only delete strokes that are crossed twice */
- if (isect->next && isect->next->stroke == isect->stroke) {
- int start_index, end_index;
- int i;
+ /* check if it circled around an exact point */
+ for (isect = gest->intersections.first; isect; isect = isect->next) {
+ /* only delete strokes that are crossed twice */
+ if (isect->next && isect->next->stroke == isect->stroke) {
+ int start_index, end_index;
+ int i;
- start_index = MIN2(isect->after, isect->next->after);
- end_index = MAX2(isect->before, isect->next->before);
+ start_index = MIN2(isect->after, isect->next->after);
+ end_index = MAX2(isect->before, isect->next->before);
- for (i = start_index; i <= end_index; i++) {
- if (isect->stroke->points[i].type == PT_EXACT) {
- return 1; /* at least one exact point found, stop detect here */
- }
+ for (i = start_index; i <= end_index; i++) {
+ if (isect->stroke->points[i].type == PT_EXACT) {
+ return 1; /* at least one exact point found, stop detect here */
}
-
- /* skip next */
- isect = isect->next;
}
+
+ /* skip next */
+ isect = isect->next;
}
}
}
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index e7efd7936c0..346ed0002bd 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -1113,9 +1113,6 @@ typedef struct MeshDeformBind {
/* direct solver */
int *varidx;
-
- BVHTree *bvhtree;
- BVHTreeFromMesh bvhdata;
} MeshDeformBind;
typedef struct MeshDeformIsect {
@@ -1133,9 +1130,8 @@ typedef struct MeshDeformIsect {
/* our own triangle intersection, so we can fully control the epsilons and
* prevent corner case from going wrong*/
-static int meshdeform_tri_intersect(const float orig[3], const float end[3], const float vert0[3],
- const float vert1[3], const float vert2[3],
- float r_isectco[3], float r_uvw[3])
+static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
+ float vert1[3], float vert2[3], float *isectco, float *uvw)
{
float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3];
float det, inv_det, u, v, dir[3], isectdir[3];
@@ -1152,10 +1148,8 @@ static int meshdeform_tri_intersect(const float orig[3], const float end[3], con
/* if determinant is near zero, ray lies in plane of triangle */
det = dot_v3v3(edge1, pvec);
- if (UNLIKELY(det == 0.0f)) {
+ if (det == 0.0f)
return 0;
- }
-
inv_det = 1.0f / det;
/* calculate distance from vert0 to ray origin */
@@ -1174,16 +1168,16 @@ static int meshdeform_tri_intersect(const float orig[3], const float end[3], con
if (v < -EPSILON || u + v > 1.0f + EPSILON)
return 0;
- r_isectco[0] = (1.0f - u - v) * vert0[0] + u * vert1[0] + v * vert2[0];
- r_isectco[1] = (1.0f - u - v) * vert0[1] + u * vert1[1] + v * vert2[1];
- r_isectco[2] = (1.0f - u - v) * vert0[2] + u * vert1[2] + v * vert2[2];
+ isectco[0] = (1.0f - u - v) * vert0[0] + u * vert1[0] + v * vert2[0];
+ isectco[1] = (1.0f - u - v) * vert0[1] + u * vert1[1] + v * vert2[1];
+ isectco[2] = (1.0f - u - v) * vert0[2] + u * vert1[2] + v * vert2[2];
- r_uvw[0] = 1.0f - u - v;
- r_uvw[1] = u;
- r_uvw[2] = v;
+ uvw[0] = 1.0f - u - v;
+ uvw[1] = u;
+ uvw[2] = v;
/* check if it is within the length of the line segment */
- sub_v3_v3v3(isectdir, r_isectco, orig);
+ sub_v3_v3v3(isectdir, isectco, orig);
if (dot_v3v3(dir, isectdir) < -EPSILON)
return 0;
@@ -1194,79 +1188,83 @@ static int meshdeform_tri_intersect(const float orig[3], const float end[3], con
return 1;
}
-static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
- {
- void **data = userdata;
- MeshDeformBind *mdb = data[1];
- MFace *mface = data[0], *mf;
- MeshDeformIsect *isec = data[2];
- float no[3], co[3], end[3], uvw[3], dist, face[4][3];
-
- mf = mface + index;
-
- copy_v3_v3(face[0], mdb->cagecos[mf->v1]);
- copy_v3_v3(face[1], mdb->cagecos[mf->v2]);
- copy_v3_v3(face[2], mdb->cagecos[mf->v3]);
- if (mf->v4)
- copy_v3_v3(face[3], mdb->cagecos[mf->v4]);
-
- add_v3_v3v3(end, isec->start, isec->vec);
-
- if (!meshdeform_tri_intersect(ray->origin, end, face[0], face[1], face[2], co, uvw))
- if (!mf->v4 || !meshdeform_tri_intersect(ray->origin, end, face[0], face[2], face[3], co, uvw))
- return;
-
- if (!mf->v4)
- normal_tri_v3(no, face[0], face[1], face[2]);
- else
- normal_quad_v3(no, face[0], face[1], face[2], face[3]);
-
- dist = len_v3v3(ray->origin, co)/len_v3(isec->vec);
- if (dist < hit->dist) {
- hit->index = index;
- hit->dist = dist;
- copy_v3_v3(hit->co, co);
-
- isec->isect = dot_v3v3(no, ray->direction) <= 0.0;
- isec->labda = dist;
- isec->face = mf;
+static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec)
+{
+ MFace *mface;
+ float face[4][3], co[3], uvw[3], len, nor[3], end[3];
+ int f, hit, is = 0, totface;
+
+ isec->labda = 1e10;
+
+ mface = mdb->cagedm->getTessFaceArray(mdb->cagedm);
+ totface = mdb->cagedm->getNumTessFaces(mdb->cagedm);
+
+ add_v3_v3v3(end, isec->start, isec->vec);
+
+ for (f = 0; f < totface; f++, mface++) {
+ copy_v3_v3(face[0], mdb->cagecos[mface->v1]);
+ copy_v3_v3(face[1], mdb->cagecos[mface->v2]);
+ copy_v3_v3(face[2], mdb->cagecos[mface->v3]);
+
+ if (mface->v4) {
+ copy_v3_v3(face[3], mdb->cagecos[mface->v4]);
+ hit = meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw);
+
+ if (hit) {
+ normal_tri_v3(nor, face[0], face[1], face[2]);
+ }
+ else {
+ hit = meshdeform_tri_intersect(isec->start, end, face[0], face[2], face[3], co, uvw);
+ normal_tri_v3(nor, face[0], face[2], face[3]);
+ }
+ }
+ else {
+ hit = meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw);
+ normal_tri_v3(nor, face[0], face[1], face[2]);
+ }
+
+ if (hit) {
+ len = len_v3v3(isec->start, co) / len_v3v3(isec->start, end);
+ if (len < isec->labda) {
+ isec->labda = len;
+ isec->face = mface;
+ isec->isect = (dot_v3v3(isec->vec, nor) <= 0.0f);
+ is = 1;
+ }
+ }
}
+
+ return is;
}
static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float *co1, float *co2)
{
MDefBoundIsect *isect;
- BVHTreeRayHit hit;
- MeshDeformIsect isect_mdef;
+ MeshDeformIsect isec;
float (*cagecos)[3];
- void *data[3] = {mdb->cagedm->getTessFaceArray(mdb->cagedm), mdb, &isect_mdef};
- MFace *mface1 = data[0], *mface;
+ MFace *mface;
float vert[4][3], len, end[3];
static float epsilon[3] = {0, 0, 0}; //1e-4, 1e-4, 1e-4};
/* setup isec */
- memset(&isect_mdef, 0, sizeof(isect_mdef));
- isect_mdef.labda = 1e10f;
+ memset(&isec, 0, sizeof(isec));
+ isec.labda = 1e10f;
- add_v3_v3v3(isect_mdef.start, co1, epsilon);
+ add_v3_v3v3(isec.start, co1, epsilon);
add_v3_v3v3(end, co2, epsilon);
- sub_v3_v3v3(isect_mdef.vec, end, isect_mdef.start);
+ sub_v3_v3v3(isec.vec, end, isec.start);
- hit.index = -1;
- hit.dist = FLT_MAX;
- if (BLI_bvhtree_ray_cast(mdb->bvhtree, isect_mdef.start, isect_mdef.vec,
- 0.0, &hit, harmonic_ray_callback, data) != -1)
- {
- len= isect_mdef.labda;
- isect_mdef.face = mface = mface1 + hit.index;
+ if (meshdeform_intersect(mdb, &isec)) {
+ len = isec.labda;
+ mface = (MFace *)isec.face;
/* create MDefBoundIsect */
isect = BLI_memarena_alloc(mdb->memarena, sizeof(*isect));
/* compute intersection coordinate */
- isect->co[0] = co1[0] + isect_mdef.vec[0] * len;
- isect->co[1] = co1[1] + isect_mdef.vec[1] * len;
- isect->co[2] = co1[2] + isect_mdef.vec[2] * len;
+ isect->co[0] = co1[0] + isec.vec[0] * len;
+ isect->co[1] = co1[1] + isec.vec[1] * len;
+ isect->co[2] = co1[2] + isec.vec[2] * len;
isect->len = len_v3v3(co1, isect->co);
if (isect->len < MESHDEFORM_LEN_THRESHOLD)
@@ -1278,7 +1276,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
isect->v[3] = mface->v4;
isect->nvert = (mface->v4) ? 4 : 3;
- isect->facing = isect_mdef.isect;
+ isect->facing = isec.isect;
/* compute mean value coordinates for interpolation */
cagecos = mdb->cagecos;
@@ -1768,7 +1766,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
mdb->totalphi = MEM_callocN(sizeof(float) * mdb->size3, "MeshDeformBindTotalPhi");
mdb->boundisect = MEM_callocN(sizeof(*mdb->boundisect) * mdb->size3, "MDefBoundIsect");
mdb->semibound = MEM_callocN(sizeof(int) * mdb->size3, "MDefSemiBound");
- mdb->bvhtree = bvhtree_from_mesh_faces(&mdb->bvhdata, mdb->cagedm, FLT_EPSILON*100, 4, 6);
+
mdb->inside = MEM_callocN(sizeof(int) * mdb->totvert, "MDefInside");
if (mmd->flag & MOD_MDEF_DYNAMIC_BIND)
@@ -1884,7 +1882,6 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
MEM_freeN(mdb->boundisect);
MEM_freeN(mdb->semibound);
BLI_memarena_free(mdb->memarena);
- free_bvhtree_from_mesh(&mdb->bvhdata);
}
#if 0
diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c
index 31398948b82..cdcb3ab4683 100644
--- a/source/blender/editors/armature/poseSlide.c
+++ b/source/blender/editors/armature/poseSlide.c
@@ -631,7 +631,6 @@ static int pose_slide_modal(bContext *C, wmOperator *op, wmEvent *evt)
switch (evt->type) {
case LEFTMOUSE: /* confirm */
- case RETKEY:
{
/* return to normal cursor and header status */
ED_area_headerprint(pso->sa, NULL);
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 189b2e977c2..44112006ad9 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -719,7 +719,9 @@ static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
if (pchan) {
/* select if bone is visible and can be affected */
- if (PBONE_SELECTABLE(arm, pchan->bone)) {
+ if ((PBONE_VISIBLE(arm, pchan->bone)) &&
+ (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
+ {
pchan->bone->flag |= BONE_SELECTED;
changed = 1;
}
@@ -886,16 +888,16 @@ static void pose_copy_menu(Scene *scene)
if (pose_has_protected_selected(ob, 0)) {
i = BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
if (i < 25)
- nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|Constraints... %x5");
+ nr = pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5");
else
- nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4");
+ nr = pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4");
}
else {
i = BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
if (i < 25)
- nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|Constraints... %x5|%l|Transform Locks %x6|IK Limits %x7|Bone Shape %x8");
+ nr = pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
else
- nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|%l|Transform Locks %x6|IK Limits %x7|Bone Shape %x8");
+ nr = pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
}
if (nr <= 0)
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index d22b9f2abfb..9c13f4be6a9 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1579,9 +1579,8 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
BPoint *bp, *bpn, *newbp;
int a, b, newu, newv, sel;
- if (obedit->type != OB_SURF) {
- return OPERATOR_CANCELLED;
- }
+ if (obedit->type == OB_SURF) ;
+ else return OPERATOR_CANCELLED;
cu->lastsel = NULL;
@@ -1594,12 +1593,8 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
a = nu->pntsu * nu->pntsv;
while (a) {
a--;
- if (bp->f1 & flag) {
- /* pass */
- }
- else {
- break;
- }
+ if (bp->f1 & flag) ;
+ else break;
bp++;
}
if (a == 0) {
@@ -1720,12 +1715,8 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
bp = nu->bp;
a = nu->pntsu;
while (a) {
- if (bp->f1 & flag) {
- /* pass */
- }
- else {
- break;
- }
+ if (bp->f1 & flag) ;
+ else break;
bp++;
a--;
}
@@ -3771,28 +3762,20 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
/* first nurbs: u = resolu-1 selected */
- if (is_u_selected(nu1, nu1->pntsu - 1) ) {
- /* pass */
- }
+ if (is_u_selected(nu1, nu1->pntsu - 1) ) ;
else {
/* For 2D curves blender uses (orderv = 0). It doesn't make any sense mathematically. */
/* but after rotating (orderu = 0) will be confusing. */
if (nu1->orderv == 0) nu1->orderv = 1;
rotate_direction_nurb(nu1);
- if (is_u_selected(nu1, nu1->pntsu - 1)) {
- /* pass */
- }
+ if (is_u_selected(nu1, nu1->pntsu - 1)) ;
else {
rotate_direction_nurb(nu1);
- if (is_u_selected(nu1, nu1->pntsu - 1)) {
- /* pass */
- }
+ if (is_u_selected(nu1, nu1->pntsu - 1)) ;
else {
rotate_direction_nurb(nu1);
- if (is_u_selected(nu1, nu1->pntsu - 1)) {
- /* pass */
- }
+ if (is_u_selected(nu1, nu1->pntsu - 1)) ;
else {
/* rotate again, now its OK! */
if (nu1->pntsv != 1) rotate_direction_nurb(nu1);
@@ -3803,25 +3786,17 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
}
/* 2nd nurbs: u = 0 selected */
- if (is_u_selected(nu2, 0) ) {
- /* pass */
- }
+ if (is_u_selected(nu2, 0) ) ;
else {
if (nu2->orderv == 0) nu2->orderv = 1;
rotate_direction_nurb(nu2);
- if (is_u_selected(nu2, 0)) {
- /* pass */
- }
+ if (is_u_selected(nu2, 0)) ;
else {
rotate_direction_nurb(nu2);
- if (is_u_selected(nu2, 0)) {
- /* pass */
- }
+ if (is_u_selected(nu2, 0)) ;
else {
rotate_direction_nurb(nu2);
- if (is_u_selected(nu2, 0)) {
- /* pass */
- }
+ if (is_u_selected(nu2, 0)) ;
else {
/* rotate again, now its OK! */
if (nu1->pntsu == 1) rotate_direction_nurb(nu1);
@@ -3917,27 +3892,15 @@ static int merge_nurb(bContext *C, wmOperator *op)
/* resolution match, to avoid uv rotations */
if (nus1->nu->pntsv == 1) {
- if (nus1->nu->pntsu == nus2->nu->pntsu || nus1->nu->pntsu == nus2->nu->pntsv) {
- /* pass */
- }
- else {
- ok = 0;
- }
+ if (nus1->nu->pntsu == nus2->nu->pntsu || nus1->nu->pntsu == nus2->nu->pntsv) ;
+ else ok = 0;
}
else if (nus2->nu->pntsv == 1) {
- if (nus2->nu->pntsu == nus1->nu->pntsu || nus2->nu->pntsu == nus1->nu->pntsv) {
- /* pass */
- }
- else {
- ok = 0;
- }
- }
- else if (nus1->nu->pntsu == nus2->nu->pntsu || nus1->nu->pntsv == nus2->nu->pntsv) {
- /* pass */
- }
- else if (nus1->nu->pntsu == nus2->nu->pntsv || nus1->nu->pntsv == nus2->nu->pntsu) {
- /* pass */
+ if (nus2->nu->pntsu == nus1->nu->pntsu || nus2->nu->pntsu == nus1->nu->pntsv) ;
+ else ok = 0;
}
+ else if (nus1->nu->pntsu == nus2->nu->pntsu || nus1->nu->pntsv == nus2->nu->pntsv) ;
+ else if (nus1->nu->pntsu == nus2->nu->pntsv || nus1->nu->pntsv == nus2->nu->pntsu) ;
else {
ok = 0;
}
@@ -3986,12 +3949,8 @@ static int make_segment_exec(bContext *C, wmOperator *op)
if (isNurbsel_count(cu, nu) == 1) {
/* only 1 selected, not first or last, a little complex, but intuitive */
if (nu->pntsv == 1) {
- if ( (nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) {
- /* pass */
- }
- else {
- break;
- }
+ if ( (nu->bp->f1 & SELECT) || (nu->bp[nu->pntsu - 1].f1 & SELECT)) ;
+ else break;
}
}
}
@@ -5725,12 +5684,8 @@ static int delete_exec(bContext *C, wmOperator *op)
a = nu->pntsu;
if (a) {
while (a) {
- if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) {
- /* pass */
- }
- else {
- break;
- }
+ if (BEZSELECTED_HIDDENHANDLES(cu, bezt) ) ;
+ else break;
a--;
bezt++;
}
@@ -5749,12 +5704,8 @@ static int delete_exec(bContext *C, wmOperator *op)
a = nu->pntsu * nu->pntsv;
if (a) {
while (a) {
- if (bp->f1 & SELECT) {
- /* pass */
- }
- else {
- break;
- }
+ if (bp->f1 & SELECT) ;
+ else break;
a--;
bp++;
}
@@ -6616,18 +6567,18 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
if (!isSurf) { /* adding curve */
if (obedit == NULL || obedit->type != OB_CURVE) {
Curve *cu;
-
+
obedit = ED_object_add_type(C, OB_CURVE, loc, rot, TRUE, layer);
newob = 1;
cu = (Curve *)obedit->data;
cu->flag |= CU_DEFORM_FILL;
-
+
if (type & CU_PRIM_PATH)
cu->flag |= CU_PATH | CU_3D;
- }
+ }
else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
- }
+ }
else { /* adding surface */
if (obedit == NULL || obedit->type != OB_SURF) {
obedit = ED_object_add_type(C, OB_SURF, loc, rot, TRUE, layer);
@@ -6638,6 +6589,7 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
/* rename here, the undo stack checks name for valid undo pushes */
if (newob) {
+
if (obedit->type == OB_CURVE) {
rename_id((ID *)obedit, get_curve_defname(type));
rename_id((ID *)obedit->data, get_curve_defname(type));
@@ -6647,11 +6599,11 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
rename_id((ID *)obedit->data, get_surf_defname(type));
}
}
-
+
/* ED_object_add_type doesnt do an undo, is needed for redo operator on primitive */
if (newob && enter_editmode)
ED_undo_push(C, "Enter Editmode");
-
+
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
nu = add_nurbs_primitive(C, obedit, mat, type, newob);
@@ -6691,11 +6643,12 @@ void CURVE_OT_primitive_bezier_curve_add(wmOperatorType *ot)
ot->name = "Add Bezier";
ot->description = "Construct a Bezier Curve";
ot->idname = "CURVE_OT_primitive_bezier_curve_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_bezier_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6713,11 +6666,12 @@ void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot)
ot->name = "Add Bezier Circle";
ot->description = "Construct a Bezier Circle";
ot->idname = "CURVE_OT_primitive_bezier_circle_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_bezier_circle_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6735,11 +6689,12 @@ void CURVE_OT_primitive_nurbs_curve_add(wmOperatorType *ot)
ot->name = "Add Nurbs Curve";
ot->description = "Construct a Nurbs Curve";
ot->idname = "CURVE_OT_primitive_nurbs_curve_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_curve_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6757,11 +6712,12 @@ void CURVE_OT_primitive_nurbs_circle_add(wmOperatorType *ot)
ot->name = "Add Nurbs Circle";
ot->description = "Construct a Nurbs Circle";
ot->idname = "CURVE_OT_primitive_nurbs_circle_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_circle_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6779,11 +6735,12 @@ void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot)
ot->name = "Add Path";
ot->description = "Construct a Path";
ot->idname = "CURVE_OT_primitive_nurbs_path_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_curve_path_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6802,11 +6759,12 @@ void SURFACE_OT_primitive_nurbs_surface_curve_add(wmOperatorType *ot)
ot->name = "Add Surface Curve";
ot->description = "Construct a Nurbs surface Curve";
ot->idname = "SURFACE_OT_primitive_nurbs_surface_curve_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_surface_curve_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6824,11 +6782,12 @@ void SURFACE_OT_primitive_nurbs_surface_circle_add(wmOperatorType *ot)
ot->name = "Add Surface Circle";
ot->description = "Construct a Nurbs surface Circle";
ot->idname = "SURFACE_OT_primitive_nurbs_surface_circle_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_surface_circle_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6846,11 +6805,12 @@ void SURFACE_OT_primitive_nurbs_surface_surface_add(wmOperatorType *ot)
ot->name = "Add Surface Patch";
ot->description = "Construct a Nurbs surface Patch";
ot->idname = "SURFACE_OT_primitive_nurbs_surface_surface_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_surface_surface_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6868,11 +6828,12 @@ void SURFACE_OT_primitive_nurbs_surface_cylinder_add(wmOperatorType *ot)
ot->name = "Add Surface Cylinder";
ot->description = "Construct a Nurbs surface Cylinder";
ot->idname = "SURFACE_OT_primitive_nurbs_surface_cylinder_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_surface_cylinder_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6890,11 +6851,12 @@ void SURFACE_OT_primitive_nurbs_surface_sphere_add(wmOperatorType *ot)
ot->name = "Add Surface Sphere";
ot->description = "Construct a Nurbs surface Sphere";
ot->idname = "SURFACE_OT_primitive_nurbs_surface_sphere_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_surface_sphere_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -6912,11 +6874,12 @@ void SURFACE_OT_primitive_nurbs_surface_torus_add(wmOperatorType *ot)
ot->name = "Add Surface Torus";
ot->description = "Construct a Nurbs surface Torus";
ot->idname = "SURFACE_OT_primitive_nurbs_surface_torus_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_nurbs_surface_torus_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index b379ce6e5cf..b11d640256c 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -441,9 +441,8 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, float
obedit = BKE_object_add(scene, OB_FONT);
base = scene->basact;
- /* seems to assume view align ? TODO - look into this, could be an operator option */
- ED_object_base_init_transform(C, base, NULL, rot);
-
+
+ ED_object_base_init_transform(C, base, NULL, rot); /* seems to assume view align ? TODO - look into this, could be an operator option */
BKE_object_where_is_calc(scene, obedit);
obedit->loc[0] += offset[0];
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 3b26c46a410..5ff4ccbd126 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -149,8 +149,7 @@ static void gp_draw_stroke_buffer(tGPspoint *points, int totpoints, short thickn
/* ----- Existing Strokes Drawing (3D and Point) ------ */
/* draw a given stroke - just a single dot (only one point) */
-static void gp_draw_stroke_point(bGPDspoint *points, short thickness, short dflag, short sflag,
- int offsx, int offsy, int winx, int winy)
+static void gp_draw_stroke_point(bGPDspoint *points, short thickness, short dflag, short sflag, int offsx, int offsy, int winx, int winy)
{
/* draw point */
if (sflag & GP_STROKE_3DSPACE) {
@@ -509,8 +508,7 @@ static void gp_draw_strokes(bGPDframe *gpf, int offsx, int offsy, int winx, int
glDepthMask(0);
glEnable(GL_DEPTH_TEST);
- /* first arg is normally rv3d->dist, but this isn't
- * available here and seems to work quite well without */
+ /* first arg is normally rv3d->dist, but this isn't available here and seems to work quite well without */
bglPolygonOffset(1.0f, 1.0f);
#if 0
glEnable(GL_POLYGON_OFFSET_LINE);
@@ -581,8 +579,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
/* draw 'onionskins' (frame left + right) */
if (gpl->flag & GP_LAYER_ONIONSKIN) {
- /* drawing method - only immediately surrounding (gstep = 0),
- * or within a frame range on either side (gstep > 0)*/
+ /* drawing method - only immediately surrounding (gstep = 0), or within a frame range on either side (gstep > 0)*/
if (gpl->gstep) {
bGPDframe *gf;
float fac;
@@ -643,8 +640,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
if (ED_gpencil_session_active() && (gpl->flag & GP_LAYER_ACTIVE) &&
(gpf->flag & GP_FRAME_PAINT))
{
- /* Buffer stroke needs to be drawn with a different linestyle
- * to help differentiate them from normal strokes. */
+ /* Buffer stroke needs to be drawn with a different linestyle to help differentiate them from normal strokes. */
gp_draw_stroke_buffer(gpd->sbuffer, gpd->sbuffer_size, lthick, dflag, gpd->sbuffer_sflag);
}
}
@@ -728,8 +724,8 @@ void draw_gpencil_2dimage(const bContext *C)
}
/* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly
- * Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes,
- * second time with onlyv2d=0 for screen-aligned strokes */
+ * Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, second time with onlyv2d=0 for screen-aligned strokes
+ */
void draw_gpencil_view2d(const bContext *C, short onlyv2d)
{
ScrArea *sa = CTX_wm_area(C);
@@ -754,8 +750,9 @@ void draw_gpencil_view2d(const bContext *C, short onlyv2d)
}
/* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly
- * Note: this gets called twice - first time with only3d=1 to draw 3d-strokes,
- * second time with only3d=0 for screen-aligned strokes */
+ * Note: this gets called twice - first time with only3d=1 to draw 3d-strokes, second time with only3d=0 for screen-aligned strokes
+ */
+
void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, short only3d)
{
bGPdata *gpd;
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index 8a3c996a481..d90ec02b0c1 100644
--- a/source/blender/editors/gpencil/gpencil_buttons.c
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -75,15 +75,17 @@ static void gp_ui_activelayer_cb(bContext *C, void *gpd, void *gpl)
/* make sure the layer we want to remove is the active one */
gpencil_layer_setactive(gpd, gpl);
- WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); /* XXX please work! */
}
/* delete 'active' layer */
static void gp_ui_dellayer_cb(bContext *C, void *gpd, void *gpl)
{
- gpencil_layer_delete((bGPdata *)gpd, (bGPDlayer *)gpl);
+ /* make sure the layer we want to remove is the active one */
+ gpencil_layer_setactive(gpd, gpl);
+ gpencil_layer_delactive(gpd);
- WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); /* XXX please work! */
}
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 46df8ba5fac..659e99607f0 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -224,7 +224,7 @@ static int gp_data_add_exec(bContext *C, wmOperator *op)
}
/* notifiers */
- WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); // XXX need a nicer one that will work
return OPERATOR_FINISHED;
}
@@ -272,7 +272,7 @@ static int gp_data_unlink_exec(bContext *C, wmOperator *op)
}
/* notifiers */
- WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); // XXX need a nicer one that will work
return OPERATOR_FINISHED;
}
@@ -306,10 +306,10 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op)
*gpd_ptr = gpencil_data_addnew("GPencil");
/* add new layer now */
- gpencil_layer_addnew(*gpd_ptr, "GP_Layer", 1);
+ gpencil_layer_addnew(*gpd_ptr);
/* notifiers */
- WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); // XXX please work!
return OPERATOR_FINISHED;
}
@@ -360,7 +360,7 @@ static int gp_actframe_delete_exec(bContext *C, wmOperator *op)
gpencil_layer_delframe(gpl, gpf);
/* notifiers */
- WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); // XXX please work!
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index c07f0db7114..5909c4fc270 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -278,15 +278,11 @@ static void gp_stroke_convertcoords(tGPsdata *p, const int mval[2], float out[3]
gp_get_3d_reference(p, rvec);
/* method taken from editview.c - mouse_cursor() */
- /* TODO, use ED_view3d_project_float_global */
- if (ED_view3d_project_int_global(p->ar, rvec, mval_prj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- VECSUB2D(mval_f, mval_prj, mval);
- ED_view3d_win_to_delta(p->ar, mval_f, dvec);
- sub_v3_v3v3(out, rvec, dvec);
- }
- else {
- zero_v3(out);
- }
+ ED_view3d_project_int_noclip(p->ar, rvec, mval_prj);
+
+ VECSUB2D(mval_f, mval_prj, mval);
+ ED_view3d_win_to_delta(p->ar, mval_f, dvec);
+ sub_v3_v3v3(out, rvec, dvec);
}
}
@@ -395,10 +391,8 @@ static short gp_stroke_addpoint(tGPsdata *p, const int mval[2], float pressure)
pts = &gps->points[gps->totpoints - 1];
- /* special case for poly lines: normally,
- * depth is needed only when creating new stroke from buffer,
- * but poly lines are converting to stroke instantly,
- * so initialize depth buffer before converting coordinates
+ /* special case for poly lines: normally, depth is needed only when creating new stroke from buffer,
+ * but poly lines are converting to stroke instantly, so initialize depth buffer before converting coordinates
*/
if (gpencil_project_check(p)) {
View3D *v3d = p->sa->spacedata.first;
@@ -794,37 +788,6 @@ static short gp_stroke_eraser_strokeinside(const int mval[], const int UNUSED(mv
return 0;
}
-static void gp_point_to_xy(ARegion *ar, View2D *v2d, rctf *subrect, bGPDstroke *gps, bGPDspoint *pt,
- int *r_x, int *r_y)
-{
- int xyval[2];
-
- if (gps->flag & GP_STROKE_3DSPACE) {
- if (ED_view3d_project_int_global(ar, &pt->x, xyval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- *r_x = xyval[0];
- *r_y = xyval[1];
- }
- else {
- *r_x = V2D_IS_CLIPPED;
- *r_y = V2D_IS_CLIPPED;
- }
- }
- else if (gps->flag & GP_STROKE_2DSPACE) {
- UI_view2d_view_to_region(v2d, pt->x, pt->y, r_x, r_y);
- }
- else {
- if (subrect == NULL) { /* normal 3D view */
- *r_x = (int)(pt->x / 100 * ar->winx);
- *r_y = (int)(pt->y / 100 * ar->winy);
- }
- else { /* camera view, use subrect */
- *r_x = (int)((pt->x / 100) * BLI_rctf_size_x(subrect)) + subrect->xmin;
- *r_y = (int)((pt->y / 100) * BLI_rctf_size_y(subrect)) + subrect->ymin;
- }
- }
-}
-
-
/* eraser tool - evaluation per stroke */
// TODO: this could really do with some optimization (KD-Tree/BVH?)
static void gp_stroke_eraser_dostroke(tGPsdata *p,
@@ -833,6 +796,7 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p,
{
bGPDspoint *pt1, *pt2;
int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
+ int xyval[2];
int i;
if (gps->totpoints == 0) {
@@ -842,11 +806,28 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p,
BLI_freelinkN(&gpf->strokes, gps);
}
else if (gps->totpoints == 1) {
- gp_point_to_xy(p->ar, p->v2d, p->subrect, gps, gps->points, &x0, &y0);
+ /* get coordinates */
+ if (gps->flag & GP_STROKE_3DSPACE) {
+ ED_view3d_project_int(p->ar, &gps->points->x, xyval);
+ x0 = xyval[0];
+ y0 = xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DSPACE) {
+ UI_view2d_view_to_region(p->v2d, gps->points->x, gps->points->y, &x0, &y0);
+ }
+ else {
+ if (p->subrect == NULL) { /* normal 3D view */
+ x0 = (int)(gps->points->x / 100 * p->ar->winx);
+ y0 = (int)(gps->points->y / 100 * p->ar->winy);
+ }
+ else { /* camera view, use subrect */
+ x0 = (int)((gps->points->x / 100) * BLI_rctf_size_x(p->subrect)) + p->subrect->xmin;
+ y0 = (int)((gps->points->y / 100) * BLI_rctf_size_y(p->subrect)) + p->subrect->ymin;
+ }
+ }
/* do boundbox check first */
-
- if ((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(rect, x0, y0)) {
+ if (BLI_rcti_isect_pt(rect, x0, y0)) {
/* only check if point is inside */
if (((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) {
/* free stroke */
@@ -863,13 +844,39 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p,
/* get points to work with */
pt1 = gps->points + i;
pt2 = gps->points + i + 1;
-
- gp_point_to_xy(p->ar, p->v2d, p->subrect, gps, pt1, &x0, &y0);
- gp_point_to_xy(p->ar, p->v2d, p->subrect, gps, pt2, &x1, &y1);
-
+
+ /* get coordinates */
+ if (gps->flag & GP_STROKE_3DSPACE) {
+ ED_view3d_project_int(p->ar, &pt1->x, xyval);
+ x0 = xyval[0];
+ y0 = xyval[1];
+
+ ED_view3d_project_int(p->ar, &pt2->x, xyval);
+ x1 = xyval[0];
+ y1 = xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DSPACE) {
+ UI_view2d_view_to_region(p->v2d, pt1->x, pt1->y, &x0, &y0);
+
+ UI_view2d_view_to_region(p->v2d, pt2->x, pt2->y, &x1, &y1);
+ }
+ else {
+ if (p->subrect == NULL) { /* normal 3D view */
+ x0 = (int)(pt1->x / 100 * p->ar->winx);
+ y0 = (int)(pt1->y / 100 * p->ar->winy);
+ x1 = (int)(pt2->x / 100 * p->ar->winx);
+ y1 = (int)(pt2->y / 100 * p->ar->winy);
+ }
+ else { /* camera view, use subrect */
+ x0 = (int)((pt1->x / 100) * BLI_rctf_size_x(p->subrect)) + p->subrect->xmin;
+ y0 = (int)((pt1->y / 100) * BLI_rctf_size_y(p->subrect)) + p->subrect->ymin;
+ x1 = (int)((pt2->x / 100) * BLI_rctf_size_x(p->subrect)) + p->subrect->xmin;
+ y1 = (int)((pt2->y / 100) * BLI_rctf_size_y(p->subrect)) + p->subrect->ymin;
+ }
+ }
+
/* check that point segment of the boundbox of the eraser stroke */
- if (((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(rect, x0, y0)) ||
- ((!ELEM(V2D_IS_CLIPPED, x1, y1)) && BLI_rcti_isect_pt(rect, x1, y1))) {
+ if (BLI_rcti_isect_pt(rect, x0, y0) || BLI_rcti_isect_pt(rect, x1, y1)) {
/* check if point segment of stroke had anything to do with
* eraser region (either within stroke painted, or on its lines)
* - this assumes that linewidth is irrelevant
@@ -1118,7 +1125,7 @@ static void gp_paint_initstroke(tGPsdata *p, short paintmode)
/* get active layer (or add a new one if non-existent) */
p->gpl = gpencil_layer_getactive(p->gpd);
if (p->gpl == NULL) {
- p->gpl = gpencil_layer_addnew(p->gpd, "GP_Layer", 1);
+ p->gpl = gpencil_layer_addnew(p->gpd);
if (p->custom_color[3])
copy_v3_v3(p->gpl->color, p->custom_color);
@@ -1398,17 +1405,13 @@ static void gpencil_draw_status_indicators(tGPsdata *p)
/* print status info */
switch (p->paintmode) {
case GP_PAINTMODE_ERASER:
- ED_area_headerprint(p->sa,
- "Grease Pencil Erase Session: Hold and drag LMB or RMB to erase |"
- " ESC/Enter to end");
+ ED_area_headerprint(p->sa, "Grease Pencil Erase Session: Hold and drag LMB or RMB to erase | ESC/Enter to end");
break;
case GP_PAINTMODE_DRAW_STRAIGHT:
- ED_area_headerprint(p->sa, "Grease Pencil Line Session: Hold and drag LMB to draw | "
- "ESC/Enter to end");
+ ED_area_headerprint(p->sa, "Grease Pencil Line Session: Hold and drag LMB to draw | ESC/Enter to end");
break;
case GP_PAINTMODE_DRAW:
- ED_area_headerprint(p->sa, "Grease Pencil Freehand Session: Hold and drag LMB to draw | "
- "ESC/Enter to end");
+ ED_area_headerprint(p->sa, "Grease Pencil Freehand Session: Hold and drag LMB to draw | ESC/Enter to end");
break;
default: /* unhandled future cases */
@@ -1595,7 +1598,7 @@ static int gpencil_draw_exec(bContext *C, wmOperator *op)
gpencil_draw_exit(C, op);
/* refreshes */
- WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); // XXX need a nicer one that will work
/* done */
return OPERATOR_FINISHED;
@@ -1656,7 +1659,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, wmEvent *event)
//printf("\tGP - hotkey invoked... waiting for click-drag\n");
}
- WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL, NULL);
/* add a modal handler for this operator, so that we can then draw continuous strokes */
WM_event_add_modal_handler(C, op);
return OPERATOR_RUNNING_MODAL;
@@ -1684,8 +1687,7 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
//printf("\t\tGP - start stroke\n");
/* we may need to set up paint env again if we're resuming */
- /* XXX: watch it with the paintmode! in future,
- * it'd be nice to allow changing paint-mode when in sketching-sessions */
+ /* XXX: watch it with the paintmode! in future, it'd be nice to allow changing paint-mode when in sketching-sessions */
/* XXX: with tablet events, we may event want to check for eraser here, for nicer tablet support */
if (gp_session_initdata(C, p))
@@ -1770,7 +1772,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, wmEvent *event)
estate = OPERATOR_RUNNING_MODAL;
/* stroke could be smoothed, send notifier to refresh screen */
- WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL);
}
else {
//printf("\t\tGP - end of stroke + op\n");
@@ -1860,7 +1862,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, wmEvent *event)
case OPERATOR_FINISHED:
/* one last flush before we're done */
gpencil_draw_exit(C, op);
- WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL); // XXX need a nicer one that will work
break;
case OPERATOR_CANCELLED:
@@ -1869,10 +1871,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, wmEvent *event)
case OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH:
/* event doesn't need to be handled */
-#if 0
- printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n",
- event->type, event->type == MIDDLEMOUSE, event->type==MOUSEMOVE);
-#endif
+ //printf("unhandled event -> %d (mmb? = %d | mmv? = %d)\n", event->type, event->type == MIDDLEMOUSE, event->type==MOUSEMOVE);
break;
}
diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index 3d2cd260fb9..fa9f5196866 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -111,7 +111,7 @@ int ED_undo_gpencil_step(bContext *C, int step, const char *name)
}
}
- WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_SCREEN | ND_GPENCIL | NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 8d7ae3aad6a..e1401a8ff88 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -232,28 +232,28 @@ typedef enum eAnimFilter_Flags {
/* Dopesheet only */
/* 'Scene' channels */
-#define SEL_SCEC(sce) (CHECK_TYPE_INLINE(sce, Scene), ((sce->flag & SCE_DS_SELECTED)))
-#define EXPANDED_SCEC(sce) (CHECK_TYPE_INLINE(sce, Scene), ((sce->flag & SCE_DS_COLLAPSED) == 0))
+#define SEL_SCEC(sce) ((sce->flag & SCE_DS_SELECTED))
+#define EXPANDED_SCEC(sce) ((sce->flag & SCE_DS_COLLAPSED) == 0)
/* 'Sub-Scene' channels (flags stored in Data block) */
-#define FILTER_WOR_SCED(wo) (CHECK_TYPE_INLINE(wo, World), (wo->flag & WO_DS_EXPAND))
+#define FILTER_WOR_SCED(wo) ((wo->flag & WO_DS_EXPAND))
/* 'Object' channels */
-#define SEL_OBJC(base) (CHECK_TYPE_INLINE(base, Base), ((base->flag & SELECT)))
-#define EXPANDED_OBJC(ob) (CHECK_TYPE_INLINE(ob, Object), ((ob->nlaflag & OB_ADS_COLLAPSED) == 0))
+#define SEL_OBJC(base) ((base->flag & SELECT))
+#define EXPANDED_OBJC(ob) ((ob->nlaflag & OB_ADS_COLLAPSED) == 0)
/* 'Sub-object' channels (flags stored in Data block) */
-#define FILTER_SKE_OBJD(key) (CHECK_TYPE_INLINE(key, Key), ((key->flag & KEY_DS_EXPAND)))
-#define FILTER_MAT_OBJD(ma) (CHECK_TYPE_INLINE(ma, Material), ((ma->flag & MA_DS_EXPAND)))
-#define FILTER_LAM_OBJD(la) (CHECK_TYPE_INLINE(la, Lamp), ((la->flag & LA_DS_EXPAND)))
-#define FILTER_CAM_OBJD(ca) (CHECK_TYPE_INLINE(ca, Camera), ((ca->flag & CAM_DS_EXPAND)))
-#define FILTER_CUR_OBJD(cu) (CHECK_TYPE_INLINE(cu, Curve), ((cu->flag & CU_DS_EXPAND)))
-#define FILTER_PART_OBJD(part) (CHECK_TYPE_INLINE(part, ParticleSettings), ((part->flag & PART_DS_EXPAND)))
-#define FILTER_MBALL_OBJD(mb) (CHECK_TYPE_INLINE(mb, MetaBall), ((mb->flag2 & MB_DS_EXPAND)))
-#define FILTER_ARM_OBJD(arm) (CHECK_TYPE_INLINE(arm, bArmature), ((arm->flag & ARM_DS_EXPAND)))
-#define FILTER_MESH_OBJD(me) (CHECK_TYPE_INLINE(me, Mesh), ((me->flag & ME_DS_EXPAND)))
-#define FILTER_LATTICE_OBJD(lt) (CHECK_TYPE_INLINE(lt, Lattice), ((lt->flag & LT_DS_EXPAND)))
-#define FILTER_SPK_OBJD(spk) (CHECK_TYPE_INLINE(spk, Speaker), ((spk->flag & SPK_DS_EXPAND)))
+#define FILTER_SKE_OBJD(key) ((key->flag & KEY_DS_EXPAND))
+#define FILTER_MAT_OBJD(ma) ((ma->flag & MA_DS_EXPAND))
+#define FILTER_LAM_OBJD(la) ((la->flag & LA_DS_EXPAND))
+#define FILTER_CAM_OBJD(ca) ((ca->flag & CAM_DS_EXPAND))
+#define FILTER_CUR_OBJD(cu) ((cu->flag & CU_DS_EXPAND))
+#define FILTER_PART_OBJD(part) ((part->flag & PART_DS_EXPAND))
+#define FILTER_MBALL_OBJD(mb) ((mb->flag2 & MB_DS_EXPAND))
+#define FILTER_ARM_OBJD(arm) ((arm->flag & ARM_DS_EXPAND))
+#define FILTER_MESH_OBJD(me) ((me->flag & ME_DS_EXPAND))
+#define FILTER_LATTICE_OBJD(lt) ((lt->flag & LT_DS_EXPAND))
+#define FILTER_SPK_OBJD(spk) ((spk->flag & SPK_DS_EXPAND))
/* Variable use expanders */
-#define FILTER_NTREE_DATA(ntree) (CHECK_TYPE_INLINE(ntree, bNodeTree), ((ntree->flag & NTREE_DS_EXPAND)))
-#define FILTER_TEX_DATA(tex) (CHECK_TYPE_INLINE(tex, Tex), ((tex->flag & TEX_DS_EXPAND)))
+#define FILTER_NTREE_DATA(ntree) ((ntree->flag & NTREE_DS_EXPAND))
+#define FILTER_TEX_DATA(tex) ((tex->flag & TEX_DS_EXPAND))
/* 'Sub-object/Action' channels (flags stored in Action) */
#define SEL_ACTC(actc) ((actc->flag & ACT_SELECTED))
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index efd10f3cb6b..b9996c87194 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -93,18 +93,9 @@ typedef struct EditBone {
#define BONESEL_NOSEL (1 << 31) /* Indicates a negative number */
/* useful macros */
-#define EBONE_VISIBLE(arm, ebone) ( \
- CHECK_TYPE_INLINE(arm, bArmature), \
- CHECK_TYPE_INLINE(ebone, EditBone), \
- (((arm)->layer & (ebone)->layer) && !((ebone)->flag & BONE_HIDDEN_A)) \
- )
-
+#define EBONE_VISIBLE(arm, ebone) (((arm)->layer & (ebone)->layer) && !((ebone)->flag & BONE_HIDDEN_A))
#define EBONE_SELECTABLE(arm, ebone) (EBONE_VISIBLE(arm, ebone) && !(ebone->flag & BONE_UNSELECTABLE))
-
-#define EBONE_EDITABLE(ebone) ( \
- CHECK_TYPE_INLINE(ebone, EditBone), \
- (((ebone)->flag & BONE_SELECTED) && !((ebone)->flag & BONE_EDITMODE_LOCKED)) \
- )
+#define EBONE_EDITABLE(ebone) (((ebone)->flag & BONE_SELECTED) && !((ebone)->flag & BONE_EDITMODE_LOCKED))
/* used in bone_select_hierachy() */
#define BONE_SELECT_PARENT 0
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 093872c79f6..02c7d52f08d 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -138,7 +138,7 @@ int EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, sh
int EDBM_backbuf_check(unsigned int index);
void EDBM_backbuf_free(void);
-int EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot,
+int EDBM_backbuf_border_mask_init(struct ViewContext *vc, int mcords[][2], short tot,
short xmin, short ymin, short xmax, short ymax);
int EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads);
@@ -149,7 +149,7 @@ struct BMFace *EDBM_face_find_nearest(struct ViewContext *vc, int *dist);
int EDBM_select_pick(struct bContext *C, const int mval[2], short extend, short deselect, short toggle);
void EDBM_selectmode_set(struct BMEditMesh *em);
-void EDBM_selectmode_convert(struct BMEditMesh *em, const short selectmode_old, const short selectmode_new);
+void EDBM_selectmode_convert(struct BMEditMesh *em, short selectmode_old, const short selectmode_new);
void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const short select);
@@ -174,7 +174,7 @@ void ED_spacetypes_init(void);
/* editmesh_tools.c (could be moved) */
-void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEditMesh *em);
+void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object *obedit, struct BMEditMesh *em);
/* editface.c */
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 9836d690e53..26c8b865377 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -126,6 +126,7 @@ float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob,
const float loc[3], const float rot[3], float primmat[][4]);
void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode);
+int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float loc[3], float rot[3],
int *enter_editmode, unsigned int *layer, int *is_view_aligned);
diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h
index dee97c7882a..0076b08da99 100644
--- a/source/blender/editors/include/ED_particle.h
+++ b/source/blender/editors/include/ED_particle.h
@@ -61,7 +61,7 @@ void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
int PE_mouse_particles(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
int PE_border_select(struct bContext *C, struct rcti *rect, int select, int extend);
int PE_circle_select(struct bContext *C, int selecting, const int mval[2], float rad);
-int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, short extend, short select);
+int PE_lasso_select(struct bContext *C, int mcords[][2], short moves, short extend, short select);
void PE_deselect_all_visible(struct PTCacheEdit *edit);
/* undo */
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index f71133d3118..9536dd76581 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -40,11 +40,9 @@ struct BPoint;
struct BezTriple;
struct BezTriple;
struct BoundBox;
-struct EditBone;
struct ImBuf;
struct MVert;
struct Main;
-struct MetaElem;
struct Nurb;
struct Nurb;
struct Object;
@@ -115,49 +113,15 @@ void ED_view3d_depth_tag_update(struct RegionView3D *rv3d);
/* TODO, these functions work quite differently, we should make them behave in a uniform way
* otherwise we can't be sure bugs are not added when we need to move from short->float types for eg
* - Campbell */
-
-
-/* return values for ED_view3d_project_...() */
-typedef enum {
- V3D_PROJ_RET_OK = 0,
- V3D_PROJ_RET_CLIP_NEAR = 1, /* can't avoid this when in perspective mode, (can't avoid) */
- V3D_PROJ_RET_CLIP_BB = 2, /* bounding box clip - RV3D_CLIPPING */
- V3D_PROJ_RET_CLIP_WIN = 3, /* outside window bounds */
- V3D_PROJ_RET_OVERFLOW = 4 /* outside range (mainly for short), (can't avoid) */
-} eV3DProjStatus;
-
-/* some clipping tests are optional */
-typedef enum {
- V3D_PROJ_TEST_NOP = 0,
- V3D_PROJ_TEST_CLIP_BB = (1 << 0),
- V3D_PROJ_TEST_CLIP_WIN = (1 << 1),
-} eV3DProjTest;
-
-
-/* *** short *** */
-eV3DProjStatus ED_view3d_project_short_ex(struct ARegion *ar, float perspmat[4][4], const int is_local,
- const float co[3], short r_co[2], eV3DProjTest flag);
-eV3DProjStatus ED_view3d_project_short_global(struct ARegion *ar, const float co[3], short r_co[2], eV3DProjTest flag);
-eV3DProjStatus ED_view3d_project_short_object(struct ARegion *ar, const float co[3], short r_co[2], eV3DProjTest flag);
-
-/* *** int *** */
-eV3DProjStatus ED_view3d_project_int_ex(struct ARegion *ar, float perspmat[4][4], const int is_local,
- const float co[3], int r_co[2], eV3DProjTest flag);
-eV3DProjStatus ED_view3d_project_int_global(struct ARegion *ar, const float co[3], int r_co[2], eV3DProjTest flag);
-eV3DProjStatus ED_view3d_project_int_object(struct ARegion *ar, const float co[3], int r_co[2], eV3DProjTest flag);
-
-/* *** float *** */
-eV3DProjStatus ED_view3d_project_float_ex(struct ARegion *ar, float perspmat[4][4], const int is_local,
- const float co[3], float r_co[2], eV3DProjTest flag);
-eV3DProjStatus ED_view3d_project_float_global(struct ARegion *ar, const float co[3], float r_co[2], eV3DProjTest flag);
-eV3DProjStatus ED_view3d_project_float_object(struct ARegion *ar, const float co[3], float r_co[2], eV3DProjTest flag);
-
+void ED_view3d_project_short(struct ARegion *ar, const float co[3], short r_co[2]);
+void ED_view3d_project_short_noclip(struct ARegion *ar, const float vec[3], short r_co[2]);
+void ED_view3d_project_int(struct ARegion *ar, const float co[3], int r_co[2]);
+void ED_view3d_project_int_noclip(struct ARegion *ar, const float co[3], int r_co[2]);
+void ED_view3d_project_float(struct ARegion *ar, const float co[3], float r_co[2]);
+void ED_view3d_project_float_noclip(struct ARegion *ar, const float co[3], float r_co[2]);
void ED_view3d_project_float_v2_m4(const struct ARegion *a, const float co[3], float r_co[2], float mat[4][4]);
void ED_view3d_project_float_v3_m4(struct ARegion *a, const float co[3], float r_co[3], float mat[4][4]);
-/* Base's get their own function since its a common operation */
-eV3DProjStatus ED_view3d_project_base(struct ARegion *ar, struct Base *base);
-
void ED_view3d_unproject(struct bglMats *mats, float out[3], const float x, const float y, const float z);
int ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend);
@@ -171,11 +135,7 @@ void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData,
void mesh_foreachScreenEdge(struct ViewContext *vc, void (*func)(void *userData, struct BMEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, eV3DClipTest clipVerts);
void mesh_foreachScreenFace(struct ViewContext *vc, void (*func)(void *userData, struct BMFace *efa, int x, int y, int index), void *userData);
void nurbs_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, int x, int y), void *userData);
-void mball_foreachScreenElem(struct ViewContext *vc, void (*func)(void *userData, struct MetaElem *ml, int x, int y), void *userData);
void lattice_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData);
-void armature_foreachScreenBone(struct ViewContext *vc, void (*func)(void *userData, struct EditBone *ebone, int x0, int y0, int x1, int y1), void *userData);
-void pose_foreachScreenBone(struct ViewContext *vc, void (*func)(void *userData, struct bPoseChannel *pchan, int x0, int y0, int x1, int y1), void *userData);
-
void ED_view3d_clipping_calc(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, const struct rcti *rect);
void ED_view3d_clipping_local(struct RegionView3D *rv3d, float mat[][4]);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 5d2709f0488..32132f497a8 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -421,6 +421,7 @@ void uiBlockSetDirection(uiBlock *block, int direction);
void uiBlockFlipOrder(uiBlock *block);
void uiBlockSetFlag(uiBlock *block, int flag);
void uiBlockClearFlag(uiBlock *block, int flag);
+void uiBlockSetXOfs(uiBlock *block, int xofs);
int uiButGetRetVal(uiBut *but);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index d442ce1b04b..810cbc25862 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -996,20 +996,24 @@ void ui_fontscale(short *points, float aspect)
/* project button or block (but==NULL) to pixels in regionspace */
static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, uiBut *but)
{
- rctf rectf = (but)? but->rect: block->rect;
+ float gx, gy;
+ float getsizex, getsizey;
- ui_block_to_window_fl(ar, block, &rectf.xmin, &rectf.ymin);
- ui_block_to_window_fl(ar, block, &rectf.xmax, &rectf.ymax);
+ getsizex = ar->winx;
+ getsizey = ar->winy;
- rectf.xmin -= ar->winrct.xmin;
- rectf.ymin -= ar->winrct.ymin;
- rectf.xmax -= ar->winrct.xmin;
- rectf.ymax -= ar->winrct.ymin;
+ gx = (but ? but->rect.xmin : block->rect.xmin) + (block->panel ? block->panel->ofsx : 0.0f);
+ gy = (but ? but->rect.ymin : block->rect.ymin) + (block->panel ? block->panel->ofsy : 0.0f);
+
+ rect->xmin = floorf(getsizex * (0.5f + 0.5f * (gx * block->winmat[0][0] + gy * block->winmat[1][0] + block->winmat[3][0])));
+ rect->ymin = floorf(getsizey * (0.5f + 0.5f * (gx * block->winmat[0][1] + gy * block->winmat[1][1] + block->winmat[3][1])));
+
+ gx = (but ? but->rect.xmax : block->rect.xmax) + (block->panel ? block->panel->ofsx : 0.0f);
+ gy = (but ? but->rect.ymax : block->rect.ymax) + (block->panel ? block->panel->ofsy : 0.0f);
+
+ rect->xmax = floorf(getsizex * (0.5f + 0.5f * (gx * block->winmat[0][0] + gy * block->winmat[1][0] + block->winmat[3][0])));
+ rect->ymax = floorf(getsizey * (0.5f + 0.5f * (gx * block->winmat[0][1] + gy * block->winmat[1][1] + block->winmat[3][1])));
- rect->xmin = floorf(rectf.xmin);
- rect->ymin = floorf(rectf.ymin);
- rect->xmax = floorf(rectf.xmax);
- rect->ymax = floorf(rectf.ymax);
}
/* uses local copy of style, to scale things down, and allow widgets to change stuff */
@@ -1152,15 +1156,9 @@ static void ui_is_but_sel(uiBut *but, double *value)
}
}
- if (is_push == 2) {
- /* pass */
- }
- else if (is_push == 1) {
- but->flag |= UI_SELECT;
- }
- else {
- but->flag &= ~UI_SELECT;
- }
+ if (is_push == 2) ;
+ else if (is_push == 1) but->flag |= UI_SELECT;
+ else but->flag &= ~UI_SELECT;
}
static uiBut *ui_find_inlink(uiBlock *block, void *poin)
@@ -2162,6 +2160,8 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
wm_subwindow_getmatrix(window, region->swinid, block->winmat);
wm_subwindow_getsize(window, region->swinid, &getsizex, &getsizey);
+ /* TODO - investigate why block->winmat[0][0] is negative
+ * in the image view when viewRedrawForce is called */
block->aspect = 2.0f / fabsf(getsizex * block->winmat[0][0]);
}
else {
@@ -3423,6 +3423,11 @@ void uiBlockClearFlag(uiBlock *block, int flag)
block->flag &= ~flag;
}
+void uiBlockSetXOfs(uiBlock *block, int xofs)
+{
+ block->xofs = xofs;
+}
+
void uiButSetFlag(uiBut *but, int flag)
{
but->flag |= flag;
@@ -3869,41 +3874,12 @@ void uiButGetStrInfo(bContext *C, uiBut *but, int nbr, ...)
}
}
else if (ELEM3(type, BUT_GET_RNAENUM_IDENTIFIER, BUT_GET_RNAENUM_LABEL, BUT_GET_RNAENUM_TIP)) {
- PointerRNA *ptr = NULL;
- PropertyRNA *prop = NULL;
- int value = 0;
-
- /* get the enum property... */
if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
- /* enum property */
- ptr = &but->rnapoin;
- prop = but->rnaprop;
- value = (but->type == ROW) ? (int)but->hardmax : (int)ui_get_but_val(but);
- }
- else if (but->optype) {
- PointerRNA *opptr = uiButGetOperatorPtrRNA(but);
- wmOperatorType *ot = but->optype;
-
- /* if the default property of the operator is enum and it is set,
- * fetch the tooltip of the selected value so that "Snap" and "Mirror"
- * operator menus in the Anim Editors will show tooltips for the different
- * operations instead of the meaningless generic operator tooltip
- */
- if (ot->prop && RNA_property_type(ot->prop) == PROP_ENUM) {
- if (RNA_struct_contains_property(opptr, ot->prop)) {
- ptr = opptr;
- prop = ot->prop;
- value = RNA_property_enum_get(opptr, ot->prop);
- }
- }
- }
-
- /* get strings from matching enum item */
- if (ptr && prop) {
if (!item) {
int i;
-
- RNA_property_enum_items_gettexted(C, ptr, prop, &items, &totitems, &free_items);
+ int value = (but->type == ROW) ? (int)but->hardmax : (int)ui_get_but_val(but);
+ RNA_property_enum_items_gettexted(C, &but->rnapoin, but->rnaprop, &items, &totitems, &free_items);
+
for (i = 0, item = items; i < totitems; i++, item++) {
if (item->identifier[0] && item->value == value)
break;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index f798f0b399b..bfa9cc2727c 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -704,9 +704,7 @@ static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, wmEvent *event)
BLI_rcti_rctf_copy(&rect, &but->rect);
- if (but->imb) {
- /* use button size itself */
- }
+ if (but->imb) ; /* use button size itself */
else if (but->flag & UI_ICON_LEFT) {
rect.xmax = rect.xmin + (BLI_rcti_size_y(&rect));
}
@@ -1186,9 +1184,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
/* numeric value */
if (ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) {
- if (but->poin == NULL && but->rnapoin.data == NULL) {
- /* pass */
- }
+ if (but->poin == NULL && but->rnapoin.data == NULL) ;
else if (mode == 'c') {
ui_get_but_string(but, buf, sizeof(buf));
WM_clipboard_text_set(buf, 0);
@@ -1209,9 +1205,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
else if (but->type == COLOR) {
float rgb[3];
- if (but->poin == NULL && but->rnapoin.data == NULL) {
- /* pass */
- }
+ if (but->poin == NULL && but->rnapoin.data == NULL) ;
else if (mode == 'c') {
ui_get_but_vectorf(but, rgb);
@@ -1240,9 +1234,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
else if (ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
uiHandleButtonData *active_data = but->active;
- if (but->poin == NULL && but->rnapoin.data == NULL) {
- /* pass */
- }
+ if (but->poin == NULL && but->rnapoin.data == NULL) ;
else if (mode == 'c') {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
BLI_strncpy(buf, active_data->str, UI_MAX_DRAW_STR);
@@ -2175,16 +2167,6 @@ static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data)
}
}
-int ui_button_open_menu_direction(uiBut *but)
-{
- uiHandleButtonData *data = but->active;
-
- if (data && data->menu)
- return data->menu->direction;
-
- return 0;
-}
-
/* ***************** events for different button types *************** */
static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
@@ -2305,9 +2287,7 @@ static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
{
if (data->state == BUTTON_STATE_HIGHLIGHT) {
if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val == KM_PRESS) {
- if (but->dt == UI_EMBOSSN && !event->ctrl) {
- /* pass */
- }
+ if (but->dt == UI_EMBOSSN && !event->ctrl) ;
else {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
return WM_UI_HANDLER_BREAK;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index b4b0686d6fc..b48c9bcab7e 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -315,6 +315,7 @@ struct uiBlock {
char tooltipdisabled; /* to avoid tooltip after click */
char endblock; /* uiEndBlock done? */
+ float xofs, yofs; /* offset to parent button */
eBlockBoundsCalc bounds_type; /* for doing delayed */
int mx, my;
int bounds, minbounds; /* for doing delayed */
@@ -364,8 +365,7 @@ extern void ui_set_but_hsv(uiBut *but);
extern void ui_get_but_vectorf(uiBut *but, float vec[3]);
extern void ui_set_but_vectorf(uiBut *but, const float vec[3]);
-extern void ui_hsvcircle_vals_from_pos(float *val_rad, float *val_dist, const rcti *rect,
- const float mx, const float my);
+extern void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my);
extern void ui_get_but_string(uiBut *but, char *str, size_t maxlen);
extern void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen);
@@ -418,9 +418,6 @@ struct uiPopupBlockHandle {
int menuretval;
float retvalue;
float retvec[4];
-
- /* menu direction */
- int direction;
};
uiBlock *ui_block_func_COLOR(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
@@ -483,7 +480,6 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, struct uiWidgetColors *wc
extern void ui_button_activate_do(struct bContext *C, struct ARegion *ar, uiBut *but);
extern void ui_button_active_free(const struct bContext *C, uiBut *but);
extern int ui_button_is_active(struct ARegion *ar);
-extern int ui_button_open_menu_direction(uiBut *but);
/* interface_widgets.c */
void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 8e30b31f3fe..7a369019ac4 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -835,9 +835,8 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
bt = block->buttons.last;
bt->flag = UI_TEXT_LEFT;
}
- else { /* XXX bug here, colums draw bottom item badly */
+ else /* XXX bug here, collums draw bottom item badly */
uiItemS(column);
- }
}
}
@@ -2516,12 +2515,8 @@ static void ui_item_align(uiLayout *litem, short nr)
if (!bitem->but->alignnr)
bitem->but->alignnr = nr;
}
- else if (item->type == ITEM_LAYOUT_ABSOLUTE) {
- /* pass */
- }
- else if (item->type == ITEM_LAYOUT_OVERLAP) {
- /* pass */
- }
+ else if (item->type == ITEM_LAYOUT_ABSOLUTE) ;
+ else if (item->type == ITEM_LAYOUT_OVERLAP) ;
else if (item->type == ITEM_LAYOUT_BOX) {
box = (uiLayoutItemBx *)item;
box->roundbox->alignnr = nr;
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index e4e2598c494..1ee06b1ff64 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -216,7 +216,7 @@ static void eyedropper_color_set(bContext *C, Eyedropper *eye, const float col[3
/* set sample from accumulated values */
static void eyedropper_color_set_accum(bContext *C, Eyedropper *eye)
{
- float col[3];
+ float col[4];
mul_v3_v3fl(col, eye->accum_col, 1.0f / (float)eye->accum_tot);
eyedropper_color_set(C, eye, col);
}
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 4dafb4b2d4b..605233cd96f 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1341,14 +1341,6 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
ui_block_to_window_fl(butregion, but->block, &butrct.xmin, &butrct.ymin);
ui_block_to_window_fl(butregion, but->block, &butrct.xmax, &butrct.ymax);
- /* widget_roundbox_set has this correction too, keep in sync */
- if (but->type != PULLDOWN) {
- if (but->flag & UI_BUT_ALIGN_TOP)
- butrct.ymax += 1.0f;
- if (but->flag & UI_BUT_ALIGN_LEFT)
- butrct.xmin -= 1.0f;
- }
-
/* calc block rect */
if (block->rect.xmin == 0.0f && block->rect.xmax == 0.0f) {
if (block->buttons.first) {
@@ -1475,6 +1467,9 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
}
}
+ /* apply requested offset in the block */
+ xof += block->xofs / block->aspect;
+ yof += block->yofs / block->aspect;
#if 0
/* clamp to window bounds, could be made into an option if its ever annoying */
if ( (offscreen = (block->rect.ymin + yof)) < 0) yof -= offscreen; /* bottom */
@@ -1664,10 +1659,12 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
/* if this is being created from a button */
if (but) {
+ if (ELEM(but->type, BLOCK, PULLDOWN))
+ block->xofs = -2; /* for proper alignment */
+
block->aspect = but->block->aspect;
ui_block_position(window, butregion, but, block);
- handle->direction = block->direction;
}
else {
/* keep a list of these, needed for pulldown menus */
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 0e1fd87c985..87a7d1957c5 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -891,8 +891,8 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect
/* calculate blend color */
if (ELEM4(but->type, TOG, ROW, TOGN, LISTROW)) {
- if (but->flag & UI_SELECT) {}
- else if (but->flag & UI_ACTIVE) {}
+ if (but->flag & UI_SELECT) ;
+ else if (but->flag & UI_ACTIVE) ;
else alpha = 0.5f;
}
@@ -1889,47 +1889,53 @@ static void ui_hsv_cursor(float x, float y)
}
-void ui_hsvcircle_vals_from_pos(float *val_rad, float *val_dist, const rcti *rect,
- const float mx, const float my)
+void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my)
{
/* duplication of code... well, simple is better now */
- const float centx = BLI_rcti_cent_x_fl(rect);
- const float centy = BLI_rcti_cent_y_fl(rect);
- const float radius = (float)mini(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)) / 2.0f;
- const float m_delta[2] = {mx - centx, my - centy};
- const float dist_squared = len_squared_v2(m_delta);
+ float centx = BLI_rcti_cent_x_fl(rect);
+ float centy = BLI_rcti_cent_y_fl(rect);
+ float radius, dist;
+
+ if (BLI_rcti_size_x(rect) > BLI_rcti_size_y(rect))
+ radius = (float)BLI_rcti_size_y(rect) / 2;
+ else
+ radius = (float)BLI_rcti_size_x(rect) / 2;
- *val_dist = (dist_squared < (radius * radius)) ? sqrtf(dist_squared) / radius : 1.0f;
- *val_rad = atan2f(m_delta[0], m_delta[1]) / (2.0f * (float)M_PI) + 0.5f;
+ mx -= centx;
+ my -= centy;
+ dist = sqrt(mx * mx + my * my);
+ if (dist < radius)
+ *valdist = dist / radius;
+ else
+ *valdist = 1.0f;
+
+ *valrad = atan2f(mx, my) / (2.0f * (float)M_PI) + 0.5f;
}
-static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
+static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
{
- const int tot = 32;
- const float radstep = 2.0f * (float)M_PI / (float)tot;
-
- const float centx = BLI_rcti_cent_x_fl(rect);
- const float centy = BLI_rcti_cent_y_fl(rect);
- float radius = (float)mini(BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)) / 2.0f;
-
/* gouraud triangle fan */
- const float *hsv_ptr = ui_block_hsv_get(but->block);
- float ang = 0.0f;
- float cursor_radius;
+ float radstep, ang = 0.0f;
+ float centx, centy, radius, cursor_radius;
float rgb[3], hsvo[3], hsv[3], col[3], colcent[3];
- int a;
+ int a, tot = 32;
int color_profile = but->block->color_profile;
if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA)
color_profile = FALSE;
+ radstep = 2.0f * (float)M_PI / (float)tot;
+ centx = BLI_rcti_cent_x_fl(rect);
+ centy = BLI_rcti_cent_y_fl(rect);
+
+ if (BLI_rcti_size_x(rect) > BLI_rcti_size_y(rect))
+ radius = (float)BLI_rcti_size_y(rect) / 2;
+ else
+ radius = (float)BLI_rcti_size_x(rect) / 2;
+
/* color */
ui_get_but_vectorf(but, rgb);
-
- /* since we use compat functions on both 'hsv' and 'hsvo', they need to be initialized */
- hsvo[0] = hsv[0] = hsv_ptr[0];
- hsvo[1] = hsv[1] = hsv_ptr[1];
- hsvo[2] = hsv[2] = hsv_ptr[2];
+ /* copy_v3_v3(hsv, ui_block_hsv_get(but->block)); */ /* UNUSED */
rgb_to_hsv_compat_v(rgb, hsvo);
@@ -2702,16 +2708,16 @@ static void widget_menunodebut(uiWidgetColors *wcol, rcti *rect, int UNUSED(stat
*wcol = wcol_backup;
}
-static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
+static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign))
{
if (state & UI_ACTIVE) {
uiWidgetBase wtb;
- float rad = 0.25f * BLI_rcti_size_y(rect); /* 4.0f */
-
+ float rad = 0.5f * BLI_rcti_size_y(rect); /* 4.0f */
+
widget_init(&wtb);
-
+
/* half rounded */
- round_box_edges(&wtb, roundboxalign, rect, rad);
+ round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
widgetbase_draw(&wtb, wcol);
}
@@ -3048,12 +3054,9 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
static int widget_roundbox_set(uiBut *but, rcti *rect)
{
- int roundbox = UI_CNR_ALL;
-
/* alignment */
- if ((but->flag & UI_BUT_ALIGN) && but->type != PULLDOWN) {
+ if (but->flag & UI_BUT_ALIGN) {
- /* ui_block_position has this correction too, keep in sync */
if (but->flag & UI_BUT_ALIGN_TOP)
rect->ymax += 1;
if (but->flag & UI_BUT_ALIGN_LEFT)
@@ -3061,50 +3064,27 @@ static int widget_roundbox_set(uiBut *but, rcti *rect)
switch (but->flag & UI_BUT_ALIGN) {
case UI_BUT_ALIGN_TOP:
- roundbox = UI_CNR_BOTTOM_LEFT | UI_CNR_BOTTOM_RIGHT;
- break;
+ return UI_CNR_BOTTOM_LEFT | UI_CNR_BOTTOM_RIGHT;
case UI_BUT_ALIGN_DOWN:
- roundbox = UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT;
- break;
+ return UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT;
case UI_BUT_ALIGN_LEFT:
- roundbox = UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT;
- break;
+ return UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT;
case UI_BUT_ALIGN_RIGHT:
- roundbox = UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT;
- break;
+ return UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT;
case UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_RIGHT:
- roundbox = UI_CNR_TOP_LEFT;
- break;
+ return UI_CNR_TOP_LEFT;
case UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_LEFT:
- roundbox = UI_CNR_TOP_RIGHT;
- break;
+ return UI_CNR_TOP_RIGHT;
case UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT:
- roundbox = UI_CNR_BOTTOM_LEFT;
- break;
+ return UI_CNR_BOTTOM_LEFT;
case UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT:
- roundbox = UI_CNR_BOTTOM_RIGHT;
- break;
+ return UI_CNR_BOTTOM_RIGHT;
default:
- roundbox = 0;
- break;
+ return 0;
}
}
- /* align with open menu */
- if (but->active) {
- int direction = ui_button_open_menu_direction(but);
-
- if (direction == UI_TOP)
- roundbox &= ~(UI_CNR_TOP_RIGHT|UI_CNR_TOP_LEFT);
- else if (direction == UI_DOWN)
- roundbox &= ~(UI_CNR_BOTTOM_RIGHT|UI_CNR_BOTTOM_LEFT);
- else if (direction == UI_LEFT)
- roundbox &= ~(UI_CNR_TOP_LEFT|UI_CNR_BOTTOM_LEFT);
- else if (direction == UI_RIGHT)
- roundbox &= ~(UI_CNR_TOP_RIGHT|UI_CNR_BOTTOM_RIGHT);
- }
-
- return roundbox;
+ return UI_CNR_ALL;
}
/* conversion from old to new buttons, so still messy */
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c
index 69cfdf4e51b..55bad39f4f2 100644
--- a/source/blender/editors/mask/mask_select.c
+++ b/source/blender/editors/mask/mask_select.c
@@ -485,7 +485,7 @@ void MASK_OT_select_border(wmOperatorType *ot)
WM_operator_properties_gesture_border(ot, TRUE);
}
-static int do_lasso_select_mask(bContext *C, const int mcords[][2], short moves, short select)
+static int do_lasso_select_mask(bContext *C, int mcords[][2], short moves, short select)
{
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
@@ -549,7 +549,7 @@ static int do_lasso_select_mask(bContext *C, const int mcords[][2], short moves,
static int clip_lasso_select_exec(bContext *C, wmOperator *op)
{
int mcords_tot;
- const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
+ int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
short select;
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 429b2148894..a677f1272a3 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -214,9 +214,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
/* fill array by selection */
mp = me->mpoly;
for (a = 0; a < me->totpoly; a++, mp++) {
- if (mp->flag & ME_HIDE) {
- /* pass */
- }
+ if (mp->flag & ME_HIDE) ;
else if (mp->flag & ME_FACE_SEL) {
hash_add_face(ehash, mp, me->mloop + mp->loopstart);
linkflag[a] = 1;
@@ -428,7 +426,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
if (me == 0 || me->totpoly == 0) return;
if (mode == 0)
- mode = pupmenu("Seams %t|Mark Border Seam %x1|Clear Seam %x2");
+ mode = pupmenu("Seams%t|Mark Border Seam %x1|Clear Seam %x2");
if (mode != 1 && mode != 2)
return;
@@ -574,9 +572,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
mpoly = me->mpoly;
for (a = 1; a <= me->totpoly; a++, mpoly++) {
if (selar[a]) {
- if (mpoly->flag & ME_HIDE) {
- /* pass */
- }
+ if (mpoly->flag & ME_HIDE) ;
else {
if (select) mpoly->flag |= ME_FACE_SEL;
else mpoly->flag &= ~ME_FACE_SEL;
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index 0cf4ac48bf7..fdaddec5246 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -64,7 +64,7 @@ static Object *make_prim_init(bContext *C, const char *idname,
*state = 0;
if (obedit == NULL || obedit->type != OB_MESH) {
obedit = ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer);
-
+
rename_id((ID *)obedit, idname);
rename_id((ID *)obedit->data, idname);
@@ -103,7 +103,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state;
unsigned int layer;
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Plane", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -125,11 +125,12 @@ void MESH_OT_primitive_plane_add(wmOperatorType *ot)
ot->name = "Add Plane";
ot->description = "Construct a filled planar mesh with 4 vertices";
ot->idname = "MESH_OT_primitive_plane_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_plane_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -144,7 +145,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state;
unsigned int layer;
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Cube", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -152,7 +153,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
if (!EDBM_op_call_and_selectf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, dia * 2.0f)) {
return OPERATOR_CANCELLED;
}
-
+
/* BMESH_TODO make plane side this: M_SQRT2 - plane (diameter of 1.41 makes it unit size) */
make_prim_finish(C, obedit, &state, enter_editmode);
@@ -165,11 +166,12 @@ void MESH_OT_primitive_cube_add(wmOperatorType *ot)
ot->name = "Add Cube";
ot->description = "Construct a cube mesh";
ot->idname = "MESH_OT_primitive_cube_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_cube_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -190,10 +192,10 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state, cap_end, cap_tri;
unsigned int layer;
-
+
cap_end = RNA_enum_get(op->ptr, "fill_type");
cap_tri = (cap_end == 2);
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Circle", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -205,9 +207,9 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
{
return OPERATOR_CANCELLED;
}
-
+
make_prim_finish(C, obedit, &state, enter_editmode);
-
+
return OPERATOR_FINISHED;
}
@@ -219,14 +221,15 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
ot->name = "Add Circle";
ot->description = "Construct a circle mesh";
ot->idname = "MESH_OT_primitive_circle_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_circle_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
/* props */
RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
prop = RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
@@ -244,10 +247,10 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state, cap_end, cap_tri;
unsigned int layer;
-
+
cap_end = RNA_enum_get(op->ptr, "end_fill_type");
cap_tri = (cap_end == 2);
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Cylinder", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -263,9 +266,9 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
{
return OPERATOR_CANCELLED;
}
-
+
make_prim_finish(C, obedit, &state, enter_editmode);
-
+
return OPERATOR_FINISHED;
}
@@ -277,14 +280,15 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
ot->name = "Add Cylinder";
ot->description = "Construct a cylinder mesh";
ot->idname = "MESH_OT_primitive_cylinder_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_cylinder_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
/* props */
RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
prop = RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
@@ -304,10 +308,10 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state, cap_end, cap_tri;
unsigned int layer;
-
+
cap_end = RNA_enum_get(op->ptr, "end_fill_type");
cap_tri = (cap_end == 2);
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Cone", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -320,7 +324,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
{
return OPERATOR_CANCELLED;
}
-
+
make_prim_finish(C, obedit, &state, enter_editmode);
return OPERATOR_FINISHED;
@@ -334,14 +338,15 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
ot->name = "Add Cone";
ot->description = "Construct a conic mesh";
ot->idname = "MESH_OT_primitive_cone_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_cone_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
/* props */
RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
prop = RNA_def_float(ot->srna, "radius1", 1.0f, 0.0, FLT_MAX, "Radius 1", "", 0.001, 100.00);
@@ -363,7 +368,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state;
unsigned int layer;
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Grid", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -376,9 +381,8 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
{
return OPERATOR_CANCELLED;
}
-
+
make_prim_finish(C, obedit, &state, enter_editmode);
-
return OPERATOR_FINISHED;
}
@@ -390,14 +394,15 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot)
ot->name = "Add Grid";
ot->description = "Construct a grid mesh";
ot->idname = "MESH_OT_primitive_grid_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_grid_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
/* props */
RNA_def_int(ot->srna, "x_subdivisions", 10, 3, INT_MAX, "X Subdivisions", "", 3, 1000);
RNA_def_int(ot->srna, "y_subdivisions", 10, 3, INT_MAX, "Y Subdivisions", "", 3, 1000);
@@ -415,20 +420,19 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state, view_aligned;
unsigned int layer;
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &view_aligned);
if (!view_aligned)
rot[0] += (float)M_PI / 2.0f;
-
+
obedit = make_prim_init(C, "Monkey", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "vertout", "create_monkey mat=%m4", mat)) {
return OPERATOR_CANCELLED;
}
-
+
make_prim_finish(C, obedit, &state, enter_editmode);
-
return OPERATOR_FINISHED;
}
@@ -438,11 +442,12 @@ void MESH_OT_primitive_monkey_add(wmOperatorType *ot)
ot->name = "Add Monkey";
ot->description = "Construct a Suzanne mesh";
ot->idname = "MESH_OT_primitive_monkey_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_monkey_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -457,7 +462,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state;
unsigned int layer;
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Sphere", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -469,7 +474,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
{
return OPERATOR_CANCELLED;
}
-
+
make_prim_finish(C, obedit, &state, enter_editmode);
return OPERATOR_FINISHED;
@@ -483,14 +488,15 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
ot->name = "Add UV Sphere";
ot->description = "Construct a UV sphere mesh";
ot->idname = "MESH_OT_primitive_uv_sphere_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_uvsphere_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
/* props */
RNA_def_int(ot->srna, "segments", 32, 3, INT_MAX, "Segments", "", 3, 500);
RNA_def_int(ot->srna, "ring_count", 16, 3, INT_MAX, "Rings", "", 3, 500);
@@ -508,7 +514,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
int enter_editmode;
int state;
unsigned int layer;
-
+
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, "Icosphere", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
@@ -521,10 +527,10 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
{
return OPERATOR_CANCELLED;
}
-
+
make_prim_finish(C, obedit, &state, enter_editmode);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
@@ -535,14 +541,15 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
ot->name = "Add Ico Sphere";
ot->description = "Construct an Icosphere mesh";
ot->idname = "MESH_OT_primitive_ico_sphere_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = add_primitive_icosphere_exec;
ot->poll = ED_operator_scene_editable;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
/* props */
RNA_def_int(ot->srna, "subdivisions", 2, 1, INT_MAX, "Subdivisions", "", 1, 8);
prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00);
diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c
index e84fa90fe5c..c249d764ac1 100644
--- a/source/blender/editors/mesh/editmesh_bvh.c
+++ b/source/blender/editors/mesh/editmesh_bvh.c
@@ -371,9 +371,9 @@ int BMBVH_VertVisible(BMBVHTree *tree, BMEdge *e, RegionView3D *r3d)
}
#endif
-static BMFace *edge_ray_cast(BMBVHTree *tree, const float co[3], const float dir[3], float *r_hitout, BMEdge *e)
+static BMFace *edge_ray_cast(BMBVHTree *tree, const float co[3], const float dir[3], float *hitout, BMEdge *e)
{
- BMFace *f = BMBVH_RayCast(tree, co, dir, r_hitout, NULL);
+ BMFace *f = BMBVH_RayCast(tree, co, dir, hitout, NULL);
if (f && BM_edge_in_face(f, e))
return NULL;
@@ -392,7 +392,7 @@ static void scale_point(float c1[3], const float p[3], const float s)
int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Object *obedit)
{
BMFace *f;
- float co1[3], co2[3], co3[3], dir1[3], dir2[3], dir3[3];
+ float co1[3], co2[3], co3[3], dir1[4], dir2[4], dir3[4];
float origin[3], invmat[4][4];
float epsilon = 0.01f;
float end[3];
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 4f4fc27582c..85fc94a4c44 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -73,9 +73,6 @@
#define KMAXDIST 10 /* max mouse distance from edge before not detecting it */
-#define KNIFE_FLT_EPS 0.00001f
-#define KNIFE_FLT_EPS_SQUARED (KNIFE_FLT_EPS * KNIFE_FLT_EPS)
-
typedef struct KnifeColors {
unsigned char line[3];
unsigned char edge[3];
@@ -433,7 +430,7 @@ static KnifeVert *knife_split_edge(KnifeTool_OpData *kcd, KnifeEdge *kfe, float
float perc, cageco[3], l12;
l12 = len_v3v3(kfe->v1->co, kfe->v2->co);
- if (l12 < KNIFE_FLT_EPS) {
+ if (l12 < FLT_EPSILON * 80) {
copy_v3_v3(cageco, kfe->v1->cageco);
}
else {
@@ -449,8 +446,8 @@ static KnifeVert *knife_split_edge(KnifeTool_OpData *kcd, KnifeEdge *kfe, float
}
else {
/* kfe cuts across an existing face.
- * If v1 and v2 are in multiple faces together (e.g., if they
- * are in doubled polys) then this arbitrarily chooses one of them */
+ If v1 and v2 are in multiple faces together (e.g., if they
+ are in doubled polys) then this arbitrarily chooses one of them */
f = knife_find_common_face(&kfe->v1->faces, &kfe->v2->faces);
if (f)
knife_append_list(kcd, &newkfe->v2->faces, f);
@@ -592,7 +589,7 @@ static void knife_sort_linehits(KnifeTool_OpData *kcd)
* successor faces connected to the linehits at either end of the range */
for (i = 0; i < kcd->totlinehit - 1; i = nexti) {
for (j = i + 1; j < kcd->totlinehit; j++) {
- if (fabsf(kcd->linehits[j].l - kcd->linehits[i].l) > KNIFE_FLT_EPS)
+ if (fabsf(kcd->linehits[j].l - kcd->linehits[i].l) > 80 * FLT_EPSILON)
break;
}
nexti = j;
@@ -800,7 +797,7 @@ static void knife_add_cut(KnifeTool_OpData *kcd)
for (i = 0; i < kcd->totlinehit; i++, (lastlh = lh), lh++) {
BMFace *f = lastlh ? lastlh->f : lh->f;
- if (lastlh && len_squared_v3v3(lastlh->hit, lh->hit) == 0.0f) {
+ if (lastlh && len_v3v3(lastlh->hit, lh->hit) == 0.0f) {
if (!firstlh)
firstlh = lastlh;
continue;
@@ -819,13 +816,13 @@ static void knife_add_cut(KnifeTool_OpData *kcd)
lastlh = firstlh = NULL;
}
- if (len_squared_v3v3(kcd->prev.cage, lh->realhit) < KNIFE_FLT_EPS_SQUARED)
+ if (len_v3v3(kcd->prev.cage, lh->realhit) < FLT_EPSILON * 80)
continue;
- if (len_squared_v3v3(kcd->curr.cage, lh->realhit) < KNIFE_FLT_EPS_SQUARED)
+ if (len_v3v3(kcd->curr.cage, lh->realhit) < FLT_EPSILON * 80)
continue;
/* first linehit may be down face parallel to view */
- if (!lastlh && fabsf(lh->l) < KNIFE_FLT_EPS)
+ if (!lastlh && fabsf(lh->l) < FLT_EPSILON * 80)
continue;
if (kcd->prev.is_space) {
@@ -846,7 +843,7 @@ static void knife_add_cut(KnifeTool_OpData *kcd)
copy_v3_v3(kcd->curr.cage, lh->cagehit);
/* don't draw edges down faces parallel to view */
- if (lastlh && fabsf(lastlh->l - lh->l) < KNIFE_FLT_EPS) {
+ if (lastlh && fabsf(lastlh->l - lh->l) < FLT_EPSILON * 80) {
kcd->prev = kcd->curr;
continue;
}
@@ -1047,9 +1044,6 @@ static void knifetool_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
}
if (kcd->totlinehit > 0) {
- const float vthresh4 = kcd->vthresh / 4.0f;
- const float vthresh4_squared = vthresh4 * vthresh4;
-
BMEdgeHit *lh;
int i;
@@ -1068,12 +1062,12 @@ static void knifetool_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
knife_project_v3(kcd, lh->kfe->v2->cageco, sv2);
knife_project_v3(kcd, lh->cagehit, lh->schit);
- if (len_squared_v2v2(lh->schit, sv1) < vthresh4_squared) {
+ if (len_v2v2(lh->schit, sv1) < kcd->vthresh / 4.0f) {
copy_v3_v3(lh->cagehit, lh->kfe->v1->cageco);
glVertex3fv(lh->cagehit);
lh->v = lh->kfe->v1;
}
- else if (len_squared_v2v2(lh->schit, sv2) < vthresh4_squared) {
+ else if (len_v2v2(lh->schit, sv2) < kcd->vthresh / 4.0f) {
copy_v3_v3(lh->cagehit, lh->kfe->v2->cageco);
glVertex3fv(lh->cagehit);
lh->v = lh->kfe->v2;
@@ -1142,11 +1136,11 @@ static void knifetool_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
static float len_v3_tri_side_max(const float v1[3], const float v2[3], const float v3[3])
{
- const float s1 = len_squared_v3v3(v1, v2);
- const float s2 = len_squared_v3v3(v2, v3);
- const float s3 = len_squared_v3v3(v3, v1);
+ const float s1 = len_v3v3(v1, v2);
+ const float s2 = len_v3v3(v2, v3);
+ const float s3 = len_v3v3(v3, v1);
- return sqrtf(MAX3(s1, s2, s3));
+ return MAX3(s1, s2, s3);
}
static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
@@ -1164,7 +1158,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
/* for comparing distances, error of intersection depends on triangle scale.
* need to scale down before squaring for accurate comparison */
- const float depsilon = (KNIFE_FLT_EPS / 2.0f) * len_v3_tri_side_max(v1, v2, v3);
+ const float depsilon = 50 *FLT_EPSILON * len_v3_tri_side_max(v1, v2, v3);
const float depsilon_squared = depsilon * depsilon;
copy_v3_v3(cos + 0, v1);
@@ -1991,7 +1985,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
ScanFillFace *sf_tri;
ScanFillVert *sf_vert, *sf_vert_last;
int j;
- float rndscale = (KNIFE_FLT_EPS / 4.0f);
+ float rndscale = FLT_EPSILON * 25;
f = faces[i];
BLI_smallhash_init(hash);
@@ -3064,9 +3058,14 @@ wmKeyMap *knifetool_modal_keymap(wmKeyConfig *keyconf)
static int knifetool_modal(bContext *C, wmOperator *op, wmEvent *event)
{
- Object *obedit = CTX_data_edit_object(C);
+ Object *obedit;
KnifeTool_OpData *kcd = op->customdata;
+ if (!C) {
+ return OPERATOR_FINISHED;
+ }
+
+ obedit = CTX_data_edit_object(C);
if (!obedit || obedit->type != OB_MESH || BMEdit_FromObject(obedit) != kcd->em) {
knifetool_exit(C, op);
ED_area_headerprint(CTX_wm_area(C), NULL);
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c
index 0b3d178e2e8..001d584416f 100644
--- a/source/blender/editors/mesh/editmesh_rip.c
+++ b/source/blender/editors/mesh/editmesh_rip.c
@@ -59,7 +59,7 @@
static float edbm_rip_rip_edgedist(ARegion *ar, float mat[][4],
const float co1[3], const float co2[3], const float mvalf[2])
{
- float vec1[2], vec2[2];
+ float vec1[3], vec2[3];
ED_view3d_project_float_v2_m4(ar, co1, vec1, mat);
ED_view3d_project_float_v2_m4(ar, co2, vec2, mat);
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 680d15ec51e..f362ec32bad 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -131,7 +131,7 @@ unsigned int bm_solidoffs = 0, bm_wireoffs = 0, bm_vertoffs = 0; /* set in dr
static char *selbuf = NULL;
/* opengl doesn't support concave... */
-static void draw_triangulated(const int mcords[][2], const short tot)
+static void draw_triangulated(int mcords[][2], short tot)
{
ListBase lb = {NULL, NULL};
DispList *dl;
@@ -227,7 +227,7 @@ void EDBM_backbuf_free(void)
* - grab again and compare
* returns 'OK'
*/
-int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
+int EDBM_backbuf_border_mask_init(ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
{
unsigned int *dr, *drm;
struct ImBuf *buf, *bufmask;
@@ -1050,27 +1050,21 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short ring)
/* sets as active, useful for other tools */
if (select) {
if (em->selectmode & SCE_SELECT_VERTEX) {
- /* Find nearest vert from mouse
- * (initialize to large values incase only one vertex can be projected) */
+ /* Find nearest vert from mouse. */
float v1_co[2], v2_co[2];
- float length_1 = FLT_MAX;
- float length_2 = FLT_MAX;
/* We can't be sure this has already been set... */
ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d);
-
- if (ED_view3d_project_float_object(vc.ar, eed->v1->co, v1_co, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- length_1 = len_squared_v2v2(mvalf, v1_co);
- }
-
- if (ED_view3d_project_float_object(vc.ar, eed->v2->co, v2_co, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- length_2 = len_squared_v2v2(mvalf, v2_co);
- }
+ ED_view3d_project_float_noclip(vc.ar, eed->v1->co, v1_co);
+ ED_view3d_project_float_noclip(vc.ar, eed->v2->co, v2_co);
#if 0
printf("mouse to v1: %f\nmouse to v2: %f\n", len_squared_v2v2(mvalf, v1_co),
len_squared_v2v2(mvalf, v2_co));
#endif
- BM_select_history_store(em->bm, (length_1 < length_2) ? eed->v1 : eed->v2);
+ if (len_squared_v2v2(mvalf, v1_co) < len_squared_v2v2(mvalf, v2_co))
+ BM_select_history_store(em->bm, eed->v1);
+ else
+ BM_select_history_store(em->bm, eed->v2);
}
else if (em->selectmode & SCE_SELECT_EDGE) {
BM_select_history_store(em->bm, eed);
@@ -1090,13 +1084,12 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short ring)
float co[2], tdist;
BM_face_calc_center_mean(f, cent);
- if (ED_view3d_project_float_object(vc.ar, cent, co, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- tdist = len_squared_v2v2(mvalf, co);
- if (tdist < best_dist) {
-/* printf("Best face: %p (%f)\n", f, tdist);*/
- best_dist = tdist;
- efa = f;
- }
+ ED_view3d_project_float_noclip(vc.ar, cent, co);
+ tdist = len_squared_v2v2(mvalf, co);
+ if (tdist < best_dist) {
+/* printf("Best face: %p (%f)\n", f, tdist);*/
+ best_dist = tdist;
+ efa = f;
}
}
}
diff --git a/source/blender/editors/mesh/editmesh_slide.c b/source/blender/editors/mesh/editmesh_slide.c
index eaf0c14a0a8..bd1d13f3528 100644
--- a/source/blender/editors/mesh/editmesh_slide.c
+++ b/source/blender/editors/mesh/editmesh_slide.c
@@ -381,23 +381,22 @@ static BMEdge *vtx_slide_nrst_in_frame(VertexSlideOp *vso, const float mval[2])
BMEdge *edge = NULL;
float v1_proj[3], v2_proj[3];
+ float dist = 0;
float min_dist = FLT_MAX;
for (i = 0; i < vso->disk_edges; i++) {
edge = vso->edge_frame[i];
mul_v3_m4v3(v1_proj, vso->obj->obmat, edge->v1->co);
+ ED_view3d_project_float_noclip(vso->active_region, v1_proj, v1_proj);
+
mul_v3_m4v3(v2_proj, vso->obj->obmat, edge->v2->co);
+ ED_view3d_project_float_noclip(vso->active_region, v2_proj, v2_proj);
- /* we could use ED_view3d_project_float_object here, but for now dont since we dont have the context */
- if ((ED_view3d_project_float_global(vso->active_region, v1_proj, v1_proj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) &&
- (ED_view3d_project_float_global(vso->active_region, v2_proj, v2_proj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK))
- {
- const float dist = dist_to_line_segment_v2(mval, v1_proj, v2_proj);
- if (dist < min_dist) {
- min_dist = dist;
- cl_edge = edge;
- }
+ dist = dist_to_line_segment_v2(mval, v1_proj, v2_proj);
+ if (dist < min_dist) {
+ min_dist = dist;
+ cl_edge = edge;
}
}
}
@@ -449,21 +448,17 @@ static void vtx_slide_update(VertexSlideOp *vso, wmEvent *event)
/* Calculate interpolation value for preview */
float t_val;
- float mval_float[2] = { (float)event->mval[0], (float)event->mval[1]};
+ float mval_float[] = { (float)event->mval[0], (float)event->mval[1]};
float closest_2d[2];
other = BM_edge_other_vert(edge, vso->start_vtx);
/* Project points onto screen and do interpolation in 2D */
mul_v3_m4v3(start_vtx_proj, vso->obj->obmat, vso->start_vtx->co);
- mul_v3_m4v3(edge_other_proj, vso->obj->obmat, other->co);
+ ED_view3d_project_float_noclip(vso->active_region, start_vtx_proj, start_vtx_proj);
- if ((ED_view3d_project_float_global(vso->active_region, edge_other_proj, edge_other_proj, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK) ||
- (ED_view3d_project_float_global(vso->active_region, start_vtx_proj, start_vtx_proj, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK))
- {
- /* not much we can do here */
- return;
- }
+ mul_v3_m4v3(edge_other_proj, vso->obj->obmat, other->co);
+ ED_view3d_project_float_noclip(vso->active_region, edge_other_proj, edge_other_proj);
closest_to_line_v2(closest_2d, mval_float, start_vtx_proj, edge_other_proj);
@@ -475,7 +470,7 @@ static void vtx_slide_update(VertexSlideOp *vso, wmEvent *event)
if (edge_len <= 0.0f)
edge_len = VTX_SLIDE_SNAP_THRSH;
- edge_len = (BM_edge_calc_length(edge) * VTX_SLIDE_SNAP_THRSH) / edge_len;
+ edge_len = (len_v3v3(edge->v1->co, edge->v2->co) * VTX_SLIDE_SNAP_THRSH) / edge_len;
vso->snap_threshold = edge_len;
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 891e1487781..a76d09827f0 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -153,22 +153,19 @@ void MESH_OT_subdivide(wmOperatorType *ot)
}
-void EMBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em)
+void EMBM_project_snap_verts(bContext *C, ARegion *ar, Object *obedit, BMEditMesh *em)
{
- Object *obedit = em->ob;
BMIter iter;
BMVert *eve;
- ED_view3d_init_mats_rv3d(obedit, ar->regiondata);
-
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
- float mval[2], co_proj[3], no_dummy[3];
+ float mval[2], vec[3], no_dummy[3];
int dist_dummy;
- if (ED_view3d_project_float_object(ar, eve->co, mval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- if (snapObjectsContext(C, mval, &dist_dummy, co_proj, no_dummy, SNAP_NOT_OBEDIT)) {
- mul_v3_m4v3(eve->co, obedit->imat, co_proj);
- }
+ mul_v3_m4v3(vec, obedit->obmat, eve->co);
+ ED_view3d_project_float_noclip(ar, vec, mval);
+ if (snapObjectsContext(C, mval, &dist_dummy, vec, no_dummy, SNAP_NOT_OBEDIT)) {
+ mul_v3_m4v3(eve->co, obedit->imat, vec);
}
}
}
@@ -442,17 +439,16 @@ static int edbm_extrude_mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
zero_v3(nor);
- /* XXX If those popup menus were to be enabled again, please get rid of this "menu string" syntax! */
if (em->selectmode & SCE_SELECT_VERTEX) {
if (em->bm->totvertsel == 0) nr = 0;
else if (em->bm->totvertsel == 1) nr = 4;
else if (em->bm->totedgesel == 0) nr = 4;
else if (em->bm->totfacesel == 0)
- nr = 3; /* pupmenu("Extrude %t|Only Edges %x3|Only Vertices %x4"); */
+ nr = 3; // pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4");
else if (em->bm->totfacesel == 1)
- nr = 1; /* pupmenu("Extrude %t|Region %x1|Only Edges% x3|Only Vertices %x4"); */
+ nr = 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4");
else
- nr = 1; /* pupmenu("Extrude %t|Region %x1|Individual Faces %x2|Only Edges %x3|Only Vertices %x4"); */
+ nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4");
}
else if (em->selectmode & SCE_SELECT_EDGE) {
if (em->bm->totedgesel == 0) nr = 0;
@@ -462,16 +458,16 @@ static int edbm_extrude_mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
else if (em->totedgesel == 1) nr = 3;
else if (em->totfacesel == 0) nr = 3;
else if (em->totfacesel == 1)
- nr = 1; /* pupmenu("Extrude %t|Region %x1|Only Edges %x3"); */
+ nr = 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3");
else
- nr = 1; /* pupmenu("Extrude %t|Region %x1|Individual Faces %x2|Only Edges %x3"); */
+ nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3");
#endif
}
else {
if (em->bm->totfacesel == 0) nr = 0;
else if (em->bm->totfacesel == 1) nr = 1;
else
- nr = 1; /* pupmenu("Extrude %t|Region %x1|Individual Faces %x2"); */
+ nr = 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2");
}
if (nr < 1) return 'g';
@@ -734,10 +730,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
short use_proj;
em_setup_viewcontext(C, &vc);
-
- ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d);
-
-
+
use_proj = ((vc.scene->toolsettings->snap_flag & SCE_SNAP) &&
(vc.scene->toolsettings->snap_mode == SCE_SNAP_MODE_FACE));
@@ -765,27 +758,27 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
done = FALSE;
BM_ITER_MESH (eed, &iter, vc.em->bm, BM_EDGES_OF_MESH) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
- float co1[2], co2[2];
-
- if ((ED_view3d_project_float_object(vc.ar, eed->v1->co, co1, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) &&
- (ED_view3d_project_float_object(vc.ar, eed->v2->co, co2, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK))
- {
- /* 2D rotate by 90d while adding.
- * (x, y) = (y, -x)
- *
- * accumulate the screenspace normal in 2D,
- * with screenspace edge length weighting the result. */
- if (line_point_side_v2(co1, co2, mval_f) >= 0.0f) {
- nor[0] += (co1[1] - co2[1]);
- nor[1] += -(co1[0] - co2[0]);
- }
- else {
- nor[0] += (co2[1] - co1[1]);
- nor[1] += -(co2[0] - co1[0]);
- }
- done = TRUE;
+ float co1[3], co2[3];
+ mul_v3_m4v3(co1, vc.obedit->obmat, eed->v1->co);
+ mul_v3_m4v3(co2, vc.obedit->obmat, eed->v2->co);
+ ED_view3d_project_float_noclip(vc.ar, co1, co1);
+ ED_view3d_project_float_noclip(vc.ar, co2, co2);
+
+ /* 2D rotate by 90d while adding.
+ * (x, y) = (y, -x)
+ *
+ * accumulate the screenspace normal in 2D,
+ * with screenspace edge length weighting the result. */
+ if (line_point_side_v2(co1, co2, mval_f) >= 0.0f) {
+ nor[0] += (co1[1] - co2[1]);
+ nor[1] += -(co1[0] - co2[0]);
+ }
+ else {
+ nor[0] += (co2[1] - co1[1]);
+ nor[1] += -(co2[0] - co1[0]);
}
}
+ done = TRUE;
}
if (done) {
@@ -842,7 +835,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
/* also project the source, for retopo workflow */
if (use_proj)
- EMBM_project_snap_verts(C, vc.ar, vc.em);
+ EMBM_project_snap_verts(C, vc.ar, vc.obedit, vc.em);
}
edbm_extrude_edge(vc.obedit, vc.em, BM_ELEM_SELECT, nor);
@@ -875,7 +868,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
}
if (use_proj)
- EMBM_project_snap_verts(C, vc.ar, vc.em);
+ EMBM_project_snap_verts(C, vc.ar, vc.obedit, vc.em);
/* This normally happens when pushing undo but modal operators
* like this one don't push undo data until after modal mode is
@@ -2147,7 +2140,7 @@ static int edbm_select_vertex_path_exec(bContext *C, wmOperator *op)
}
/* if those are not found, because vertices where selected by e.g.
- * border or circle select, find two selected vertices */
+ border or circle select, find two selected vertices */
if (svert == NULL) {
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (!BM_elem_flag_test(eve, BM_ELEM_SELECT) || BM_elem_flag_test(eve, BM_ELEM_HIDDEN))
@@ -2157,7 +2150,7 @@ static int edbm_select_vertex_path_exec(bContext *C, wmOperator *op)
else if (evert == NULL) evert = eve;
else {
/* more than two vertices are selected,
- * show warning message and cancel operator */
+ show warning message and cancel operator */
svert = evert = NULL;
break;
}
@@ -2533,6 +2526,11 @@ void MESH_OT_solidify(wmOperatorType *ot)
RNA_def_property_ui_range(prop, -10, 10, 0.1, 4);
}
+typedef struct CutCurve {
+ float x;
+ float y;
+} CutCurve;
+
/* ******************************************************************** */
/* Knife Subdivide Tool. Subdivides edges intersected by a mouse trail
* drawn by user.
@@ -2566,14 +2564,15 @@ static EnumPropertyItem knife_items[] = {
/* bm_edge_seg_isect() Determines if and where a mouse trail intersects an BMEdge */
-static float bm_edge_seg_isect(const float sco_a[2], const float sco_b[2],
- float (*mouse_path)[2], int len, char mode, int *isected)
+static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
+ struct GHash *gh, int *isected)
{
#define MAXSLOPE 100000
float x11, y11, x12 = 0, y12 = 0, x2max, x2min, y2max;
float y2min, dist, lastdist = 0, xdiff2, xdiff1;
float m1, b1, m2, b2, x21, x22, y21, y22, xi;
float yi, x1min, x1max, y1max, y1min, perc = 0;
+ float *scr;
float threshold = 0.0;
int i;
@@ -2581,11 +2580,13 @@ static float bm_edge_seg_isect(const float sco_a[2], const float sco_b[2],
// XXX threshold = scene->toolsettings->select_thresh / 100;
/* Get screen coords of verts */
- x21 = sco_a[0];
- y21 = sco_a[1];
+ scr = BLI_ghash_lookup(gh, e->v1);
+ x21 = scr[0];
+ y21 = scr[1];
- x22 = sco_b[0];
- y22 = sco_b[1];
+ scr = BLI_ghash_lookup(gh, e->v2);
+ x22 = scr[0];
+ y22 = scr[1];
xdiff2 = (x22 - x21);
if (xdiff2) {
@@ -2607,11 +2608,11 @@ static float bm_edge_seg_isect(const float sco_a[2], const float sco_b[2],
y11 = y12;
}
else {
- x11 = mouse_path[i][0];
- y11 = mouse_path[i][1];
+ x11 = c[i].x;
+ y11 = c[i].y;
}
- x12 = mouse_path[i][0];
- y12 = mouse_path[i][1];
+ x12 = c[i].x;
+ y12 = c[i].y;
/* test e->v1 */
if ((x11 == x21 && y11 == y21) || (x12 == x21 && y12 == y21)) {
@@ -2635,11 +2636,11 @@ static float bm_edge_seg_isect(const float sco_a[2], const float sco_b[2],
y11 = y12;
}
else {
- x11 = mouse_path[i][0];
- y11 = mouse_path[i][1];
+ x11 = c[i].x;
+ y11 = c[i].y;
}
- x12 = mouse_path[i][0];
- y12 = mouse_path[i][1];
+ x12 = c[i].x;
+ y12 = c[i].y;
/* Perp. Distance from point to line */
if (m2 != MAXSLOPE) dist = (y12 - m2 * x12 - b2); /* /sqrt(m2 * m2 + 1); Only looking for */
@@ -2717,9 +2718,9 @@ static float bm_edge_seg_isect(const float sco_a[2], const float sco_b[2],
lastdist = dist;
}
return perc;
-}
+}
-#define ELE_EDGE_CUT 1
+#define MAX_CUTS 2048
static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
{
@@ -2731,93 +2732,76 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
BMIter iter;
BMEdge *be;
BMOperator bmop;
+ CutCurve curve[MAX_CUTS];
+ struct GHash *gh;
float isect = 0.0f;
- int len = 0, isected, i;
+ float *scr, co[4];
+ int len = 0, isected;
short numcuts = 1, mode = RNA_int_get(op->ptr, "type");
-
- /* allocd vars */
- float (*screen_vert_coords)[2], (*sco)[2], (*mouse_path)[2];
/* edit-object needed for matrix, and ar->regiondata for projections to work */
if (ELEM3(NULL, obedit, ar, ar->regiondata))
return OPERATOR_CANCELLED;
if (bm->totvertsel < 2) {
- BKE_report(op->reports, RPT_ERROR, "No edges are selected to operate on");
- return OPERATOR_CANCELLED;
- }
-
- len = RNA_collection_length(op->ptr, "path");
-
- if (len < 2) {
- BKE_report(op->reports, RPT_ERROR, "Mouse path too short");
+ //error("No edges are selected to operate on");
return OPERATOR_CANCELLED;
}
- mouse_path = MEM_mallocN(len * sizeof(*mouse_path), __func__);
-
/* get the cut curve */
RNA_BEGIN(op->ptr, itemptr, "path")
{
- RNA_float_get_array(&itemptr, "loc", (float *)&mouse_path[len]);
+ RNA_float_get_array(&itemptr, "loc", (float *)&curve[len]);
+ len++;
+ if (len >= MAX_CUTS) {
+ break;
+ }
}
RNA_END;
-
- /* for ED_view3d_project_float_object */
- ED_view3d_init_mats_rv3d(obedit, ar->regiondata);
-
- /* TODO, investigate using index lookup for screen_vert_coords() rather then a hash table */
+
+ if (len < 2) {
+ return OPERATOR_CANCELLED;
+ }
/* the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer */
- screen_vert_coords = sco = MEM_mallocN(bm->totvert * sizeof(float) * 2, __func__);
-
- BM_ITER_MESH_INDEX (bv, &iter, bm, BM_VERTS_OF_MESH, i) {
- if (ED_view3d_project_float_object(ar, bv->co, *sco, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK) {
- copy_v2_fl(*sco, FLT_MAX); /* set error value */
- }
- BM_elem_index_set(bv, i); /* set_ok */
- sco++;
-
+ gh = BLI_ghash_ptr_new("knife cut exec");
+ for (bv = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); bv; bv = BM_iter_step(&iter)) {
+ scr = MEM_mallocN(sizeof(float) * 2, "Vertex Screen Coordinates");
+ copy_v3_v3(co, bv->co);
+ co[3] = 1.0f;
+ mul_m4_v4(obedit->obmat, co);
+ ED_view3d_project_float(ar, co, scr);
+ BLI_ghash_insert(gh, bv, scr);
}
- bm->elem_index_dirty &= ~BM_VERT; /* clear dirty flag */
if (!EDBM_op_init(em, &bmop, op, "subdivide_edges")) {
- MEM_freeN(mouse_path);
- MEM_freeN(screen_vert_coords);
return OPERATOR_CANCELLED;
}
/* store percentage of edge cut for KNIFE_EXACT here.*/
for (be = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); be; be = BM_iter_step(&iter)) {
- int is_cut = FALSE;
if (BM_elem_flag_test(be, BM_ELEM_SELECT)) {
- const float *sco_a = screen_vert_coords[BM_elem_index_get(be->v1)];
- const float *sco_b = screen_vert_coords[BM_elem_index_get(be->v2)];
-
- /* check for error value (vert cant be projected) */
- if ((sco_a[0] != FLT_MAX) && (sco_b[0] != FLT_MAX)) {
- isect = bm_edge_seg_isect(sco_a, sco_b, mouse_path, len, mode, &isected);
-
- if (isect != 0.0f) {
- if (mode != KNIFE_MULTICUT && mode != KNIFE_MIDPOINT) {
- BMO_slot_map_float_insert(bm, &bmop,
- "edgepercents",
- be, isect);
- }
+ isect = bm_edge_seg_isect(be, curve, len, mode, gh, &isected);
+
+ if (isect != 0.0f) {
+ if (mode != KNIFE_MULTICUT && mode != KNIFE_MIDPOINT) {
+ BMO_slot_map_float_insert(bm, &bmop,
+ "edgepercents",
+ be, isect);
+
}
+ BMO_elem_flag_enable(bm, be, 1);
+ }
+ else {
+ BMO_elem_flag_disable(bm, be, 1);
}
}
-
- BMO_elem_flag_set(bm, be, ELE_EDGE_CUT, is_cut);
+ else {
+ BMO_elem_flag_disable(bm, be, 1);
+ }
}
-
-
- /* free all allocs */
- MEM_freeN(screen_vert_coords);
- MEM_freeN(mouse_path);
-
-
- BMO_slot_buffer_from_enabled_flag(bm, &bmop, "edges", BM_EDGE, ELE_EDGE_CUT);
+
+ BMO_slot_buffer_from_enabled_flag(bm, &bmop, "edges", BM_EDGE, 1);
if (mode == KNIFE_MIDPOINT) numcuts = 1;
BMO_slot_int_set(&bmop, "numcuts", numcuts);
@@ -2832,14 +2816,14 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
+
+ BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN);
EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
}
-#undef ELE_EDGE_CUT
-
void MESH_OT_knife_cut(wmOperatorType *ot)
{
PropertyRNA *prop;
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index f265113708a..ef826c07cc1 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -1237,12 +1237,11 @@ int ED_mesh_pick_face_vert(bContext *C, Mesh *me, Object *ob, const int mval[2],
const int v_idx = me->mloop[mp->loopstart + fidx].v;
dm->getVertCo(dm, v_idx, co);
mul_m4_v3(ob->obmat, co);
- if (ED_view3d_project_float_global(ar, co, sco, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- len = len_squared_v2v2(mval_f, sco);
- if (len < len_best) {
- len_best = len;
- v_idx_best = v_idx;
- }
+ ED_view3d_project_float_noclip(ar, co, sco);
+ len = len_squared_v2v2(mval_f, sco);
+ if (len < len_best) {
+ len_best = len;
+ v_idx_best = v_idx;
}
} while (fidx--);
}
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index e9063687506..22ccd7bbed8 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -129,33 +129,37 @@ static int mball_select_all_exec(bContext *C, wmOperator *op)
MetaElem *ml;
int action = RNA_enum_get(op->ptr, "action");
- if (mb->editelems->first == NULL)
- return OPERATOR_CANCELLED;
-
- if (action == SEL_TOGGLE) {
- action = SEL_SELECT;
- for (ml = mb->editelems->first; ml; ml = ml->next) {
- if (ml->flag & SELECT) {
- action = SEL_DESELECT;
- break;
+ ml = mb->editelems->first;
+ if (ml) {
+ if (action == SEL_TOGGLE) {
+ action = SEL_SELECT;
+ while (ml) {
+ if (ml->flag & SELECT) {
+ action = SEL_DESELECT;
+ break;
+ }
+ ml = ml->next;
}
}
- }
- switch (action) {
- case SEL_SELECT:
- BKE_mball_select_all(mb);
- break;
- case SEL_DESELECT:
- BKE_mball_deselect_all(mb);
- break;
- case SEL_INVERT:
- BKE_mball_select_swap(mb);
- break;
+ ml = mb->editelems->first;
+ while (ml) {
+ switch (action) {
+ case SEL_SELECT:
+ ml->flag |= SELECT;
+ break;
+ case SEL_DESELECT:
+ ml->flag &= ~SELECT;
+ break;
+ case SEL_INVERT:
+ ml->flag ^= SELECT;
+ break;
+ }
+ ml = ml->next;
+ }
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, mb);
}
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, mb);
-
return OPERATOR_FINISHED;
}
@@ -417,7 +421,7 @@ int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int to
Object *obedit = CTX_data_edit_object(C);
ViewContext vc;
MetaBall *mb = (MetaBall *)obedit->data;
- MetaElem *ml, *ml_act = NULL;
+ MetaElem *ml, *act = NULL;
int a, hits;
unsigned int buffer[4 * MAXPICKBUF];
rcti rect;
@@ -447,14 +451,14 @@ int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int to
/* index converted for gl stuff */
if (ml->selcol1 == buffer[4 * a + 3]) {
ml->flag |= MB_SCALE_RAD;
- ml_act = ml;
+ act = ml;
}
if (ml->selcol2 == buffer[4 * a + 3]) {
ml->flag &= ~MB_SCALE_RAD;
- ml_act = ml;
+ act = ml;
}
}
- if (ml_act) break;
+ if (act) break;
ml = ml->next;
if (ml == NULL) ml = mb->editelems->first;
if (ml == startelem) break;
@@ -462,28 +466,31 @@ int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int to
/* When some metaelem was found, then it is necessary to select or
* deselect it. */
- if (ml_act) {
+ if (act) {
if (extend) {
- ml_act->flag |= SELECT;
+ act->flag |= SELECT;
}
else if (deselect) {
- ml_act->flag &= ~SELECT;
+ act->flag &= ~SELECT;
}
else if (toggle) {
- if (ml_act->flag & SELECT)
- ml_act->flag &= ~SELECT;
+ if (act->flag & SELECT)
+ act->flag &= ~SELECT;
else
- ml_act->flag |= SELECT;
+ act->flag |= SELECT;
}
else {
/* Deselect all existing metaelems */
- BKE_mball_deselect_all(mb);
-
+ ml = mb->editelems->first;
+ while (ml) {
+ ml->flag &= ~SELECT;
+ ml = ml->next;
+ }
/* Select only metaelem clicked on */
- ml_act->flag |= SELECT;
+ act->flag |= SELECT;
}
- mb->lastelem = ml_act;
+ mb->lastelem = act;
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, mb);
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 43a32cd662e..4942b9e4390 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -43,7 +43,6 @@
#include "DNA_meta_types.h"
#include "DNA_object_fluidsim.h"
#include "DNA_object_force.h"
-#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_speaker_types.h"
#include "DNA_vfont_types.h"
@@ -111,7 +110,7 @@
#include "object_intern.h"
/* this is an exact copy of the define in rna_lamp.c
- * kept here because of linking order.
+ * kept here because of linking order.
* Icons are only defined here */
EnumPropertyItem lamp_type_items[] = {
{LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source"},
@@ -122,23 +121,6 @@ EnumPropertyItem lamp_type_items[] = {
{0, NULL, 0, NULL, NULL}
};
-/* copy from rna_object_force.c */
-static EnumPropertyItem field_type_items[] = {
- {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", ""},
- {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", ""},
- {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", ""},
- {PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", ""},
- {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", ""},
- {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", ""},
- {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", ""},
- {PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", ""},
- {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", ""},
- {PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""},
- {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", ""},
- {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
/************************** Exported *****************************/
void ED_object_location_from_view(bContext *C, float loc[3])
@@ -146,7 +128,7 @@ void ED_object_location_from_view(bContext *C, float loc[3])
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);
float *cursor;
-
+
cursor = give_cursor(scene, v3d);
copy_v3_v3(loc, cursor);
@@ -170,44 +152,44 @@ void ED_object_base_init_transform(bContext *C, Base *base, const float loc[3],
{
Object *ob = base->object;
Scene *scene = CTX_data_scene(C);
-
+
if (!scene) return;
-
+
if (loc)
copy_v3_v3(ob->loc, loc);
-
+
if (rot)
copy_v3_v3(ob->rot, rot);
-
+
BKE_object_where_is_calc(scene, ob);
}
-/* Uses context to figure out transform for primitive.
- * Returns standard diameter. */
+/* uses context to figure out transform for primitive */
+/* returns standard diameter */
float ED_object_new_primitive_matrix(bContext *C, Object *obedit,
const float loc[3], const float rot[3], float primmat[][4])
{
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3];
-
+
unit_m4(primmat);
-
+
eul_to_mat3(rmat, rot);
invert_m3(rmat);
-
+
/* inverse transform for initial rotation and object */
copy_m3_m4(mat, obedit->obmat);
mul_m3_m3m3(cmat, rmat, mat);
invert_m3_m3(imat, cmat);
copy_m4_m3(primmat, imat);
-
+
/* center */
copy_v3_v3(primmat[3], loc);
sub_v3_v3v3(primmat[3], primmat[3], obedit->obmat[3]);
invert_m3_m3(imat, mat);
mul_m3_v3(imat, primmat[3]);
-
+
if (v3d)
return ED_view3d_grid_scale(scene, v3d, NULL);
@@ -224,7 +206,7 @@ static void view_align_update(struct Main *UNUSED(main), struct Scene *UNUSED(sc
void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
{
PropertyRNA *prop;
-
+
/* note: this property gets hidden for add-camera operator */
prop = RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
RNA_def_property_update_runtime(prop, view_align_update);
@@ -234,112 +216,112 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
"Enter editmode when adding this object");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
-
+
prop = RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location",
"Location for the newly added object", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation",
"Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f);
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
-
+
prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
-int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], float rot[3],
- int *enter_editmode, unsigned int *layer, int *is_view_aligned)
+static void object_add_generic_invoke_options(bContext *C, wmOperator *op)
{
- View3D *v3d = CTX_wm_view3d(C);
-
- /* Switch to Edit mode? */
- if (RNA_struct_find_property(op->ptr, "enter_editmode")) { /* optional */
- int _enter_editmode;
- if (!enter_editmode)
- enter_editmode = &_enter_editmode;
-
- if (RNA_struct_property_is_set(op->ptr, "enter_editmode") && enter_editmode)
- *enter_editmode = RNA_boolean_get(op->ptr, "enter_editmode");
- else {
- *enter_editmode = U.flag & USER_ADD_EDITMODE;
- RNA_boolean_set(op->ptr, "enter_editmode", *enter_editmode);
- }
+ if (RNA_struct_find_property(op->ptr, "enter_editmode")) /* optional */
+ if (!RNA_struct_property_is_set(op->ptr, "enter_editmode"))
+ RNA_boolean_set(op->ptr, "enter_editmode", U.flag & USER_ADD_EDITMODE);
+
+ if (!RNA_struct_property_is_set(op->ptr, "location")) {
+ float loc[3];
+
+ ED_object_location_from_view(C, loc);
+ RNA_float_set_array(op->ptr, "location", loc);
}
+
+ if (!RNA_struct_property_is_set(op->ptr, "layers")) {
+ View3D *v3d = CTX_wm_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ int a, values[20], layer;
- /* Get layers! */
- {
- int a, layer_values[20];
- unsigned int _layer;
- if (!layer)
- layer = &_layer;
-
- if (RNA_struct_property_is_set(op->ptr, "layers")) {
- RNA_boolean_get_array(op->ptr, "layers", layer_values);
- *layer = 0;
- for (a = 0; a < 20; a++) {
- if (layer_values[a])
- *layer |= (1 << a);
- }
+ if (v3d) {
+ layer = (v3d->scenelock && !v3d->localvd) ? scene->layact : v3d->layact;
}
else {
- Scene *scene = CTX_data_scene(C);
- if (v3d)
- *layer = (v3d->scenelock && !v3d->localvd) ? scene->layact : v3d->layact;
- else
- *layer = scene->layact;
- for (a = 0; a < 20; a++) {
- layer_values[a] = *layer & (1 << a);
- }
- RNA_boolean_set_array(op->ptr, "layers", layer_values);
+ layer = scene->layact;
+ }
+
+ for (a = 0; a < 20; a++) {
+ values[a] = (layer & (1 << a));
}
- /* in local view we additionally add local view layers,
- * not part of operator properties */
- if (v3d && v3d->localvd)
- *layer |= v3d->lay;
+ RNA_boolean_set_array(op->ptr, "layers", values);
}
+}
- /* Location! */
- {
- float _loc[3];
- if (!loc)
- loc = _loc;
+int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+{
+ object_add_generic_invoke_options(C, op);
+ return op->type->exec(C, op);
+}
- if (RNA_struct_property_is_set(op->ptr, "location")) {
- RNA_float_get_array(op->ptr, "location", loc);
- }
- else {
- ED_object_location_from_view(C, loc);
- RNA_float_set_array(op->ptr, "location", loc);
- }
+int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], float rot[3],
+ int *enter_editmode, unsigned int *layer, int *is_view_aligned)
+{
+ View3D *v3d = CTX_wm_view3d(C);
+ int a, layer_values[20];
+ int view_align;
+
+ *enter_editmode = FALSE;
+ if (RNA_struct_find_property(op->ptr, "enter_editmode") && RNA_boolean_get(op->ptr, "enter_editmode")) {
+ *enter_editmode = TRUE;
}
- /* Rotation! */
- {
- int _is_view_aligned;
- float _rot[3];
- if (!is_view_aligned)
- is_view_aligned = &_is_view_aligned;
- if (!rot)
- rot = _rot;
-
- if (RNA_struct_property_is_set(op->ptr, "rotation"))
- *is_view_aligned = FALSE;
- else if (RNA_struct_property_is_set(op->ptr, "view_align"))
- *is_view_aligned = RNA_boolean_get(op->ptr, "view_align");
- else {
- *is_view_aligned = U.flag & USER_ADD_VIEWALIGNED;
- RNA_boolean_set(op->ptr, "view_align", *is_view_aligned);
- }
-
- if (*is_view_aligned) {
- ED_object_rotation_from_view(C, rot);
- RNA_float_set_array(op->ptr, "rotation", rot);
+ if (RNA_struct_property_is_set(op->ptr, "layers")) {
+ RNA_boolean_get_array(op->ptr, "layers", layer_values);
+ *layer = 0;
+ for (a = 0; a < 20; a++) {
+ if (layer_values[a])
+ *layer |= (1 << a);
+ else
+ *layer &= ~(1 << a);
}
- else
- RNA_float_get_array(op->ptr, "rotation", rot);
}
+ else {
+ /* not set, use the scenes layers */
+ Scene *scene = CTX_data_scene(C);
+ *layer = scene->layact;
+ }
+
+ /* in local view we additionally add local view layers,
+ * not part of operator properties */
+ if (v3d && v3d->localvd)
+ *layer |= v3d->lay;
- if (layer && *layer == 0) {
+ if (RNA_struct_property_is_set(op->ptr, "rotation"))
+ view_align = FALSE;
+ else if (RNA_struct_property_is_set(op->ptr, "view_align"))
+ view_align = RNA_boolean_get(op->ptr, "view_align");
+ else {
+ view_align = U.flag & USER_ADD_VIEWALIGNED;
+ RNA_boolean_set(op->ptr, "view_align", view_align);
+ }
+
+ if (view_align) {
+ ED_object_rotation_from_view(C, rot);
+ RNA_float_set_array(op->ptr, "rotation", rot);
+ }
+ else
+ RNA_float_get_array(op->ptr, "rotation", rot);
+
+ if (is_view_aligned)
+ *is_view_aligned = view_align;
+
+ RNA_float_get_array(op->ptr, "location", loc);
+
+ if (*layer == 0) {
BKE_report(op->reports, RPT_ERROR, "Property 'layer' has no values set");
return 0;
}
@@ -347,19 +329,19 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], fl
return 1;
}
-/* For object add primitive operators.
- * Do not call undo push in this function (users of this function have to). */
+/* for object add primitive operators */
+/* do not call undo push in this function (users of this function have to) */
Object *ED_object_add_type(bContext *C, int type, const float loc[3], const float rot[3],
int enter_editmode, unsigned int layer)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
Object *ob;
-
- /* For as long scene has editmode... */
+
+ /* for as long scene has editmode... */
if (CTX_data_edit_object(C))
ED_object_exit_editmode(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); /* freedata, and undo */
-
+
/* deselects all, sets scene->basact */
ob = BKE_object_add(scene, type);
BASACT->lay = ob->lay = layer;
@@ -389,12 +371,12 @@ static int object_add_exec(bContext *C, wmOperator *op)
int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
-
+
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ED_object_add_type(C, RNA_enum_get(op->ptr, "type"), loc, rot, enter_editmode, layer);
-
+
return OPERATOR_FINISHED;
}
@@ -404,62 +386,89 @@ void OBJECT_OT_add(wmOperatorType *ot)
ot->name = "Add Object";
ot->description = "Add an object to the scene";
ot->idname = "OBJECT_OT_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = object_add_exec;
+
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
RNA_def_enum(ot->srna, "type", object_type_items, 0, "Type", "");
ED_object_add_generic_props(ot, TRUE);
}
/********************* Add Effector Operator ********************/
+/* copy from rna_object_force.c*/
+static EnumPropertyItem field_type_items[] = {
+ {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", ""},
+ {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", ""},
+ {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", ""},
+ {PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", ""},
+ {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", ""},
+ {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", ""},
+ {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", ""},
+ {PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", ""},
+ {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", ""},
+ {PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""},
+ {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", ""},
+ {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""},
+ {0, NULL, 0, NULL, NULL}};
-/* for object add operator */
-static int effector_add_exec(bContext *C, wmOperator *op)
+/* for effector add primitive operators */
+static Object *effector_add_type(bContext *C, wmOperator *op, int type)
{
Object *ob;
- int type, enter_editmode;
+ int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
float mat[4][4];
+
+ object_add_generic_invoke_options(C, op);
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
- return OPERATOR_CANCELLED;
-
- type = RNA_enum_get(op->ptr, "type");
+ return NULL;
if (type == PFIELD_GUIDE) {
ob = ED_object_add_type(C, OB_CURVE, loc, rot, FALSE, layer);
- if (!ob)
- return OPERATOR_CANCELLED;
-
rename_id(&ob->id, "CurveGuide");
+
((Curve *)ob->data)->flag |= CU_PATH | CU_3D;
ED_object_enter_editmode(C, 0);
ED_object_new_primitive_matrix(C, ob, loc, rot, mat);
BLI_addtail(object_editcurve_get(ob), add_nurbs_primitive(C, ob, mat, CU_NURBS | CU_PRIM_PATH, 1));
+
if (!enter_editmode)
ED_object_exit_editmode(C, EM_FREEDATA);
}
else {
ob = ED_object_add_type(C, OB_EMPTY, loc, rot, FALSE, layer);
- if (!ob)
- return OPERATOR_CANCELLED;
-
rename_id(&ob->id, "Field");
- if (ELEM(type, PFIELD_WIND, PFIELD_VORTEX))
- ob->empty_drawtype = OB_SINGLE_ARROW;
+
+ switch (type) {
+ case PFIELD_WIND:
+ case PFIELD_VORTEX:
+ ob->empty_drawtype = OB_SINGLE_ARROW;
+ break;
+ }
}
ob->pd = object_add_collision_fields(type);
DAG_scene_sort(CTX_data_main(C), CTX_data_scene(C));
+ return ob;
+}
+
+/* for object add operator */
+static int effector_add_exec(bContext *C, wmOperator *op)
+{
+ if (effector_add_type(C, op, RNA_enum_get(op->ptr, "type")) == NULL)
+ return OPERATOR_CANCELLED;
+
return OPERATOR_FINISHED;
}
@@ -469,20 +478,22 @@ void OBJECT_OT_effector_add(wmOperatorType *ot)
ot->name = "Add Effector";
ot->description = "Add an empty object with a physics effector to the scene";
ot->idname = "OBJECT_OT_effector_add";
-
+
/* api callbacks */
+ ot->invoke = WM_menu_invoke;
ot->exec = effector_add_exec;
+
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
ot->prop = RNA_def_enum(ot->srna, "type", field_type_items, 0, "Type", "");
ED_object_add_generic_props(ot, TRUE);
}
-/********************* Add Camera Operator ********************/
+/* ***************** Add Camera *************** */
static int object_camera_add_exec(bContext *C, wmOperator *op)
{
@@ -492,15 +503,17 @@ static int object_camera_add_exec(bContext *C, wmOperator *op)
int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
-
+
/* force view align for cameras */
RNA_boolean_set(op->ptr, "view_align", TRUE);
+
+ object_add_generic_invoke_options(C, op);
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ob = ED_object_add_type(C, OB_CAMERA, loc, rot, FALSE, layer);
-
+
if (v3d) {
if (v3d->camera == NULL)
v3d->camera = ob;
@@ -515,62 +528,83 @@ static int object_camera_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_camera_add(wmOperatorType *ot)
{
PropertyRNA *prop;
-
+
/* identifiers */
ot->name = "Add Camera";
ot->description = "Add a camera object to the scene";
ot->idname = "OBJECT_OT_camera_add";
-
+
/* api callbacks */
ot->exec = object_camera_add_exec;
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
ED_object_add_generic_props(ot, TRUE);
-
+
/* hide this for cameras, default */
prop = RNA_struct_type_find_property(ot->srna, "view_align");
RNA_def_property_flag(prop, PROP_HIDDEN);
-}
+}
-/********************* Add Metaball Operator ********************/
+/* ***************** add primitives *************** */
static int object_metaball_add_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
+ /*MetaElem *elem;*/ /*UNUSED*/
int newob = 0;
int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
float mat[4][4];
+ object_add_generic_invoke_options(C, op); /* XXX these props don't get set right when only exec() is called */
+
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
-
+
if (obedit == NULL || obedit->type != OB_MBALL) {
obedit = ED_object_add_type(C, OB_MBALL, loc, rot, TRUE, layer);
newob = 1;
}
- else
- DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
-
+ else DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
+
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
-
- add_metaball_primitive(C, obedit, mat, RNA_enum_get(op->ptr, "type"), newob);
+
+ /* elem= (MetaElem *) */ add_metaball_primitive(C, obedit, mat, RNA_enum_get(op->ptr, "type"), newob);
/* userdef */
if (newob && !enter_editmode) {
ED_object_exit_editmode(C, EM_FREEDATA);
}
-
+
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit);
-
+
return OPERATOR_FINISHED;
}
+static int object_metaball_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+{
+ Object *obedit = CTX_data_edit_object(C);
+ uiPopupMenu *pup;
+ uiLayout *layout;
+
+ object_add_generic_invoke_options(C, op);
+
+ pup = uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ layout = uiPupMenuLayout(pup);
+ if (!obedit || obedit->type == OB_MBALL)
+ uiItemsEnumO(layout, op->type->idname, "type");
+ else
+ uiItemsEnumO(layout, "OBJECT_OT_metaball_add", "type");
+ uiPupMenuEnd(C, pup);
+
+ return OPERATOR_CANCELLED;
+}
+
void OBJECT_OT_metaball_add(wmOperatorType *ot)
{
/* identifiers */
@@ -579,37 +613,35 @@ void OBJECT_OT_metaball_add(wmOperatorType *ot)
ot->idname = "OBJECT_OT_metaball_add";
/* api callbacks */
- ot->invoke = WM_menu_invoke;/* object_metaball_add_invoke; */
+ ot->invoke = object_metaball_add_invoke;
ot->exec = object_metaball_add_exec;
ot->poll = ED_operator_scene_editable;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- ot->prop = RNA_def_enum(ot->srna, "type", metaelem_type_items, 0, "Primitive", "");
-
+
+ RNA_def_enum(ot->srna, "type", metaelem_type_items, 0, "Primitive", "");
ED_object_add_generic_props(ot, TRUE);
}
-/********************* Add Text Operator ********************/
-
static int object_add_text_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
-
+
+ object_add_generic_invoke_options(C, op); /* XXX these props don't get set right when only exec() is called */
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
-
+
if (obedit && obedit->type == OB_FONT)
return OPERATOR_CANCELLED;
obedit = ED_object_add_type(C, OB_FONT, loc, rot, enter_editmode, layer);
-
+
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit);
-
+
return OPERATOR_FINISHED;
}
@@ -619,18 +651,17 @@ void OBJECT_OT_text_add(wmOperatorType *ot)
ot->name = "Add Text";
ot->description = "Add a text object to the scene";
ot->idname = "OBJECT_OT_text_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = object_add_text_exec;
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
-/********************* Add Armature Operator ********************/
-
static int object_armature_add_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
@@ -641,6 +672,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
+ object_add_generic_invoke_options(C, op); /* XXX these props don't get set right when only exec() is called */
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
@@ -655,76 +687,36 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Cannot create editmode armature");
return OPERATOR_CANCELLED;
}
-
+
/* v3d and rv3d are allowed to be NULL */
add_primitive_bone(CTX_data_scene(C), v3d, rv3d);
/* userdef */
if (newob && !enter_editmode)
ED_object_exit_editmode(C, EM_FREEDATA);
-
+
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit);
-
+
return OPERATOR_FINISHED;
}
void OBJECT_OT_armature_add(wmOperatorType *ot)
-{
+{
/* identifiers */
ot->name = "Add Armature";
ot->description = "Add an armature object to the scene";
ot->idname = "OBJECT_OT_armature_add";
-
+
/* api callbacks */
+ ot->invoke = ED_object_add_generic_invoke;
ot->exec = object_armature_add_exec;
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
ED_object_add_generic_props(ot, TRUE);
}
-/********************* Add Empty Operator ********************/
-
-static int object_empty_add_exec(bContext *C, wmOperator *op)
-{
- Object *ob;
- int type = RNA_enum_get(op->ptr, "type");
- unsigned int layer;
- float loc[3], rot[3];
-
- if (!ED_object_add_generic_get_opts(C, op, loc, rot, NULL, &layer, NULL))
- return OPERATOR_CANCELLED;
-
- ob = ED_object_add_type(C, OB_EMPTY, loc, rot, FALSE, layer);
- ob->empty_drawtype = type;
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_empty_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Add Empty";
- ot->description = "Add an empty object to the scene";
- ot->idname = "OBJECT_OT_empty_add";
-
- /* api callbacks */
- ot->invoke = WM_menu_invoke;
- ot->exec = object_empty_add_exec;
- ot->poll = ED_operator_objectmode;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
- ot->prop = RNA_def_enum(ot->srna, "type", object_empty_drawtype_items, 0, "Type", "");
-
- ED_object_add_generic_props(ot, FALSE);
-}
-
-/********************* Add Lamp Operator ********************/
-
static const char *get_lamp_defname(int type)
{
switch (type) {
@@ -744,10 +736,12 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
Object *ob;
Lamp *la;
int type = RNA_enum_get(op->ptr, "type");
+ int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
-
- if (!ED_object_add_generic_get_opts(C, op, loc, rot, NULL, &layer, NULL))
+
+ object_add_generic_invoke_options(C, op);
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ob = ED_object_add_type(C, OB_LAMP, loc, rot, FALSE, layer);
@@ -761,7 +755,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
ED_node_shader_default(scene, &la->id);
la->use_nodes = TRUE;
}
-
+
return OPERATOR_FINISHED;
}
@@ -771,12 +765,12 @@ void OBJECT_OT_lamp_add(wmOperatorType *ot)
ot->name = "Add Lamp";
ot->description = "Add a lamp object to the scene";
ot->idname = "OBJECT_OT_lamp_add";
-
+
/* api callbacks */
ot->invoke = WM_menu_invoke;
ot->exec = object_lamp_add_exec;
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -786,16 +780,16 @@ void OBJECT_OT_lamp_add(wmOperatorType *ot)
ED_object_add_generic_props(ot, FALSE);
}
-/********************* Add Group Instance Operator ********************/
-
static int group_instance_add_exec(bContext *C, wmOperator *op)
{
Group *group = BLI_findlink(&CTX_data_main(C)->group, RNA_enum_get(op->ptr, "group"));
+ int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
-
- if (!ED_object_add_generic_get_opts(C, op, loc, rot, NULL, &layer, NULL))
+
+ object_add_generic_invoke_options(C, op);
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
if (group) {
@@ -818,45 +812,20 @@ static int group_instance_add_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
-/* only used as menu */
-void OBJECT_OT_group_instance_add(wmOperatorType *ot)
-{
- PropertyRNA *prop;
-
- /* identifiers */
- ot->name = "Add Group Instance";
- ot->description = "Add a dupligroup instance";
- ot->idname = "OBJECT_OT_group_instance_add";
-
- /* api callbacks */
- ot->invoke = WM_enum_search_invoke;
- ot->exec = group_instance_add_exec;
- ot->poll = ED_operator_objectmode;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
- prop = RNA_def_enum(ot->srna, "group", DummyRNA_NULL_items, 0, "Group", "");
- RNA_def_enum_funcs(prop, RNA_group_itemf);
- ot->prop = prop;
- ED_object_add_generic_props(ot, FALSE);
-}
-
-/********************* Add Speaker Operator ********************/
-
static int object_speaker_add_exec(bContext *C, wmOperator *op)
{
Object *ob;
+ int enter_editmode;
unsigned int layer;
float loc[3], rot[3];
Scene *scene = CTX_data_scene(C);
- if (!ED_object_add_generic_get_opts(C, op, loc, rot, NULL, &layer, NULL))
+ object_add_generic_invoke_options(C, op);
+ if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL))
return OPERATOR_CANCELLED;
ob = ED_object_add_type(C, OB_SPEAKER, loc, rot, FALSE, layer);
-
+
/* to make it easier to start using this immediately in NLA, a default sound clip is created
* ready to be moved around to retime the sound and/or make new sound clips
*/
@@ -867,14 +836,14 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op)
NlaStrip *strip = add_nla_soundstrip(CTX_data_scene(C), ob->data);
strip->start = CFRA;
strip->end += strip->start;
-
+
/* hook them up */
BKE_nlatrack_add_strip(nlt, strip);
-
+
/* auto-name the strip, and give the track an interesting name */
strcpy(nlt->name, "SoundTrack");
BKE_nlastrip_validate_name(adt, strip);
-
+
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL);
}
@@ -898,6 +867,32 @@ void OBJECT_OT_speaker_add(wmOperatorType *ot)
ED_object_add_generic_props(ot, TRUE);
}
+/* only used as menu */
+void OBJECT_OT_group_instance_add(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name = "Add Group Instance";
+ ot->description = "Add a dupligroup instance";
+ ot->idname = "OBJECT_OT_group_instance_add";
+
+ /* api callbacks */
+ ot->invoke = WM_enum_search_invoke;
+ ot->exec = group_instance_add_exec;
+
+ ot->poll = ED_operator_objectmode;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* properties */
+ prop = RNA_def_enum(ot->srna, "group", DummyRNA_NULL_items, 0, "Group", "");
+ RNA_def_enum_funcs(prop, RNA_group_itemf);
+ ot->prop = prop;
+ ED_object_add_generic_props(ot, FALSE);
+}
+
/**************************** Delete Object *************************/
static void object_delete_check_glsl_update(Object *ob)
@@ -906,7 +901,7 @@ static void object_delete_check_glsl_update(Object *ob)
* are being tagged to be updated when object is removing from scene
*/
if (ob->type == OB_LAMP) {
- if (ob->gpulamp.first)
+ if (ob->gpulamp.first)
GPU_lamp_free(ob);
}
}
@@ -928,12 +923,16 @@ static int object_delete_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
const short use_global = RNA_boolean_get(op->ptr, "use_global");
-
+ /* int is_lamp = FALSE; */ /* UNUSED */
+
if (CTX_data_edit_object(C))
return OPERATOR_CANCELLED;
-
+
CTX_DATA_BEGIN (C, Base *, base, selected_bases)
{
+
+ /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */
+
/* deselect object -- it could be used in other scenes */
base->object->flag &= ~SELECT;
@@ -960,10 +959,10 @@ static int object_delete_exec(bContext *C, wmOperator *op)
DAG_scene_sort(bmain, scene);
DAG_ids_flush_update(bmain, 0);
-
+
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
-
+
return OPERATOR_FINISHED;
}
@@ -973,12 +972,12 @@ void OBJECT_OT_delete(wmOperatorType *ot)
ot->name = "Delete";
ot->description = "Delete selected objects";
ot->idname = "OBJECT_OT_delete";
-
+
/* api callbacks */
ot->invoke = WM_operator_confirm;
ot->exec = object_delete_exec;
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -994,29 +993,29 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
Material *ma, *mao;
ID *id;
int a;
-
+
/* XXX check object pointers */
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
{
BKE_object_relink(ob);
}
CTX_DATA_END;
-
+
/* materials */
if (dupflag & USER_DUP_MAT) {
mao = bmain->mat.first;
while (mao) {
if (mao->id.newid) {
+
ma = (Material *)mao->id.newid;
-
+
if (dupflag & USER_DUP_TEX) {
for (a = 0; a < MAX_MTEX; a++) {
if (ma->mtex[a]) {
id = (ID *)ma->mtex[a]->tex;
if (id) {
ID_NEW_US(ma->mtex[a]->tex)
- else
- ma->mtex[a]->tex = BKE_texture_copy(ma->mtex[a]->tex);
+ else ma->mtex[a]->tex = BKE_texture_copy(ma->mtex[a]->tex);
id->us--;
}
}
@@ -1026,8 +1025,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
id = (ID *)ma->ipo;
if (id) {
ID_NEW_US(ma->ipo)
- else
- ma->ipo = copy_ipo(ma->ipo);
+ else ma->ipo = copy_ipo(ma->ipo);
id->us--;
}
#endif // XXX old animation system
@@ -1035,7 +1033,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
mao = mao->id.next;
}
}
-
+
#if 0 // XXX old animation system
/* lamps */
if (dupflag & USER_DUP_IPO) {
@@ -1046,15 +1044,14 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
id = (ID *)lan->ipo;
if (id) {
ID_NEW_US(lan->ipo)
- else
- lan->ipo = copy_ipo(lan->ipo);
+ else lan->ipo = copy_ipo(lan->ipo);
id->us--;
}
}
la = la->id.next;
}
}
-
+
/* ipos */
ipo = bmain->ipo.first;
while (ipo) {
@@ -1070,9 +1067,9 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
ipo = ipo->id.next;
}
#endif // XXX old animation system
-
+
set_sca_new_poins();
-
+
clear_id_newpoins();
}
@@ -1085,17 +1082,17 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
ListBase *lb;
DupliObject *dob;
GHash *dupli_gh = NULL, *parent_gh = NULL;
-
+
if (!(base->object->transflag & OB_DUPLI))
return;
-
- lb = object_duplilist(scene, base->object, FALSE);
+
+ lb = object_duplilist(scene, base->object);
if (use_hierarchy || use_base_parent) {
dupli_gh = BLI_ghash_ptr_new("make_object_duplilist_real dupli_gh");
parent_gh = BLI_ghash_pair_new("make_object_duplilist_real parent_gh");
}
-
+
for (dob = lb->first; dob; dob = dob->next) {
Base *basen;
Object *ob = BKE_object_copy(dob->ob);
@@ -1103,24 +1100,24 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
* should be implemented better...
*/
if (ob->mat == NULL) ob->totcol = 0;
-
+
basen = MEM_dupallocN(base);
basen->flag &= ~(OB_FROMDUPLI | OB_FROMGROUP);
ob->flag = basen->flag;
basen->lay = base->lay;
BLI_addhead(&scene->base, basen); /* addhead: othwise eternal loop */
basen->object = ob;
-
+
/* make sure apply works */
BKE_free_animdata(&ob->id);
ob->adt = NULL;
-
+
ob->parent = NULL;
ob->constraints.first = ob->constraints.last = NULL;
ob->disp.first = ob->disp.last = NULL;
ob->transflag &= ~OB_DUPLI;
ob->lay = base->lay;
-
+
copy_m4_m4(ob->obmat, dob->mat);
BKE_object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
@@ -1129,7 +1126,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
if (parent_gh)
BLI_ghash_insert(parent_gh, BLI_ghashutil_pairalloc(dob->ob, SET_INT_IN_POINTER(dob->index)), ob);
}
-
+
if (use_hierarchy) {
for (dob = lb->first; dob; dob = dob->next) {
/* original parents */
@@ -1189,6 +1186,8 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
invert_m4_m4(ob_dst->parentinv, dob->mat);
BKE_object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB);
+
+
}
}
@@ -1198,9 +1197,9 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
BLI_ghash_free(parent_gh, BLI_ghashutil_pairfree, NULL);
copy_object_set_idnew(C, 0);
-
+
free_object_duplilist(lb);
-
+
base->object->transflag &= ~OB_DUPLI;
}
@@ -1211,9 +1210,9 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
const short use_base_parent = RNA_boolean_get(op->ptr, "use_base_parent");
const short use_hierarchy = RNA_boolean_get(op->ptr, "use_hierarchy");
-
+
clear_id_newpoins();
-
+
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
{
make_object_duplilist_real(C, scene, base, use_base_parent, use_hierarchy);
@@ -1227,22 +1226,23 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SCENE, scene);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
-
+
return OPERATOR_FINISHED;
}
void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
{
+
/* identifiers */
ot->name = "Make Duplicates Real";
ot->description = "Make dupli objects attached to this object real";
ot->idname = "OBJECT_OT_duplicates_make_real";
-
+
/* api callbacks */
ot->exec = object_duplicates_make_real_exec;
-
+
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -1616,12 +1616,12 @@ void OBJECT_OT_convert(wmOperatorType *ot)
ot->name = "Convert to";
ot->description = "Convert selected objects to another type";
ot->idname = "OBJECT_OT_convert";
-
+
/* api callbacks */
ot->invoke = WM_menu_invoke;
ot->exec = convert_exec;
ot->poll = convert_poll;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -1655,12 +1655,12 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
else {
obn = BKE_object_copy(ob);
obn->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
-
+
basen = MEM_mallocN(sizeof(Base), "duplibase");
*basen = *base;
BLI_addhead(&scene->base, basen); /* addhead: prevent eternal loop */
basen->object = obn;
-
+
if (basen->flag & OB_FROMGROUP) {
Group *group;
for (group = bmain->group.first; group; group = group->id.next) {
@@ -1668,21 +1668,20 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
add_to_group(group, obn, scene, basen);
}
}
-
+
/* duplicates using userflags */
if (dupflag & USER_DUP_ACT) {
BKE_copy_animdata_id_action(&obn->id);
}
-
+
if (dupflag & USER_DUP_MAT) {
for (a = 0; a < obn->totcol; a++) {
id = (ID *)obn->mat[a];
if (id) {
ID_NEW_US(obn->mat[a])
- else
- obn->mat[a] = BKE_material_copy(obn->mat[a]);
+ else obn->mat[a] = BKE_material_copy(obn->mat[a]);
id->us--;
-
+
if (dupflag & USER_DUP_ACT) {
BKE_copy_animdata_id_action(&obn->mat[a]->id);
}
@@ -1695,9 +1694,8 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
id = (ID *) psys->part;
if (id) {
ID_NEW_US(psys->part)
- else
- psys->part = BKE_particlesettings_copy(psys->part);
-
+ else psys->part = BKE_particlesettings_copy(psys->part);
+
if (dupflag & USER_DUP_ACT) {
BKE_copy_animdata_id_action(&psys->part->id);
}
@@ -1706,19 +1704,21 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
}
}
-
+
id = obn->data;
didit = 0;
-
+
switch (obn->type) {
case OB_MESH:
if (dupflag & USER_DUP_MESH) {
ID_NEW_US2(obn->data)
else {
obn->data = BKE_mesh_copy(obn->data);
+
if (obn->fluidsimSettings) {
obn->fluidsimSettings->orgMesh = (Mesh *)obn->data;
}
+
didit = 1;
}
id->us--;
@@ -1774,10 +1774,11 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
id->us--;
}
break;
+
case OB_ARMATURE:
obn->recalc |= OB_RECALC_DATA;
- if (obn->pose)
- obn->pose->flag |= POSE_RECALC;
+ if (obn->pose) obn->pose->flag |= POSE_RECALC;
+
if (dupflag & USER_DUP_ARM) {
ID_NEW_US2(obn->data)
else {
@@ -1787,7 +1788,9 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
id->us--;
}
+
break;
+
case OB_LATTICE:
if (dupflag != 0) {
ID_NEW_US2(obn->data)
@@ -1818,12 +1821,13 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
id->us--;
}
break;
+
}
/* check if obdata is copied */
if (didit) {
Key *key = BKE_key_from_object(obn);
-
+
if (dupflag & USER_DUP_ACT) {
bActuator *act;
@@ -1842,7 +1846,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
}
}
-
+
if (dupflag & USER_DUP_MAT) {
matarar = give_matarar(obn);
if (matarar) {
@@ -1850,8 +1854,8 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
id = (ID *)(*matarar)[a];
if (id) {
ID_NEW_US((*matarar)[a])
- else
- (*matarar)[a] = BKE_material_copy((*matarar)[a]);
+ else (*matarar)[a] = BKE_material_copy((*matarar)[a]);
+
id->us--;
}
}
@@ -1902,14 +1906,14 @@ static int duplicate_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
int linked = RNA_boolean_get(op->ptr, "linked");
int dupflag = (linked) ? 0 : U.dupflag;
-
+
clear_id_newpoins();
clear_sca_new_poins(); /* sensor/contr/act */
-
+
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
{
Base *basen = object_add_duplicate_internal(bmain, scene, base, dupflag);
-
+
/* note that this is safe to do with this context iterator,
* the list is made in advance */
ED_base_object_select(base, BA_DESELECT);
@@ -1941,19 +1945,19 @@ static int duplicate_exec(bContext *C, wmOperator *op)
void OBJECT_OT_duplicate(wmOperatorType *ot)
{
PropertyRNA *prop;
-
+
/* identifiers */
ot->name = "Duplicate Objects";
ot->description = "Duplicate selected objects";
ot->idname = "OBJECT_OT_duplicate";
-
+
/* api callbacks */
ot->exec = duplicate_exec;
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
/* to give to transform */
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data");
prop = RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
@@ -1962,6 +1966,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot)
/* **************** add named object, for dragdrop ************* */
+
static int add_named_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
@@ -2016,32 +2021,34 @@ void OBJECT_OT_add_named(wmOperatorType *ot)
ot->name = "Add Named Object";
ot->description = "Add named object";
ot->idname = "OBJECT_OT_add_named";
-
+
/* api callbacks */
ot->exec = add_named_exec;
ot->poll = ED_operator_objectmode;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data");
RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME - 2, "Name", "Object name to add");
}
-/**************************** Join *************************/
+
+/**************************** Join *************************/
static int join_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
-
+
if (!ob || ob->id.lib) return 0;
-
+
if (ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_ARMATURE))
return ED_operator_screenactive(C);
else
return 0;
}
+
static int join_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
@@ -2062,7 +2069,7 @@ static int join_exec(bContext *C, wmOperator *op)
return join_curve_exec(C, op);
else if (ob->type == OB_ARMATURE)
return join_armature_exec(C, op);
-
+
return OPERATOR_CANCELLED;
}
@@ -2072,23 +2079,22 @@ void OBJECT_OT_join(wmOperatorType *ot)
ot->name = "Join";
ot->description = "Join selected objects into active object";
ot->idname = "OBJECT_OT_join";
-
+
/* api callbacks */
ot->exec = join_exec;
ot->poll = join_poll;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/**************************** Join as Shape Key*************************/
-
static int join_shapes_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
-
+
if (!ob || ob->id.lib) return 0;
-
+
/* only meshes supported at the moment */
if (ob->type == OB_MESH)
return ED_operator_screenactive(C);
@@ -2100,7 +2106,7 @@ static int join_shapes_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
-
+
if (scene->obedit) {
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode");
return OPERATOR_CANCELLED;
@@ -2109,10 +2115,10 @@ static int join_shapes_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
return OPERATOR_CANCELLED;
}
-
+
if (ob->type == OB_MESH)
return join_mesh_shapes_exec(C, op);
-
+
return OPERATOR_CANCELLED;
}
@@ -2122,11 +2128,11 @@ void OBJECT_OT_join_shapes(wmOperatorType *ot)
ot->name = "Join as Shapes";
ot->description = "Merge selected objects to shapes of active object";
ot->idname = "OBJECT_OT_join_shapes";
-
+
/* api callbacks */
ot->exec = join_shapes_exec;
ot->poll = join_shapes_poll;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 56f2426b1b0..1ef7c12b409 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -40,7 +40,6 @@
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
-#include "DNA_anim_types.h"
#include "DNA_constraint_types.h"
#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
@@ -52,7 +51,6 @@
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
-#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_object.h"
@@ -73,7 +71,6 @@
#include "ED_object.h"
#include "ED_armature.h"
-#include "ED_keyframing.h"
#include "ED_screen.h"
#include "UI_interface.h"
@@ -658,15 +655,12 @@ void CONSTRAINT_OT_stretchto_reset(wmOperatorType *ot)
ot->idname = "CONSTRAINT_OT_stretchto_reset";
ot->description = "Reset original length of bone for Stretch To Constraint";
- /* callbacks */
- ot->invoke = stretchto_reset_invoke;
ot->exec = stretchto_reset_exec;
+ ot->invoke = stretchto_reset_invoke;
ot->poll = edit_constraint_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
edit_constraint_properties(ot);
}
@@ -704,15 +698,12 @@ void CONSTRAINT_OT_limitdistance_reset(wmOperatorType *ot)
ot->idname = "CONSTRAINT_OT_limitdistance_reset";
ot->description = "Reset limiting distance for Limit Distance Constraint";
- /* callbacks */
- ot->invoke = limitdistance_reset_invoke;
ot->exec = limitdistance_reset_exec;
+ ot->invoke = limitdistance_reset_invoke;
ot->poll = edit_constraint_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
edit_constraint_properties(ot);
}
@@ -833,15 +824,12 @@ void CONSTRAINT_OT_childof_set_inverse(wmOperatorType *ot)
ot->idname = "CONSTRAINT_OT_childof_set_inverse";
ot->description = "Set inverse correction for ChildOf constraint";
- /* callbacks */
- ot->invoke = childof_set_inverse_invoke;
ot->exec = childof_set_inverse_exec;
+ ot->invoke = childof_set_inverse_invoke;
ot->poll = edit_constraint_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
edit_constraint_properties(ot);
}
@@ -880,140 +868,13 @@ void CONSTRAINT_OT_childof_clear_inverse(wmOperatorType *ot)
ot->idname = "CONSTRAINT_OT_childof_clear_inverse";
ot->description = "Clear inverse correction for ChildOf constraint";
- /* callbacks */
- ot->invoke = childof_clear_inverse_invoke;
ot->exec = childof_clear_inverse_exec;
+ ot->invoke = childof_clear_inverse_invoke;
ot->poll = edit_constraint_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
- edit_constraint_properties(ot);
-}
-
-/* --------------- Follow Path Constraint ------------------ */
-
-static int followpath_path_animate_exec(bContext *C, wmOperator *op)
-{
- Object *ob = ED_object_active_context(C);
- bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_FOLLOWPATH);
- bFollowPathConstraint *data = (con) ? (bFollowPathConstraint *)con->data : NULL;
-
- bAction *act = NULL;
- FCurve *fcu = NULL;
- int sfra = RNA_int_get(op->ptr, "frame_start");
- int len = RNA_int_get(op->ptr, "length");
- float standardRange = 1.0;
-
- /* nearly impossible sanity check */
- if (data == NULL) {
- BKE_report(op->reports, RPT_ERROR, "Follow Path constraint not found");
- return OPERATOR_CANCELLED;
- }
-
- /* add F-Curve as appropriate */
- if (data->tar) {
- Curve *cu = (Curve *)data->tar->data;
-
- if ( ELEM(NULL, cu->adt, cu->adt->action) ||
- (list_find_fcurve(&cu->adt->action->curves, "eval_time", 0) == NULL))
- {
- /* create F-Curve for path animation */
- act = verify_adt_action(&cu->id, 1);
- fcu = verify_fcurve(act, NULL, NULL, "eval_time", 0, 1);
-
- /* standard vertical range - 1:1 = 100 frames */
- standardRange = 100.0f;
- }
- else {
- /* path anim exists already - abort for now as this may well be what was intended */
- BKE_report(op->reports, RPT_WARNING, "Path is already animated");
- return OPERATOR_CANCELLED;
- }
- }
- else {
- /* animate constraint's "fixed offset" */
- PointerRNA ptr;
- PropertyRNA *prop;
- char *path;
-
- /* get RNA pointer to constraint's "offset_factor" property - to build RNA path */
- RNA_pointer_create(&ob->id, &RNA_FollowPathConstraint, con, &ptr);
- prop = RNA_struct_find_property(&ptr, "offset_factor");
-
- path = RNA_path_from_ID_to_property(&ptr, prop);
-
- /* create F-Curve for constraint */
- act = verify_adt_action(&ob->id, 1);
- fcu = verify_fcurve(act, NULL, NULL, path, 0, 1);
-
- /* standard vertical range - 0.0 to 1.0 */
- standardRange = 1.0f;
-
- /* enable "Use Fixed Position" so that animating this has effect */
- data->followflag |= FOLLOWPATH_STATIC;
-
- /* path needs to be freed */
- if (path)
- MEM_freeN(path);
- }
-
- /* setup dummy 'generator' modifier here to get 1-1 correspondence still working
- * and define basic slope of this curve based on the properties
- */
- if (!fcu->bezt && !fcu->fpt && !fcu->modifiers.first) {
- FModifier *fcm = add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR);
- FMod_Generator *gen = fcm->data;
-
- /* Assume that we have the following equation:
- * y = Ax + B
- * 1 0 <-- coefficients array indices
- */
- float A = standardRange / (float)(len);
- float B = (float)(-sfra) * A;
-
- gen->coefficients[1] = A;
- gen->coefficients[0] = B;
- }
-
- /* updates... */
- WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, ob);
- return OPERATOR_FINISHED;
-}
-
-static int followpath_path_animate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
-{
- /* hook up invoke properties for figuring out which constraint we're dealing with */
- if (edit_constraint_invoke_properties(C, op)) {
- return followpath_path_animate_exec(C, op);
- }
- else {
- return OPERATOR_CANCELLED;
- }
-}
-
-void CONSTRAINT_OT_followpath_path_animate(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Auto Animate Path";
- ot->idname = "CONSTRAINT_OT_followpath_path_animate";
- ot->description = "Add default animation for path used by constraint if it isn't animated already";
-
- /* callbacks */
- ot->invoke = followpath_path_animate_invoke;
- ot->exec = followpath_path_animate_exec;
- ot->poll = edit_constraint_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* props */
edit_constraint_properties(ot);
- RNA_def_int(ot->srna, "frame_start", 1, MINAFRAME, MAXFRAME, "Start Frame",
- "First frame of path animation", MINAFRAME, MAXFRAME);
- RNA_def_int(ot->srna, "length", 100, 0, MAXFRAME, "Length",
- "Number of frames that path animation should take", 0, MAXFRAME);
}
/* ------------- Object Solver Constraint ------------------ */
@@ -1053,16 +914,13 @@ void CONSTRAINT_OT_objectsolver_set_inverse(wmOperatorType *ot)
ot->name = "Set Inverse";
ot->idname = "CONSTRAINT_OT_objectsolver_set_inverse";
ot->description = "Set inverse correction for ObjectSolver constraint";
-
- /* callbacks */
- ot->invoke = objectsolver_set_inverse_invoke;
+
ot->exec = objectsolver_set_inverse_exec;
+ ot->invoke = objectsolver_set_inverse_invoke;
ot->poll = edit_constraint_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
edit_constraint_properties(ot);
}
@@ -1099,16 +957,13 @@ void CONSTRAINT_OT_objectsolver_clear_inverse(wmOperatorType *ot)
ot->name = "Clear Inverse";
ot->idname = "CONSTRAINT_OT_objectsolver_clear_inverse";
ot->description = "Clear inverse correction for ObjectSolver constraint";
-
- /* callbacks */
- ot->invoke = objectsolver_clear_inverse_invoke;
+
ot->exec = objectsolver_clear_inverse_exec;
+ ot->invoke = objectsolver_clear_inverse_invoke;
ot->poll = edit_constraint_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
edit_constraint_properties(ot);
}
@@ -1128,14 +983,13 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con)
void ED_object_constraint_update(Object *ob)
{
+
if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
object_test_constraints(ob);
- if (ob->type == OB_ARMATURE)
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
- else
- DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+ if (ob->type == OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
+ else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
void ED_object_constraint_dependency_update(Main *bmain, Scene *scene, Object *ob)
@@ -1152,7 +1006,6 @@ static int constraint_poll(bContext *C)
return (ptr.id.data && ptr.data);
}
-
static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op))
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint);
@@ -1167,12 +1020,12 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op))
constraints_set_active(lb, NULL);
ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */
-
+
/* ITASC needs to be rebuilt once a constraint is removed [#26920] */
if (is_ik) {
BIK_clear_data(ob->pose);
}
-
+
/* notifiers */
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob);
@@ -1199,7 +1052,6 @@ void CONSTRAINT_OT_delete(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-
static int constraint_move_down_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_active_context(C);
@@ -1229,6 +1081,7 @@ static int constraint_move_down_invoke(bContext *C, wmOperator *op, wmEvent *UNU
return OPERATOR_CANCELLED;
}
+
void CONSTRAINT_OT_move_down(wmOperatorType *ot)
{
/* identifiers */
@@ -1237,14 +1090,12 @@ void CONSTRAINT_OT_move_down(wmOperatorType *ot)
ot->description = "Move constraint down in constraint stack";
/* callbacks */
- ot->invoke = constraint_move_down_invoke;
ot->exec = constraint_move_down_exec;
+ ot->invoke = constraint_move_down_invoke;
ot->poll = edit_constraint_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
edit_constraint_properties(ot);
}
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 43c6c332791..bdc7699ee96 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1017,9 +1017,9 @@ static void UNUSED_FUNCTION(copy_attr_menu) (Main * bmain, Scene * scene, View3D
if (!(ob = OBACT)) return;
- if (scene->obedit) { /* XXX get from context */
-/* if (ob->type == OB_MESH) */
-/* XXX mesh_copy_menu(); */
+ if (scene->obedit) { // XXX get from context
+// if (ob->type == OB_MESH)
+// XXX mesh_copy_menu();
return;
}
@@ -1030,34 +1030,34 @@ static void UNUSED_FUNCTION(copy_attr_menu) (Main * bmain, Scene * scene, View3D
*/
strcpy(str,
- "Copy Attributes %t|Location %x1|Rotation %x2|Size %x3|Draw Options %x4|"
- "Time Offset %x5|Dupli %x6|Object Color %x31|%l|Mass %x7|Damping %x8|All Physical Attributes %x11|Properties %x9|"
- "Logic Bricks %x10|Protected Transform %x29|%l");
+ "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|"
+ "Time Offset%x5|Dupli%x6|Object Color%x31|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|"
+ "Logic Bricks%x10|Protected Transform%x29|%l");
- strcat(str, "|Object Constraints %x22");
- strcat(str, "|NLA Strips %x26");
+ strcat(str, "|Object Constraints%x22");
+ strcat(str, "|NLA Strips%x26");
-/* XXX if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) { */
-/* strcat(str, "|Texture Space %x17"); */
-/* } */
+// XXX if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
+// strcat(str, "|Texture Space%x17");
+// }
- if (ob->type == OB_FONT) strcat(str, "|Font Settings %x18|Bevel Settings %x19");
- if (ob->type == OB_CURVE) strcat(str, "|Bevel Settings %x19|UV Orco %x28");
+ if (ob->type == OB_FONT) strcat(str, "|Font Settings%x18|Bevel Settings%x19");
+ if (ob->type == OB_CURVE) strcat(str, "|Bevel Settings%x19|UV Orco%x28");
if ((ob->type == OB_FONT) || (ob->type == OB_CURVE)) {
- strcat(str, "|Curve Resolution %x25");
+ strcat(str, "|Curve Resolution%x25");
}
if (ob->type == OB_MESH) {
- strcat(str, "|Subsurf Settings %x21|AutoSmooth %x27");
+ strcat(str, "|Subsurf Settings%x21|AutoSmooth%x27");
}
- if (ob->soft) strcat(str, "|Soft Body Settings %x23");
+ if (ob->soft) strcat(str, "|Soft Body Settings%x23");
- strcat(str, "|Pass Index %x30");
+ strcat(str, "|Pass Index%x30");
if (ob->type == OB_MESH || ob->type == OB_CURVE || ob->type == OB_LATTICE || ob->type == OB_SURF) {
- strcat(str, "|Modifiers ... %x24");
+ strcat(str, "|Modifiers ...%x24");
}
event = pupmenu(str);
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 727286c3d80..b62ff676066 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -112,7 +112,6 @@ void OBJECT_OT_add_named(struct wmOperatorType *ot);
void OBJECT_OT_metaball_add(struct wmOperatorType *ot);
void OBJECT_OT_text_add(struct wmOperatorType *ot);
void OBJECT_OT_armature_add(struct wmOperatorType *ot);
-void OBJECT_OT_empty_add(struct wmOperatorType *ot);
void OBJECT_OT_lamp_add(struct wmOperatorType *ot);
void OBJECT_OT_effector_add(struct wmOperatorType *ot);
void OBJECT_OT_camera_add(struct wmOperatorType *ot);
@@ -194,7 +193,6 @@ void CONSTRAINT_OT_childof_set_inverse(struct wmOperatorType *ot);
void CONSTRAINT_OT_childof_clear_inverse(struct wmOperatorType *ot);
void CONSTRAINT_OT_objectsolver_set_inverse(struct wmOperatorType *ot);
void CONSTRAINT_OT_objectsolver_clear_inverse(struct wmOperatorType *ot);
-void CONSTRAINT_OT_followpath_path_animate(struct wmOperatorType *ot);
/* object_vgroup.c */
void OBJECT_OT_vertex_group_add(struct wmOperatorType *ot);
@@ -204,7 +202,6 @@ void OBJECT_OT_vertex_group_remove_from(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_select(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_deselect(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_copy_to_linked(struct wmOperatorType *ot);
-void OBJECT_OT_vertex_group_transfer_weight(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_copy_to_selected(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_normalize(struct wmOperatorType *ot);
@@ -215,7 +212,6 @@ void OBJECT_OT_vertex_group_fix(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_invert(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_blend(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_clean(struct wmOperatorType *ot);
-void OBJECT_OT_vertex_group_limit_total(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_mirror(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_set_active(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_sort(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 65d0c966dc2..cec849efca7 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -113,7 +113,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_delete);
WM_operatortype_append(OBJECT_OT_text_add);
WM_operatortype_append(OBJECT_OT_armature_add);
- WM_operatortype_append(OBJECT_OT_empty_add);
WM_operatortype_append(OBJECT_OT_lamp_add);
WM_operatortype_append(OBJECT_OT_camera_add);
WM_operatortype_append(OBJECT_OT_speaker_add);
@@ -169,7 +168,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(CONSTRAINT_OT_childof_clear_inverse);
WM_operatortype_append(CONSTRAINT_OT_objectsolver_set_inverse);
WM_operatortype_append(CONSTRAINT_OT_objectsolver_clear_inverse);
- WM_operatortype_append(CONSTRAINT_OT_followpath_path_animate);
WM_operatortype_append(OBJECT_OT_vertex_group_add);
WM_operatortype_append(OBJECT_OT_vertex_group_remove);
@@ -178,7 +176,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_vertex_group_select);
WM_operatortype_append(OBJECT_OT_vertex_group_deselect);
WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_linked);
- WM_operatortype_append(OBJECT_OT_vertex_group_transfer_weight);
WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_selected);
WM_operatortype_append(OBJECT_OT_vertex_group_copy);
WM_operatortype_append(OBJECT_OT_vertex_group_normalize);
@@ -189,7 +186,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_vertex_group_levels);
WM_operatortype_append(OBJECT_OT_vertex_group_blend);
WM_operatortype_append(OBJECT_OT_vertex_group_clean);
- WM_operatortype_append(OBJECT_OT_vertex_group_limit_total);
WM_operatortype_append(OBJECT_OT_vertex_group_mirror);
WM_operatortype_append(OBJECT_OT_vertex_group_set_active);
WM_operatortype_append(OBJECT_OT_vertex_group_sort);
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 1b08235b75c..9129d651d4d 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -962,10 +962,8 @@ void OBJECT_OT_origin_set(wmOperatorType *ot)
{
static EnumPropertyItem prop_set_center_types[] = {
{GEOMETRY_TO_ORIGIN, "GEOMETRY_ORIGIN", 0, "Geometry to Origin", "Move object geometry to object origin"},
- {ORIGIN_TO_GEOMETRY, "ORIGIN_GEOMETRY", 0, "Origin to Geometry",
- "Move object origin to center of object geometry"},
- {ORIGIN_TO_CURSOR, "ORIGIN_CURSOR", 0, "Origin to 3D Cursor",
- "Move object origin to position of the 3D cursor"},
+ {ORIGIN_TO_GEOMETRY, "ORIGIN_GEOMETRY", 0, "Origin to Geometry", "Move object origin to center of object geometry"},
+ {ORIGIN_TO_CURSOR, "ORIGIN_CURSOR", 0, "Origin to 3D Cursor", "Move object origin to position of the 3d cursor"},
{0, NULL, 0, NULL, NULL}
};
@@ -977,7 +975,7 @@ void OBJECT_OT_origin_set(wmOperatorType *ot)
/* identifiers */
ot->name = "Set Origin";
- ot->description = "Set the object's origin, by either moving the data, or set to center of data, or use 3D cursor";
+ ot->description = "Set the object's origin, by either moving the data, or set to center of data, or use 3d cursor";
ot->idname = "OBJECT_OT_origin_set";
/* api callbacks */
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index dea7eb984ad..b31d2b8b076 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -20,7 +20,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): Ove M Henriksen.
+ * Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -29,6 +29,7 @@
* \ingroup edobj
*/
+
#include <string.h>
#include <stddef.h>
#include <math.h>
@@ -82,19 +83,6 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *defgroup);
static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg);
static void vgroup_delete_all(Object *ob);
-static int vertex_group_use_vert_sel(Object *ob)
-{
- if (ob->mode == OB_MODE_EDIT) {
- return TRUE;
- }
- else if (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) {
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
static Lattice *vgroup_edit_lattice(Object *ob)
{
Lattice *lt = ob->data;
@@ -389,316 +377,6 @@ int ED_vgroup_copy_array(Object *ob, Object *ob_from)
return 1;
}
-/***********************Start weight transfer (WT)*********************************/
-
-typedef enum WT_VertexGroupMode {
- WT_REPLACE_ACTIVE_VERTEX_GROUP = 1,
- WT_REPLACE_ALL_VERTEX_GROUPS = 2
-} WT_VertexGroupMode;
-
-typedef enum WT_Method {
- WT_BY_INDEX = 1,
- WT_BY_NEAREST_VERTEX = 2,
- WT_BY_NEAREST_FACE = 3,
- WT_BY_NEAREST_VERTEX_IN_FACE = 4
-} WT_Method;
-
-typedef enum WT_ReplaceMode {
- WT_REPLACE_ALL_WEIGHTS = 1,
- WT_REPLACE_EMPTY_WEIGHTS = 2,
- WT_REPLACE_SELECTED_WEIGHTS = 3
-} WT_ReplaceMode;
-
-static EnumPropertyItem WT_vertex_group_mode_item[] = {
- {WT_REPLACE_ACTIVE_VERTEX_GROUP, "WT_REPLACE_ACTIVE_VERTEX_GROUP", 1, "Active", "Transfer active vertex group from selected to active mesh."},
- {WT_REPLACE_ALL_VERTEX_GROUPS, "WT_REPLACE_ALL_VERTEX_GROUPS", 1, "All", "Transfer all vertex groups from selected to active mesh."},
- {0, NULL, 0, NULL, NULL}
-};
-
-static EnumPropertyItem WT_method_item[] = {
- {WT_BY_INDEX, "WT_BY_INDEX", 1, "Vertex index", "Copy for identical meshes."},
- {WT_BY_NEAREST_VERTEX, "WT_BY_NEAREST_VERTEX", 1, "Nearest vertex", "Copy weight from closest vertex."},
- {WT_BY_NEAREST_FACE, "WT_BY_NEAREST_FACE", 1, "Nearest face", "Barycentric interpolation from nearest face."},
- {WT_BY_NEAREST_VERTEX_IN_FACE, "WT_BY_NEAREST_VERTEX_IN_FACE", 1, "Nearest vertex in face", "Copy weight from closest vertex in nearest face."},
- {0, NULL, 0, NULL, NULL}
-};
-
-static EnumPropertyItem WT_replace_mode_item[] = {
- {WT_REPLACE_ALL_WEIGHTS, "WT_REPLACE_ALL_WEIGHTS", 1, "All", "Overwrites all weights."},
- {WT_REPLACE_EMPTY_WEIGHTS, "WT_REPLACE_EMPTY_WEIGHTS", 1, "Empty", "Adds weights to vertices with no weight."},
- {WT_REPLACE_SELECTED_WEIGHTS, "WT_REPLACE_SELECTED_WEIGHTS", 1, "Selected", "Replace selected weights."},
- {0, NULL, 0, NULL, NULL}
-};
-
-/*copy weight*/
-static void vgroup_transfer_weight(MVert *mv_dst, float *weight_dst, float weight_src, WT_ReplaceMode replace_mode)
-{
- switch (replace_mode) {
-
- case WT_REPLACE_ALL_WEIGHTS:
- *weight_dst = weight_src;
- break;
-
- case WT_REPLACE_EMPTY_WEIGHTS:
- if (*weight_dst == 0) *weight_dst = weight_src;
- break;
-
- case WT_REPLACE_SELECTED_WEIGHTS:
- if (mv_dst->flag & SELECT) *weight_dst = weight_src;
- break;
-
- default:
- BLI_assert(0);
- break;
- }
-}
-
-/* could be exposed externally */
-static int ed_vgroup_transfer_weight(Object *ob_dst, Object *ob_src, bDeformGroup *dg_src, Scene *scene,
- WT_Method method, WT_ReplaceMode replace_mode, wmOperator *op)
-{
- bDeformGroup *dg_dst;
- Mesh *me_dst, *me_src;
- DerivedMesh *dmesh_src;
- BVHTreeFromMesh tree_mesh_vertices_src, tree_mesh_faces_src = {NULL};
- MDeformVert **dv_array_src, **dv_array_dst, **dv_src, **dv_dst;
- MVert *mv_dst, *mv_src;
- MFace *mface_src, *mf;
- BVHTreeNearest nearest;
- MDeformWeight *dw_dst, *dw_src;
- int dv_tot_src, dv_tot_dst, i, v_index, index_dst, index_src, index_nearest, index_nearest_vertex;
- unsigned int f_index;
- float weight, tmp_weight[4], tmp_co[3], normal[3], tmp_mat[4][4], dist_v1, dist_v2, dist_v3, dist_v4;
-
- /* create new and overwrite vertex group on destination without data */
- if (!defgroup_find_name(ob_dst, dg_src->name) || replace_mode == WT_REPLACE_ALL_WEIGHTS) {
- ED_vgroup_delete(ob_dst, defgroup_find_name(ob_dst, dg_src->name));
- ED_vgroup_add_name(ob_dst, dg_src->name);
- }
-
- /* get destination deformgroup */
- dg_dst = defgroup_find_name(ob_dst, dg_src->name);
-
- /* get meshes */
- dmesh_src = mesh_get_derived_deform(scene, ob_src, CD_MASK_BAREMESH);
- me_dst = ob_dst->data;
- me_src = ob_src->data;
-
- /* sanity check */
- if (!me_src->dvert) {
- BKE_reportf(op->reports, RPT_ERROR, "Transfer failed. Source mesh does not have any vertex groups");
- return 0;
- }
-
- /* create data in memory when nothing there */
- if (!me_dst->dvert) ED_vgroup_data_create(ob_dst->data);
-
- /* get vertex group arrays */
- ED_vgroup_give_parray(ob_src->data, &dv_array_src, &dv_tot_src, FALSE);
- ED_vgroup_give_parray(ob_dst->data, &dv_array_dst, &dv_tot_dst, FALSE);
-
- /* get indexes of vertex groups */
- index_src = BLI_findindex(&ob_src->defbase, dg_src);
- index_dst = BLI_findindex(&ob_dst->defbase, dg_dst);
-
- /* get vertices */
- mv_dst = me_dst->mvert;
- mv_src = dmesh_src->getVertArray(dmesh_src);
-
- /* prepare transformation matrix */
- invert_m4_m4(ob_src->imat, ob_src->obmat);
- mult_m4_m4m4(tmp_mat, ob_src->imat, ob_dst->obmat);
-
- /* clear weights */
- if (replace_mode == WT_REPLACE_ALL_WEIGHTS) {
- for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++) {
- dw_dst = defvert_verify_index(*dv_dst, index_dst);
- if (dw_dst) (*dw_dst).weight = 0;
- }
- }
-
- switch (method) {
-
- case WT_BY_INDEX:
- /* check if indices are matching, delete and return if not */
- if (ob_dst == ob_src || dv_tot_dst == 0 || dv_tot_dst != dv_tot_src ||
- dv_array_src == NULL || dv_array_dst == NULL)
- {
- ED_vgroup_delete(ob_dst, defgroup_find_name(ob_dst, dg_dst->name));
- if (dv_array_src) MEM_freeN(dv_array_src);
- if (dv_array_dst) MEM_freeN(dv_array_dst);
- dmesh_src->release(dmesh_src);
- BKE_reportf(op->reports, RPT_ERROR, "Transfer failed. Indices are not matching");
- return 0;
- }
-
- /* loop through the vertices*/
- for(i = 0, dv_src = dv_array_src, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++, dv_src++, mv_src++) {
-
- /* copy weight */
- dw_src = defvert_find_index(*dv_src, index_src);
- if (dw_src && dw_src->weight) {
- dw_dst = defvert_verify_index(*dv_dst, index_dst);
- vgroup_transfer_weight(mv_dst, &dw_dst->weight, dw_src->weight, replace_mode);
- }
- }
- break;
-
- case WT_BY_NEAREST_VERTEX:
- /* make node tree */
- bvhtree_from_mesh_verts(&tree_mesh_vertices_src, dmesh_src, FLT_EPSILON, 2, 6);
-
- /* loop trough vertices */
- for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++, mv_dst++){
-
- /* reset nearest */
- nearest.dist = FLT_MAX;
- /* With current binary tree its marginally faster to start searching at the top, as opposed to previous search. */
- nearest.index = -1;
-
- /* transform into target space */
- mul_v3_m4v3(tmp_co, tmp_mat, mv_dst->co);
-
- /* node tree accelerated search for closest vetex */
- BLI_bvhtree_find_nearest(tree_mesh_vertices_src.tree, tmp_co,
- &nearest, tree_mesh_vertices_src.nearest_callback, &tree_mesh_vertices_src);
-
- /* copy weight that are not NULL including weight value 0. Existing target weights are overwritten prior to this in relevant cases. */
- dw_src = defvert_find_index(dv_array_src[nearest.index], index_src);
- if (dw_src && dw_src->weight) {
- dw_dst = defvert_verify_index(*dv_dst, index_dst);
- vgroup_transfer_weight(mv_dst, &dw_dst->weight, dw_src->weight, replace_mode);
- }
- }
-
- /* free memory */
- free_bvhtree_from_mesh(&tree_mesh_vertices_src);
- break;
-
- case WT_BY_NEAREST_FACE:
- /* get faces */
- DM_ensure_tessface(dmesh_src);
- mface_src = dmesh_src->getTessFaceArray(dmesh_src);
-
- /* make node tree */
- bvhtree_from_mesh_faces(&tree_mesh_faces_src, dmesh_src, FLT_EPSILON, 2, 6);
-
- /* loop through the vertices */
- for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++, mv_dst++) {
-
- /* reset nearest */
- nearest.dist = FLT_MAX;
- /* With current binary tree its marginally faster to start searching at the top, as opposed to previous search. */
- nearest.index = -1;
-
- /* transform into target space */
- mul_v3_m4v3(tmp_co, tmp_mat, mv_dst->co);
-
- /* node tree accelerated search for closest face */
- BLI_bvhtree_find_nearest(tree_mesh_faces_src.tree, tmp_co,
- &nearest, tree_mesh_faces_src.nearest_callback, &tree_mesh_faces_src);
- index_nearest = nearest.index;
-
- /* project onto face */
- mf = &mface_src[index_nearest];
- normal_tri_v3(normal, mv_src[mf->v1].co, mv_src[mf->v2].co, mv_src[mf->v3].co);
- project_v3_plane(tmp_co, normal, mv_src[mf->v1].co);
-
- /* interpolate weights over face*/
- f_index = mf->v4 ? 3 : 2;
- if (f_index == 3) {
- interp_weights_face_v3(tmp_weight, mv_src[mf->v1].co, mv_src[mf->v2].co, mv_src[mf->v3].co, mv_src[mf->v4].co, tmp_co);
- }
- else {
- interp_weights_face_v3(tmp_weight, mv_src[mf->v1].co, mv_src[mf->v2].co, mv_src[mf->v3].co, NULL, tmp_co);
- }
-
- /* get weights from face*/
- weight = 0;
- do {
- v_index = (&mf->v1)[f_index];
- weight += tmp_weight[f_index] * defvert_find_weight(dv_array_src[v_index], index_src);
- } while (f_index--);
-
- /* copy weight that are not NULL including weight value 0. Existing target weights are overwritten prior to this in relevant cases. */
- if (weight > 0) {
- dw_dst = defvert_verify_index(*dv_dst, index_dst);
- vgroup_transfer_weight(mv_dst, &dw_dst->weight, weight, replace_mode);
- }
- }
-
- /* free memory */
- free_bvhtree_from_mesh(&tree_mesh_faces_src);
- break;
-
- case WT_BY_NEAREST_VERTEX_IN_FACE:
- /* get faces */
- DM_ensure_tessface(dmesh_src);
- mface_src = dmesh_src->getTessFaceArray(dmesh_src);
-
- /* make node tree */
- bvhtree_from_mesh_faces(&tree_mesh_faces_src, dmesh_src, FLT_EPSILON, 2, 6);
-
- /* loop through the vertices */
- for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++, mv_dst++){
-
- /* reset nearest */
- nearest.dist = FLT_MAX;
- /* With current binary tree its marginally faster to start searching at the top, as opposed to previous search. */
- nearest.index = -1;
-
- /* transform into target space */
- mul_v3_m4v3(tmp_co, tmp_mat, mv_dst->co);
-
- /* node tree accelerated search for closest face */
- BLI_bvhtree_find_nearest(tree_mesh_faces_src.tree, tmp_co,
- &nearest, tree_mesh_faces_src.nearest_callback, &tree_mesh_faces_src);
- index_nearest = nearest.index;
-
- /* get distances */
- mf = &mface_src[index_nearest];
- dist_v1 = len_squared_v3v3(tmp_co, mv_src[mf->v1].co);
- dist_v2 = len_squared_v3v3(tmp_co, mv_src[mf->v2].co);
- dist_v3 = len_squared_v3v3(tmp_co, mv_src[mf->v3].co);
-
- /* get closest vertex */
- f_index = mf->v4 ? 3 : 2;
- if (dist_v1 < dist_v2 && dist_v1 < dist_v3) index_nearest_vertex = mf->v1;
- else if (dist_v2 < dist_v3) index_nearest_vertex = mf->v2;
- else index_nearest_vertex = mf->v3;
- if (f_index == 3) {
- dist_v4 = len_squared_v3v3(tmp_co, mv_src[mf->v4].co);
- if (dist_v4 < dist_v1 && dist_v4 < dist_v2 && dist_v4 < dist_v3) {
- index_nearest_vertex = mf->v4;
- }
- }
-
- /* copy weight that are not NULL including weight value 0. Existing target weights are overwritten prior to this in relevant cases. */
- dw_src = defvert_find_index(dv_array_src[index_nearest_vertex], index_src);
- if (dw_src && dw_src->weight) {
- dw_dst = defvert_verify_index(*dv_dst, index_dst);
- vgroup_transfer_weight(mv_dst, &dw_dst->weight, dw_src->weight, replace_mode);
- }
- }
-
- /* free memory */
- free_bvhtree_from_mesh(&tree_mesh_faces_src);
- break;
-
- default:
- BLI_assert(0);
- break;
- }
-
- /*free memory*/
- if (dv_array_src) MEM_freeN(dv_array_src);
- if (dv_array_dst) MEM_freeN(dv_array_dst);
- dmesh_src->release(dmesh_src);
-
- return 1;
-}
-
-/***********************End weight transfer (WT)***********************************/
/* for Mesh in Object mode */
/* allows editmode for Lattice */
@@ -1026,7 +704,7 @@ static void vgroup_normalize(Object *ob)
int i, dvert_tot = 0;
const int def_nr = ob->actdef - 1;
- const int use_vert_sel = vertex_group_use_vert_sel(ob);
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1431,7 +1109,7 @@ static void vgroup_levels(Object *ob, float offset, float gain)
int i, dvert_tot = 0;
const int def_nr = ob->actdef - 1;
- const int use_vert_sel = vertex_group_use_vert_sel(ob);
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1465,7 +1143,7 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
int i, dvert_tot = 0;
const int def_nr = ob->actdef - 1;
- const int use_vert_sel = vertex_group_use_vert_sel(ob);
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (lock_active && !BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1543,7 +1221,7 @@ static void vgroup_invert(Object *ob, const short auto_assign, const short auto_
MDeformVert *dv, **dvert_array = NULL;
int i, dvert_tot = 0;
const int def_nr = ob->actdef - 1;
- const int use_vert_sel = vertex_group_use_vert_sel(ob);
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1711,119 +1389,13 @@ static void vgroup_blend(Object *ob, const float fac)
}
}
-static int inv_cmp_mdef_vert_weights(const void *a1, const void *a2)
-{
- /* qsort sorts in ascending order. We want descending order to save a memcopy
- * so this compare function is inverted from the standard greater than comparison qsort needs.
- * A normal compare function is called with two pointer arguments and should return an integer less than, equal to,
- * or greater than zero corresponding to whether its first argument is considered less than, equal to,
- * or greater than its second argument. This does the opposite. */
- const struct MDeformWeight *dw1 = a1, *dw2 = a2;
-
- if (dw1->weight < dw2->weight) return 1;
- else if (dw1->weight > dw2->weight) return -1;
- else if (&dw1 < &dw2) return 1; /* compare addresses so we have a stable sort algorithm */
- else return -1;
-}
-
-/* Used for limiting the number of influencing bones per vertex when exporting
- * skinned meshes. if all_deform_weights is True, limit all deform modifiers
- * to max_weights regardless of type, otherwise, only limit the number of influencing bones per vertex*/
-static int vertex_group_limit_total(Object *ob,
- const int max_weights,
- const int all_deform_weights)
-{
- MDeformVert *dv, **dvert_array = NULL;
- int i, dvert_tot = 0;
- const int use_vert_sel = vertex_group_use_vert_sel(ob);
- int is_change = FALSE;
-
- ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
-
- if (dvert_array) {
- int defbase_tot = BLI_countlist(&ob->defbase);
- const char *vgroup_validmap = (all_deform_weights == FALSE) ?
- BKE_objdef_validmap_get(ob, defbase_tot) :
- NULL;
- int num_to_drop = 0;
-
- /* only the active group */
- for (i = 0; i < dvert_tot; i++) {
-
- /* in case its not selected */
- if (!(dv = dvert_array[i])) {
- continue;
- }
-
- if (all_deform_weights) {
- /* keep only the largest weights, discarding the rest
- * qsort will put array in descending order because of invCompare function */
- num_to_drop = dv->totweight - max_weights;
- if (num_to_drop > 0) {
- qsort(dv->dw, dv->totweight, sizeof(MDeformWeight), inv_cmp_mdef_vert_weights);
- dv->dw = MEM_reallocN(dv->dw, sizeof(MDeformWeight) * max_weights);
- dv->totweight = max_weights;
- is_change = TRUE;
- }
- }
- else {
- MDeformWeight *dw_temp;
- int bone_count = 0, non_bone_count = 0;
- int j;
- /* only consider vgroups with bone modifiers attached (in vgroup_validmap) */
-
- num_to_drop = dv->totweight - max_weights;
-
- /* first check if we even need to test further */
- if (num_to_drop > 0) {
- /* re-pack dw array so that non-bone weights are first, bone-weighted verts at end
- * sort the tail, then copy only the truncated array back to dv->dw */
- dw_temp = MEM_mallocN(sizeof(MDeformWeight) * (dv->totweight), __func__);
- bone_count = 0; non_bone_count = 0;
- for (j = 0; j < dv->totweight; j++) {
- BLI_assert(dv->dw[j].def_nr < defbase_tot);
- if (!vgroup_validmap[(dv->dw[j]).def_nr]) {
- dw_temp[non_bone_count] = dv->dw[j];
- non_bone_count += 1;
- }
- else {
- dw_temp[dv->totweight - 1 - bone_count] = dv->dw[j];
- bone_count += 1;
- }
- }
- BLI_assert(bone_count + non_bone_count == dv->totweight);
- num_to_drop = bone_count - max_weights;
- if (num_to_drop > 0) {
- qsort(&dw_temp[non_bone_count], bone_count, sizeof(MDeformWeight), inv_cmp_mdef_vert_weights);
- dv->totweight -= num_to_drop;
- /* Do we want to clean/normalize here? */
- MEM_freeN(dv->dw);
- dv->dw = MEM_reallocN(dw_temp, sizeof(MDeformWeight) * dv->totweight);
- is_change = TRUE;
- }
- else {
- MEM_freeN(dw_temp);
- }
- }
- }
- }
- MEM_freeN(dvert_array);
-
- if (vgroup_validmap) {
- MEM_freeN((void *)vgroup_validmap);
- }
- }
-
- return is_change;
-}
-
static void vgroup_clean(Object *ob, const float epsilon, int keep_single)
{
MDeformWeight *dw;
MDeformVert *dv, **dvert_array = NULL;
int i, dvert_tot = 0;
const int def_nr = ob->actdef - 1;
- const int use_vert_sel = vertex_group_use_vert_sel(ob);
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
if (!BLI_findlink(&ob->defbase, def_nr)) {
return;
@@ -1859,7 +1431,7 @@ static void vgroup_clean_all(Object *ob, const float epsilon, const int keep_sin
{
MDeformVert **dvert_array = NULL;
int i, dvert_tot = 0;
- const int use_vert_sel = vertex_group_use_vert_sel(ob);
+ const int use_vert_sel = (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) != 0;
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
@@ -3093,47 +2665,6 @@ void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
"Keep verts assigned to at least one group when cleaning");
}
-static int vertex_group_limit_total_exec(bContext *C, wmOperator *op)
-{
- Object *ob = ED_object_context(C);
-
- const int limit = RNA_int_get(op->ptr, "limit");
- const int all_deform_weights = RNA_boolean_get(op->ptr, "all_deform_weights");
-
- if (vertex_group_limit_total(ob, limit, all_deform_weights)) {
-
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
- WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
-
- return OPERATOR_FINISHED;
- }
- else {
- BKE_reportf(op->reports, RPT_WARNING, "No vertex groups limited");
-
- /* note, would normally return cancelled, except we want the redo
- * UI to show up for users to change */
- return OPERATOR_FINISHED;
- }
-}
-
-void OBJECT_OT_vertex_group_limit_total(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Limit Number of Weights per Vertex";
- ot->idname = "OBJECT_OT_vertex_group_limit_total";
- ot->description = "Limits deform weights associated with a vertex to a specified number by removing lowest weights";
-
- /* api callbacks */
- ot->poll = vertex_group_poll;
- ot->exec = vertex_group_limit_total_exec;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- RNA_def_int(ot->srna, "limit", 4, 1, 32, "Limit", "Maximum number of deform weights", 1, 32);
- RNA_def_boolean(ot->srna, "all_deform_weights", FALSE, "All Deform Weights", "Cull all deform weights, not just bones");
-}
static int vertex_group_mirror_exec(bContext *C, wmOperator *op)
{
@@ -3238,6 +2769,7 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+
void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot)
{
/* identifiers */
@@ -3253,86 +2785,6 @@ void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int vertex_group_transfer_weight_exec(bContext *C, wmOperator *op)
-{
- Scene *scene = CTX_data_scene(C);
- Object *ob_act = CTX_data_active_object(C);
- bDeformGroup *dg_src;
- int fail = 0;
-
- WT_VertexGroupMode vertex_group_mode = RNA_enum_get(op->ptr, "WT_vertex_group_mode");
- WT_Method method = RNA_enum_get(op->ptr, "WT_method");
- WT_ReplaceMode replace_mode = RNA_enum_get(op->ptr, "WT_replace_mode");
-
- /* Macro to loop through selected objects and perform operation depending on function, option and method */
- CTX_DATA_BEGIN (C, Object *, ob_slc, selected_editable_objects)
- {
-
- if (ob_act != ob_slc && ob_slc->defbase.first) {
- switch (vertex_group_mode) {
-
- case WT_REPLACE_ACTIVE_VERTEX_GROUP:
- if (!ed_vgroup_transfer_weight(ob_act, ob_slc,
- BLI_findlink(&ob_slc->defbase, ob_slc->actdef - 1),
- scene, method, replace_mode, op))
- {
- fail++;
- }
- break;
-
- case WT_REPLACE_ALL_VERTEX_GROUPS:
- for (dg_src = ob_slc->defbase.first; dg_src; dg_src = dg_src->next) {
- if (!ed_vgroup_transfer_weight(ob_act, ob_slc,
- dg_src, scene, method, replace_mode, op))
- {
- fail++;
- }
- }
- break;
-
- default:
- BLI_assert(0);
- break;
- }
- }
- }
-
- /* Event notifiers for correct display of data */
- DAG_id_tag_update(&ob_slc->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob_slc);
- WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob_slc->data);
-
- CTX_DATA_END;
-
- if (fail != 0) {
- return OPERATOR_CANCELLED;
- }
- else {
- return OPERATOR_FINISHED;
- }
-}
-
-/* transfers weight from active to selected */
-void OBJECT_OT_vertex_group_transfer_weight(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Transfer weight";
- ot->idname = "OBJECT_OT_vertex_group_transfer_weight";
- ot->description = "Transfer weight paint to active from selected mesh";
-
- /* api callbacks */
- ot->poll = vertex_group_poll;
- ot->exec = vertex_group_transfer_weight_exec;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- /* properties */
- ot->prop = RNA_def_enum(ot->srna, "WT_vertex_group_mode", WT_vertex_group_mode_item, 1, "Group", "");
- ot->prop = RNA_def_enum(ot->srna, "WT_method", WT_method_item, 3, "Method", "");
- ot->prop = RNA_def_enum(ot->srna, "WT_replace_mode", WT_replace_mode_item, 1, "Replace", "");
-}
-
static EnumPropertyItem vgroup_items[] = {
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 1010c0efce4..ea6f9d4cebb 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -398,41 +398,41 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
/*************************** selection utilities *******************************/
-static int key_test_depth(PEData *data, const float co[3], const int screen_co[2])
+static int key_test_depth(PEData *data, const float co[3])
{
View3D *v3d= data->vc.v3d;
double ux, uy, uz;
float depth;
+ short wco[3], x, y;
/* nothing to do */
if ((v3d->drawtype<=OB_WIRE) || (v3d->flag & V3D_ZBUF_SELECT)==0)
return 1;
- /* used to calculate here but all callers have the screen_co already, so pass as arg */
-#if 0
- if (ED_view3d_project_int_global(data->vc.ar, co, screen_co,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) != V3D_PROJ_RET_OK)
- {
+ ED_view3d_project_short(data->vc.ar, co, wco);
+
+ if (wco[0] == IS_CLIPPED)
return 0;
- }
-#endif
gluProject(co[0], co[1], co[2], data->mats.modelview, data->mats.projection,
(GLint *)data->mats.viewport, &ux, &uy, &uz);
+ x=wco[0];
+ y=wco[1];
+
#if 0 /* works well but too slow on some systems [#23118] */
- screen_co[0] += (short)data->vc.ar->winrct.xmin;
- screen_co[1] += (short)data->vc.ar->winrct.ymin;
+ x+= (short)data->vc.ar->winrct.xmin;
+ y+= (short)data->vc.ar->winrct.ymin;
/* PE_set_view3d_data calls this. no need to call here */
/* view3d_validate_backbuf(&data->vc); */
- glReadPixels(screen_co[0], screen_co[1], 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
+ glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
#else /* faster to use depths, these are calculated in PE_set_view3d_data */
{
ViewDepths *vd = data->vc.rv3d->depths;
assert(vd && vd->depths);
/* we know its not clipped */
- depth = vd->depths[screen_co[1] * vd->w + screen_co[0]];
+ depth= vd->depths[y * vd->w + x];
}
#endif
@@ -445,21 +445,21 @@ static int key_test_depth(PEData *data, const float co[3], const int screen_co[2
static int key_inside_circle(PEData *data, float rad, const float co[3], float *distance)
{
float dx, dy, dist;
- int screen_co[2];
+ int sco[2];
- /* TODO, should this check V3D_PROJ_TEST_CLIP_BB too? */
- if (ED_view3d_project_int_global(data->vc.ar, co, screen_co, V3D_PROJ_TEST_CLIP_WIN) != V3D_PROJ_RET_OK) {
+ ED_view3d_project_int(data->vc.ar, co, sco);
+
+ if (sco[0] == IS_CLIPPED)
return 0;
- }
-
- dx= data->mval[0] - screen_co[0];
- dy= data->mval[1] - screen_co[1];
+
+ dx= data->mval[0] - sco[0];
+ dy= data->mval[1] - sco[1];
dist= sqrt(dx*dx + dy*dy);
if (dist > rad)
return 0;
- if (key_test_depth(data, co, screen_co)) {
+ if (key_test_depth(data, co)) {
if (distance)
*distance=dist;
@@ -471,16 +471,17 @@ static int key_inside_circle(PEData *data, float rad, const float co[3], float *
static int key_inside_rect(PEData *data, const float co[3])
{
- int screen_co[2];
+ int sco[2];
+
+ ED_view3d_project_int(data->vc.ar, co, sco);
- if (ED_view3d_project_int_global(data->vc.ar, co, screen_co, V3D_PROJ_TEST_CLIP_WIN) != V3D_PROJ_RET_OK) {
+ if (sco[0] == IS_CLIPPED)
return 0;
- }
- if (screen_co[0] > data->rect->xmin && screen_co[0] < data->rect->xmax &&
- screen_co[1] > data->rect->ymin && screen_co[1] < data->rect->ymax)
+ if (sco[0] > data->rect->xmin && sco[0] < data->rect->xmax &&
+ sco[1] > data->rect->ymin && sco[1] < data->rect->ymax)
{
- return key_test_depth(data, co, screen_co);
+ return key_test_depth(data, co);
}
return 0;
@@ -1633,7 +1634,7 @@ int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad)
/************************ lasso select operator ************************/
-int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short extend, short select)
+int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, short select)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
@@ -1644,7 +1645,7 @@ int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short
ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
POINT_P; KEY_K;
float co[3], mat[4][4]= MAT4_UNITY;
- int screen_co[2];
+ int vertco[2];
PEData data;
@@ -1665,9 +1666,9 @@ int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short
LOOP_KEYS {
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
- if ((ED_view3d_project_int_global(ar, co, screen_co, V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK) &&
- BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], IS_CLIPPED) &&
- key_test_depth(&data, co, screen_co))
+ ED_view3d_project_int(ar, co, vertco);
+ if (BLI_lasso_is_point_inside(mcords, moves, vertco[0], vertco[1], IS_CLIPPED) &&
+ key_test_depth(&data, co))
{
if (select && !(key->flag & PEK_SELECT)) {
key->flag |= PEK_SELECT;
@@ -1685,9 +1686,9 @@ int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
- if ((ED_view3d_project_int_global(ar, co, screen_co, V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK) &&
- BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], IS_CLIPPED) &&
- key_test_depth(&data, co, screen_co))
+ ED_view3d_project_int(ar, co, vertco);
+ if (BLI_lasso_is_point_inside(mcords, moves, vertco[0], vertco[1], IS_CLIPPED) &&
+ key_test_depth(&data, co))
{
if (select && !(key->flag & PEK_SELECT)) {
key->flag |= PEK_SELECT;
@@ -2788,7 +2789,7 @@ static void brush_cut(PEData *data, int pa_index)
float rad2, cut_time= 1.0;
float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv;
int k, cut, keys= (int)pow(2.0, (double)pset->draw_step);
- int screen_co[2];
+ int vertco[2];
/* blunt scissors */
if (BLI_frand() > data->cutfac) return;
@@ -2797,15 +2798,13 @@ static void brush_cut(PEData *data, int pa_index)
if (edit->points[pa_index].flag & PEP_HIDE)
return;
- if (ED_view3d_project_int_global(ar, key->co, screen_co, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK)
- return;
-
rad2= data->rad * data->rad;
cut=0;
- x0 = (float)screen_co[0];
- x1 = (float)screen_co[1];
+ ED_view3d_project_int_noclip(ar, key->co, vertco);
+ x0= (float)vertco[0];
+ x1= (float)vertco[1];
o0= (float)data->mval[0];
o1= (float)data->mval[1];
@@ -2814,27 +2813,26 @@ static void brush_cut(PEData *data, int pa_index)
xo1= x1 - o1;
/* check if root is inside circle */
- if (xo0*xo0 + xo1*xo1 < rad2 && key_test_depth(data, key->co, screen_co)) {
+ if (xo0*xo0 + xo1*xo1 < rad2 && key_test_depth(data, key->co)) {
cut_time= -1.0f;
cut= 1;
}
else {
/* calculate path time closest to root that was inside the circle */
for (k=1, key++; k<=keys; k++, key++) {
+ ED_view3d_project_int_noclip(ar, key->co, vertco);
- if ((ED_view3d_project_int_global(ar, key->co, screen_co, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK) ||
- key_test_depth(data, key->co, screen_co) == 0)
- {
- x0 = (float)screen_co[0];
- x1 = (float)screen_co[1];
+ if (key_test_depth(data, key->co) == 0) {
+ x0= (float)vertco[0];
+ x1= (float)vertco[1];
xo0= x0 - o0;
xo1= x1 - o1;
continue;
}
- v0 = (float)screen_co[0] - x0;
- v1 = (float)screen_co[1] - x1;
+ v0= (float)vertco[0] - x0;
+ v1= (float)vertco[1] - x1;
dv= v0*v0 + v1*v1;
@@ -2859,8 +2857,8 @@ static void brush_cut(PEData *data, int pa_index)
}
}
- x0 = (float)screen_co[0];
- x1 = (float)screen_co[1];
+ x0= (float)vertco[0];
+ x1= (float)vertco[1];
xo0= x0 - o0;
xo1= x1 - o1;
@@ -3989,9 +3987,7 @@ void PE_undo_step(Scene *scene, int step)
}
else if (step==1) {
- if (edit->curundo==NULL || edit->curundo->prev==NULL) {
- /* pass */
- }
+ if (edit->curundo==NULL || edit->curundo->prev==NULL);
else {
if (G.debug & G_DEBUG) printf("undo %s\n", edit->curundo->name);
edit->curundo= edit->curundo->prev;
@@ -4001,9 +3997,7 @@ void PE_undo_step(Scene *scene, int step)
else {
/* curundo has to remain current situation! */
- if (edit->curundo==NULL || edit->curundo->next==NULL) {
- /* pass */
- }
+ if (edit->curundo==NULL || edit->curundo->next==NULL);
else {
get_PTCacheUndo(edit, edit->curundo->next);
edit->curundo= edit->curundo->next;
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 315386a947e..099d868a0ad 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -695,21 +695,21 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
outStringsChanged=1;
}
- /* check if modified output dir is ok */
+ // check if modified output dir is ok
#if 0
if (outStringsChanged) {
char dispmsg[FILE_MAX+256];
int selection=0;
BLI_strncpy(dispmsg, "Output settings set to: '", sizeof(dispmsg));
strcat(dispmsg, newSurfdataPath);
- strcat(dispmsg, "'%t|Continue with changed settings %x1|Discard and abort %x0");
+ strcat(dispmsg, "'%t|Continue with changed settings%x1|Discard and abort%x0");
- /* ask user if thats what he/she wants... */
+ // ask user if thats what he/she wants...
selection = pupmenu(dispmsg);
- if (selection < 1) return 0; /* 0 from menu, or -1 aborted */
+ if (selection < 1) return 0; // 0 from menu, or -1 aborted
BLI_strncpy(targetDir, newSurfdataPath, sizeof(targetDir));
strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR);
- BLI_path_abs(targetDir, G.main->name); /* fixed #frame-no */
+ BLI_path_abs(targetDir, G.main->name); // fixed #frame-no
}
#endif
return outStringsChanged;
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index cd55b91cb6b..08ccf37265b 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -224,12 +224,8 @@ static void material_changed(Main *bmain, Material *ma)
/* find node materials using this */
for (parent = bmain->mat.first; parent; parent = parent->id.next) {
- if (parent->use_nodes && parent->nodetree && nodes_use_material(parent->nodetree, ma)) {
- /* pass */
- }
- else {
- continue;
- }
+ if (parent->use_nodes && parent->nodetree && nodes_use_material(parent->nodetree, ma)) ;
+ else continue;
BKE_icon_changed(BKE_icon_getid(&parent->id));
@@ -251,15 +247,9 @@ static void texture_changed(Main *bmain, Tex *tex)
/* find materials */
for (ma = bmain->mat.first; ma; ma = ma->id.next) {
- if (mtex_use_tex(ma->mtex, MAX_MTEX, tex)) {
- /* pass */
- }
- else if (ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex)) {
- /* pass */
- }
- else {
- continue;
- }
+ if (mtex_use_tex(ma->mtex, MAX_MTEX, tex)) ;
+ else if (ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex)) ;
+ else continue;
BKE_icon_changed(BKE_icon_getid(&ma->id));
@@ -269,30 +259,18 @@ static void texture_changed(Main *bmain, Tex *tex)
/* find lamps */
for (la = bmain->lamp.first; la; la = la->id.next) {
- if (mtex_use_tex(la->mtex, MAX_MTEX, tex)) {
- /* pass */
- }
- else if (la->nodetree && nodes_use_tex(la->nodetree, tex)) {
- /* pass */
- }
- else {
- continue;
- }
+ if (mtex_use_tex(la->mtex, MAX_MTEX, tex)) ;
+ else if (la->nodetree && nodes_use_tex(la->nodetree, tex)) ;
+ else continue;
BKE_icon_changed(BKE_icon_getid(&la->id));
}
/* find worlds */
for (wo = bmain->world.first; wo; wo = wo->id.next) {
- if (mtex_use_tex(wo->mtex, MAX_MTEX, tex)) {
- /* pass */
- }
- else if (wo->nodetree && nodes_use_tex(wo->nodetree, tex)) {
- /* pass */
- }
- else {
- continue;
- }
+ if (mtex_use_tex(wo->mtex, MAX_MTEX, tex)) ;
+ else if (wo->nodetree && nodes_use_tex(wo->nodetree, tex)) ;
+ else continue;
BKE_icon_changed(BKE_icon_getid(&wo->id));
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index ad9b0f61eb1..d14514546f5 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -407,12 +407,8 @@ void region_scissor_winrct(ARegion *ar, rcti *winrct)
ar = ar->prev;
if (BLI_rcti_isect(winrct, &ar->winrct, NULL)) {
- if (ar->flag & RGN_FLAG_HIDDEN) {
- /* pass */
- }
- else if (ar->alignment & RGN_SPLIT_PREV) {
- /* pass */
- }
+ if (ar->flag & RGN_FLAG_HIDDEN) ;
+ else if (ar->alignment & RGN_SPLIT_PREV) ;
else if (ar->alignment == RGN_OVERLAP_LEFT) {
winrct->xmin = ar->winrct.xmax + 1;
}
@@ -939,25 +935,20 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
/* prefsize, for header we stick to exception */
prefsizex = ar->sizex ? ar->sizex : ar->type->prefsizex;
- if (ar->regiontype == RGN_TYPE_HEADER) {
+ if (ar->regiontype == RGN_TYPE_HEADER)
prefsizey = ar->type->prefsizey;
- }
else if (ar->regiontype == RGN_TYPE_UI && sa->spacetype == SPACE_FILE) {
prefsizey = UI_UNIT_Y * 2 + (UI_UNIT_Y / 2);
}
- else {
+ else
prefsizey = ar->sizey ? ar->sizey : ar->type->prefsizey;
- }
-
-
- if (ar->flag & RGN_FLAG_HIDDEN) {
- /* hidden is user flag */
- }
- else if (alignment == RGN_ALIGN_FLOAT) {
- /* XXX floating area region, not handled yet here */
- }
+
+ /* hidden is user flag */
+ if (ar->flag & RGN_FLAG_HIDDEN) ;
+ /* XXX floating area region, not handled yet here */
+ else if (alignment == RGN_ALIGN_FLOAT) ;
+ /* remainder is too small for any usage */
else if (rct_fits(remainder, 'v', 1) < 0 || rct_fits(remainder, 'h', 1) < 0) {
- /* remainder is too small for any usage */
ar->flag |= RGN_FLAG_TOO_SMALL;
}
else if (alignment == RGN_ALIGN_NONE) {
@@ -1468,39 +1459,39 @@ void ED_area_prevspace(bContext *C, ScrArea *sa)
static const char *editortype_pup(void)
{
const char *types = N_(
- "Editor type: %t"
+ "Editor type:%t"
"|3D View %x1"
"|%l"
-
+
"|Timeline %x15"
"|Graph Editor %x2"
"|DopeSheet %x12"
"|NLA Editor %x13"
-
+
"|%l"
-
+
"|UV/Image Editor %x6"
-
+
"|Video Sequence Editor %x8"
"|Movie Clip Editor %x20"
"|Text Editor %x9"
"|Node Editor %x16"
"|Logic Editor %x17"
-
+
"|%l"
-
+
"|Properties %x4"
"|Outliner %x3"
"|User Preferences %x19"
- "|Info %x7"
+ "|Info%x7"
"|%l"
"|File Browser %x5"
-
+
"|%l"
-
+
"|Python Console %x18"
);
@@ -1526,7 +1517,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
but = uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D,
editortype_pup(), xco, yco, UI_UNIT_X + 10, UI_UNIT_Y,
&(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
- TIP_("Display current editor type (click for a menu of available types)"));
+ TIP_("Displays current editor type. Click for menu of available types"));
uiButSetFunc(but, spacefunc, NULL, NULL);
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index e3d714b1917..e14266c83a7 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -322,16 +322,11 @@ static int project_brush_radius(ViewContext *vc,
add_v3_v3v3(offset, location, ortho);
/* project the center of the brush, and the tangent point to the view onto the screen */
- if ((ED_view3d_project_float_global(vc->ar, location, p1, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) &&
- (ED_view3d_project_float_global(vc->ar, offset, p2, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK))
- {
- /* the distance between these points is the size of the projected brush in pixels */
- return len_v2v2(p1, p2);
- }
- else {
- BLI_assert(0); /* assert because the code that sets up the vectors should disallow this */
- return 0;
- }
+ ED_view3d_project_float(vc->ar, location, p1);
+ ED_view3d_project_float(vc->ar, offset, p2);
+
+ /* the distance between these points is the size of the projected brush in pixels */
+ return len_v2v2(p1, p2);
}
static int sculpt_get_brush_geometry(bContext *C, ViewContext *vc,
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 162e2fa15d6..794e7755636 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -51,7 +51,7 @@ struct wmOperator;
struct wmOperatorType;
/* paint_stroke.c */
-typedef int (*StrokeGetLocation)(struct bContext *C, float location[3], const float mouse[2]);
+typedef int (*StrokeGetLocation)(struct bContext *C, float location[3], float mouse[2]);
typedef int (*StrokeTestStart)(struct bContext *C, struct wmOperator *op, const float mouse[2]);
typedef void (*StrokeUpdateStep)(struct bContext *C, struct PaintStroke *stroke, struct PointerRNA *itemptr);
typedef void (*StrokeDone)(const struct bContext *C, struct PaintStroke *stroke);
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 2ae24db7c33..7fabaf7f23d 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -139,13 +139,13 @@ static float event_tablet_data(wmEvent *event, int *pen_flip)
}
/* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */
-static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, const float mouse_in[2])
+static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, float mouse_in[2])
{
Scene *scene = CTX_data_scene(C);
Paint *paint = paint_get_active_from_context(C);
Brush *brush = paint_brush(paint);
PaintStroke *stroke = op->customdata;
- float mouse_out[2];
+ float mouse[3];
PointerRNA itemptr;
float location[3];
float pressure;
@@ -159,24 +159,24 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *ev
if (stroke->vc.obact->sculpt) {
float delta[2];
- BKE_brush_jitter_pos(scene, brush, mouse_in, mouse_out);
+ BKE_brush_jitter_pos(scene, brush, mouse_in, mouse);
/* XXX: meh, this is round about because
* BKE_brush_jitter_pos isn't written in the best way to
* be reused here */
if (brush->flag & BRUSH_JITTER_PRESSURE) {
- sub_v2_v2v2(delta, mouse_out, mouse_in);
+ sub_v2_v2v2(delta, mouse, mouse_in);
mul_v2_fl(delta, pressure);
- add_v2_v2v2(mouse_out, mouse_in, delta);
+ add_v2_v2v2(mouse, mouse_in, delta);
}
}
else {
- copy_v2_v2(mouse_out, mouse_in);
+ copy_v2_v2(mouse, mouse_in);
}
/* TODO: can remove the if statement once all modes have this */
if (stroke->get_location)
- stroke->get_location(C, location, mouse_out);
+ stroke->get_location(C, location, mouse);
else
zero_v3(location);
@@ -184,11 +184,12 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *ev
RNA_collection_add(op->ptr, "stroke", &itemptr);
RNA_float_set_array(&itemptr, "location", location);
- RNA_float_set_array(&itemptr, "mouse", mouse_out);
+ RNA_float_set_array(&itemptr, "mouse", mouse);
RNA_boolean_set(&itemptr, "pen_flip", pen_flip);
RNA_float_set(&itemptr, "pressure", pressure);
- copy_v2_v2(stroke->last_mouse_position, mouse_out);
+ stroke->last_mouse_position[0] = mouse[0];
+ stroke->last_mouse_position[1] = mouse[1];
stroke->update_step(C, stroke, &itemptr);
}
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c
index e406d4f5c3b..f5b9aa742c6 100644
--- a/source/blender/editors/sculpt_paint/paint_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_undo.c
@@ -152,9 +152,7 @@ static int undo_stack_step(bContext *C, UndoStack *stack, int step, const char *
UndoElem *undo;
if (step == 1) {
- if (stack->current == NULL) {
- /* pass */
- }
+ if (stack->current == NULL) ;
else {
if (!name || strcmp(stack->current->name, name) == 0) {
if (G.debug & G_DEBUG_WM) {
@@ -167,9 +165,7 @@ static int undo_stack_step(bContext *C, UndoStack *stack, int step, const char *
}
}
else if (step == -1) {
- if ((stack->current != NULL && stack->current->next == NULL) || stack->elems.first == NULL) {
- /* pass */
- }
+ if ((stack->current != NULL && stack->current->next == NULL) || stack->elems.first == NULL) ;
else {
if (!name || strcmp(stack->current->name, name) == 0) {
undo = (stack->current && stack->current->next) ? stack->current->next : stack->elems.first;
@@ -258,9 +254,7 @@ int ED_undo_paint_valid(int type, const char *name)
else
return 0;
- if (stack->current == NULL) {
- /* pass */
- }
+ if (stack->current == NULL) ;
else {
if (name && strcmp(stack->current->name, name) == 0)
return 1;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 6b3017b8638..8aed92df3af 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -846,22 +846,20 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x
static float calc_vp_strength_dl(VPaint *vp, ViewContext *vc, const float vert_nor[3],
const float mval[2], const float brush_size_pressure)
{
- float vertco[2];
-
- if (ED_view3d_project_float_global(vc->ar, vert_nor, vertco, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- float delta[2];
- float dist_squared;
+ Brush *brush = paint_brush(&vp->paint);
+ float dist_squared;
+ float vertco[2], delta[2];
- sub_v2_v2v2(delta, mval, vertco);
- dist_squared = dot_v2v2(delta, delta); /* len squared */
- if (dist_squared <= brush_size_pressure * brush_size_pressure) {
- Brush *brush = paint_brush(&vp->paint);
- const float dist = sqrtf(dist_squared);
- return BKE_brush_curve_strength_clamp(brush, dist, brush_size_pressure);
- }
+ ED_view3d_project_float_noclip(vc->ar, vert_nor, vertco);
+ sub_v2_v2v2(delta, mval, vertco);
+ dist_squared = dot_v2v2(delta, delta); /* len squared */
+ if (dist_squared > brush_size_pressure * brush_size_pressure) {
+ return 0.0f;
+ }
+ else {
+ const float dist = sqrtf(dist_squared);
+ return BKE_brush_curve_strength_clamp(brush, dist, brush_size_pressure);
}
-
- return 0.0f;
}
static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc,
@@ -2372,8 +2370,7 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- int retval;
-
+
op->customdata = paint_stroke_new(C, NULL, wpaint_stroke_test_start,
wpaint_stroke_update_step,
wpaint_stroke_done, event->type);
@@ -2381,9 +2378,7 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* add modal handler */
WM_event_add_modal_handler(C, op);
- retval = op->type->modal(C, op, event);
- OPERATOR_RETVAL_CHECK(retval);
- BLI_assert(retval == OPERATOR_RUNNING_MODAL);
+ op->type->modal(C, op, event);
return OPERATOR_RUNNING_MODAL;
}
@@ -2819,8 +2814,7 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- int retval;
-
+
op->customdata = paint_stroke_new(C, NULL, vpaint_stroke_test_start,
vpaint_stroke_update_step,
vpaint_stroke_done, event->type);
@@ -2828,9 +2822,7 @@ static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* add modal handler */
WM_event_add_modal_handler(C, op);
- retval = op->type->modal(C, op, event);
- OPERATOR_RETVAL_CHECK(retval);
- BLI_assert(retval == OPERATOR_RUNNING_MODAL);
+ op->type->modal(C, op, event);
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index e03c2fbfd21..ec0478d128f 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3738,7 +3738,7 @@ static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin)
* (This allows us to ignore the GL depth buffer)
* Returns 0 if the ray doesn't hit the mesh, non-zero otherwise
*/
-int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2])
+int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2])
{
ViewContext vc;
Object *ob;
@@ -3998,7 +3998,6 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even
{
struct PaintStroke *stroke;
int ignore_background_click;
- int retval;
if (!sculpt_brush_stroke_init(C, op))
return OPERATOR_CANCELLED;
@@ -4022,9 +4021,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even
/* add modal handler */
WM_event_add_modal_handler(C, op);
- retval = op->type->modal(C, op, event);
- OPERATOR_RETVAL_CHECK(retval);
- BLI_assert(retval == OPERATOR_RUNNING_MODAL);
+ op->type->modal(C, op, event);
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index acb906e4a91..0852378974e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -65,7 +65,7 @@ void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct
void free_sculptsession_deformMats(struct SculptSession *ss);
/* Stroke */
-int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]);
+int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2]);
/* Undo */
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index cd036d7cb50..7635f85a37e 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -1369,14 +1369,10 @@ void ACTION_OT_frame_jump(wmOperatorType *ot)
/* defines for snap keyframes tool */
static EnumPropertyItem prop_actkeys_snap_types[] = {
- {ACTKEYS_SNAP_CFRA, "CFRA", 0, "Current frame",
- "Snap selected keyframes to the current frame"},
- {ACTKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame",
- "Snap selected keyframes to the nearest (whole) frame (use to fix accidental sub-frame offsets)"},
- {ACTKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second",
- "Snap selected keyframes to the nearest second"},
- {ACTKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker",
- "Snap selected keyframes to the nearest marker"},
+ {ACTKEYS_SNAP_CFRA, "CFRA", 0, "Current frame", ""},
+ {ACTKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame", ""}, // XXX as single entry?
+ {ACTKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second", ""}, // XXX as single entry?
+ {ACTKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -1477,12 +1473,9 @@ void ACTION_OT_snap(wmOperatorType *ot)
/* defines for mirror keyframes tool */
static EnumPropertyItem prop_actkeys_mirror_types[] = {
- {ACTKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current frame",
- "Flip times of selected keyframes using the current frame as the mirror line"},
- {ACTKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0",
- "Flip values of selected keyframes (i.e. negative values become positive, and vice versa)"},
- {ACTKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker",
- "Flip times of selected keyframes using the first selected marker as the reference point"},
+ {ACTKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current frame", ""},
+ {ACTKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0", ""},
+ {ACTKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -1504,8 +1497,12 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
/* for 'first selected marker' mode, need to find first selected marker first! */
// XXX should this be made into a helper func in the API?
if (mode == ACTKEYS_MIRROR_MARKER) {
- TimeMarker *marker = ED_markers_get_first_selected(ac->markers);
+ TimeMarker *marker = NULL;
+ /* find first selected marker */
+ marker = ED_markers_get_first_selected(ac->markers);
+
+ /* store marker's time (if available) */
if (marker)
ked.f1 = (float)marker->frame;
else
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 2e92b1eea6f..92b6517cbd9 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -357,8 +357,8 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn)
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED) {
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL) {
/* only handle this event in GPencil mode for performance considerations */
if (saction->mode == SACTCONT_GPENCIL)
ED_area_tag_redraw(sa);
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index d7936c1e2e8..5e940df2a30 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -117,7 +117,6 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
int *points, totseg, i, a;
float sfra = SFRA, efra = EFRA, framelen = ar->winx / (efra - sfra + 1);
MovieTracking *tracking = &clip->tracking;
- MovieTrackingObject *act_object = BKE_tracking_object_get_active(tracking);
MovieTrackingTrack *act_track = BKE_tracking_track_get_active(&clip->tracking);
MovieTrackingReconstruction *reconstruction = BKE_tracking_get_active_reconstruction(tracking);
@@ -219,8 +218,8 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
/* solver keyframes */
glColor4ub(175, 255, 0, 255);
- draw_keyframe(act_object->keyframe1 + clip->start_frame - 1, CFRA, sfra, framelen, 2);
- draw_keyframe(act_object->keyframe2 + clip->start_frame - 1, CFRA, sfra, framelen, 2);
+ draw_keyframe(tracking->settings.keyframe1 + clip->start_frame - 1, CFRA, sfra, framelen, 2);
+ draw_keyframe(tracking->settings.keyframe2 + clip->start_frame - 1, CFRA, sfra, framelen, 2);
/* movie clip animation */
if ((sc->mode == SC_MODE_MASKEDIT) && sc->mask_info.mask) {
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index ffe4762ad15..3f925df30c7 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -407,6 +407,8 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
case NC_SCREEN:
switch (wmn->data) {
case ND_ANIMPLAY:
+ case ND_GPENCIL:
+ clip_scopes_check_gpencil_change(sa);
ED_area_tag_redraw(sa);
break;
}
@@ -418,12 +420,6 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
ED_area_tag_redraw(sa);
}
break;
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED) {
- clip_scopes_check_gpencil_change(sa);
- ED_area_tag_redraw(sa);
- }
- break;
}
}
@@ -1163,8 +1159,8 @@ static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED)
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
}
@@ -1377,8 +1373,8 @@ static void clip_props_area_listener(ARegion *ar, wmNotifier *wmn)
if (wmn->data == ND_SPACE_CLIP)
ED_region_tag_redraw(ar);
break;
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED)
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
}
@@ -1410,8 +1406,8 @@ static void clip_properties_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->data == ND_DATA)
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
case NC_BRUSH:
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 8dc28bbaee0..97f7d7bf132 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1343,6 +1343,7 @@ static int solve_camera_initjob(bContext *C, SolveCameraJob *scj, wmOperator *op
MovieClip *clip = ED_space_clip_get_clip(sc);
Scene *scene = CTX_data_scene(C);
MovieTracking *tracking = &clip->tracking;
+ MovieTrackingSettings *settings = &clip->tracking.settings;
MovieTrackingObject *object = BKE_tracking_object_get_active(tracking);
int width, height;
@@ -1358,7 +1359,7 @@ static int solve_camera_initjob(bContext *C, SolveCameraJob *scj, wmOperator *op
scj->user = sc->user;
scj->context = BKE_tracking_reconstruction_context_new(tracking, object,
- object->keyframe1, object->keyframe2, width, height);
+ settings->keyframe1, settings->keyframe2, width, height);
tracking->stats = MEM_callocN(sizeof(MovieTrackingStats), "solve camera stats");
@@ -2858,14 +2859,14 @@ static int set_solver_keyframe_exec(bContext *C, wmOperator *op)
SpaceClip *sc = CTX_wm_space_clip(C);
MovieClip *clip = ED_space_clip_get_clip(sc);
MovieTracking *tracking = &clip->tracking;
- MovieTrackingObject *object = BKE_tracking_object_get_active(tracking);
+ MovieTrackingSettings *settings = &tracking->settings;
int keyframe = RNA_enum_get(op->ptr, "keyframe");
int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr);
if (keyframe == 0)
- object->keyframe1 = framenr;
+ settings->keyframe1 = framenr;
else
- object->keyframe2 = framenr;
+ settings->keyframe2 = framenr;
WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, clip);
diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c
index 4f62d3fdc2f..507e492497d 100644
--- a/source/blender/editors/space_clip/tracking_select.c
+++ b/source/blender/editors/space_clip/tracking_select.c
@@ -413,7 +413,7 @@ void CLIP_OT_select_border(wmOperatorType *ot)
/********************** lasso select operator *********************/
-static int do_lasso_select_marker(bContext *C, const int mcords[][2], const short moves, short select)
+static int do_lasso_select_marker(bContext *C, int mcords[][2], short moves, short select)
{
SpaceClip *sc = CTX_wm_space_clip(C);
ARegion *ar = CTX_wm_region(C);
@@ -469,7 +469,7 @@ static int do_lasso_select_marker(bContext *C, const int mcords[][2], const shor
static int clip_lasso_select_exec(bContext *C, wmOperator *op)
{
int mcords_tot;
- const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
+ int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
short select;
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index ce522ec7e3f..d3b4df05aa9 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -748,9 +748,7 @@ static int file_is_blend_backup(const char *str)
a = strlen(str);
b = 7;
- if (a == 0 || b >= a) {
- /* pass */
- }
+ if (a == 0 || b >= a) ;
else {
char *loc;
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index c5fa64d3a70..7107a6a2369 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -1824,18 +1824,12 @@ void GRAPH_OT_frame_jump(wmOperatorType *ot)
/* defines for snap keyframes tool */
static EnumPropertyItem prop_graphkeys_snap_types[] = {
- {GRAPHKEYS_SNAP_CFRA, "CFRA", 0, "Current Frame",
- "Snap selected keyframes to the current frame"},
- {GRAPHKEYS_SNAP_VALUE, "VALUE", 0, "Cursor Value",
- "Set values of selected keyframes to the cursor value (Y/Horizontal component)"},
- {GRAPHKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame",
- "Snap selected keyframes to the nearest (whole) frame (use to fix accidental sub-frame offsets)"},
- {GRAPHKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second",
- "Snap selected keyframes to the nearest second"},
- {GRAPHKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker",
- "Snap selected keyframes to the nearest marker"},
- {GRAPHKEYS_SNAP_HORIZONTAL, "HORIZONTAL", 0, "Flatten Handles",
- "Flatten handles for a smoother transition"},
+ {GRAPHKEYS_SNAP_CFRA, "CFRA", 0, "Current Frame", ""},
+ {GRAPHKEYS_SNAP_VALUE, "VALUE", 0, "Cursor Value", ""},
+ {GRAPHKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame", ""}, // XXX as single entry?
+ {GRAPHKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second", ""}, // XXX as single entry?
+ {GRAPHKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker", ""},
+ {GRAPHKEYS_SNAP_HORIZONTAL, "HORIZONTAL", 0, "Flatten Handles", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -1938,16 +1932,11 @@ void GRAPH_OT_snap(wmOperatorType *ot)
/* defines for mirror keyframes tool */
static EnumPropertyItem prop_graphkeys_mirror_types[] = {
- {GRAPHKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current Frame",
- "Flip times of selected keyframes using the current frame as the mirror line"},
- {GRAPHKEYS_MIRROR_VALUE, "VALUE", 0, "By Values over Cursor Value",
- "Flip values of selected keyframes using the cursor value (Y/Horizontal component) as the mirror line"},
- {GRAPHKEYS_MIRROR_YAXIS, "YAXIS", 0, "By Times over Time=0",
- "Flip times of selected keyframes, effectively reversing the order they appear in"},
- {GRAPHKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0",
- "Flip values of selected keyframes (i.e. negative values become positive, and vice versa)"},
- {GRAPHKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker",
- "Flip times of selected keyframes using the first selected marker as the reference point"},
+ {GRAPHKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current Frame", ""},
+ {GRAPHKEYS_MIRROR_VALUE, "VALUE", 0, "By Values over Cursor Value", ""},
+ {GRAPHKEYS_MIRROR_YAXIS, "YAXIS", 0, "By Times over Time=0", ""},
+ {GRAPHKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0", ""},
+ {GRAPHKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 2f01483d23f..0d40a6ae007 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -120,8 +120,6 @@ ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **lock_r)
if (ibuf && (ibuf->rect || ibuf->rect_float))
return ibuf;
}
- else
- *lock_r = NULL;
return NULL;
}
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 7f53f378042..dbad6e8bb24 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -414,9 +414,8 @@ static void image_refresh(const bContext *C, ScrArea *sa)
/* don't need to check for pin here, see above */
sima->image = tf->tpage;
- if ((sima->flag & SI_EDITTILE) == 0) {
- sima->curtile = tf->tile;
- }
+ if (sima->flag & SI_EDITTILE) ;
+ else sima->curtile = tf->tile;
}
}
}
@@ -709,8 +708,8 @@ static void image_main_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED)
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
}
@@ -738,8 +737,8 @@ static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->data == ND_DATA)
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
case NC_BRUSH:
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 470f82195a4..1d04855666e 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1389,11 +1389,6 @@ static void node_shader_buts_tex_voronoi(uiLayout *layout, bContext *UNUSED(C),
uiItemR(layout, ptr, "coloring", 0, "", ICON_NONE);
}
-static void node_shader_buts_tex_coord(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
-{
- uiItemR(layout, ptr, "from_dupli", 0, NULL, 0);
-}
-
static void node_shader_buts_glossy(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "distribution", 0, "", ICON_NONE);
@@ -1475,9 +1470,6 @@ static void node_shader_set_butfunc(bNodeType *ntype)
case SH_NODE_TEX_VORONOI:
ntype->uifunc = node_shader_buts_tex_voronoi;
break;
- case SH_NODE_TEX_COORD:
- ntype->uifunc = node_shader_buts_tex_coord;
- break;
case SH_NODE_BSDF_GLOSSY:
case SH_NODE_BSDF_GLASS:
ntype->uifunc = node_shader_buts_glossy;
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index b0916a50c37..f7757ce49b4 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -539,7 +539,7 @@ void NODE_OT_select_border(wmOperatorType *ot)
/* ****** Lasso Select ****** */
-static int do_lasso_select_node(bContext *C, const int mcords[][2], short moves, short select)
+static int do_lasso_select_node(bContext *C, int mcords[][2], short moves, short select)
{
SpaceNode *snode = CTX_wm_space_node(C);
bNode *node;
@@ -585,7 +585,7 @@ static int do_lasso_select_node(bContext *C, const int mcords[][2], short moves,
static int node_lasso_select_exec(bContext *C, wmOperator *op)
{
int mcords_tot;
- const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
+ int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
short select;
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index b70d66f60b4..0601d7c105f 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -440,6 +440,9 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
break;
case NC_SCREEN:
switch (wmn->data) {
+ case ND_GPENCIL:
+ ED_region_tag_redraw(ar);
+ break;
case ND_SCREENCAST:
case ND_ANIMPLAY:
ED_region_tag_redraw(ar);
@@ -460,10 +463,6 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED)
- ED_region_tag_redraw(ar);
- break;
}
}
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index d2e47427b94..a05588495e9 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -783,9 +783,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
wmKeyMapItem *kmi = te->directdata;
/* modal map? */
- if (kmi->propvalue) {
- /* pass */
- }
+ if (kmi->propvalue) ;
else {
uiDefBlockBut(block, operator_search_menu, kmi, "", xstart, (int)te->ys + 1, butw1, UI_UNIT_Y - 1, "Assign new Operator");
}
@@ -1411,15 +1409,11 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
/* closed item, we draw the icons, not when it's a scene, or master-server list though */
if (!TSELEM_OPEN(tselem, soops)) {
if (te->subtree.first) {
- if (tselem->type == 0 && te->idcode == ID_SCE) {
- /* pass */
- }
- else if (tselem->type != TSE_R_LAYER) {
- /* this tree element always has same amount of branches, so don't draw */
-
+ if (tselem->type == 0 && te->idcode == ID_SCE) ;
+ else if (tselem->type != TSE_R_LAYER) { /* this tree element always has same amount of branches, so don't draw */
int tempx = startx + offsx;
- /* divider */
+ // divider
UI_ThemeColorShade(TH_BACK, -40);
glRecti(tempx - 10, *starty + 4, tempx - 8, *starty + UI_UNIT_Y - 4);
@@ -1531,7 +1525,7 @@ static void outliner_draw_tree(bContext *C, uiBlock *block, Scene *scene, ARegio
{
TreeElement *te;
int starty, startx;
- float col[3];
+ float col[4];
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // only once
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 09df1d57b2b..bf76fdda61e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -1160,49 +1160,37 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op)
event = RNA_enum_get(op->ptr, "type");
set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
- if (event <= 0)
- return OPERATOR_CANCELLED;
-
- switch (datalevel) {
- case TSE_POSE_CHANNEL:
- {
+ if (datalevel == TSE_POSE_CHANNEL) {
+ if (event > 0) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "PoseChannel operation");
}
- break;
-
- case TSE_BONE:
- {
+ }
+ else if (datalevel == TSE_BONE) {
+ if (event > 0) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "Bone operation");
}
- break;
-
- case TSE_EBONE:
- {
+ }
+ else if (datalevel == TSE_EBONE) {
+ if (event > 0) {
outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb, NULL);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
ED_undo_push(C, "EditBone operation");
}
- break;
-
- case TSE_SEQUENCE:
- {
+ }
+ else if (datalevel == TSE_SEQUENCE) {
+ if (event > 0) {
Scene *scene = CTX_data_scene(C);
outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb, scene);
}
- break;
-
- case TSE_RNA_STRUCT:
- if (event == 5) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, data_select_linked_cb, C);
- }
- break;
-
- default:
- break;
+ }
+ else if (datalevel == TSE_RNA_STRUCT) {
+ if (event == 5) {
+ outliner_do_data_operation(soops, datalevel, event, &soops->tree, data_select_linked_cb, C);
+ }
}
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index ef0542130ea..3e1ce1fea6e 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -769,9 +769,7 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
else {
/* do not extend Armature when we have posemode */
tselem = TREESTORE(te->parent);
- if (GS(tselem->id->name) == ID_OB && ((Object *)tselem->id)->mode & OB_MODE_POSE) {
- /* pass */
- }
+ if (GS(tselem->id->name) == ID_OB && ((Object *)tselem->id)->mode & OB_MODE_POSE) ;
else {
Bone *curBone;
for (curBone = arm->bonebase.first; curBone; curBone = curBone->next) {
@@ -813,15 +811,9 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->parent = parent;
te->index = index; // for data arays
- if (ELEM3(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
- /* pass */
- }
- else if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
- /* pass */
- }
- else if (type == TSE_ANIM_DATA) {
- /* pass */
- }
+ if (ELEM3(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) ;
+ else if (ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) ;
+ else if (type == TSE_ANIM_DATA) ;
else {
te->name = id->name + 2; // default, can be overridden by Library or non-ID data
te->idcode = GS(id->name);
@@ -1063,12 +1055,8 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
if (key[0]) {
wmOperatorType *ot = NULL;
- if (kmi->propvalue) {
- /* pass */
- }
- else {
- ot = WM_operatortype_find(kmi->idname, 0);
- }
+ if (kmi->propvalue) ;
+ else ot = WM_operatortype_find(kmi->idname, 0);
if (ot || kmi->propvalue) {
TreeElement *ten = outliner_add_element(soops, &te->subtree, kmi, te, TSE_KEYMAP_ITEM, a);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 459a8d54d12..204930e82a6 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -579,9 +579,7 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
seq2 = del_seq_find_replace_recurs(scene, seq->seq2);
seq3 = del_seq_find_replace_recurs(scene, seq->seq3);
- if (seq1 == seq->seq1 && seq2 == seq->seq2 && seq3 == seq->seq3) {
- /* pass */
- }
+ if (seq1 == seq->seq1 && seq2 == seq->seq2 && seq3 == seq->seq3) ;
else if (seq1 || seq2 || seq3) {
seq->seq1 = (seq1) ? seq1 : (seq2) ? seq2 : seq3;
seq->seq2 = (seq2) ? seq2 : (seq1) ? seq1 : seq3;
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 7bfe58cb50a..21c70a5b4a9 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -556,8 +556,8 @@ static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED) {
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL) {
ED_region_tag_redraw(ar);
}
break;
@@ -610,8 +610,8 @@ static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
- case NC_GPENCIL:
- if (wmn->data == ND_DATA) {
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL) {
ED_region_tag_redraw(ar);
}
break;
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index a68524fcdd6..5111d20b8ee 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1741,7 +1741,6 @@ void draw_text_main(SpaceText *st, ARegion *ar)
char linenr[12];
int i, x, y, winx, linecount = 0, lineno = 0;
int wraplinecount = 0, wrap_skip = 0;
- int margin_column_x;
if (st->lheight) st->viewlines = (int)ar->winy / st->lheight;
else st->viewlines = 0;
@@ -1846,14 +1845,10 @@ void draw_text_main(SpaceText *st, ARegion *ar)
if (st->flags & ST_SHOW_MARGIN) {
UI_ThemeColor(TH_HILITE);
- margin_column_x = x + st->cwidth * (st->margin_column - st->left);
-
- if (margin_column_x >= x) {
- glBegin(GL_LINES);
- glVertex2i(margin_column_x, 0);
- glVertex2i(margin_column_x, ar->winy - 2);
- glEnd();
- }
+ glBegin(GL_LINES);
+ glVertex2i(x + st->cwidth * st->margin_column, 0);
+ glVertex2i(x + st->cwidth * st->margin_column, ar->winy - 2);
+ glEnd();
}
/* draw other stuff */
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index b2fb16ff7fe..75b8e2f218d 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -3352,7 +3352,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot)
/* identifiers */
ot->name = "To 3D Object";
ot->idname = "TEXT_OT_to_3d_object";
- ot->description = "Create 3D text object from active text data block";
+ ot->description = "Create 3d text object from active text data block";
/* api callbacks */
ot->exec = text_to_3d_object_exec;
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 31df13343ce..ecce12b8cba 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -2226,16 +2226,9 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, const short dt)
}
/* restore */
- if (index != -1) {
- glLoadName(-1);
- }
-
- if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) {
- /* pass */
- }
- else if (dt > OB_WIRE) {
- bglPolygonOffset(rv3d->dist, 0.0f);
- }
+ if (index != -1) glLoadName(-1);
+ if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) ;
+ else if (dt > OB_WIRE) bglPolygonOffset(rv3d->dist, 0.0f);
/* finally names and axes */
if (arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) {
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 1b008c27fc0..9d25c3e5f52 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -101,7 +101,6 @@
#include "ED_sculpt.h"
#include "ED_types.h"
#include "ED_curve.h" /* for curve_editnurbs */
-#include "ED_armature.h"
#include "UI_resources.h"
@@ -240,6 +239,107 @@ static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
return 1;
}
+/* ************* only use while object drawing **************
+ * or after running ED_view3d_init_mats_rv3d
+ * */
+static void view3d_project_short_clip(ARegion *ar, const float vec[3], short adr[2], int is_local)
+{
+ RegionView3D *rv3d = ar->regiondata;
+ float fx, fy, vec4[4];
+
+ adr[0] = IS_CLIPPED;
+
+ /* clipplanes in eye space */
+ if (rv3d->rflag & RV3D_CLIPPING) {
+ if (ED_view3d_clipping_test(rv3d, vec, is_local))
+ return;
+ }
+
+ copy_v3_v3(vec4, vec);
+ vec4[3] = 1.0;
+
+ mul_m4_v4(rv3d->persmatob, vec4);
+
+ /* clipplanes in window space */
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+
+ if (fx > 0 && fx < ar->winx) {
+
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
+
+ if (fy > 0.0f && fy < (float)ar->winy) {
+ adr[0] = (short)floorf(fx);
+ adr[1] = (short)floorf(fy);
+ }
+ }
+ }
+}
+
+/* BMESH NOTE: this function is unused in bmesh only */
+
+/* only use while object drawing */
+static void UNUSED_FUNCTION(view3d_project_short_noclip) (ARegion * ar, const float vec[3], short adr[2])
+{
+ RegionView3D *rv3d = ar->regiondata;
+ float fx, fy, vec4[4];
+
+ adr[0] = IS_CLIPPED;
+
+ copy_v3_v3(vec4, vec);
+ vec4[3] = 1.0;
+
+ mul_m4_v4(rv3d->persmatob, vec4);
+
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+
+ if (fx > -32700 && fx < 32700) {
+
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
+
+ if (fy > -32700.0f && fy < 32700.0f) {
+ adr[0] = (short)floorf(fx);
+ adr[1] = (short)floorf(fy);
+ }
+ }
+ }
+}
+
+/* same as view3d_project_short_clip but use persmat instead of persmatob for projection */
+static void view3d_project_short_clip_persmat(ARegion *ar, const float vec[3], short adr[2], int is_local)
+{
+ RegionView3D *rv3d = ar->regiondata;
+ float fx, fy, vec4[4];
+
+ adr[0] = IS_CLIPPED;
+
+ /* clipplanes in eye space */
+ if (rv3d->rflag & RV3D_CLIPPING) {
+ if (ED_view3d_clipping_test(rv3d, vec, is_local))
+ return;
+ }
+
+ copy_v3_v3(vec4, vec);
+ vec4[3] = 1.0;
+
+ mul_m4_v4(rv3d->persmat, vec4);
+
+ /* clipplanes in window space */
+ if (vec4[3] > (float)BL_NEAR_CLIP) { /* is the NEAR clipping cutoff for picking */
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+
+ if (fx > 0 && fx < ar->winx) {
+
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
+
+ if (fy > 0.0f && fy < (float)ar->winy) {
+ adr[0] = (short)floorf(fx);
+ adr[1] = (short)floorf(fy);
+ }
+ }
+ }
+}
/* ************************ */
/* check for glsl drawing */
@@ -783,17 +883,13 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa
if (mat && !(vos->flag & V3D_CACHE_TEXT_WORLDSPACE))
mul_m4_v3(mat, vos->vec);
- if (ED_view3d_project_short_ex(ar,
- (vos->flag & V3D_CACHE_TEXT_GLOBALSPACE) ? rv3d->persmat : rv3d->persmatob,
- (vos->flag & V3D_CACHE_TEXT_LOCALCLIP) != 0,
- vos->vec, vos->sco,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
+ if (vos->flag & V3D_CACHE_TEXT_GLOBALSPACE)
+ view3d_project_short_clip_persmat(ar, vos->vec, vos->sco, (vos->flag & V3D_CACHE_TEXT_LOCALCLIP) != 0);
+ else
+ view3d_project_short_clip(ar, vos->vec, vos->sco, (vos->flag & V3D_CACHE_TEXT_LOCALCLIP) != 0);
+
+ if (vos->sco[0] != IS_CLIPPED)
tot++;
- }
- else {
- vos->sco[0] = IS_CLIPPED;
- }
}
if (tot) {
@@ -1878,17 +1974,15 @@ void lattice_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, BPo
DispList *dl = BKE_displist_find(&obedit->disp, DL_VERTS);
float *co = dl ? dl->verts : NULL;
int i, N = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
+ short s[2] = {IS_CLIPPED, 0};
ED_view3d_clipping_local(vc->rv3d, obedit->obmat); /* for local clipping lookups */
for (i = 0; i < N; i++, bp++, co += 3) {
if (bp->hide == 0) {
- int screen_co[2];
- if (ED_view3d_project_int_object(vc->ar, dl ? co : bp->vec, screen_co,
- V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- func(userData, bp, screen_co[0], screen_co[1]);
- }
+ view3d_project_short_clip(vc->ar, dl ? co : bp->vec, s, TRUE);
+ if (s[0] != IS_CLIPPED)
+ func(userData, bp, s[0], s[1]);
}
}
}
@@ -1990,16 +2084,19 @@ static void mesh_foreachScreenVert__mapFunc(void *userData, int index, const flo
BMVert *eve = EDBM_vert_at_index(data->vc.em, index);
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
- const eV3DProjTest flag = (data->clipVerts == V3D_CLIP_TEST_OFF) ?
- V3D_PROJ_TEST_NOP :
- V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN;
- int screen_co[2];
+ short s[2] = {IS_CLIPPED, 0};
- if (ED_view3d_project_int_object(data->vc.ar, co, screen_co, flag) != V3D_PROJ_RET_OK) {
- return;
+ if (data->clipVerts != V3D_CLIP_TEST_OFF) {
+ view3d_project_short_clip(data->vc.ar, co, s, TRUE);
+ }
+ else {
+ float co2[2];
+ mul_v3_m4v3(co2, data->vc.obedit->obmat, co);
+ ED_view3d_project_short_noclip(data->vc.ar, co2, s);
}
- data->func(data->userData, eve, screen_co[0], screen_co[1], index);
+ if (s[0] != IS_CLIPPED)
+ data->func(data->userData, eve, s[0], s[1], index);
}
}
@@ -2060,34 +2157,38 @@ static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, const flo
BMEdge *eed = EDBM_edge_at_index(data->vc.em, index);
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- int screen_co_a[2];
- int screen_co_b[2];
-
- const eV3DProjTest flag = (data->clipVerts == V3D_CLIP_TEST_RV3D_CLIPPING) ?
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN :
- V3D_PROJ_TEST_NOP;
-
- if (ED_view3d_project_int_object(data->vc.ar, v0co, screen_co_a, flag) != V3D_PROJ_RET_OK) {
- return;
- }
- if (ED_view3d_project_int_object(data->vc.ar, v1co, screen_co_b, flag) != V3D_PROJ_RET_OK) {
- return;
- }
+ short s[2][2];
if (data->clipVerts == V3D_CLIP_TEST_RV3D_CLIPPING) {
- /* pass */
+ view3d_project_short_clip(data->vc.ar, v0co, s[0], TRUE);
+ view3d_project_short_clip(data->vc.ar, v1co, s[1], TRUE);
+
+ if (s[0][0] == IS_CLIPPED || s[1][0] == IS_CLIPPED) {
+ return;
+ }
}
else {
+ float v1_co[3], v2_co[3];
+
+ mul_v3_m4v3(v1_co, data->vc.obedit->obmat, v0co);
+ mul_v3_m4v3(v2_co, data->vc.obedit->obmat, v1co);
+
+ /* XXX, todo, use ED_view3d_project_int_noclip(...), however these functions work differently
+ * and need to be cleaned up, Campbell */
+ ED_view3d_project_short_noclip(data->vc.ar, v1_co, s[0]);
+ ED_view3d_project_short_noclip(data->vc.ar, v2_co, s[1]);
+
if (data->clipVerts == V3D_CLIP_TEST_REGION) {
- if (!BLI_rcti_isect_segment(&data->win_rect, screen_co_a, screen_co_b)) {
+ /* make an int copy */
+ int s_int[2][2] = {{s[0][0], s[0][1]},
+ {s[1][0], s[1][1]}};
+ if (!BLI_rcti_isect_segment(&data->win_rect, s_int[0], s_int[1])) {
return;
}
}
}
- data->func(data->userData, eed,
- screen_co_a[0], screen_co_a[1],
- screen_co_b[0], screen_co_b[1], index);
+ data->func(data->userData, eed, s[0][0], s[0][1], s[1][0], s[1][1], index);
}
}
@@ -2126,11 +2227,14 @@ static void mesh_foreachScreenFace__mapFunc(void *userData, int index, const flo
BMFace *efa = EDBM_face_at_index(data->vc.em, index);
if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- int screen_co[2];
- if (ED_view3d_project_int_object(data->vc.ar, cent, screen_co,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- data->func(data->userData, efa, screen_co[0], screen_co[1], index);
+ float cent2[3];
+ short s[2];
+
+ mul_v3_m4v3(cent2, data->vc.obedit->obmat, cent);
+ ED_view3d_project_short(data->vc.ar, cent2, s);
+
+ if (s[0] != IS_CLIPPED) {
+ data->func(data->userData, efa, s[0], s[1], index);
}
}
}
@@ -2147,7 +2251,8 @@ void mesh_foreachScreenFace(
data.func = func;
data.userData = userData;
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
+ //if (clipVerts)
+ ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
EDBM_index_arrays_init(vc->em, 0, 0, 1);
dm->foreachMappedFaceCenter(dm, mesh_foreachScreenFace__mapFunc, &data);
@@ -2162,6 +2267,7 @@ void nurbs_foreachScreenVert(
void *userData)
{
Curve *cu = vc->obedit->data;
+ short s[2] = {IS_CLIPPED, 0};
Nurb *nu;
int i;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
@@ -2174,31 +2280,22 @@ void nurbs_foreachScreenVert(
BezTriple *bezt = &nu->bezt[i];
if (bezt->hide == 0) {
- int screen_co[2];
if (cu->drawflag & CU_HIDE_HANDLES) {
- if (ED_view3d_project_int_object(vc->ar, bezt->vec[1], screen_co,
- V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- func(userData, nu, NULL, bezt, 1, screen_co[0], screen_co[1]);
- }
+ view3d_project_short_clip(vc->ar, bezt->vec[1], s, TRUE);
+ if (s[0] != IS_CLIPPED)
+ func(userData, nu, NULL, bezt, 1, s[0], s[1]);
}
else {
- if (ED_view3d_project_int_object(vc->ar, bezt->vec[0], screen_co,
- V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- func(userData, nu, NULL, bezt, 0, screen_co[0], screen_co[1]);
- }
- if (ED_view3d_project_int_object(vc->ar, bezt->vec[1], screen_co,
- V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- func(userData, nu, NULL, bezt, 1, screen_co[0], screen_co[1]);
- }
- if (ED_view3d_project_int_object(vc->ar, bezt->vec[2], screen_co,
- V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- func(userData, nu, NULL, bezt, 2, screen_co[0], screen_co[1]);
- }
+ view3d_project_short_clip(vc->ar, bezt->vec[0], s, TRUE);
+ if (s[0] != IS_CLIPPED)
+ func(userData, nu, NULL, bezt, 0, s[0], s[1]);
+ view3d_project_short_clip(vc->ar, bezt->vec[1], s, TRUE);
+ if (s[0] != IS_CLIPPED)
+ func(userData, nu, NULL, bezt, 1, s[0], s[1]);
+ view3d_project_short_clip(vc->ar, bezt->vec[2], s, TRUE);
+ if (s[0] != IS_CLIPPED)
+ func(userData, nu, NULL, bezt, 2, s[0], s[1]);
}
}
}
@@ -2208,129 +2305,15 @@ void nurbs_foreachScreenVert(
BPoint *bp = &nu->bp[i];
if (bp->hide == 0) {
- int screen_co[2];
- if (ED_view3d_project_int_object(vc->ar, bp->vec, screen_co,
- V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- func(userData, nu, bp, NULL, -1, screen_co[0], screen_co[1]);
- }
+ view3d_project_short_clip(vc->ar, bp->vec, s, TRUE);
+ if (s[0] != IS_CLIPPED)
+ func(userData, nu, bp, NULL, -1, s[0], s[1]);
}
}
}
}
}
-/* ED_view3d_init_mats_rv3d must be called first */
-void mball_foreachScreenElem(
- struct ViewContext *vc,
- void (*func)(void *userData, struct MetaElem *ml, int x, int y),
- void *userData)
-{
- MetaBall *mb = (MetaBall *)vc->obedit->data;
- MetaElem *ml;
-
- for (ml = mb->editelems->first; ml; ml = ml->next) {
- int screen_co[2];
- if (ED_view3d_project_int_object(vc->ar, &ml->x, screen_co,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- func(userData, ml, screen_co[0], screen_co[1]);
- }
- }
-}
-
-/* ED_view3d_init_mats_rv3d must be called first */
-void armature_foreachScreenBone(
- struct ViewContext *vc,
- void (*func)(void *userData, struct EditBone *ebone, int x0, int y0, int x1, int y1),
- void *userData)
-{
- bArmature *arm = vc->obedit->data;
- EditBone *ebone;
-
- for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- int screen_co_a[2], screen_co_b[2];
- int points_proj_tot = 0;
-
- /* project head location to screenspace */
- if (ED_view3d_project_int_object(vc->ar, ebone->head, screen_co_a,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- points_proj_tot++;
- }
- else {
- screen_co_a[0] = IS_CLIPPED; /* weak */
- /* screen_co_a[1]: intentionally dont set this so we get errors on misuse */
- }
-
- /* project tail location to screenspace */
- if (ED_view3d_project_int_object(vc->ar, ebone->tail, screen_co_b,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- points_proj_tot++;
- }
- else {
- screen_co_b[0] = IS_CLIPPED; /* weak */
- /* screen_co_b[1]: intentionally dont set this so we get errors on misuse */
- }
-
- if (points_proj_tot) { /* at least one point's projection worked */
- func(userData, ebone,
- screen_co_a[0], screen_co_a[1],
- screen_co_b[0], screen_co_b[1]);
- }
- }
- }
-}
-
-/* ED_view3d_init_mats_rv3d must be called first */
-/* almost _exact_ copy of #armature_foreachScreenBone */
-void pose_foreachScreenBone(
- struct ViewContext *vc,
- void (*func)(void *userData, struct bPoseChannel *pchan, int x0, int y0, int x1, int y1),
- void *userData)
-{
- bArmature *arm = vc->obact->data;
- bPose *pose = vc->obact->pose;
- bPoseChannel *pchan;
-
- for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
- if (PBONE_VISIBLE(arm, pchan->bone)) {
- int screen_co_a[2], screen_co_b[2];
- int points_proj_tot = 0;
-
- /* project head location to screenspace */
- if (ED_view3d_project_int_object(vc->ar, pchan->pose_head, screen_co_a,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- points_proj_tot++;
- }
- else {
- screen_co_a[0] = IS_CLIPPED; /* weak */
- /* screen_co_a[1]: intentionally dont set this so we get errors on misuse */
- }
-
- /* project tail location to screenspace */
- if (ED_view3d_project_int_object(vc->ar, pchan->pose_tail, screen_co_b,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- points_proj_tot++;
- }
- else {
- screen_co_b[0] = IS_CLIPPED; /* weak */
- /* screen_co_b[1]: intentionally dont set this so we get errors on misuse */
- }
-
- if (points_proj_tot) { /* at least one point's projection worked */
- func(userData, pchan,
- screen_co_a[0], screen_co_a[1],
- screen_co_b[0], screen_co_b[1]);
- }
- }
- }
-}
-
/* ************** DRAW MESH ****************** */
/* First section is all the "simple" draw routines,
@@ -6639,7 +6622,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
/* which wire color */
if ((dflag & DRAW_CONSTCOLOR) == 0) {
- ED_view3d_project_base(ar, base);
+ ED_view3d_project_short(ar, ob->obmat[3], &base->sx);
draw_object_wire_color(scene, base, _ob_wire_col, warning_recursive);
ob_wire_col = _ob_wire_col;
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 236cbb86724..1e371cb074d 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -776,6 +776,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
break;
case NC_SCREEN:
switch (wmn->data) {
+ case ND_GPENCIL:
case ND_ANIMPLAY:
case ND_SKETCH:
ED_region_tag_redraw(ar);
@@ -792,10 +793,6 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
break;
- case NC_GPENCIL:
- if (wmn->action == NA_EDITED)
- ED_region_tag_redraw(ar);
- break;
}
}
@@ -944,8 +941,8 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
- case NC_GPENCIL:
- if (wmn->data == ND_DATA)
+ case NC_SCREEN:
+ if (wmn->data == ND_GPENCIL)
ED_region_tag_redraw(ar);
break;
}
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 1f7bae0b23e..c8aca5674a4 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -86,15 +86,13 @@
#define B_REDR 2
#define B_OBJECTPANELMEDIAN 1008
-#define NBR_TRANSFORM_PROPERTIES 7
-
/* temporary struct for storing transform properties */
typedef struct {
float ob_eul[4]; /* used for quat too... */
float ob_scale[3]; /* need temp space due to linked values */
float ob_dims[3];
short link_scale;
- float ve_median[NBR_TRANSFORM_PROPERTIES];
+ float ve_median[9];
int curdef;
float *defweightp;
} TransformProperties;
@@ -133,38 +131,17 @@ static float compute_scale_factor(const float ve_median, const float median)
/* is used for both read and write... */
static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim)
{
-/* Get rid of those ugly magic numbers, even in a single func they become confusing! */
-/* Location, common to all. */
-/* XXX Those two *must* remain contiguous (used as array)! */
-#define LOC_X 0
-#define LOC_Y 1
-#define LOC_Z 2
-/* Meshes... */
-#define M_CREASE 3
-#define M_WEIGHT 4
-/* XXX Those two *must* remain contiguous (used as array)! */
-#define M_SKIN_X 5
-#define M_SKIN_Y 6
-/* Curves... */
-#define C_BWEIGHT 3
-#define C_WEIGHT 4
-#define C_RADIUS 5
-#define C_TILT 6
-/*Lattice... */
-#define L_WEIGHT 4
-
uiBlock *block = (layout) ? uiLayoutAbsoluteBlock(layout) : NULL;
MDeformVert *dvert = NULL;
TransformProperties *tfp;
- float median[NBR_TRANSFORM_PROPERTIES], ve_median[NBR_TRANSFORM_PROPERTIES];
- int tot, totedgedata, totcurvedata, totlattdata, totskinradius, totcurvebweight;
- int meshdata = FALSE, i;
+ float median[9], ve_median[9];
+ int tot, totw, totweight, totedge, totradius, totskinradius;
char defstr[320];
- PointerRNA data_ptr;
+ PointerRNA radius_ptr;
- fill_vn_fl(median, NBR_TRANSFORM_PROPERTIES, 0.0f);
- tot = totedgedata = totcurvedata = totlattdata = totskinradius = totcurvebweight = 0;
- defstr[0] = '\0';
+ median[0] = median[1] = median[2] = median[3] = median[4] = median[5] = median[6] = median[7] = median[8] = 0.0;
+ tot = totw = totweight = totedge = totradius = totskinradius = 0;
+ defstr[0] = 0;
/* make sure we got storage */
if (v3d->properties_storage == NULL)
@@ -185,11 +162,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
evedef = eve;
tot++;
- add_v3_v3(&median[LOC_X], eve->co);
+ add_v3_v3(median, eve->co);
vs = (MVertSkin *)CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_MVERT_SKIN);
if (vs) {
- add_v2_v2(&median[M_SKIN_X], vs->radius); /* Third val not used currently. */
+ add_v2_v2(median + 7, vs->radius); /* Third val not used currently. */
totskinradius++;
}
}
@@ -199,12 +176,12 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
float *f;
- totedgedata++;
+ totedge++;
f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
- median[M_CREASE] += f ? *f : 0.0f;
+ median[3] += f ? *f : 0.0f;
f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
- median[M_WEIGHT] += f ? *f : 0.0f;
+ median[6] += f ? *f : 0.0f;
}
}
@@ -234,8 +211,6 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
tfp->defweightp = &dvert->dw[0].weight;
}
}
-
- meshdata = totedgedata || totskinradius;
}
else if (ob->type == OB_CURVE || ob->type == OB_SURF) {
Curve *cu = ob->data;
@@ -254,24 +229,22 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
a = nu->pntsu;
while (a--) {
if (bezt->f2 & SELECT) {
- add_v3_v3(&median[LOC_X], bezt->vec[1]);
+ add_v3_v3(median, bezt->vec[1]);
tot++;
- median[C_WEIGHT] += bezt->weight;
- median[C_RADIUS] += bezt->radius;
- median[C_TILT] += bezt->alfa;
- if (!totcurvedata) { /* I.e. first time... */
- selp = bezt;
- seltype = &RNA_BezierSplinePoint;
- }
- totcurvedata++;
+ median[4] += bezt->weight;
+ totweight++;
+ median[5] += bezt->radius;
+ totradius++;
+ selp = bezt;
+ seltype = &RNA_BezierSplinePoint;
}
else {
if (bezt->f1 & SELECT) {
- add_v3_v3(&median[LOC_X], bezt->vec[0]);
+ add_v3_v3(median, bezt->vec[0]);
tot++;
}
if (bezt->f3 & SELECT) {
- add_v3_v3(&median[LOC_X], bezt->vec[2]);
+ add_v3_v3(median, bezt->vec[2]);
tot++;
}
}
@@ -283,18 +256,16 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
a = nu->pntsu * nu->pntsv;
while (a--) {
if (bp->f1 & SELECT) {
- add_v3_v3(&median[LOC_X], bp->vec);
- median[C_BWEIGHT] += bp->vec[3];
- totcurvebweight++;
+ add_v3_v3(median, bp->vec);
+ median[3] += bp->vec[3];
+ totw++;
tot++;
- median[C_WEIGHT] += bp->weight;
- median[C_RADIUS] += bp->radius;
- median[C_TILT] += bp->alfa;
- if (!totcurvedata) { /* I.e. first time... */
- selp = bp;
- seltype = &RNA_SplinePoint;
- }
- totcurvedata++;
+ median[4] += bp->weight;
+ totweight++;
+ median[5] += bp->radius;
+ totradius++;
+ selp = bp;
+ seltype = &RNA_SplinePoint;
}
bp++;
}
@@ -302,102 +273,84 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
nu = nu->next;
}
- if (totcurvedata == 1)
- RNA_pointer_create(&cu->id, seltype, selp, &data_ptr);
+ if (totradius == 1)
+ RNA_pointer_create(&cu->id, seltype, selp, &radius_ptr);
}
else if (ob->type == OB_LATTICE) {
Lattice *lt = ob->data;
BPoint *bp;
int a;
- StructRNA *seltype = NULL;
- void *selp = NULL;
a = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
bp = lt->editlatt->latt->def;
while (a--) {
if (bp->f1 & SELECT) {
- add_v3_v3(&median[LOC_X], bp->vec);
+ add_v3_v3(median, bp->vec);
tot++;
- median[L_WEIGHT] += bp->weight;
- if (!totlattdata) { /* I.e. first time... */
- selp = bp;
- seltype = &RNA_LatticePoint;
- }
- totlattdata++;
+ median[4] += bp->weight;
+ totweight++;
}
bp++;
}
-
- if (totlattdata == 1)
- RNA_pointer_create(&lt->id, seltype, selp, &data_ptr);
}
if (tot == 0) {
uiDefBut(block, LABEL, 0, IFACE_("Nothing selected"), 0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
return;
}
-
- /* Location, X/Y/Z */
- mul_v3_fl(&median[LOC_X], 1.0f / (float)tot);
- if (v3d->flag & V3D_GLOBAL_STATS)
- mul_m4_v3(ob->obmat, &median[LOC_X]);
-
- if (meshdata) {
- if (totedgedata) {
- median[M_CREASE] /= (float)totedgedata;
- median[M_WEIGHT] /= (float)totedgedata;
- }
- if (totskinradius) {
- median[M_SKIN_X] /= (float)totskinradius;
- median[M_SKIN_Y] /= (float)totskinradius;
- }
+ median[0] /= (float)tot;
+ median[1] /= (float)tot;
+ median[2] /= (float)tot;
+ if (totedge) {
+ median[3] /= (float)totedge;
+ median[6] /= (float)totedge;
}
- else if (totcurvedata) {
- median[C_WEIGHT] /= (float)totcurvedata;
- median[C_RADIUS] /= (float)totcurvedata;
- median[C_TILT] /= (float)totcurvedata;
- if (totcurvebweight)
- median[C_BWEIGHT] /= (float)totcurvebweight;
+ else if (totw)
+ median[3] /= (float)totw;
+ if (totweight)
+ median[4] /= (float)totweight;
+ if (totradius)
+ median[5] /= (float)totradius;
+ if (totskinradius) {
+ median[7] /= (float)totskinradius;
+ median[8] /= (float)totskinradius;
}
- else if (totlattdata)
- median[L_WEIGHT] /= (float)totlattdata;
+
+ if (v3d->flag & V3D_GLOBAL_STATS)
+ mul_m4_v3(ob->obmat, median);
if (block) { /* buttons */
uiBut *but;
int yi = 200;
const int buth = 20 * UI_DPI_ICON_FAC;
const int but_margin = 2;
- const char *c;
memcpy(tfp->ve_median, median, sizeof(tfp->ve_median));
uiBlockBeginAlign(block);
if (tot == 1) {
- if (totcurvedata) /* Curve */
- c = IFACE_("Control Point:");
- else /* Mesh or lattice */
- c = IFACE_("Vertex:");
+ uiDefBut(block, LABEL, 0, IFACE_("Vertex:"), 0, yi -= buth, 200, buth, NULL, 0, 0, 0, 0, "");
+ }
+ else {
+ uiDefBut(block, LABEL, 0, IFACE_("Median:"), 0, yi -= buth, 200, buth, NULL, 0, 0, 0, 0, "");
}
- else
- c = IFACE_("Median:");
- uiDefBut(block, LABEL, 0, c, 0, yi -= buth, 200, buth, NULL, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
/* Should be no need to translate these. */
but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, yi -= buth, 200, buth,
- &(tfp->ve_median[LOC_X]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
+ &(tfp->ve_median[0]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, yi -= buth, 200, buth,
- &(tfp->ve_median[LOC_Y]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
+ &(tfp->ve_median[1]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, yi -= buth, 200, buth,
- &(tfp->ve_median[LOC_Z]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
+ &(tfp->ve_median[2]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- if (totcurvebweight == tot) {
+ if (totw == tot) {
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, yi -= buth, 200, buth,
- &(tfp->ve_median[C_BWEIGHT]), 0.01, 100.0, 1, 3, "");
+ &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
}
uiBlockBeginAlign(block);
@@ -409,60 +362,60 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
&v3d->flag, 0, 0, 0, 0, "Displays local values");
uiBlockEndAlign(block);
- /* Meshes... */
- if (meshdata) {
- if (totedgedata) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
- totedgedata == 1 ? IFACE_("Crease:") : IFACE_("Mean Crease:"),
- 0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[M_CREASE]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
- totedgedata == 1 ? IFACE_("Bevel Weight:") : IFACE_("Mean Bevel Weight:"),
- 0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[M_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
- }
- if (totskinradius) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
- totskinradius == 1 ? IFACE_("Radius X:") : IFACE_("Mean Radius X:"),
- 0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[M_SKIN_X]), 0.0, 100.0, 1, 3, TIP_("X radius used by Skin modifier"));
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN,
- totskinradius == 1 ? IFACE_("Radius Y:") : IFACE_("Mean Radius Y:"),
- 0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[M_SKIN_Y]), 0.0, 100.0, 1, 3, TIP_("Y radius used by Skin modifier"));
- }
- }
- /* Curve... */
- else if (totcurvedata == 1) {
- uiDefButR(block, NUM, 0, "Weight", 0, yi -= buth + but_margin, 200, buth,
- &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL);
- uiDefButR(block, NUM, 0, "Radius", 0, yi -= buth + but_margin, 200, buth,
- &data_ptr, "radius", 0, 0.0, 100.0, 1, 3, NULL);
- uiDefButR(block, NUM, 0, "Tilt", 0, yi -= buth + but_margin, 200, buth,
- &data_ptr, "tilt", 0, -M_PI * 2.0f, M_PI * 2.0f, 1, 3, NULL);
+ if (totweight == 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Weight:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal"));
}
- else if (totcurvedata > 1) {
+ else if (totweight > 1) {
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"),
+ 0, yi -= buth, 200, buth,
+ &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal"));
+ }
+
+ if (totradius == 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Radius:"),
0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[C_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal"));
+ &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points"));
+ }
+ else if (totradius > 1) {
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Radius:"),
0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[C_RADIUS]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points"));
- but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Tilt:"),
- 0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[C_TILT]), -M_PI * 2.0f, M_PI * 2.0f, 1, 3,
- TIP_("Tilt (inclination) of curve control points"));
- uiButSetUnitType(but, PROP_UNIT_ROTATION);
+ &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points"));
}
- /* Lattice... */
- else if (totlattdata == 1) {
- uiDefButR(block, NUM, 0, "Weight", 0, yi -= buth + but_margin, 200, buth,
- &data_ptr, "weight_softbody", 0, 0.0, 1.0, 1, 3, NULL);
+
+ if (totskinradius == 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Radius X:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[7]), 0.0, 100.0, 1, 3, TIP_("X radius used by Skin modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Radius Y:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[8]), 0.0, 100.0, 1, 3, TIP_("Y radius used by Skin modifier"));
}
- else if (totlattdata > 1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"),
+ else if (totskinradius > 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Radius X:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[7]), 0.0, 100.0, 1, 3, TIP_("Median X radius used by Skin modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Radius Y:"),
0, yi -= buth + but_margin, 200, buth,
- &(tfp->ve_median[L_WEIGHT]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal"));
+ &(tfp->ve_median[8]), 0.0, 100.0, 1, 3, TIP_("Median Y radius used by Skin modifier"));
+ }
+
+ if (totedge == 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Crease:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Bevel Weight:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
+ }
+ else if (totedge > 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Crease:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Bevel Weight:"),
+ 0, yi -= buth + but_margin, 200, buth,
+ &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
}
uiBlockEndAlign(block);
@@ -474,12 +427,16 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
if (v3d->flag & V3D_GLOBAL_STATS) {
invert_m4_m4(ob->imat, ob->obmat);
- mul_m4_v3(ob->imat, &median[LOC_X]);
- mul_m4_v3(ob->imat, &ve_median[LOC_X]);
+ mul_m4_v3(ob->imat, median);
+ mul_m4_v3(ob->imat, ve_median);
}
- i = NBR_TRANSFORM_PROPERTIES;
- while (i--)
- median[i] = ve_median[i] - median[i];
+ sub_v3_v3v3(median, ve_median, median);
+ median[3] = ve_median[3] - median[3];
+ median[4] = ve_median[4] - median[4];
+ median[5] = ve_median[5] - median[5];
+ median[6] = ve_median[6] - median[6];
+ median[7] = ve_median[7] - median[7];
+ median[8] = ve_median[8] - median[8];
if (ob->type == OB_MESH) {
Mesh *me = ob->data;
@@ -488,20 +445,20 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
BMVert *eve;
BMIter iter;
- if (len_v3(&median[LOC_X]) > 0.000001f) {
+ if (len_v3(median) > 0.000001f) {
BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
- add_v3_v3(eve->co, &median[LOC_X]);
+ add_v3_v3(eve->co, median);
}
}
EDBM_mesh_normals_update(em);
}
- if (median[M_CREASE] != 0.0f) {
+ if (median[3] != 0.0f) {
BMEdge *eed;
- const float sca = compute_scale_factor(ve_median[M_CREASE], median[M_CREASE]);
+ const float sca = compute_scale_factor(ve_median[3], median[3]);
if (ELEM(sca, 0.0f, 1.0f)) {
BM_ITER_MESH (eed, &iter, bm, BM_EDGES_OF_MESH) {
@@ -537,9 +494,9 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- if (median[M_WEIGHT] != 0.0f) {
+ if (median[6] != 0.0f) {
BMEdge *eed;
- const float sca = compute_scale_factor(ve_median[M_WEIGHT], median[M_WEIGHT]);
+ const float sca = compute_scale_factor(ve_median[6], median[6]);
if (ELEM(sca, 0.0f, 1.0f)) {
BM_ITER_MESH (eed, &iter, bm, BM_EDGES_OF_MESH) {
@@ -575,11 +532,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- if (median[M_SKIN_X] != 0.0f) {
+ if (median[7] != 0.0f) {
BMVert *eve;
/* That one is not clamped to [0.0, 1.0]. */
- float sca = ve_median[M_SKIN_X];
- if (ve_median[M_SKIN_X] - median[M_SKIN_X] == 0.0f) {
+ float sca = ve_median[7];
+ if (ve_median[7] - median[7] == 0.0f) {
BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
MVertSkin *vs = (MVertSkin *)CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_MVERT_SKIN);
@@ -589,7 +546,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
else {
- sca /= (ve_median[M_SKIN_X] - median[M_SKIN_X]);
+ sca /= (ve_median[7] - median[7]);
BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
MVertSkin *vs = (MVertSkin *)CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_MVERT_SKIN);
@@ -599,11 +556,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
}
- if (median[M_SKIN_Y] != 0.0f) {
+ if (median[8] != 0.0f) {
BMVert *eve;
/* That one is not clamped to [0.0, 1.0]. */
- float sca = ve_median[M_SKIN_Y];
- if (ve_median[M_SKIN_Y] - median[M_SKIN_Y] == 0.0f) {
+ float sca = ve_median[8];
+ if (ve_median[8] - median[8] == 0.0f) {
BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
MVertSkin *vs = (MVertSkin *)CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_MVERT_SKIN);
@@ -613,7 +570,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
else {
- sca /= (ve_median[M_SKIN_Y] - median[M_SKIN_Y]);
+ sca /= (ve_median[8] - median[8]);
BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
MVertSkin *vs = (MVertSkin *)CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_MVERT_SKIN);
@@ -632,7 +589,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
BezTriple *bezt;
int a;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
- const float scale_w = compute_scale_factor(ve_median[C_WEIGHT], median[C_WEIGHT]);
+ const float scale_w = compute_scale_factor(ve_median[4], median[4]);
nu = nurbs->first;
while (nu) {
@@ -641,11 +598,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
a = nu->pntsu;
while (a--) {
if (bezt->f2 & SELECT) {
- add_v3_v3(bezt->vec[0], &median[LOC_X]);
- add_v3_v3(bezt->vec[1], &median[LOC_X]);
- add_v3_v3(bezt->vec[2], &median[LOC_X]);
+ add_v3_v3(bezt->vec[0], median);
+ add_v3_v3(bezt->vec[1], median);
+ add_v3_v3(bezt->vec[2], median);
- if (median[C_WEIGHT] != 0.0f) {
+ if (median[4] != 0.0f) {
if (ELEM(scale_w, 0.0f, 1.0f)) {
bezt->weight = scale_w;
}
@@ -656,15 +613,14 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- bezt->radius += median[C_RADIUS];
- bezt->alfa += median[C_TILT];
+ bezt->radius += median[5];
}
else {
if (bezt->f1 & SELECT) {
- add_v3_v3(bezt->vec[0], &median[LOC_X]);
+ add_v3_v3(bezt->vec[0], median);
}
if (bezt->f3 & SELECT) {
- add_v3_v3(bezt->vec[2], &median[LOC_X]);
+ add_v3_v3(bezt->vec[2], median);
}
}
bezt++;
@@ -675,10 +631,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
a = nu->pntsu * nu->pntsv;
while (a--) {
if (bp->f1 & SELECT) {
- add_v3_v3(bp->vec, &median[LOC_X]);
- bp->vec[3] += median[C_BWEIGHT];
+ add_v3_v3(bp->vec, median);
+ bp->vec[3] += median[3];
- if (median[C_WEIGHT] != 0.0f) {
+ if (median[4] != 0.0f) {
if (ELEM(scale_w, 0.0f, 1.0f)) {
bp->weight = scale_w;
}
@@ -689,8 +645,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- bp->radius += median[C_RADIUS];
- bp->alfa += median[C_TILT];
+ bp->radius += median[5];
}
bp++;
}
@@ -705,15 +660,15 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
Lattice *lt = ob->data;
BPoint *bp;
int a;
- const float scale_w = compute_scale_factor(ve_median[L_WEIGHT], median[L_WEIGHT]);
+ const float scale_w = compute_scale_factor(ve_median[4], median[4]);
a = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
bp = lt->editlatt->latt->def;
while (a--) {
if (bp->f1 & SELECT) {
- add_v3_v3(bp->vec, &median[LOC_X]);
+ add_v3_v3(bp->vec, median);
- if (median[L_WEIGHT] != 0.0f) {
+ if (median[4] != 0.0f) {
if (ELEM(scale_w, 0.0f, 1.0f)) {
bp->weight = scale_w;
}
@@ -730,28 +685,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
/* ED_undo_push(C, "Transform properties"); */
}
-
-/* Clean up! */
-/* Location, common to all. */
-#undef LOC_X
-#undef LOC_Y
-#undef LOC_Z
-/* Meshes (and lattice)... */
-#undef M_CREASE
-#undef M_WEIGHT
-#undef M_SKIN_X
-#undef M_SKIN_Y
-/* Curves... */
-#undef C_BWEIGHT
-#undef C_WEIGHT
-#undef C_RADIUS
-#undef C_TILT
-/* Lattice... */
-#undef L_WEIGHT
}
-#undef NBR_TRANSFORM_PROPERTIES
-
-
#define B_VGRP_PNL_COPY 1
#define B_VGRP_PNL_NORMALIZE 2
#define B_VGRP_PNL_EDIT_SINGLE 8 /* or greater */
@@ -1227,6 +1161,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
col = uiLayoutColumn(pa->layout, FALSE);
+ /* row = uiLayoutRow(col, FALSE); */ /* UNUSED */
RNA_id_pointer_create(&ob->id, &obptr);
if (ob == obedit) {
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index c5246b1ad1f..25ad85d3db8 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -355,9 +355,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
if (dx < GRID_MIN_PX_D) {
rv3d->gridview *= sublines;
dx *= sublines;
- if (dx < GRID_MIN_PX_D) {
- /* pass */
- }
+ if (dx < GRID_MIN_PX_D) ;
else {
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx);
@@ -555,23 +553,32 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
{
- int co[2];
-
+ int mx, my, co[2];
+ int flag;
+
/* we don't want the clipping for cursor */
- if (ED_view3d_project_int_global(ar, give_cursor(scene, v3d), co, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
+ flag = v3d->flag;
+ v3d->flag = 0;
+ ED_view3d_project_int(ar, give_cursor(scene, v3d), co);
+ v3d->flag = flag;
+
+ mx = co[0];
+ my = co[1];
+
+ if (mx != IS_CLIPPED) {
setlinestyle(0);
cpack(0xFF);
- circ((float)co[0], (float)co[1], 10.0);
+ circ((float)mx, (float)my, 10.0);
setlinestyle(4);
cpack(0xFFFFFF);
- circ((float)co[0], (float)co[1], 10.0);
+ circ((float)mx, (float)my, 10.0);
setlinestyle(0);
cpack(0x0);
- sdrawline(co[0] - 20, co[1], co[0] - 5, co[1]);
- sdrawline(co[0] + 5, co[1], co[0] + 20, co[1]);
- sdrawline(co[0], co[1] - 20, co[0], co[1] - 5);
- sdrawline(co[0], co[1] + 5, co[0], co[1] + 20);
+ sdrawline(mx - 20, my, mx - 5, my);
+ sdrawline(mx + 5, my, mx + 20, my);
+ sdrawline(mx, my - 20, mx, my - 5);
+ sdrawline(mx, my + 5, mx, my + 20);
}
}
@@ -1920,7 +1927,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
if (base->object->restrictflag & OB_RESTRICT_VIEW) return;
tbase.flag = OB_FROMDUPLI | base->flag;
- lb = object_duplilist(scene, base->object, FALSE);
+ lb = object_duplilist(scene, base->object);
// BLI_sortlist(lb, dupli_ob_sort); /* might be nice to have if we have a dupli list with mixed objects. */
dob = dupli_step(lb->first);
@@ -2333,7 +2340,7 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
if (ob->transflag & OB_DUPLI) {
DupliObject *dob;
- ListBase *lb = object_duplilist(scene, ob, FALSE);
+ ListBase *lb = object_duplilist(scene, ob);
for (dob = lb->first; dob; dob = dob->next)
if (dob->ob->type == OB_LAMP)
@@ -2856,12 +2863,6 @@ static int view3d_main_area_draw_engine(const bContext *C, ARegion *ar, int draw
engine->tile_x = ceil(ar->winx / (float)scene->r.xparts);
engine->tile_y = ceil(ar->winy / (float)scene->r.yparts);
- /* clamp small tile sizes to prevent inefficient threading utilization
- * the same happens for final renders as well
- */
- engine->tile_x = MAX2(engine->tile_x, 64);
- engine->tile_y = MAX2(engine->tile_x, 64);
-
type->view_update(engine, C);
rv3d->render_engine = engine;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 4e8981f16bd..744ce6f6209 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -966,6 +966,7 @@ static int viewrotate_cancel(bContext *C, wmOperator *op)
void VIEW3D_OT_rotate(wmOperatorType *ot)
{
+
/* identifiers */
ot->name = "Rotate view";
ot->description = "Rotate the view";
@@ -1234,8 +1235,8 @@ void VIEW3D_OT_ndof_pan(struct wmOperatorType *ot)
/*
- * this is basically just the pan only code + the rotate only code crammed into one function that does both
- */
+* this is basically just the pan only code + the rotate only code crammed into one function that does both
+*/
static int ndof_all_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if (event->type != NDOF_MOTION)
@@ -2900,7 +2901,7 @@ static EnumPropertyItem prop_view_items[] = {
{RV3D_VIEW_RIGHT, "RIGHT", 0, "Right", "View From the Right"},
{RV3D_VIEW_TOP, "TOP", 0, "Top", "View From the Top"},
{RV3D_VIEW_BOTTOM, "BOTTOM", 0, "Bottom", "View From the Bottom"},
- {RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the Active Camera"},
+ {RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active camera"},
{0, NULL, 0, NULL, NULL}
};
@@ -3124,7 +3125,7 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
/* identifiers */
ot->name = "View numpad";
- ot->description = "Use a preset viewpoint";
+ ot->description = "Set the view";
ot->idname = "VIEW3D_OT_viewnumpad";
/* api callbacks */
@@ -3134,8 +3135,8 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
/* flags */
ot->flag = 0;
- ot->prop = RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "Preset viewpoint to use");
- RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
+ prop = RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "The Type of view");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna, "align_active", 0, "Align Active", "Align to the active object's axis");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
@@ -3212,9 +3213,7 @@ void VIEW3D_OT_view_orbit(wmOperatorType *ot)
/* flags */
ot->flag = 0;
-
- /* properties */
- ot->prop = RNA_def_enum(ot->srna, "type", prop_view_orbit_items, 0, "Orbit", "Direction of View Orbit");
+ RNA_def_enum(ot->srna, "type", prop_view_orbit_items, 0, "Orbit", "Direction of View Orbit");
}
static EnumPropertyItem prop_view_pan_items[] = {
@@ -3263,9 +3262,7 @@ void VIEW3D_OT_view_pan(wmOperatorType *ot)
/* flags */
ot->flag = 0;
-
- /* Properties */
- ot->prop = RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan");
+ RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan");
}
static int viewpersportho_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3293,7 +3290,7 @@ void VIEW3D_OT_view_persportho(wmOperatorType *ot)
{
/* identifiers */
ot->name = "View Persp/Ortho";
- ot->description = "Switch the current view from perspective/orthographic projection";
+ ot->description = "Switch the current view from perspective/orthographic";
ot->idname = "VIEW3D_OT_view_persportho";
/* api callbacks */
@@ -3409,8 +3406,7 @@ void VIEW3D_OT_background_image_remove(wmOperatorType *ot)
/* flags */
ot->flag = 0;
-
- /* properties */
+
RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Background image index to remove", 0, INT_MAX);
}
@@ -3518,49 +3514,57 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
/* ***************** 3d cursor cursor op ******************* */
/* mx my in region coords */
-static int view3d_cursor3d_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
+static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
Scene *scene = CTX_data_scene(C);
ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
- float *fp = NULL;
- float mval_fl[2];
+ float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3];
+ int mval[2];
+// short ctrl= 0; // XXX
int flip;
fp = give_cursor(scene, v3d);
+// if (obedit && ctrl) lr_click= 1;
+ copy_v3_v3(oldcurs, fp);
+
+ ED_view3d_project_int_noclip(ar, fp, mval);
flip = initgrabz(rv3d, fp[0], fp[1], fp[2]);
- /* reset the depth based on the view offset (we _know_ the offset is infront of us) */
+ /* reset the depth based on the view offset */
if (flip) {
negate_v3_v3(fp, rv3d->ofs);
- /* re initialize, no need to check flip again */
- /* flip = */ initgrabz(rv3d, fp[0], fp[1], fp[2]);
+
+ /* re initialize */
+ ED_view3d_project_int_noclip(ar, fp, mval);
+ flip = initgrabz(rv3d, fp[0], fp[1], fp[2]);
+ (void)flip;
}
- if (ED_view3d_project_float_global(ar, fp, mval_fl, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- short depth_used = FALSE;
+ if (mval[0] != IS_CLIPPED) {
+ short depth_used = 0;
if (U.uiflag & USER_ZBUF_CURSOR) { /* maybe this should be accessed some other way */
view3d_operator_needs_opengl(C);
if (ED_view3d_autodist(scene, ar, v3d, event->mval, fp))
- depth_used = TRUE;
+ depth_used = 1;
}
- if (depth_used == FALSE) {
- float dvec[3];
- VECSUB2D(mval_fl, mval_fl, event->mval);
- ED_view3d_win_to_delta(ar, mval_fl, dvec);
+ if (depth_used == 0) {
+ float mval_f[2];
+ VECSUB2D(mval_f, mval, event->mval);
+ ED_view3d_win_to_delta(ar, mval_f, dvec);
sub_v3_v3(fp, dvec);
}
}
else {
- const float dx = ((float)(event->mval[0] - (ar->winx / 2))) * rv3d->zfac / (ar->winx / 2);
- const float dy = ((float)(event->mval[1] - (ar->winy / 2))) * rv3d->zfac / (ar->winy / 2);
- const float fz = (rv3d->persmat[0][3] * fp[0] +
- rv3d->persmat[1][3] * fp[1] +
- rv3d->persmat[2][3] * fp[2] +
- rv3d->persmat[3][3]) / rv3d->zfac;
+
+ dx = ((float)(event->mval[0] - (ar->winx / 2))) * rv3d->zfac / (ar->winx / 2);
+ dy = ((float)(event->mval[1] - (ar->winy / 2))) * rv3d->zfac / (ar->winy / 2);
+
+ fz = rv3d->persmat[0][3] * fp[0] + rv3d->persmat[1][3] * fp[1] + rv3d->persmat[2][3] * fp[2] + rv3d->persmat[3][3];
+ fz = fz / rv3d->zfac;
fp[0] = (rv3d->persinv[0][0] * dx + rv3d->persinv[1][0] * dy + rv3d->persinv[2][0] * fz) - rv3d->ofs[0];
fp[1] = (rv3d->persinv[0][1] * dx + rv3d->persinv[1][1] * dy + rv3d->persinv[2][1] * fz) - rv3d->ofs[1];
@@ -3584,7 +3588,7 @@ void VIEW3D_OT_cursor3d(wmOperatorType *ot)
ot->idname = "VIEW3D_OT_cursor3d";
/* api callbacks */
- ot->invoke = view3d_cursor3d_invoke;
+ ot->invoke = set_3dcursor_invoke;
ot->poll = ED_operator_view3d_active;
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 5f0bb180711..53e2af39db8 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -61,14 +61,13 @@
#include "IMB_imbuf.h"
#include "BKE_global.h"
-#include "BKE_armature.h"
#include "BKE_context.h"
+#include "BKE_paint.h"
+#include "BKE_armature.h"
#include "BKE_depsgraph.h"
-#include "BKE_mball.h"
+#include "BKE_tessmesh.h"
#include "BKE_movieclip.h"
#include "BKE_object.h"
-#include "BKE_paint.h"
-#include "BKE_tessmesh.h"
#include "BKE_tracking.h"
@@ -111,16 +110,15 @@ int view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const int m
{
float dvec[3];
int mval_cpy[2];
- eV3DProjStatus ret;
mval_cpy[0] = mval[0];
mval_cpy[1] = mval[1];
- ret = ED_view3d_project_int_global(vc->ar, fp, mval_cpy, V3D_PROJ_TEST_NOP);
+ ED_view3d_project_int_noclip(vc->ar, fp, mval_cpy);
initgrabz(vc->rv3d, fp[0], fp[1], fp[2]);
- if (ret == V3D_PROJ_RET_OK) {
+ if (mval_cpy[0] != IS_CLIPPED) {
const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]),
(float)(mval_cpy[1] - mval[1])};
ED_view3d_win_to_delta(vc->ar, mval_f, dvec);
@@ -257,33 +255,10 @@ static void edbm_backbuf_check_and_select_tfaces(Mesh *me, int select)
typedef struct LassoSelectUserData {
ViewContext *vc;
- const rcti *rect;
- const int (*mcords)[2];
- int moves;
- int select;
-
- /* runtime */
- int pass;
- int is_done;
- int is_change;
+ rcti *rect;
+ int (*mcords)[2], moves, select, pass, done;
} LassoSelectUserData;
-static void view3d_userdata_lassoselect_init(LassoSelectUserData *r_data,
- ViewContext *vc, const rcti *rect, const int (*mcords)[2],
- const int moves, const int select)
-{
- r_data->vc = vc;
- r_data->rect = rect;
- r_data->mcords = mcords;
- r_data->moves = moves;
- r_data->select = select;
-
- /* runtime */
- r_data->pass = 0;
- r_data->is_done = FALSE;
- r_data->is_change = FALSE;
-}
-
static int view3d_selectable_data(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@@ -314,12 +289,12 @@ static int view3d_selectable_data(bContext *C)
/* helper also for borderselect */
-static int edge_fully_inside_rect(const rcti *rect, int x1, int y1, int x2, int y2)
+static int edge_fully_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
{
return BLI_rcti_isect_pt(rect, x1, y1) && BLI_rcti_isect_pt(rect, x2, y2);
}
-static int edge_inside_rect(const rcti *rect, int x1, int y1, int x2, int y2)
+static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
{
int d1, d2, d3, d4;
@@ -344,70 +319,35 @@ static int edge_inside_rect(const rcti *rect, int x1, int y1, int x2, int y2)
return 1;
}
-static void do_lasso_select_pose__doSelectBone(void *userData, struct bPoseChannel *pchan, int x0, int y0, int x1, int y1)
+/* warning; lasso select with backbuffer-check draws in backbuf with persp(PERSP_WIN)
+ * and returns with persp(PERSP_VIEW). After lasso select backbuf is not OK
+ */
+static void do_lasso_select_pose(ViewContext *vc, Object *ob, int mcords[][2], short moves, short select)
{
- LassoSelectUserData *data = userData;
- bArmature *arm = data->vc->obact->data;
-
- if (PBONE_SELECTABLE(arm, pchan->bone)) {
- int is_point_done = FALSE;
- int points_proj_tot = 0;
-
- /* project head location to screenspace */
- if (x0 != IS_CLIPPED) {
- points_proj_tot++;
- if (BLI_rcti_isect_pt(data->rect, x0, y0) &&
- BLI_lasso_is_point_inside(data->mcords, data->moves, x0, y0, INT_MAX))
- {
- is_point_done = TRUE;
- }
- }
+ bPoseChannel *pchan;
+ float vec[3];
+ int sco1[2], sco2[2];
+ bArmature *arm = ob->data;
+
+ if ((ob->type != OB_ARMATURE) || (ob->pose == NULL)) return;
- /* project tail location to screenspace */
- if (x1 != IS_CLIPPED) {
- points_proj_tot++;
- if (BLI_rcti_isect_pt(data->rect, x1, y1) &&
- BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, INT_MAX))
- {
- is_point_done = TRUE;
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ if (PBONE_SELECTABLE(arm, pchan->bone)) {
+ mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
+ ED_view3d_project_int(vc->ar, vec, sco1);
+ mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
+ ED_view3d_project_int(vc->ar, vec, sco2);
+
+ if (BLI_lasso_is_edge_inside(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1], IS_CLIPPED)) {
+ if (select) pchan->bone->flag |= BONE_SELECTED;
+ else pchan->bone->flag &= ~BONE_SELECTED;
}
}
-
- /* if one of points selected, we skip the bone itself */
- if ((is_point_done == TRUE) ||
- ((is_point_done == FALSE) && (points_proj_tot == 2) &&
- BLI_lasso_is_edge_inside(data->mcords, data->moves, x0, y0, x1, y1, INT_MAX)))
- {
- if (data->select) pchan->bone->flag |= BONE_SELECTED;
- else pchan->bone->flag &= ~BONE_SELECTED;
- data->is_change = TRUE;
- }
- data->is_change |= is_point_done;
}
-}
-static void do_lasso_select_pose(ViewContext *vc, Object *ob, const int mcords[][2], short moves, short select)
-{
- LassoSelectUserData data;
- rcti rect;
- if ((ob->type != OB_ARMATURE) || (ob->pose == NULL)) {
- return;
- }
-
- view3d_userdata_lassoselect_init(&data, vc, &rect, mcords, moves, select);
-
- ED_view3d_init_mats_rv3d(vc->obact, vc->rv3d);
-
- BLI_lasso_boundbox(&rect, mcords, moves);
-
- pose_foreachScreenBone(vc, do_lasso_select_pose__doSelectBone, &data);
-
- if (data.is_change) {
- bArmature *arm = ob->data;
- if (arm->flag & ARM_HAS_VIZ_DEPS) {
- /* mask modifier ('armature' mode), etc. */
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- }
+ if (arm->flag & ARM_HAS_VIZ_DEPS) {
+ /* mask modifier ('armature' mode), etc. */
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
@@ -422,7 +362,7 @@ static void object_deselect_all_visible(Scene *scene, View3D *v3d)
}
}
-static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], const short moves, short extend, short select)
+static void do_lasso_select_objects(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
Base *base;
@@ -431,7 +371,7 @@ static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], cons
for (base = vc->scene->base.first; base; base = base->next) {
if (BASE_SELECTABLE(vc->v3d, base)) { /* use this to avoid un-needed lasso lookups */
- ED_view3d_project_base(vc->ar, base);
+ ED_view3d_project_short(vc->ar, base->object->obmat[3], &base->sx);
if (BLI_lasso_is_point_inside(mcords, moves, base->sx, base->sy, IS_CLIPPED)) {
if (select) ED_base_object_select(base, BA_SELECT);
@@ -466,7 +406,7 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int
BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, IS_CLIPPED))
{
BM_edge_select_set(data->vc->em->bm, eed, data->select);
- data->is_done = TRUE;
+ data->done = TRUE;
}
}
else {
@@ -487,7 +427,7 @@ static void do_lasso_select_mesh__doSelectFace(void *userData, BMFace *efa, int
}
}
-static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
+static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
LassoSelectUserData data;
ToolSettings *ts = vc->scene->toolsettings;
@@ -499,7 +439,13 @@ static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short m
/* set editmesh */
vc->em = BMEdit_FromObject(vc->obedit);
- view3d_userdata_lassoselect_init(&data, vc, &rect, mcords, moves, select);
+ data.vc = vc;
+ data.rect = &rect;
+ data.mcords = mcords;
+ data.moves = moves;
+ data.select = select;
+ data.done = FALSE;
+ data.pass = 0;
if (extend == 0 && select)
EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT);
@@ -523,7 +469,7 @@ static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short m
data.pass = 0;
mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
- if (data.is_done == 0) {
+ if (data.done == 0) {
data.pass = 1;
mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
}
@@ -551,7 +497,7 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BP
if (BLI_lasso_is_point_inside(data->mcords, data->moves, x, y, IS_CLIPPED)) {
if (bp) {
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
- if (bp == cu->lastsel && !(bp->f1 & SELECT)) cu->lastsel = NULL;
+ if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL;
}
else {
if (cu->drawflag & CU_HIDE_HANDLES) {
@@ -570,16 +516,20 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BP
}
}
- if (bezt == cu->lastsel && !(bezt->f2 & SELECT)) cu->lastsel = NULL;
+ if (bezt == cu->lastsel && !(bezt->f2 & 1)) cu->lastsel = NULL;
}
}
}
-static void do_lasso_select_curve(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
+static void do_lasso_select_curve(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
LassoSelectUserData data;
- view3d_userdata_lassoselect_init(&data, vc, NULL, mcords, moves, select);
+ /* set vc->editnurb */
+ data.vc = vc;
+ data.mcords = mcords;
+ data.moves = moves;
+ data.select = select;
if (extend == 0 && select)
CU_deselect_all(vc->obedit);
@@ -596,11 +546,14 @@ static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x,
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
}
}
-static void do_lasso_select_lattice(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
+static void do_lasso_select_lattice(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
LassoSelectUserData data;
- view3d_userdata_lassoselect_init(&data, vc, NULL, mcords, moves, select);
+ /* set editdata in vc */
+ data.mcords = mcords;
+ data.moves = moves;
+ data.select = select;
if (extend == 0 && select)
ED_setflagsLatt(vc->obedit, 0);
@@ -609,104 +562,83 @@ static void do_lasso_select_lattice(ViewContext *vc, const int mcords[][2], shor
lattice_foreachScreenVert(vc, do_lasso_select_lattice__doSelect, &data);
}
-static void do_lasso_select_armature__doSelectBone(void *userData, struct EditBone *ebone, int x0, int y0, int x1, int y1)
+static void do_lasso_select_armature(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
- LassoSelectUserData *data = userData;
- bArmature *arm = data->vc->obedit->data;
+ bArmature *arm = vc->obedit->data;
+ EditBone *ebone;
+ float vec[3];
+ short sco1[2], sco2[2], didpoint;
+ int change = FALSE;
- if (EBONE_SELECTABLE(arm, ebone)) {
- int is_point_done = FALSE;
- int points_proj_tot = 0;
+ if (extend == 0 && select)
+ ED_armature_deselect_all_visible(vc->obedit);
- /* project head location to screenspace */
- if (x0 != IS_CLIPPED) {
- points_proj_tot++;
- if (BLI_rcti_isect_pt(data->rect, x0, y0) &&
- BLI_lasso_is_point_inside(data->mcords, data->moves, x0, y0, INT_MAX))
- {
- is_point_done = TRUE;
- if (data->select) ebone->flag |= BONE_ROOTSEL;
- else ebone->flag &= ~BONE_ROOTSEL;
+ /* set editdata in vc */
+
+ for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
+ if (EBONE_SELECTABLE(arm, ebone)) {
+ mul_v3_m4v3(vec, vc->obedit->obmat, ebone->head);
+ ED_view3d_project_short(vc->ar, vec, sco1);
+ mul_v3_m4v3(vec, vc->obedit->obmat, ebone->tail);
+ ED_view3d_project_short(vc->ar, vec, sco2);
+
+ didpoint = 0;
+ if (BLI_lasso_is_point_inside(mcords, moves, sco1[0], sco1[1], IS_CLIPPED)) {
+ if (select) ebone->flag |= BONE_ROOTSEL;
+ else ebone->flag &= ~BONE_ROOTSEL;
+ didpoint = 1;
+ change = TRUE;
}
- }
-
- /* project tail location to screenspace */
- if (x1 != IS_CLIPPED) {
- points_proj_tot++;
- if (BLI_rcti_isect_pt(data->rect, x1, y1) &&
- BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, INT_MAX))
+ if (BLI_lasso_is_point_inside(mcords, moves, sco2[0], sco2[1], IS_CLIPPED)) {
+ if (select) ebone->flag |= BONE_TIPSEL;
+ else ebone->flag &= ~BONE_TIPSEL;
+ didpoint = 1;
+ change = TRUE;
+ }
+ /* if one of points selected, we skip the bone itself */
+ if (didpoint == 0 &&
+ BLI_lasso_is_edge_inside(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1], IS_CLIPPED))
{
- is_point_done = TRUE;
- if (data->select) ebone->flag |= BONE_TIPSEL;
- else ebone->flag &= ~BONE_TIPSEL;
+ if (select) ebone->flag |= BONE_TIPSEL | BONE_ROOTSEL | BONE_SELECTED;
+ else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
+ change = TRUE;
}
}
-
- /* if one of points selected, we skip the bone itself */
- if ((is_point_done == FALSE) && (points_proj_tot == 2) &&
- BLI_lasso_is_edge_inside(data->mcords, data->moves, x0, y0, x1, y1, INT_MAX))
- {
- if (data->select) ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- data->is_change = TRUE;
- }
-
- data->is_change |= is_point_done;
}
-}
-
-static void do_lasso_select_armature(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
-{
- LassoSelectUserData data;
- rcti rect;
-
- view3d_userdata_lassoselect_init(&data, vc, &rect, mcords, moves, select);
-
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
-
- BLI_lasso_boundbox(&rect, mcords, moves);
-
- if (extend == 0 && select)
- ED_armature_deselect_all_visible(vc->obedit);
-
- armature_foreachScreenBone(vc, do_lasso_select_armature__doSelectBone, &data);
-
- if (data.is_change) {
- bArmature *arm = vc->obedit->data;
+
+ if (change) {
ED_armature_sync_selection(arm->edbo);
ED_armature_validate_active(arm);
WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obedit);
}
}
-static void do_lasso_select_mball__doSelectElem(void *userData, struct MetaElem *ml, int x, int y)
-{
- LassoSelectUserData *data = userData;
- if (BLI_rcti_isect_pt(data->rect, x, y) &&
- BLI_lasso_is_point_inside(data->mcords, data->moves, x, y, INT_MAX)) {
- if (data->select) ml->flag |= SELECT;
- else ml->flag &= ~SELECT;
- data->is_change = TRUE;
- }
-}
-static void do_lasso_select_meta(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
-{
- LassoSelectUserData data;
- rcti rect;
- MetaBall *mb = (MetaBall *)vc->obedit->data;
- if (extend == 0 && select)
- BKE_mball_deselect_all(mb);
-
- view3d_userdata_lassoselect_init(&data, vc, &rect, mcords, moves, select);
+static void do_lasso_select_meta(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
+{
+ MetaBall *mb = (MetaBall *)vc->obedit->data;
+ MetaElem *ml;
+ float vec[3];
+ short sco[2];
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
+ if (extend == 0 && select) {
+ for (ml = mb->editelems->first; ml; ml = ml->next) {
+ ml->flag &= ~SELECT;
+ }
+ }
- BLI_lasso_boundbox(&rect, mcords, moves);
+ for (ml = mb->editelems->first; ml; ml = ml->next) {
+
+ mul_v3_m4v3(vec, vc->obedit->obmat, &ml->x);
+ ED_view3d_project_short(vc->ar, vec, sco);
- mball_foreachScreenElem(vc, do_lasso_select_mball__doSelectElem, &data);
+ if (BLI_lasso_is_point_inside(mcords, moves, sco[0], sco[1], IS_CLIPPED)) {
+ if (select) ml->flag |= SELECT;
+ else ml->flag &= ~SELECT;
+ }
+ }
}
static int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend)
@@ -768,7 +700,7 @@ static int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int
return OPERATOR_FINISHED;
}
-static void do_lasso_select_paintvert(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
+static void do_lasso_select_paintvert(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
Object *ob = vc->obact;
Mesh *me = ob ? ob->data : NULL;
@@ -790,7 +722,7 @@ static void do_lasso_select_paintvert(ViewContext *vc, const int mcords[][2], sh
paintvert_flush_flags(ob);
}
-static void do_lasso_select_paintface(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
+static void do_lasso_select_paintface(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
Object *ob = vc->obact;
Mesh *me = ob ? ob->data : NULL;
@@ -845,9 +777,7 @@ static void do_lasso_select_node(int mcords[][2], short moves, short select)
}
#endif
-static void view3d_lasso_select(bContext *C, ViewContext *vc,
- const int mcords[][2], short moves,
- short extend, short select)
+static void view3d_lasso_select(bContext *C, ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
Object *ob = CTX_data_active_object(C);
@@ -898,7 +828,7 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op)
{
ViewContext vc;
int mcords_tot;
- const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
+ int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
short extend, select;
@@ -1129,7 +1059,8 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int
}
else {
int temp, dist = 15;
- ED_view3d_project_base(vc->ar, base);
+
+ ED_view3d_project_short(vc->ar, base->object->obmat[3], &base->sx);
temp = abs(base->sx - mval[0]) + abs(base->sy - mval[1]);
if (temp < dist)
@@ -1410,7 +1341,8 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
base = startbase;
while (base) {
if (BASE_SELECTABLE(v3d, base)) {
- ED_view3d_project_base(ar, base);
+ ED_view3d_project_short(ar, base->object->obmat[3], &base->sx);
+
temp = abs(base->sx - mval[0]) + abs(base->sy - mval[1]);
if (base == BASACT) temp += 10;
if (temp < dist) {
@@ -1506,8 +1438,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
}
}
}
- else if (ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend, deselect, toggle) ) {
- /* then bone is found */
+ else if (ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend, deselect, toggle) ) { /* then bone is found */
/* we make the armature selected:
* not-selected active object in posemode won't work well for tools */
@@ -1582,37 +1513,19 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
typedef struct BoxSelectUserData {
ViewContext *vc;
- const rcti *rect;
- int select;
-
- /* runtime */
- int pass;
- int is_done;
- int is_change;
+ rcti *rect;
+ int select, pass, done;
} BoxSelectUserData;
-static void view3d_userdata_boxselect_init(BoxSelectUserData *r_data,
- ViewContext *vc, const rcti *rect, const int select)
-{
- r_data->vc = vc;
- r_data->rect = rect;
- r_data->select = select;
-
- /* runtime */
- r_data->pass = 0;
- r_data->is_done = FALSE;
- r_data->is_change = FALSE;
-}
-
-int edge_inside_circle(int centx, int centy, int radius, int x1, int y1, int x2, int y2)
+int edge_inside_circle(int centx, int centy, int rad, int x1, int y1, int x2, int y2)
{
- int radius_squared = radius * radius;
+ int radsq = rad * rad;
/* check points in circle itself */
- if ((x1 - centx) * (x1 - centx) + (y1 - centy) * (y1 - centy) <= radius_squared) {
+ if ((x1 - centx) * (x1 - centx) + (y1 - centy) * (y1 - centy) <= radsq) {
return TRUE;
}
- else if ((x2 - centx) * (x2 - centx) + (y2 - centy) * (y2 - centy) <= radius_squared) {
+ else if ((x2 - centx) * (x2 - centx) + (y2 - centy) * (y2 - centy) <= radsq) {
return TRUE;
}
else {
@@ -1620,7 +1533,7 @@ int edge_inside_circle(int centx, int centy, int radius, int x1, int y1, int x2,
const float v1[2] = {x1, y1};
const float v2[2] = {x2, y2};
/* pointdistline */
- if (dist_squared_to_line_segment_v2(cent, v1, v2) < (float)radius_squared) {
+ if (dist_squared_to_line_segment_v2(cent, v1, v2) < (float)radsq) {
return TRUE;
}
}
@@ -1637,7 +1550,7 @@ static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoi
if (BLI_rcti_isect_pt(data->rect, x, y)) {
if (bp) {
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
- if (bp == cu->lastsel && !(bp->f1 & SELECT)) cu->lastsel = NULL;
+ if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL;
}
else {
if (cu->drawflag & CU_HIDE_HANDLES) {
@@ -1656,7 +1569,7 @@ static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoi
}
}
- if (bezt == cu->lastsel && !(bezt->f2 & SELECT)) cu->lastsel = NULL;
+ if (bezt == cu->lastsel && !(bezt->f2 & 1)) cu->lastsel = NULL;
}
}
}
@@ -1664,7 +1577,9 @@ static int do_nurbs_box_select(ViewContext *vc, rcti *rect, int select, int exte
{
BoxSelectUserData data;
- view3d_userdata_boxselect_init(&data, vc, rect, select);
+ data.vc = vc;
+ data.rect = rect;
+ data.select = select;
if (extend == 0 && select)
CU_deselect_all(vc->obedit);
@@ -1687,7 +1602,9 @@ static int do_lattice_box_select(ViewContext *vc, rcti *rect, int select, int ex
{
BoxSelectUserData data;
- view3d_userdata_boxselect_init(&data, vc, rect, select);
+ data.vc = vc;
+ data.rect = rect;
+ data.select = select;
if (extend == 0 && select)
ED_setflagsLatt(vc->obedit, 0);
@@ -1714,7 +1631,7 @@ static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0
if (data->pass == 0) {
if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) {
BM_edge_select_set(data->vc->em->bm, eed, data->select);
- data->is_done = TRUE;
+ data->done = TRUE;
}
}
else {
@@ -1738,7 +1655,11 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
ToolSettings *ts = vc->scene->toolsettings;
int bbsel;
- view3d_userdata_boxselect_init(&data, vc, rect, select);
+ data.vc = vc;
+ data.rect = rect;
+ data.select = select;
+ data.pass = 0;
+ data.done = FALSE;
if (extend == 0 && select)
EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT);
@@ -1763,7 +1684,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
data.pass = 0;
mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
- if (data.is_done == 0) {
+ if (data.done == 0) {
data.pass = 1;
mesh_foreachScreenEdge(vc, do_mesh_box_select__doSelectEdge, &data, V3D_CLIP_TEST_OFF);
}
@@ -1796,8 +1717,11 @@ static int do_meta_box_select(ViewContext *vc, rcti *rect, int select, int exten
hits = view3d_opengl_select(vc, buffer, MAXPICKBUF, rect);
- if (extend == 0 && select)
- BKE_mball_deselect_all(mb);
+ if (extend == 0 && select) {
+ for (ml = mb->editelems->first; ml; ml = ml->next) {
+ ml->flag &= ~SELECT;
+ }
+ }
for (ml = mb->editelems->first; ml; ml = ml->next) {
for (a = 0; a < hits; a++) {
@@ -2218,32 +2142,15 @@ typedef struct CircleSelectUserData {
short select;
int mval[2];
float radius;
- float radius_squared;
-
- /* runtime */
- int is_change;
} CircleSelectUserData;
-static void view3d_userdata_circleselect_init(CircleSelectUserData *r_data,
- ViewContext *vc, const int select, const int mval[2], const float rad)
-{
- r_data->vc = vc;
- r_data->select = select;
- copy_v2_v2_int(r_data->mval, mval);
- r_data->radius = rad;
- r_data->radius_squared = rad * rad;
-
- /* runtime */
- r_data->is_change = FALSE;
-}
-
static void mesh_circle_doSelectVert(void *userData, BMVert *eve, int x, int y, int UNUSED(index))
{
CircleSelectUserData *data = userData;
- const float delta[2] = {(float)(x - data->mval[0]),
- (float)(y - data->mval[1])};
+ int mx = x - data->mval[0], my = y - data->mval[1];
+ float r = sqrt(mx * mx + my * my);
- if (len_squared_v2(delta) <= data->radius_squared) {
+ if (r <= data->radius) {
BM_vert_select_set(data->vc->em->bm, eve, data->select);
}
}
@@ -2258,10 +2165,10 @@ static void mesh_circle_doSelectEdge(void *userData, BMEdge *eed, int x0, int y0
static void mesh_circle_doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
{
CircleSelectUserData *data = userData;
- const float delta[2] = {(float)(x - data->mval[0]),
- (float)(y - data->mval[1])};
-
- if (len_squared_v2(delta) <= data->radius_squared) {
+ int mx = x - data->mval[0], my = y - data->mval[1];
+ float r = sqrt(mx * mx + my * my);
+
+ if (r <= data->radius) {
BM_face_select_set(data->vc->em->bm, efa, data->select);
}
}
@@ -2277,7 +2184,11 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f
vc->em = BMEdit_FromObject(vc->obedit);
- view3d_userdata_circleselect_init(&data, vc, select, mval, rad);
+ data.vc = vc;
+ data.select = select;
+ data.mval[0] = mval[0];
+ data.mval[1] = mval[1];
+ data.radius = rad;
if (ts->selectmode & SCE_SELECT_VERTEX) {
if (bbsel) {
@@ -2348,17 +2259,16 @@ static void paint_vertsel_circle_select(ViewContext *vc, int select, const int m
static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
CircleSelectUserData *data = userData;
+ int mx = x - data->mval[0], my = y - data->mval[1];
+ float r = sqrt(mx * mx + my * my);
Object *obedit = data->vc->obedit;
Curve *cu = (Curve *)obedit->data;
- const float delta[2] = {(float)(x - data->mval[0]),
- (float)(y - data->mval[1])};
-
- if (len_squared_v2(delta) <= data->radius_squared) {
+ if (r <= data->radius) {
if (bp) {
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
- if (bp == cu->lastsel && !(bp->f1 & SELECT)) cu->lastsel = NULL;
+ if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL;
}
else {
if (cu->drawflag & CU_HIDE_HANDLES) {
@@ -2377,7 +2287,7 @@ static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint
}
}
- if (bezt == cu->lastsel && !(bezt->f2 & SELECT)) cu->lastsel = NULL;
+ if (bezt == cu->lastsel && !(bezt->f2 & 1)) cu->lastsel = NULL;
}
}
}
@@ -2385,7 +2295,13 @@ static void nurbscurve_circle_select(ViewContext *vc, int select, const int mval
{
CircleSelectUserData data;
- view3d_userdata_circleselect_init(&data, vc, select, mval, rad);
+ /* set vc-> edit data */
+
+ data.select = select;
+ data.mval[0] = mval[0];
+ data.mval[1] = mval[1];
+ data.radius = rad;
+ data.vc = vc;
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
nurbs_foreachScreenVert(vc, nurbscurve_circle_doSelect, &data);
@@ -2395,10 +2311,10 @@ static void nurbscurve_circle_select(ViewContext *vc, int select, const int mval
static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int y)
{
CircleSelectUserData *data = userData;
- const float delta[2] = {(float)(x - data->mval[0]),
- (float)(y - data->mval[1])};
+ int mx = x - data->mval[0], my = y - data->mval[1];
+ float r = sqrt(mx * mx + my * my);
- if (len_squared_v2(delta) <= data->radius_squared) {
+ if (r <= data->radius) {
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
}
}
@@ -2406,7 +2322,12 @@ static void lattice_circle_select(ViewContext *vc, int select, const int mval[2]
{
CircleSelectUserData data;
- view3d_userdata_circleselect_init(&data, vc, select, mval, rad);
+ /* set vc-> edit data */
+
+ data.select = select;
+ data.mval[0] = mval[0];
+ data.mval[1] = mval[1];
+ data.radius = rad;
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
lattice_foreachScreenVert(vc, latticecurve_circle_doSelect, &data);
@@ -2417,10 +2338,10 @@ static void lattice_circle_select(ViewContext *vc, int select, const int mval[2]
static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int x, int y)
{
CircleSelectUserData *data = userData;
- const float delta[2] = {(float)(x - data->mval[0]),
- (float)(y - data->mval[1])};
-
- if (len_squared_v2(delta) <= data->radius_squared) {
+ int mx = x - data->mval[0], my = y - data->mval[1];
+ float r = sqrt(mx * mx + my * my);
+
+ if (r <= data->radius) {
if (data->select)
pchan->bone->flag |= BONE_SELECTED;
else
@@ -2429,78 +2350,63 @@ static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int
}
return 0;
}
-static void do_circle_select_pose__doSelectBone(void *userData, struct bPoseChannel *pchan, int x0, int y0, int x1, int y1)
-{
- CircleSelectUserData *data = userData;
- bArmature *arm = data->vc->obact->data;
-
- if (PBONE_SELECTABLE(arm, pchan->bone)) {
- int is_point_done = FALSE;
- int points_proj_tot = 0;
-
- /* project head location to screenspace */
- if (x0 != IS_CLIPPED) {
- points_proj_tot++;
- if (pchan_circle_doSelectJoint(data, pchan, x0, y0)) {
- is_point_done = TRUE;
- }
- }
-
- /* project tail location to screenspace */
- if (x1 != IS_CLIPPED) {
- points_proj_tot++;
- if (pchan_circle_doSelectJoint(data, pchan, x1, y1)) {
- is_point_done = TRUE;
- }
- }
-
- /* check if the head and/or tail is in the circle
- * - the call to check also does the selection already
- */
-
- /* only if the endpoints didn't get selected, deal with the middle of the bone too
- * It works nicer to only do this if the head or tail are not in the circle,
- * otherwise there is no way to circle select joints alone */
- if ((is_point_done == FALSE) && (points_proj_tot == 2) &&
- edge_inside_circle(data->mval[0], data->mval[1], data->radius, x0, y0, x1, y1))
- {
- if (data->select) pchan->bone->flag |= BONE_SELECTED;
- else pchan->bone->flag &= ~BONE_SELECTED;
- data->is_change = TRUE;
- }
-
- data->is_change |= is_point_done;
- }
-}
static void pose_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
{
CircleSelectUserData data;
+ bArmature *arm = vc->obact->data;
+ bPose *pose = vc->obact->pose;
+ bPoseChannel *pchan;
+ int change = FALSE;
- view3d_userdata_circleselect_init(&data, vc, select, mval, rad);
+ /* set vc->edit data */
+ data.select = select;
+ data.mval[0] = mval[0];
+ data.mval[1] = mval[1];
+ data.radius = rad;
ED_view3d_init_mats_rv3d(vc->obact, vc->rv3d); /* for foreach's screen/vert projection */
- pose_foreachScreenBone(vc, do_circle_select_pose__doSelectBone, &data);
-
- if (data.is_change) {
- bArmature *arm = vc->obact->data;
+ /* check each PoseChannel... */
+ /* TODO: could be optimized at some point */
+ for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
+ short sco1[2], sco2[2], didpoint = 0;
+ float vec[3];
+
+ /* skip invisible bones */
+ if (PBONE_SELECTABLE(arm, pchan->bone) == 0)
+ continue;
+
+ /* project head location to screenspace */
+ mul_v3_m4v3(vec, vc->obact->obmat, pchan->pose_head);
+ ED_view3d_project_short(vc->ar, vec, sco1);
+
+ /* project tail location to screenspace */
+ mul_v3_m4v3(vec, vc->obact->obmat, pchan->pose_tail);
+ ED_view3d_project_short(vc->ar, vec, sco2);
+
+ /* check if the head and/or tail is in the circle
+ * - the call to check also does the selection already
+ */
+ if (pchan_circle_doSelectJoint(&data, pchan, sco1[0], sco1[1]))
+ didpoint = 1;
+ if (pchan_circle_doSelectJoint(&data, pchan, sco2[0], sco2[1]))
+ didpoint = 1;
+
+ change |= didpoint;
+ }
+ if (change) {
WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obact);
-
- if (arm->flag & ARM_HAS_VIZ_DEPS) {
- /* mask modifier ('armature' mode), etc. */
- DAG_id_tag_update(&vc->obact->id, OB_RECALC_DATA);
- }
}
}
static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int x, int y, short head)
{
CircleSelectUserData *data = userData;
- const float delta[2] = {(float)(x - data->mval[0]),
- (float)(y - data->mval[1])};
+ int mx = x - data->mval[0], my = y - data->mval[1];
+ float r = sqrt(mx * mx + my * my);
- if (len_squared_v2(delta) <= data->radius_squared) {
+ if (r <= data->radius) {
if (head) {
if (data->select)
ebone->flag |= BONE_ROOTSEL;
@@ -2517,90 +2423,66 @@ static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int
}
return 0;
}
-static void do_circle_select_armature__doSelectBone(void *userData, struct EditBone *ebone, int x0, int y0, int x1, int y1)
+static void armature_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
{
- CircleSelectUserData *data = userData;
- bArmature *arm = data->vc->obedit->data;
+ CircleSelectUserData data;
+ bArmature *arm = vc->obedit->data;
+ EditBone *ebone;
+ int change = FALSE;
+
+ /* set vc->edit data */
+ data.select = select;
+ data.mval[0] = mval[0];
+ data.mval[1] = mval[1];
+ data.radius = rad;
- if (EBONE_SELECTABLE(arm, ebone)) {
- int is_point_done = FALSE;
- int points_proj_tot = 0;
+ ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
+
+ /* check each EditBone... */
+ /* TODO: could be optimized at some point */
+ for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
+ short sco1[2], sco2[2], didpoint = 0;
+ float vec[3];
+
+ if (EBONE_SELECTABLE(arm, ebone) == 0)
+ continue;
/* project head location to screenspace */
- if (x0 != IS_CLIPPED) {
- points_proj_tot++;
- if (armature_circle_doSelectJoint(data, ebone, x0, y0, TRUE)) {
- is_point_done = TRUE;
- }
- }
-
+ mul_v3_m4v3(vec, vc->obedit->obmat, ebone->head);
+ ED_view3d_project_short(vc->ar, vec, sco1);
+
/* project tail location to screenspace */
- if (x1 != IS_CLIPPED) {
- points_proj_tot++;
- if (armature_circle_doSelectJoint(data, ebone, x1, y1, FALSE)) {
- is_point_done = TRUE;
- }
- }
-
- /* check if the head and/or tail is in the circle
- * - the call to check also does the selection already
+ mul_v3_m4v3(vec, vc->obedit->obmat, ebone->tail);
+ ED_view3d_project_short(vc->ar, vec, sco2);
+
+ /* check if the head and/or tail is in the circle
+ * - the call to check also does the selection already
*/
-
- /* only if the endpoints didn't get selected, deal with the middle of the bone too
- * It works nicer to only do this if the head or tail are not in the circle,
- * otherwise there is no way to circle select joints alone */
- if ((is_point_done == FALSE) && (points_proj_tot == 2) &&
- edge_inside_circle(data->mval[0], data->mval[1], data->radius, x0, y0, x1, y1))
- {
- if (data->select) ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- data->is_change = TRUE;
+ if (armature_circle_doSelectJoint(&data, ebone, sco1[0], sco1[1], 1))
+ didpoint = 1;
+ if (armature_circle_doSelectJoint(&data, ebone, sco2[0], sco2[1], 0))
+ didpoint = 1;
+
+ /* only if the endpoints didn't get selected, deal with the middle of the bone too */
+ /* XXX should we just do this always? */
+ if ((didpoint == 0) && edge_inside_circle(mval[0], mval[1], rad, sco1[0], sco1[1], sco2[0], sco2[1])) {
+ if (select)
+ ebone->flag |= BONE_TIPSEL | BONE_ROOTSEL | BONE_SELECTED;
+ else
+ ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
+ change = TRUE;
}
-
- data->is_change |= is_point_done;
+
+ change |= didpoint;
}
-}
-static void armature_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
-{
- CircleSelectUserData data;
- bArmature *arm = vc->obedit->data;
- view3d_userdata_circleselect_init(&data, vc, select, mval, rad);
-
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
-
- armature_foreachScreenBone(vc, do_circle_select_armature__doSelectBone, &data);
-
- if (data.is_change) {
+ if (change) {
ED_armature_sync_selection(arm->edbo);
ED_armature_validate_active(arm);
WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obedit);
}
}
-static void do_circle_select_mball__doSelectElem(void *userData, struct MetaElem *ml, int x, int y)
-{
- CircleSelectUserData *data = userData;
- const float delta[2] = {(float)(x - data->mval[0]),
- (float)(y - data->mval[1])};
-
- if (len_squared_v2(delta) <= data->radius_squared) {
- if (data->select) ml->flag |= SELECT;
- else ml->flag &= ~SELECT;
- data->is_change = TRUE;
- }
-}
-static void mball_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
-{
- CircleSelectUserData data;
-
- view3d_userdata_circleselect_init(&data, vc, select, mval, rad);
-
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
-
- mball_foreachScreenElem(vc, do_circle_select_mball__doSelectElem, &data);
-}
-
/** Callbacks for circle selection in Editmode */
static void obedit_circle_select(ViewContext *vc, short select, const int mval[2], float rad)
@@ -2619,50 +2501,24 @@ static void obedit_circle_select(ViewContext *vc, short select, const int mval[2
case OB_ARMATURE:
armature_circle_select(vc, select, mval, rad);
break;
- case OB_MBALL:
- mball_circle_select(vc, select, mval, rad);
- break;
default:
return;
}
}
-static int object_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
-{
- Scene *scene = vc->scene;
- const float radius_squared = rad * rad;
- const float mval_fl[2] = {mval[0], mval[1]};
- int is_change = FALSE;
-
- Base *base;
- select = select ? BA_SELECT : BA_DESELECT;
- for (base = FIRSTBASE; base; base = base->next) {
- if (((base->flag & SELECT) == 0) && BASE_SELECTABLE(vc->v3d, base)) {
- float screen_co[2];
- if (ED_view3d_project_float_global(vc->ar, base->object->obmat[3], screen_co,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) == V3D_PROJ_RET_OK)
- {
- if (len_squared_v2v2(mval_fl, screen_co) <= radius_squared) {
- ED_base_object_select(base, select);
- is_change = TRUE;
- }
- }
- }
- }
-
- return is_change;
-}
-
/* not a real operator, only for circle test */
static int view3d_circle_select_exec(bContext *C, wmOperator *op)
{
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = CTX_wm_region(C);
Scene *scene = CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
+ View3D *v3d = sa->spacedata.first;
+ int x = RNA_int_get(op->ptr, "x");
+ int y = RNA_int_get(op->ptr, "y");
int radius = RNA_int_get(op->ptr, "radius");
int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
int select;
- const int mval[2] = {RNA_int_get(op->ptr, "x"),
- RNA_int_get(op->ptr, "y")};
select = (gesture_mode == GESTURE_MODAL_SELECT);
@@ -2670,10 +2526,13 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
(obact && (obact->mode & (OB_MODE_PARTICLE_EDIT | OB_MODE_POSE))) )
{
ViewContext vc;
+ int mval[2];
view3d_operator_needs_opengl(C);
view3d_set_viewcontext(C, &vc);
+ mval[0] = x;
+ mval[1] = y;
if (CTX_data_edit_object(C)) {
obedit_circle_select(&vc, select, mval, (float)radius);
@@ -2696,12 +2555,21 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
else {
- ViewContext vc;
- view3d_set_viewcontext(C, &vc);
-
- if (object_circle_select(&vc, select, mval, (float)radius)) {
- WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
+ Base *base;
+ select = select ? BA_SELECT : BA_DESELECT;
+ for (base = FIRSTBASE; base; base = base->next) {
+ if (BASE_SELECTABLE(v3d, base)) {
+ ED_view3d_project_short(ar, base->object->obmat[3], &base->sx);
+ if (base->sx != IS_CLIPPED) {
+ int dx = base->sx - x;
+ int dy = base->sy - y;
+ if (dx * dx + dy * dy < radius * radius)
+ ED_base_object_select(base, select);
+ }
+ }
}
+
+ WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C));
}
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index e4a6d7e1b17..ff518e6ce5b 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -858,19 +858,6 @@ void ED_view3d_project_float_v3_m4(ARegion *ar, const float vec[3], float r_co[3
}
}
-eV3DProjStatus ED_view3d_project_base(struct ARegion *ar, struct Base *base)
-{
- eV3DProjStatus ret = ED_view3d_project_short_global(ar, base->object->obmat[3], &base->sx,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN);
-
- if (ret != V3D_PROJ_RET_OK) {
- base->sx = IS_CLIPPED;
- base->sy = 0;
- }
-
- return ret;
-}
-
int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
{
/* return 1: draw */
@@ -906,145 +893,148 @@ int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
return 0;
}
-/* perspmat is typically...
- * - 'rv3d->perspmat', is_local == FALSE
- * - 'rv3d->perspmatob', is_local == TRUE
- */
-static eV3DProjStatus ed_view3d_project__internal(ARegion *ar,
- float perspmat[4][4], const int is_local, /* normally hidden */
- const float co[3], float r_co[2], eV3DProjTest flag)
+void ED_view3d_project_short(ARegion *ar, const float co[3], short r_co[2]) /* clips */
{
+ RegionView3D *rv3d = ar->regiondata;
float fx, fy, vec4[4];
-
- if (flag & V3D_PROJ_TEST_CLIP_BB) {
- RegionView3D *rv3d = ar->regiondata;
- if (rv3d->rflag & RV3D_CLIPPING) {
- if (ED_view3d_clipping_test(rv3d, co, is_local)) {
- return V3D_PROJ_RET_CLIP_BB;
- }
+
+ r_co[0] = IS_CLIPPED;
+
+ if (rv3d->rflag & RV3D_CLIPPING) {
+ if (ED_view3d_clipping_test(rv3d, co, FALSE)) {
+ return;
}
}
-
+
copy_v3_v3(vec4, co);
vec4[3] = 1.0;
- mul_m4_v4(perspmat, vec4);
-
+ mul_m4_v4(rv3d->persmat, vec4);
+
if (vec4[3] > (float)BL_NEAR_CLIP) {
- fx = ((float)ar->winx / 2.0f) * (1.0f + vec4[0] / vec4[3]);
- if (((flag & V3D_PROJ_TEST_CLIP_WIN) == 0) || (fx > 0 && fx < ar->winx)) {
- fy = ((float)ar->winy / 2.0f) * (1.0f + vec4[1] / vec4[3]);
- if (((flag & V3D_PROJ_TEST_CLIP_WIN) == 0) || (fy > 0.0f && fy < (float)ar->winy)) {
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+
+ if (fx > 0 && fx < ar->winx) {
+
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
+
+ if (fy > 0.0f && fy < (float)ar->winy) {
r_co[0] = (short)floor(fx);
r_co[1] = (short)floor(fy);
}
- else {
- return V3D_PROJ_RET_CLIP_WIN;
- }
}
- else {
- return V3D_PROJ_RET_CLIP_WIN;
- }
- }
- else {
- return V3D_PROJ_RET_CLIP_NEAR;
}
-
- return V3D_PROJ_RET_OK;
}
-eV3DProjStatus ED_view3d_project_short_ex(ARegion *ar, float perspmat[4][4], const int is_local,
- const float co[3], short r_co[2], eV3DProjTest flag)
+void ED_view3d_project_int(ARegion *ar, const float co[3], int r_co[2])
{
- float tvec[2];
- eV3DProjStatus ret = ed_view3d_project__internal(ar, perspmat, is_local, co, tvec, flag);
- if (ret == V3D_PROJ_RET_OK) {
- if ((tvec[0] > -32700.0 && tvec[0] < 32700.0f) &&
- (tvec[1] > -32700.0 && tvec[1] < 32700.0f))
- {
- r_co[0] = (short)floor(tvec[0]);
- r_co[1] = (short)floor(tvec[1]);
- }
- else {
- ret = V3D_PROJ_RET_OVERFLOW;
+ RegionView3D *rv3d = ar->regiondata;
+ float fx, fy, vec4[4];
+
+ copy_v3_v3(vec4, co);
+ vec4[3] = 1.0;
+ r_co[0] = (int)2140000000.0f;
+
+ mul_m4_v4(rv3d->persmat, vec4);
+
+ if (vec4[3] > (float)BL_NEAR_CLIP) {
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+
+ if (fx > -2140000000.0f && fx < 2140000000.0f) {
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
+
+ if (fy > -2140000000.0f && fy < 2140000000.0f) {
+ r_co[0] = (int)floor(fx);
+ r_co[1] = (int)floor(fy);
+ }
}
}
- return ret;
}
-eV3DProjStatus ED_view3d_project_int_ex(ARegion *ar, float perspmat[4][4], const int is_local,
- const float co[3], int r_co[2], eV3DProjTest flag)
+void ED_view3d_project_int_noclip(ARegion *ar, const float co[3], int r_co[2])
{
- float tvec[2];
- eV3DProjStatus ret = ed_view3d_project__internal(ar, perspmat, is_local, co, tvec, flag);
- if (ret == V3D_PROJ_RET_OK) {
- if ((tvec[0] > -2140000000.0 && tvec[0] < 2140000000.0f) &&
- (tvec[1] > -2140000000.0 && tvec[1] < 2140000000.0f))
- {
- r_co[0] = (int)floor(tvec[0]);
- r_co[1] = (int)floor(tvec[1]);
- }
- else {
- ret = V3D_PROJ_RET_OVERFLOW;
- }
+ RegionView3D *rv3d = ar->regiondata;
+ float fx, fy, vec4[4];
+
+ copy_v3_v3(vec4, co);
+ vec4[3] = 1.0;
+
+ mul_m4_v4(rv3d->persmat, vec4);
+
+ if (fabs(vec4[3]) > BL_NEAR_CLIP) {
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
+
+ r_co[0] = (int)floor(fx);
+ r_co[1] = (int)floor(fy);
+ }
+ else {
+ r_co[0] = ar->winx / 2;
+ r_co[1] = ar->winy / 2;
}
- return ret;
}
-eV3DProjStatus ED_view3d_project_float_ex(ARegion *ar, float perspmat[4][4], const int is_local,
- const float co[3], float r_co[2], eV3DProjTest flag)
+void ED_view3d_project_short_noclip(ARegion *ar, const float co[3], short r_co[2])
{
- float tvec[2];
- eV3DProjStatus ret = ed_view3d_project__internal(ar, perspmat, is_local, co, tvec, flag);
- if (ret == V3D_PROJ_RET_OK) {
- if (finite(tvec[0]) &&
- finite(tvec[1]))
- {
- copy_v2_v2(r_co, tvec);
- }
- else {
- ret = V3D_PROJ_RET_OVERFLOW;
+ RegionView3D *rv3d = ar->regiondata;
+ float fx, fy, vec4[4];
+
+ copy_v3_v3(vec4, co);
+ vec4[3] = 1.0;
+ r_co[0] = IS_CLIPPED;
+
+ mul_m4_v4(rv3d->persmat, vec4);
+
+ if (vec4[3] > (float)BL_NEAR_CLIP) {
+ fx = (ar->winx / 2) * (1 + vec4[0] / vec4[3]);
+
+ if (fx > -32700 && fx < 32700) {
+
+ fy = (ar->winy / 2) * (1 + vec4[1] / vec4[3]);
+
+ if (fy > -32700.0f && fy < 32700.0f) {
+ r_co[0] = (short)floor(fx);
+ r_co[1] = (short)floor(fy);
+ }
}
}
- return ret;
}
-/* --- short --- */
-eV3DProjStatus ED_view3d_project_short_global(ARegion *ar, const float co[3], short r_co[2], eV3DProjTest flag)
+void ED_view3d_project_float(ARegion *ar, const float co[3], float r_co[2])
{
RegionView3D *rv3d = ar->regiondata;
- return ED_view3d_project_short_ex(ar, rv3d->persmat, FALSE, co, r_co, flag);
-}
-/* object space, use ED_view3d_init_mats_rv3d before calling */
-eV3DProjStatus ED_view3d_project_short_object(ARegion *ar, const float co[3], short r_co[2], eV3DProjTest flag)
-{
- RegionView3D *rv3d = ar->regiondata;
- return ED_view3d_project_short_ex(ar, rv3d->persmatob, TRUE, co, r_co, flag);
-}
-/* --- int --- */
-eV3DProjStatus ED_view3d_project_int_global(ARegion *ar, const float co[3], int r_co[2], eV3DProjTest flag)
-{
- RegionView3D *rv3d = ar->regiondata;
- return ED_view3d_project_int_ex(ar, rv3d->persmat, FALSE, co, r_co, flag);
-}
-/* object space, use ED_view3d_init_mats_rv3d before calling */
-eV3DProjStatus ED_view3d_project_int_object(ARegion *ar, const float co[3], int r_co[2], eV3DProjTest flag)
-{
- RegionView3D *rv3d = ar->regiondata;
- return ED_view3d_project_int_ex(ar, rv3d->persmatob, TRUE, co, r_co, flag);
-}
+ float vec4[4];
-/* --- float --- */
-eV3DProjStatus ED_view3d_project_float_global(ARegion *ar, const float co[3], float r_co[2], eV3DProjTest flag)
-{
- RegionView3D *rv3d = ar->regiondata;
- return ED_view3d_project_float_ex(ar, rv3d->persmat, FALSE, co, r_co, flag);
+ copy_v3_v3(vec4, co);
+ vec4[3] = 1.0;
+ r_co[0] = IS_CLIPPED;
+
+ mul_m4_v4(rv3d->persmat, vec4);
+
+ if (vec4[3] > (float)BL_NEAR_CLIP) {
+ r_co[0] = (float)(ar->winx / 2.0f) + (ar->winx / 2.0f) * vec4[0] / vec4[3];
+ r_co[1] = (float)(ar->winy / 2.0f) + (ar->winy / 2.0f) * vec4[1] / vec4[3];
+ }
}
-/* object space, use ED_view3d_init_mats_rv3d before calling */
-eV3DProjStatus ED_view3d_project_float_object(ARegion *ar, const float co[3], float r_co[2], eV3DProjTest flag)
+
+void ED_view3d_project_float_noclip(ARegion *ar, const float co[3], float r_co[2])
{
RegionView3D *rv3d = ar->regiondata;
- return ED_view3d_project_float_ex(ar, rv3d->persmatob, TRUE, co, r_co, flag);
+ float vec4[4];
+
+ copy_v3_v3(vec4, co);
+ vec4[3] = 1.0;
+
+ mul_m4_v4(rv3d->persmat, vec4);
+
+ if (fabs(vec4[3]) > BL_NEAR_CLIP) {
+ r_co[0] = (float)(ar->winx / 2.0f) + (ar->winx / 2.0f) * vec4[0] / vec4[3];
+ r_co[1] = (float)(ar->winy / 2.0f) + (ar->winy / 2.0f) * vec4[1] / vec4[3];
+ }
+ else {
+ r_co[0] = ar->winx / 2.0f;
+ r_co[1] = ar->winy / 2.0f;
+ }
}
/* copies logic of get_view3d_viewplane(), keep in sync */
@@ -1319,7 +1309,7 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
Base tbase;
tbase.flag = OB_FROMDUPLI;
- lb = object_duplilist(scene, base->object, FALSE);
+ lb = object_duplilist(scene, base->object);
for (dob = lb->first; dob; dob = dob->next) {
tbase.object = dob->ob;
@@ -1647,6 +1637,7 @@ static int localview_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_localview(wmOperatorType *ot)
{
+
/* identifiers */
ot->name = "Local View";
ot->description = "Toggle display of selected object(s) separately and centered in view";
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 5e31de96e0e..343fa6681f3 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -57,8 +57,6 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "BLF_api.h"
-
#include "BKE_nla.h"
#include "BKE_bmesh.h"
#include "BKE_context.h"
@@ -90,14 +88,12 @@
#include "BLI_linklist.h"
#include "BLI_smallhash.h"
#include "BLI_array.h"
-#include "PIL_time.h"
-#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "transform.h"
-#include <stdio.h> // XXX: duplicated???
+#include <stdio.h>
static void drawTransformApply(const struct bContext *C, ARegion *ar, void *arg);
static int doEdgeSlide(TransInfo *t, float perc);
@@ -229,12 +225,8 @@ void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy)
void projectIntView(TransInfo *t, const float vec[3], int adr[2])
{
if (t->spacetype == SPACE_VIEW3D) {
- if (t->ar->regiontype == RGN_TYPE_WINDOW) {
- if (ED_view3d_project_int_global(t->ar, vec, adr, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK) {
- adr[0] = (int)2140000000.0f; /* this is what was done in 2.64, perhaps we can be smarter? */
- adr[1] = (int)2140000000.0f;
- }
- }
+ if (t->ar->regiontype == RGN_TYPE_WINDOW)
+ ED_view3d_project_int_noclip(t->ar, vec, adr);
}
else if (t->spacetype == SPACE_IMAGE) {
SpaceImage *sima = t->sa->spacedata.first;
@@ -355,11 +347,7 @@ void projectFloatView(TransInfo *t, const float vec[3], float adr[2])
case SPACE_VIEW3D:
{
if (t->ar->regiontype == RGN_TYPE_WINDOW) {
- if (ED_view3d_project_float_global(t->ar, vec, adr, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK) {
- /* XXX, 2.64 and prior did this, weak! */
- adr[0] = t->ar->winx / 2.0f;
- adr[1] = t->ar->winy / 2.0f;
- }
+ ED_view3d_project_float_noclip(t->ar, vec, adr);
return;
}
break;
@@ -831,7 +819,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
float mati[3][3] = MAT3_UNITY;
char cmode = constraintModeToChar(t);
int handled = 1;
-
+
t->redraw |= handleMouseInput(t, &t->mouse, event);
if (event->type == MOUSEMOVE) {
@@ -1275,13 +1263,10 @@ int transformEvent(TransInfo *t, wmEvent *event)
if (t->handleEvent)
t->redraw |= t->handleEvent(t, event);
- if (handled || t->redraw) {
- t->last_update = PIL_check_seconds_timer();
+ if (handled || t->redraw)
return 0;
- }
- else {
+ else
return OPERATOR_PASS_THROUGH;
- }
}
int calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], int cent2d[2])
@@ -1564,74 +1549,14 @@ static void drawTransformView(const struct bContext *C, ARegion *UNUSED(ar), voi
drawNonPropEdge(C, t);
}
-/* just draw a little warning message in the top-right corner of the viewport to warn that autokeying is enabled */
-static void drawAutoKeyWarning(TransInfo *t, ARegion *ar)
+#if 0
+static void drawTransformPixel(const struct bContext *UNUSED(C), ARegion *UNUSED(ar), void *UNUSED(arg))
{
- int show_warning;
-
- /* colored border around the viewport */
- UI_ThemeColor(TH_VERTEX_SELECT);
-
- glBegin(GL_LINE_LOOP);
- glVertex2f(1, 1);
- glVertex2f(1, ar->winy-1);
- glVertex2f(ar->winx-1, ar->winy-1);
- glVertex2f(ar->winx-1, 1);
- glEnd();
-
- /* Entire warning should "blink" to catch periphery attention without being overly distracting
- * much like how a traditional recording sign in the corner of a camcorder works
- *
- * - Blink frequency here is 0.5 secs (i.e. a compromise between epilepsy-inducing flicker + too slow to notice).
- * We multiply by two to speed up the odd/even time-in-seconds = on/off toggle.
- * - Always start with warning shown so that animators are more likely to notice when starting to transform
- */
-
- show_warning = ((int)((t->last_update - floor(t->last_update)) * 2.0) & 1);
-
- if ((show_warning) || (t->state == TRANS_STARTING)) {
- const char printable[] = "Auto Keying On";
- int xco, yco;
-
- xco = ar->winx - BLF_width_default(printable) - 10;
- yco = ar->winy - BLF_height_default(printable) - 10;
-
- /* warning text (to clarify meaning of overlays)
- * - original color was red to match the icon, but that clashes badly with a less nasty border
- */
- UI_ThemeColor(TH_VERTEX_SELECT);
- BLF_draw_default_ascii(xco, ar->winy - 17, 0.0f, printable, sizeof(printable));
-
- /* autokey recording icon... */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- xco -= (ICON_DEFAULT_WIDTH + 2);
- UI_icon_draw(xco, yco, ICON_REC);
-
- glDisable(GL_BLEND);
- }
-}
-
-static void drawTransformPixel(const struct bContext *UNUSED(C), ARegion *ar, void *arg)
-{
- TransInfo *t = arg;
- Scene *scene = t->scene;
- Object *ob = OBACT;
-
- /* draw autokeyframing hint in the corner
- * - only draw if enabled (advanced users may be distracted/annoyed),
- * for objects that will be autokeyframed (no point ohterwise),
- * AND only for the active region (as showing all is too overwhelming)
- */
- if ((U.autokey_flag & AUTOKEY_FLAG_NOWARNING) == 0) {
- if (ar == t->ar) {
- if (ob && autokeyframe_cfra_can_key(scene, &ob->id)) {
- drawAutoKeyWarning(t, ar);
- }
- }
- }
+// TransInfo *t = arg;
+//
+// drawHelpline(C, t->mval[0], t->mval[1], t);
}
+#endif
void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
{
@@ -1801,7 +1726,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
t->draw_handle_apply = ED_region_draw_cb_activate(t->ar->type, drawTransformApply, t, REGION_DRAW_PRE_VIEW);
t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
- t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
+ //t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
}
else if (t->spacetype == SPACE_IMAGE) {
@@ -4048,15 +3973,12 @@ int Tilt(TransInfo *t, const int UNUSED(mval[2]))
outputNumInput(&(t->num), c);
- sprintf(str, "Tilt: %s° %s", &c[0], t->proptext);
+ sprintf(str, "Tilt: %s %s", &c[0], t->proptext);
final = DEG2RADF(final);
-
- /* XXX For some reason, this seems needed for this op, else RNA prop is not updated... :/ */
- t->values[0] = final;
}
else {
- sprintf(str, "Tilt: %.2f° %s", RAD2DEGF(final), t->proptext);
+ sprintf(str, "Tilt: %.2f %s", RAD2DEGF(final), t->proptext);
}
for (i = 0; i < t->total; i++, td++) {
@@ -4867,12 +4789,12 @@ static void calcNonProportionalEdgeSlide(TransInfo *t, SlideData *sld, const flo
sv->edge_len = len_v3v3(dw_p, up_p);
mul_v3_m4v3(v_proj, t->obedit->obmat, sv->v->co);
- if (ED_view3d_project_float_global(t->ar, v_proj, v_proj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- dist = len_squared_v2v2(mval, v_proj);
- if (dist < min_dist) {
- min_dist = dist;
- sld->curr_sv_index = i;
- }
+ ED_view3d_project_float_noclip(t->ar, v_proj, v_proj);
+
+ dist = len_squared_v2v2(mval, v_proj);
+ if (dist < min_dist) {
+ min_dist = dist;
+ sld->curr_sv_index = i;
}
}
}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 40f53423d37..e645cb2fed6 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -322,8 +322,6 @@ typedef struct TransInfo {
float auto_values[4];
float axis[3];
float axis_orig[3]; /* TransCon can change 'axis', store the original value here */
-
- double last_update; /* Time of last update (in seconds) */
void *view;
struct bContext *context; /* Only valid (non null) during an operator called function. */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 2e9d1ee670f..39a5da94798 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -3986,13 +3986,13 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
*flag = (seq->flag | SELECT) & ~(SEQ_LEFTSEL | SEQ_RIGHTSEL);
if (t->frame_side == 'R') {
- if (right <= cfra) { *count = *flag = 0; } /* ignore */
- else if (left > cfra) { } /* keep the selection */
+ if (right <= cfra) *count = *flag = 0; /* ignore */
+ else if (left > cfra) ; /* keep the selection */
else *flag |= SEQ_RIGHTSEL;
}
else {
- if (left >= cfra) { *count = *flag = 0; } /* ignore */
- else if (right < cfra) { } /* keep the selection */
+ if (left >= cfra) *count = *flag = 0; /* ignore */
+ else if (right < cfra) ; /* keep the selection */
else *flag |= SEQ_LEFTSEL;
}
}
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index fc0c174a525..81a4c082dcc 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -605,10 +605,8 @@ static void TRANSFORM_OT_trackball(struct wmOperatorType *ot)
static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
{
- PropertyRNA *prop;
-
/* identifiers */
- ot->name = "Rotate";
+ ot->name = "Rotate";
ot->description = "Rotate selected items";
ot->idname = OP_ROTATION;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
@@ -620,22 +618,19 @@ static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
- prop = RNA_def_float(ot->srna, "value", 0.0f, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
- RNA_def_property_subtype(prop, PROP_ANGLE);
+ RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
Transform_Properties(ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP);
}
static void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
{
- PropertyRNA *prop;
-
/* identifiers */
- ot->name = "Tilt";
+ ot->name = "Tilt";
/* optionals -
* "Tilt selected vertices"
- * "Specify an extra axis rotation for selected vertices of 3D curve" */
- ot->description = "Tilt selected control vertices of 3D curve";
+ * "Specify an extra axis rotation for selected vertices of 3d curve" */
+ ot->description = "Tilt selected control vertices of 3d curve";
ot->idname = OP_TILT;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
@@ -646,10 +641,9 @@ static void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
ot->cancel = transform_cancel;
ot->poll = ED_operator_editcurve_3d;
- prop = RNA_def_float(ot->srna, "value", 0.0, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
- RNA_def_property_subtype(prop, PROP_ANGLE);
+ RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
- Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP);
+ Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_SNAP);
}
static void TRANSFORM_OT_warp(struct wmOperatorType *ot)
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 0e25739c34a..a155ff7786a 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -402,7 +402,7 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C)
const char *BIF_menustringTransformOrientation(const bContext *C, const char *title)
{
- const char *menu = IFACE_("%t|Global %x0|Local %x1|Gimbal %x4|Normal %x2|View %x3");
+ const char *menu = IFACE_("%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3");
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
TransformOrientation *ts;
int i = V3D_MANIP_CUSTOM;
@@ -411,14 +411,14 @@ const char *BIF_menustringTransformOrientation(const bContext *C, const char *ti
title = IFACE_(title);
- str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + elem_size * BIF_countTransformOrientation(C), "UserTransSpace from matrix");
+ str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + elem_size * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix"));
p = str_menu;
p += sprintf(str_menu, "%s", title);
p += sprintf(p, "%s", menu);
for (ts = transform_spaces->first; ts; ts = ts->next) {
- p += sprintf(p, "|%s %%x%d", ts->name, i++);
+ p += sprintf(p, "|%s%%x%d", ts->name, i++);
}
return str_menu;
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 94b8abb8850..1d75be05534 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -80,8 +80,6 @@
#define USE_BVH_FACE_SNAP
-#define TRANSFORM_DIST_MAX_PX 1000
-
/********************* PROTOTYPES ***********************/
static void setSnappingCallback(TransInfo *t);
@@ -298,7 +296,7 @@ void applyProject(TransInfo *t)
for (i = 0; i < t->total; i++, td++) {
float iloc[3], loc[3], no[3];
float mval[2];
- int dist = TRANSFORM_DIST_MAX_PX;
+ int dist = 1000;
if (td->flag & TD_NOACTION)
break;
@@ -317,18 +315,18 @@ void applyProject(TransInfo *t)
copy_v3_v3(iloc, td->ob->obmat[3]);
}
- if (ED_view3d_project_float_global(t->ar, iloc, mval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- if (snapObjectsTransform(t, mval, &dist, loc, no, t->tsnap.modeSelect)) {
-// if (t->flag & (T_EDIT|T_POSE)) {
-// mul_m4_v3(imat, loc);
-// }
-
- sub_v3_v3v3(tvec, loc, iloc);
-
- mul_m3_v3(td->smtx, tvec);
-
- add_v3_v3(td->loc, tvec);
- }
+ ED_view3d_project_float(t->ar, iloc, mval);
+
+ if (snapObjectsTransform(t, mval, &dist, loc, no, t->tsnap.modeSelect)) {
+// if (t->flag & (T_EDIT|T_POSE)) {
+// mul_m4_v3(imat, loc);
+// }
+//
+ sub_v3_v3v3(tvec, loc, iloc);
+
+ mul_m3_v3(td->smtx, tvec);
+
+ add_v3_v3(td->loc, tvec);
}
//XXX constraintTransLim(t, td);
@@ -603,9 +601,7 @@ int updateSelectedSnapPoint(TransInfo *t)
int dx, dy;
int dist;
- if (ED_view3d_project_int_global(t->ar, p->co, screen_loc, V3D_PROJ_TEST_NOP) != V3D_PROJ_RET_OK) {
- continue;
- }
+ ED_view3d_project_int(t->ar, p->co, screen_loc);
dx = t->mval[0] - screen_loc[0];
dy = t->mval[1] - screen_loc[1];
@@ -1236,12 +1232,8 @@ static int snapEdge(ARegion *ar, float v1co[3], short v1no[3], float v2co[3], sh
new_depth = len_v3v3(location, ray_start);
- if (ED_view3d_project_int_global(ar, location, screen_loc, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- new_dist = abs(screen_loc[0] - (int)mval[0]) + abs(screen_loc[1] - (int)mval[1]);
- }
- else {
- new_dist = TRANSFORM_DIST_MAX_PX;
- }
+ ED_view3d_project_int(ar, location, screen_loc);
+ new_dist = abs(screen_loc[0] - (int)mval[0]) + abs(screen_loc[1] - (int)mval[1]);
/* 10% threshold if edge is closer but a bit further
* this takes care of series of connected edges a bit slanted w.r.t the viewport
@@ -1297,13 +1289,8 @@ static int snapVertex(ARegion *ar, float vco[3], short vno[3], float obmat[][4],
new_depth = len_v3v3(location, ray_start);
- if (ED_view3d_project_int_global(ar, location, screen_loc, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
- new_dist = abs(screen_loc[0] - (int)mval[0]) + abs(screen_loc[1] - (int)mval[1]);
- }
- else {
- new_dist = TRANSFORM_DIST_MAX_PX;
- }
-
+ ED_view3d_project_int(ar, location, screen_loc);
+ new_dist = abs(screen_loc[0] - (int)mval[0]) + abs(screen_loc[1] - (int)mval[1]);
if (new_dist <= *r_dist && new_depth < *r_depth) {
*r_depth = new_depth;
@@ -1710,7 +1697,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c
if (ob->transflag & OB_DUPLI) {
DupliObject *dupli_ob;
- ListBase *lb = object_duplilist(scene, ob, FALSE);
+ ListBase *lb = object_duplilist(scene, ob);
for (dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next) {
Object *dob = dupli_ob->ob;
@@ -1916,7 +1903,7 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L
if (ob->transflag & OB_DUPLI) {
DupliObject *dupli_ob;
- ListBase *lb = object_duplilist(scene, ob, FALSE);
+ ListBase *lb = object_duplilist(scene, ob);
for (dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next) {
Object *dob = dupli_ob->ob;
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 6e655faf35f..871bfbfe702 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -2744,7 +2744,7 @@ static void UV_OT_circle_select(wmOperatorType *ot)
/* ******************** lasso select operator **************** */
-static int do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short moves, short select)
+static int do_lasso_select_mesh_uv(bContext *C, int mcords[][2], short moves, short select)
{
Image *ima = CTX_data_edit_image(C);
ARegion *ar = CTX_wm_region(C);
@@ -2818,7 +2818,7 @@ static int do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mov
static int uv_lasso_select_exec(bContext *C, wmOperator *op)
{
int mcords_tot;
- const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
+ int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
short select;
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 201162262b2..3e5a14774c2 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1269,14 +1269,6 @@ void GPU_buffer_draw_elements(GPUBuffer *elements, unsigned int mode, int start,
/* XXX: the rest of the code in this file is used for optimized PBVH
* drawing and doesn't interact at all with the buffer code above */
-/* Return false if VBO is either unavailable or disabled by the user,
- true otherwise */
-static int gpu_vbo_enabled(void)
-{
- return (GLEW_ARB_vertex_buffer_object &&
- !(U.gameflags & USER_DISABLE_VBO));
-}
-
/* Convenience struct for building the VBO. */
typedef struct {
float co[3];
@@ -1312,10 +1304,6 @@ struct GPU_Buffers {
int has_hidden;
unsigned int tot_tri, tot_quad;
-
- /* The PBVH ensures that either all faces in the node are
- smooth-shaded or all faces are flat-shaded */
- int smooth;
};
typedef enum {
VBO_ENABLED,
@@ -1397,88 +1385,28 @@ void GPU_update_mesh_buffers(GPU_Buffers *buffers, MVert *mvert,
int *vert_indices, int totvert, const float *vmask)
{
VertexBufferFormat *vert_data;
- int i, j, k;
+ int i;
buffers->vmask = vmask;
if (buffers->vert_buf) {
- int totelem = (buffers->smooth ? totvert : (buffers->tot_tri * 3));
-
/* Build VBO */
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffers->vert_buf);
glBufferDataARB(GL_ARRAY_BUFFER_ARB,
- sizeof(VertexBufferFormat) * totelem,
- NULL, GL_STATIC_DRAW_ARB);
-
+ sizeof(VertexBufferFormat) * totvert,
+ NULL, GL_STATIC_DRAW_ARB);
vert_data = glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
if (vert_data) {
- /* Vertex data is shared if smooth-shaded, but seperate
- copies are made for flat shading because normals
- shouldn't be shared. */
- if (buffers->smooth) {
- for (i = 0; i < totvert; ++i) {
- MVert *v = mvert + vert_indices[i];
- VertexBufferFormat *out = vert_data + i;
-
- copy_v3_v3(out->co, v->co);
- memcpy(out->no, v->no, sizeof(short) * 3);
- if (vmask) {
- gpu_color_from_mask_copy(vmask[vert_indices[i]],
- out->color);
- }
- }
- }
- else {
- for (i = 0; i < buffers->totface; ++i) {
- const MFace *f = &buffers->mface[buffers->face_indices[i]];
- const unsigned int *fv = &f->v1;
- const int vi[2][3] = {{0, 1, 2}, {3, 0, 2}};
- float fno[3];
- short no[3];
-
- float fmask;
-
- /* Face normal and mask */
- if (f->v4) {
- normal_quad_v3(fno,
- mvert[fv[0]].co,
- mvert[fv[1]].co,
- mvert[fv[2]].co,
- mvert[fv[3]].co);
- if (vmask) {
- fmask = (vmask[fv[0]] +
- vmask[fv[1]] +
- vmask[fv[2]] +
- vmask[fv[3]]) * 0.25;
- }
- }
- else {
- normal_tri_v3(fno,
- mvert[fv[0]].co,
- mvert[fv[1]].co,
- mvert[fv[2]].co);
- if (vmask) {
- fmask = (vmask[fv[0]] +
- vmask[fv[1]] +
- vmask[fv[2]]) / 3.0f;
- }
- }
- normal_float_to_short_v3(no, fno);
-
- for (j = 0; j < (f->v4 ? 2 : 1); j++) {
- for (k = 0; k < 3; k++) {
- const MVert *v = &mvert[fv[vi[j][k]]];
- VertexBufferFormat *out = vert_data;
-
- copy_v3_v3(out->co, v->co);
- memcpy(out->no, no, sizeof(short) * 3);
- if (vmask)
- gpu_color_from_mask_copy(fmask, out->color);
-
- vert_data++;
- }
- }
+ for (i = 0; i < totvert; ++i) {
+ MVert *v = mvert + vert_indices[i];
+ VertexBufferFormat *out = vert_data + i;
+
+ copy_v3_v3(out->co, v->co);
+ memcpy(out->no, v->no, sizeof(short) * 3);
+ if (vmask) {
+ gpu_color_from_mask_copy(vmask[vert_indices[i]],
+ out->color);
}
}
@@ -1506,7 +1434,6 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
buffers = MEM_callocN(sizeof(GPU_Buffers), "GPU_Buffers");
buffers->index_type = GL_UNSIGNED_SHORT;
- buffers->smooth = mface[face_indices[0]].flag & ME_SMOOTH;
/* Count the number of visible triangles */
for (i = 0, tottri = 0; i < totface; ++i) {
@@ -1514,11 +1441,8 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
if (!paint_is_face_hidden(f, mvert))
tottri += f->v4 ? 2 : 1;
}
-
- /* An element index buffer is used for smooth shading, but flat
- shading requires separate vertex normals so an index buffer is
- can't be used there. */
- if (gpu_vbo_enabled() && buffers->smooth)
+
+ if (GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
glGenBuffersARB(1, &buffers->index_buf);
if (buffers->index_buf) {
@@ -1562,7 +1486,7 @@ GPU_Buffers *GPU_build_mesh_buffers(int (*face_vert_indices)[4],
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
- if (buffers->index_buf || !buffers->smooth)
+ if (buffers->index_buf)
glGenBuffersARB(1, &buffers->vert_buf);
buffers->tot_tri = tottri;
@@ -1667,8 +1591,6 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, CCGElem **grids,
buffers->grid_flag_mats = grid_flag_mats;
buffers->gridkey = *key;
- buffers->smooth = grid_flag_mats[grid_indices[0]].flag & ME_SMOOTH;
-
//printf("node updated %p\n", buffers);
}
@@ -1763,7 +1685,7 @@ static GLuint gpu_get_grid_buffer(int gridsize, GLenum *index_type, unsigned *to
/* VBO is disabled; delete the previous buffer (if it exists) and
* return an invalid handle */
- if (gpu_vbo_enabled()) {
+ if (!GLEW_ARB_vertex_buffer_object || (U.gameflags & USER_DISABLE_VBO)) {
if (buffer)
glDeleteBuffersARB(1, &buffer);
return 0;
@@ -1851,7 +1773,7 @@ GPU_Buffers *GPU_build_grid_buffers(int *grid_indices, int totgrid,
#undef FILL_QUAD_BUFFER
-static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
+static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers, int smooth)
{
const MVert *mvert = buffers->mvert;
int i, j;
@@ -1871,7 +1793,7 @@ static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
glBegin((f->v4) ? GL_QUADS : GL_TRIANGLES);
- if (buffers->smooth) {
+ if (smooth) {
for (j = 0; j < S; j++) {
if (has_mask) {
gpu_color_from_mask_set(buffers->vmask[fv[j]]);
@@ -1918,7 +1840,7 @@ static void gpu_draw_buffers_legacy_mesh(GPU_Buffers *buffers)
}
}
-static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
+static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers, int smooth)
{
const CCGKey *key = &buffers->gridkey;
int i, j, x, y, gridsize = buffers->gridkey.grid_size;
@@ -1951,7 +1873,7 @@ static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
if (paint_is_grid_face_hidden(gh, gridsize, x, y))
continue;
- if (buffers->smooth) {
+ if (smooth) {
for (j = 0; j < 4; j++) {
if (has_mask) {
gpu_color_from_mask_set(*CCG_elem_mask(key, e[j]));
@@ -1981,7 +1903,7 @@ static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
glEnd();
}
- else if (buffers->smooth) {
+ else if (smooth) {
for (y = 0; y < gridsize - 1; y++) {
glBegin(GL_QUAD_STRIP);
for (x = 0; x < gridsize; x++) {
@@ -2042,21 +1964,26 @@ static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
{
const int has_mask = (buffers->vmask || buffers->gridkey.has_mask);
+ int smooth = 0;
if (buffers->totface) {
const MFace *f = &buffers->mface[buffers->face_indices[0]];
if (!setMaterial(f->mat_nr + 1, NULL))
return;
+
+ smooth = f->flag & ME_SMOOTH;
+ glShadeModel(smooth ? GL_SMOOTH : GL_FLAT);
}
else if (buffers->totgrid) {
const DMFlagMat *f = &buffers->grid_flag_mats[buffers->grid_indices[0]];
if (!setMaterial(f->mat_nr + 1, NULL))
return;
- }
- glShadeModel((buffers->smooth || buffers->totface) ? GL_SMOOTH : GL_FLAT);
+ smooth = f->flag & ME_SMOOTH;
+ glShadeModel(smooth ? GL_SMOOTH : GL_FLAT);
+ }
- if (buffers->vert_buf) {
+ if (buffers->vert_buf && buffers->index_buf) {
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
if (has_mask) {
@@ -2068,9 +1995,7 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
}
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffers->vert_buf);
-
- if (buffers->index_buf)
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
if (buffers->tot_quad) {
char *offset = 0;
@@ -2091,8 +2016,6 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
}
}
else {
- int totelem = buffers->tot_tri * 3;
-
glVertexPointer(3, GL_FLOAT, sizeof(VertexBufferFormat),
(void *)offsetof(VertexBufferFormat, co));
glNormalPointer(GL_SHORT, sizeof(VertexBufferFormat),
@@ -2102,15 +2025,11 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
(void *)offsetof(VertexBufferFormat, color));
}
- if (buffers->index_buf)
- glDrawElements(GL_TRIANGLES, totelem, buffers->index_type, 0);
- else
- glDrawArrays(GL_TRIANGLES, 0, totelem);
+ glDrawElements(GL_TRIANGLES, buffers->tot_tri * 3, buffers->index_type, 0);
}
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
- if (buffers->index_buf)
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
@@ -2123,10 +2042,10 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
}
/* fallbacks if we are out of memory or VBO is disabled */
else if (buffers->totface) {
- gpu_draw_buffers_legacy_mesh(buffers);
+ gpu_draw_buffers_legacy_mesh(buffers, smooth);
}
else if (buffers->totgrid) {
- gpu_draw_buffers_legacy_grids(buffers);
+ gpu_draw_buffers_legacy_grids(buffers, smooth);
}
}
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index e035f1c3f5a..4732586b912 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -841,7 +841,7 @@ static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr)
if (ob->transflag & OB_DUPLI) {
DupliObject *dob;
- ListBase *lb = object_duplilist(shi->gpumat->scene, ob, FALSE);
+ ListBase *lb = object_duplilist(shi->gpumat->scene, ob);
for (dob=lb->first; dob; dob=dob->next) {
Object *ob_iter = dob->ob;
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index 344ae604ed4..bbe70a7d73f 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -25,6 +25,7 @@
set(INC
.
+ ../avi
../blenkernel
../blenlib
../blenloader
@@ -142,13 +143,6 @@ if(WITH_IMAGE_REDCODE)
add_definitions(-DWITH_REDCODE)
endif()
-if(WITH_CODEC_AVI)
- list(APPEND INC
- ../avi
- )
- add_definitions(-DWITH_AVI)
-endif()
-
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../quicktime
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index ed349e8f7eb..d5cc4929aed 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -62,9 +62,7 @@
#include "imbuf.h"
-#ifdef WITH_AVI
-# include "AVI_avi.h"
-#endif
+#include "AVI_avi.h"
#ifdef WITH_QUICKTIME
# if defined(_WIN32) || defined(__APPLE__)
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 4aeba9af89d..394f5169046 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -78,9 +78,7 @@
#include "imbuf.h"
-#ifdef WITH_AVI
-# include "AVI_avi.h"
-#endif
+#include "AVI_avi.h"
#ifdef WITH_QUICKTIME
#if defined(_WIN32) || defined(__APPLE__)
@@ -187,7 +185,6 @@ static void an_stringenc(char *string, const char *head, const char *tail, unsig
BLI_stringenc(string, head, tail, numlen, pic);
}
-#ifdef WITH_AVI
static void free_anim_avi(struct anim *anim)
{
#if defined(_WIN32) && !defined(FREE_WINDOWS)
@@ -222,7 +219,6 @@ static void free_anim_avi(struct anim *anim)
anim->duration = 0;
}
-#endif /* WITH_AVI */
#ifdef WITH_FFMPEG
static void free_anim_ffmpeg(struct anim *anim);
@@ -239,10 +235,7 @@ void IMB_free_anim(struct anim *anim)
}
free_anim_movie(anim);
-
-#ifdef WITH_AVI
free_anim_avi(anim);
-#endif
#ifdef WITH_QUICKTIME
free_anim_quicktime(anim);
@@ -294,7 +287,7 @@ struct anim *IMB_open_anim(const char *name, int ib_flags, int streamindex, char
return(anim);
}
-#ifdef WITH_AVI
+
static int startavi(struct anim *anim)
{
@@ -404,9 +397,7 @@ static int startavi(struct anim *anim)
return 0;
}
-#endif /* WITH_AVI */
-#ifdef WITH_AVI
static ImBuf *avi_fetchibuf(struct anim *anim, int position)
{
ImBuf *ibuf = NULL;
@@ -456,7 +447,6 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position)
return ibuf;
}
-#endif /* WITH_AVI */
#ifdef WITH_FFMPEG
@@ -1216,11 +1206,7 @@ static ImBuf *anim_getnew(struct anim *anim)
if (anim == NULL) return(NULL);
free_anim_movie(anim);
-
-#ifdef WITH_AVI
free_anim_avi(anim);
-#endif
-
#ifdef WITH_QUICKTIME
free_anim_quicktime(anim);
#endif
@@ -1247,7 +1233,6 @@ static ImBuf *anim_getnew(struct anim *anim)
if (startmovie(anim)) return (NULL);
ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0); /* fake */
break;
-#ifdef WITH_AVI
case ANIM_AVI:
if (startavi(anim)) {
printf("couldnt start avi\n");
@@ -1255,7 +1240,6 @@ static ImBuf *anim_getnew(struct anim *anim)
}
ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0);
break;
-#endif
#ifdef WITH_QUICKTIME
case ANIM_QTIME:
if (startquicktime(anim)) return (0);
@@ -1347,13 +1331,11 @@ struct ImBuf *IMB_anim_absolute(struct anim *anim, int position,
IMB_convert_rgba_to_abgr(ibuf);
}
break;
-#ifdef WITH_AVI
case ANIM_AVI:
ibuf = avi_fetchibuf(anim, position);
if (ibuf)
anim->curposition = position;
break;
-#endif
#ifdef WITH_QUICKTIME
case ANIM_QTIME:
ibuf = qtime_fetchibuf(anim, position);
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 593e08062fe..97316c48621 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -36,19 +36,18 @@
#include "IMB_indexer.h"
#include "IMB_anim.h"
+#include "AVI_avi.h"
#include "imbuf.h"
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "BKE_global.h"
-#ifdef WITH_AVI
-# include "AVI_avi.h"
-#endif
-
#ifdef WITH_FFMPEG
-# include "ffmpeg_compat.h"
-#endif
+
+#include "ffmpeg_compat.h"
+
+#endif //WITH_FFMPEG
static char magic[] = "BlenMIdx";
@@ -956,9 +955,9 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context,
}
/* process pictures still stuck in decoder engine after EOF
- * according to ffmpeg docs using 0-size packets.
- *
- * At least, if we haven't already stopped... */
+ according to ffmpeg docs using 0-size packets.
+
+ At least, if we haven't already stopped... */
if (!*stop) {
int frame_finished;
@@ -990,7 +989,6 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context,
* - internal AVI (fallback) rebuilder
* ---------------------------------------------------------------------- */
-#ifdef WITH_AVI
typedef struct FallbackIndexBuilderContext {
int anim_type;
@@ -1151,8 +1149,6 @@ static void index_rebuild_fallback(FallbackIndexBuilderContext *context,
}
}
-#endif /* WITH_AVI */
-
/* ----------------------------------------------------------------------
* - public API
* ---------------------------------------------------------------------- */
@@ -1168,19 +1164,15 @@ IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecod
context = index_ffmpeg_create_context(anim, tcs_in_use, proxy_sizes_in_use, quality);
break;
#endif
-#ifdef WITH_AVI
default:
context = index_fallback_create_context(anim, tcs_in_use, proxy_sizes_in_use, quality);
break;
-#endif
}
if (context)
context->anim_type = anim->curtype;
return context;
-
- (void)tcs_in_use, (void)proxy_sizes_in_use, (void)quality;
}
void IMB_anim_index_rebuild(struct IndexBuildContext *context,
@@ -1192,14 +1184,10 @@ void IMB_anim_index_rebuild(struct IndexBuildContext *context,
index_rebuild_ffmpeg((FFmpegIndexBuilderContext *)context, stop, do_update, progress);
break;
#endif
-#ifdef WITH_AVI
default:
index_rebuild_fallback((FallbackIndexBuilderContext *)context, stop, do_update, progress);
break;
-#endif
}
-
- (void)stop, (void)do_update, (void)progress;
}
void IMB_anim_index_rebuild_finish(IndexBuildContext *context, short stop)
@@ -1210,15 +1198,10 @@ void IMB_anim_index_rebuild_finish(IndexBuildContext *context, short stop)
index_rebuild_ffmpeg_finish((FFmpegIndexBuilderContext *)context, stop);
break;
#endif
-#ifdef WITH_AVI
default:
index_rebuild_fallback_finish((FallbackIndexBuilderContext *)context, stop);
break;
-#endif
}
-
- (void)stop;
- (void)proxy_sizes; /* static defined at top of the file */
}
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 8dd791c8508..833671e3f2f 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -211,12 +211,7 @@ int IMB_ispic(const char *filename)
static int isavi(const char *name)
{
-#ifdef WITH_AVI
return AVI_is_avi(name);
-#else
- (void)name;
- return FALSE;
-#endif
}
#ifdef WITH_QUICKTIME
@@ -228,10 +223,6 @@ static int isqtime(const char *name)
#ifdef WITH_FFMPEG
-/* BLI_vsnprintf in ffmpeg_log_callback() causes invalid warning */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wmissing-format-attribute"
-
static char ffmpeg_last_error[1024];
static void ffmpeg_log_callback(void *ptr, int level, const char *format, va_list arg)
@@ -249,8 +240,6 @@ static void ffmpeg_log_callback(void *ptr, int level, const char *format, va_lis
}
}
-#pragma GCC diagnostic pop
-
void IMB_ffmpeg_init(void)
{
av_register_all();
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index 9fbe045226e..284694f2b48 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -74,7 +74,7 @@ typedef struct Path {
typedef struct BevList {
struct BevList *next, *prev;
int nr, dupe_nr;
- int poly, hole;
+ short poly, hole;
} BevList;
/* These two Lines with # tell makesdna this struct can be excluded. */
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 9d40af92638..c22de3cb7eb 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -36,6 +36,8 @@
extern "C" {
#endif
+#include "DNA_defs.h" /* USE_BMESH_FORWARD_COMPAT */
+
/** descriptor and storage for a custom data layer */
typedef struct CustomDataLayer {
int type; /* type of data in layer */
diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h
index 774fbcf081a..762e027f934 100644
--- a/source/blender/makesdna/DNA_defs.h
+++ b/source/blender/makesdna/DNA_defs.h
@@ -45,6 +45,9 @@
/* hrmf, we need a better include then this */
#include "../blenloader/BLO_sys_types.h" /* needed for int64_t only! */
+/* Must not be defined for BMesh, as this guards code for pre-BMesh code to load BMesh .blend files */
+/* #define USE_BMESH_FORWARD_COMPAT */
+
/* non-id name variables should use this length */
#define MAX_NAME 64
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index dd0845dbf1e..c7f90eea176 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -37,6 +37,8 @@
#include "DNA_ID.h"
#include "DNA_customdata_types.h"
+#include "DNA_defs.h" /* USE_BMESH_FORWARD_COMPAT */
+
struct AnimData;
struct DerivedMesh;
struct Ipo;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 99df51e9ec4..b40af805f77 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -28,6 +28,9 @@
#include "DNA_defs.h"
#include "DNA_listBase.h"
+
+#define MODSTACK_DEBUG 1
+
/* WARNING ALERT! TYPEDEF VALUES ARE WRITTEN IN FILES! SO DO NOT CHANGE!
* (ONLY ADD NEW ITEMS AT THE END) */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 4b8fc9c7ed6..a1534c7b9d3 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -264,8 +264,8 @@ typedef enum eSpaceOutliner_Mode {
SO_SAME_TYPE = 5,
SO_GROUPS = 6,
SO_LIBRARIES = 7,
- /* SO_VERSE_SESSION = 8, */ /* deprecated! */
- /* SO_VERSE_MS = 9, */ /* deprecated!*/
+ SO_VERSE_SESSION = 8,
+ SO_VERSE_MS = 9,
SO_SEQUENCE = 10,
SO_DATABLOCKS = 11,
SO_USERDEF = 12,
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index c6cefce2994..1ab64ed1cc1 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -162,10 +162,7 @@ typedef struct MovieTrackingSettings {
short speed; /* speed of tracking */
/* ** reconstruction settings ** */
- int keyframe1 DNA_DEPRECATED,
- keyframe2 DNA_DEPRECATED; /* two keyframes for reconstrution initialization
- * were moved to per-tracking object settings
- */
+ int keyframe1, keyframe2; /* two keyframes for reconstrution initialization */
/* which camera intrinsics to refine. uses on the REFINE_* flags */
short refine_camera_intrinsics, pad2;
@@ -223,8 +220,6 @@ typedef struct MovieTrackingObject {
ListBase tracks; /* list of tracks use to tracking this object */
MovieTrackingReconstruction reconstruction; /* reconstruction data for this object */
-
- int keyframe1, keyframe2; /* two keyframes for reconstrution initialization */
} MovieTrackingObject;
typedef struct MovieTrackingStats {
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index c10850d74e6..218027209a8 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -49,14 +49,11 @@ struct ColorBand;
#define MAX_STYLE_NAME 64
/* default uifont_id offered by Blender */
-typedef enum eUIFont_ID {
- UIFONT_DEFAULT = 0,
-/* UIFONT_BITMAP = 1 */ /* UNUSED */
-
- /* free slots */
- UIFONT_CUSTOM1 = 2,
- UIFONT_CUSTOM2 = 3
-} eUIFont_ID;
+#define UIFONT_DEFAULT 0
+/*#define UIFONT_BITMAP 1*/ /*UNUSED*/
+/* free slots */
+#define UIFONT_CUSTOM1 2
+#define UIFONT_CUSTOM2 3
/* default fonts to load/initalize */
/* first font is the default (index 0), others optional */
@@ -67,6 +64,7 @@ typedef struct uiFont {
short uifont_id; /* own id */
short r_to_l; /* fonts that read from left to right */
short pad;
+
} uiFont;
/* this state defines appearance of text */
@@ -81,14 +79,13 @@ typedef struct uiFontStyle {
short align; /* text align hint */
float shadowalpha; /* total alpha */
float shadowcolor; /* 1 value, typically white or black anyway */
+
} uiFontStyle;
/* uiFontStyle->align */
-typedef enum eFontStyle_Align {
- UI_STYLE_TEXT_LEFT = 0,
- UI_STYLE_TEXT_CENTER = 1,
- UI_STYLE_TEXT_RIGHT = 2
-} eFontStyle_Align;
+#define UI_STYLE_TEXT_LEFT 0
+#define UI_STYLE_TEXT_CENTER 1
+#define UI_STYLE_TEXT_RIGHT 2
/* this is fed to the layout engine and widget code */
@@ -148,6 +145,7 @@ typedef struct uiPanelColors {
} uiPanelColors;
typedef struct ThemeUI {
+
/* Interface Elements (buttons, menus, icons) */
uiWidgetColors wcol_regular, wcol_tool, wcol_text;
uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
@@ -211,8 +209,8 @@ typedef struct ThemeSpace {
char vertex[4], vertex_select[4];
char edge[4], edge_select[4];
char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4];
- char face[4], face_select[4]; /* solid faces */
- char face_dot[4]; /* selected color */
+ char face[4], face_select[4]; // solid faces
+ char face_dot[4]; // selected color
char extra_edge_len[4], extra_face_angle[4], extra_face_area[4], pad3[4];
char normal[4];
char vertex_normal[4];
@@ -226,7 +224,7 @@ typedef struct ThemeSpace {
char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4], handle_auto_clamped[4];
char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4], handle_sel_auto_clamped[4];
- char ds_channel[4], ds_subchannel[4]; /* dopesheet */
+ char ds_channel[4], ds_subchannel[4]; // dopesheet
char console_output[4], console_input[4], console_info[4], console_error[4];
char console_cursor[4];
@@ -234,10 +232,10 @@ typedef struct ThemeSpace {
char vertex_size, outline_width, facedot_size;
char noodle_curving;
- char syntaxl[4], syntaxn[4], syntaxb[4]; /* syntax for textwindow and nodes */
+ char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes
char syntaxv[4], syntaxc[4];
- char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4]; /* for sequence editor */
+ char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4]; // for sequence editor
char effect[4], hpad0[4], transition[4], meta[4];
char editmesh_active[4];
@@ -289,10 +287,8 @@ typedef struct ThemeWireColor {
} ThemeWireColor;
/* flags for ThemeWireColor */
-typedef enum eWireColor_Flags {
- TH_WIRECOLOR_CONSTCOLS = (1 << 0),
- TH_WIRECOLOR_TEXTCOLS = (1 << 1),
-} eWireColor_Flags;
+#define TH_WIRECOLOR_CONSTCOLS (1<<0)
+#define TH_WIRECOLOR_TEXTCOLS (1<<1)
/* A theme */
typedef struct bTheme {
@@ -325,6 +321,7 @@ typedef struct bTheme {
/*ThemeWireColor tobj[20];*/
int active_theme_area, pad;
+
} bTheme;
/* for the moment only the name. may want to store options with this later */
@@ -348,8 +345,8 @@ typedef struct UserDef {
char pythondir[768];
char sounddir[768];
char i18ndir[768];
- char image_editor[1024]; /* 1024 = FILE_MAX */
- char anim_player[1024]; /* 1024 = FILE_MAX */
+ char image_editor[1024]; /* 1024 = FILE_MAX */
+ char anim_player[1024]; /* 1024 = FILE_MAX */
int anim_player_preset;
short v2d_min_gridsize; /* minimum spacing between gridlines in View2D grids */
@@ -396,7 +393,7 @@ typedef struct UserDef {
int memcachelimit;
int prefetchframes;
short frameserverport;
- short pad_rot_angle; /* control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use */
+ short pad_rot_angle; /*control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use*/
short obcenter_dia;
short rvisize; /* rotating view icon size */
short rvibright; /* rotating view icon brightness */
@@ -425,7 +422,7 @@ typedef struct UserDef {
short autokey_mode; /* autokeying mode */
short autokey_flag; /* flags for autokeying */
- short text_render, pad9; /* options for text rendering */
+ short text_render, pad9; /*options for text rendering*/
struct ColorBand coba_weight; /* from texture.h */
@@ -448,258 +445,217 @@ extern UserDef U; /* from blenkernel blender.c */
/* ***************** USERDEF ****************** */
/* userpref/section */
-typedef enum eUserPref_Section {
- USER_SECTION_INTERFACE = 0,
- USER_SECTION_EDIT = 1,
- USER_SECTION_FILE = 2,
- USER_SECTION_SYSTEM = 3,
- USER_SECTION_THEME = 4,
- USER_SECTION_INPUT = 5,
- USER_SECTION_ADDONS = 6,
-} eUserPref_Section;
+#define USER_SECTION_INTERFACE 0
+#define USER_SECTION_EDIT 1
+#define USER_SECTION_FILE 2
+#define USER_SECTION_SYSTEM 3
+#define USER_SECTION_THEME 4
+#define USER_SECTION_INPUT 5
+#define USER_SECTION_ADDONS 6
/* flag */
-typedef enum eUserPref_Flag {
- USER_AUTOSAVE = (1 << 0),
-/* USER_AUTOGRABGRID = (1 << 1), deprecated */
-/* USER_AUTOROTGRID = (1 << 2), deprecated */
-/* USER_AUTOSIZEGRID = (1 << 3), deprecated */
- USER_SCENEGLOBAL = (1 << 4),
- USER_TRACKBALL = (1 << 5),
-/* USER_DUPLILINK = (1 << 6), deprecated */
-/* USER_FSCOLLUM = (1 << 7), deprecated */
- USER_MAT_ON_OB = (1 << 8),
-/* USER_NO_CAPSLOCK = (1 << 9), */ /* not used anywhere */
-/* USER_VIEWMOVE = (1 << 10), */ /* not used anywhere */
- USER_TOOLTIPS = (1 << 11),
- USER_TWOBUTTONMOUSE = (1 << 12),
- USER_NONUMPAD = (1 << 13),
- USER_LMOUSESELECT = (1 << 14),
- USER_FILECOMPRESS = (1 << 15),
- USER_SAVE_PREVIEWS = (1 << 16),
- USER_CUSTOM_RANGE = (1 << 17),
- USER_ADD_EDITMODE = (1 << 18),
- USER_ADD_VIEWALIGNED = (1 << 19),
- USER_RELPATHS = (1 << 20),
- USER_RELEASECONFIRM = (1 << 21),
- USER_SCRIPT_AUTOEXEC_DISABLE = (1 << 22),
- USER_FILENOUI = (1 << 23),
- USER_NONEGFRAMES = (1 << 24),
- USER_TXT_TABSTOSPACES_DISABLE = (1 << 25),
- USER_TOOLTIPS_PYTHON = (1 << 26),
-} eUserPref_Flag;
-
+#define USER_AUTOSAVE (1 << 0)
+/*#define USER_AUTOGRABGRID (1 << 1) deprecated */
+/*#define USER_AUTOROTGRID (1 << 2) deprecated */
+/*#define USER_AUTOSIZEGRID (1 << 3) deprecated */
+#define USER_SCENEGLOBAL (1 << 4)
+#define USER_TRACKBALL (1 << 5)
+/*#define USER_DUPLILINK (1 << 6) deprecated */
+/*#define USER_FSCOLLUM (1 << 7) deprecated */
+#define USER_MAT_ON_OB (1 << 8)
+/*#define USER_NO_CAPSLOCK (1 << 9)*/ /* not used anywhere */
+/*#define USER_VIEWMOVE (1 << 10)*/ /* not used anywhere */
+#define USER_TOOLTIPS (1 << 11)
+#define USER_TWOBUTTONMOUSE (1 << 12)
+#define USER_NONUMPAD (1 << 13)
+#define USER_LMOUSESELECT (1 << 14)
+#define USER_FILECOMPRESS (1 << 15)
+#define USER_SAVE_PREVIEWS (1 << 16)
+#define USER_CUSTOM_RANGE (1 << 17)
+#define USER_ADD_EDITMODE (1 << 18)
+#define USER_ADD_VIEWALIGNED (1 << 19)
+#define USER_RELPATHS (1 << 20)
+#define USER_RELEASECONFIRM (1 << 21)
+#define USER_SCRIPT_AUTOEXEC_DISABLE (1 << 22)
+#define USER_FILENOUI (1 << 23)
+#define USER_NONEGFRAMES (1 << 24)
+#define USER_TXT_TABSTOSPACES_DISABLE (1 << 25)
+#define USER_TOOLTIPS_PYTHON (1 << 26)
+
/* helper macro for checking frame clamping */
#define FRAMENUMBER_MIN_CLAMP(cfra) { \
if ((U.flag & USER_NONEGFRAMES) && (cfra < 0)) \
cfra = 0; \
} (void)0
-/* viewzoom */
-typedef enum eViewZoom_Style {
- USER_ZOOM_CONT = 0,
- USER_ZOOM_SCALE = 1,
- USER_ZOOM_DOLLY = 2
-} eViewZoom_Style;
+/* viewzom */
+#define USER_ZOOM_CONT 0
+#define USER_ZOOM_SCALE 1
+#define USER_ZOOM_DOLLY 2
/* uiflag */
-typedef enum eUserpref_UI_Flag {
- /* flags 0 and 1 were old flags (for autokeying) that aren't used anymore */
- USER_WHEELZOOMDIR = (1 << 2),
- USER_FILTERFILEEXTS = (1 << 3),
- USER_DRAWVIEWINFO = (1 << 4),
- USER_PLAINMENUS = (1 << 5),
- /* flags 6 and 7 were old flags that are no-longer used */
- USER_ALLWINCODECS = (1 << 8),
- USER_MENUOPENAUTO = (1 << 9),
- USER_ZBUF_CURSOR = (1 << 10),
- USER_AUTOPERSP = (1 << 11),
- USER_LOCKAROUND = (1 << 12),
- USER_GLOBALUNDO = (1 << 13),
- USER_ORBIT_SELECTION = (1 << 14),
- USER_ZBUF_ORBIT = (1 << 15),
- USER_HIDE_DOT = (1 << 16),
- USER_SHOW_ROTVIEWICON = (1 << 17),
- USER_SHOW_VIEWPORTNAME = (1 << 18),
- USER_CAM_LOCK_NO_PARENT = (1 << 19),
- USER_ZOOM_TO_MOUSEPOS = (1 << 20),
- USER_SHOW_FPS = (1 << 21),
- USER_MMB_PASTE = (1 << 22),
- USER_MENUFIXEDORDER = (1 << 23),
- USER_CONTINUOUS_MOUSE = (1 << 24),
- USER_ZOOM_INVERT = (1 << 25),
- USER_ZOOM_HORIZ = (1 << 26), /* for CONTINUE and DOLLY zoom */
- USER_SPLASH_DISABLE = (1 << 27),
- USER_HIDE_RECENT = (1 << 28),
- USER_SHOW_THUMBNAILS = (1 << 29),
- USER_QUIT_PROMPT = (1 << 30)
-} eUserpref_UI_Flag;
+// old flag for #define USER_KEYINSERTACT (1 << 0)
+// old flag for #define USER_KEYINSERTOBJ (1 << 1)
+#define USER_WHEELZOOMDIR (1 << 2)
+#define USER_FILTERFILEEXTS (1 << 3)
+#define USER_DRAWVIEWINFO (1 << 4)
+#define USER_PLAINMENUS (1 << 5) // old EVTTOCONSOLE print ghost events, here for tuhopuu compat. --phase
+ // old flag for hide pulldown was here
+/*#define USER_FLIPFULLSCREEN (1 << 7)*/ /* deprecated */
+#define USER_ALLWINCODECS (1 << 8)
+#define USER_MENUOPENAUTO (1 << 9)
+#define USER_ZBUF_CURSOR (1 << 10)
+#define USER_AUTOPERSP (1 << 11)
+#define USER_LOCKAROUND (1 << 12)
+#define USER_GLOBALUNDO (1 << 13)
+#define USER_ORBIT_SELECTION (1 << 14)
+#define USER_ZBUF_ORBIT (1 << 15)
+#define USER_HIDE_DOT (1 << 16)
+#define USER_SHOW_ROTVIEWICON (1 << 17)
+#define USER_SHOW_VIEWPORTNAME (1 << 18)
+#define USER_CAM_LOCK_NO_PARENT (1 << 19)
+#define USER_ZOOM_TO_MOUSEPOS (1 << 20)
+#define USER_SHOW_FPS (1 << 21)
+#define USER_MMB_PASTE (1 << 22)
+#define USER_MENUFIXEDORDER (1 << 23)
+#define USER_CONTINUOUS_MOUSE (1 << 24)
+#define USER_ZOOM_INVERT (1 << 25)
+#define USER_ZOOM_HORIZ (1 << 26) /* for CONTINUE and DOLLY zoom */
+#define USER_SPLASH_DISABLE (1 << 27)
+#define USER_HIDE_RECENT (1 << 28)
+#define USER_SHOW_THUMBNAILS (1 << 29)
+#define USER_QUIT_PROMPT (1 << 30)
/* Auto-Keying mode */
-typedef enum eAutokey_Mode {
/* AUTOKEY_ON is a bitflag */
- AUTOKEY_ON = 1,
-
+#define AUTOKEY_ON 1
/* AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2) to preserve setting, even when autokey turned off */
- AUTOKEY_MODE_NORMAL = 3,
- AUTOKEY_MODE_EDITKEYS = 5
-} eAutokey_Mode;
+#define AUTOKEY_MODE_NORMAL 3
+#define AUTOKEY_MODE_EDITKEYS 5
/* Auto-Keying flag
* U.autokey_flag (not strictly used when autokeying only - is also used when keyframing these days)
* note: AUTOKEY_FLAG_* is used with a macro, search for lines like IS_AUTOKEY_FLAG(INSERTAVAIL)
*/
-typedef enum eAutokey_Flag {
- AUTOKEY_FLAG_INSERTAVAIL = (1 << 0),
- AUTOKEY_FLAG_INSERTNEEDED = (1 << 1),
- AUTOKEY_FLAG_AUTOMATKEY = (1 << 2),
- AUTOKEY_FLAG_XYZ2RGB = (1 << 3),
-
- /* toolsettings->autokey_flag */
- AUTOKEY_FLAG_ONLYKEYINGSET = (1 << 6),
- AUTOKEY_FLAG_NOWARNING = (1 << 7),
- ANIMRECORD_FLAG_WITHNLA = (1 << 10),
-} eAutokey_Flag;
+#define AUTOKEY_FLAG_INSERTAVAIL (1<<0)
+#define AUTOKEY_FLAG_INSERTNEEDED (1<<1)
+#define AUTOKEY_FLAG_AUTOMATKEY (1<<2)
+#define AUTOKEY_FLAG_XYZ2RGB (1<<3)
+
+/* toolsettings->autokey_flag */
+#define AUTOKEY_FLAG_ONLYKEYINGSET (1<<6)
+#define ANIMRECORD_FLAG_WITHNLA (1<<10)
/* transopts */
-typedef enum eUserpref_Translation_Flags {
- USER_TR_TOOLTIPS = (1 << 0),
- USER_TR_IFACE = (1 << 1),
-/* USER_TR_MENUS = (1 << 2) deprecated */
-/* USER_TR_FILESELECT = (1 << 3) deprecated */
-/* USER_TR_TEXTEDIT = (1 << 4) deprecated */
- USER_DOTRANSLATE = (1 << 5),
- USER_USETEXTUREFONT = (1 << 6),
-/* CONVERT_TO_UTF8 = (1 << 7) deprecated */
-} eUserpref_Translation_Flags;
+#define USER_TR_TOOLTIPS (1 << 0)
+#define USER_TR_IFACE (1 << 1)
+/*#define USER_TR_MENUS (1 << 2) deprecated*/
+/*#define USER_TR_FILESELECT (1 << 3) deprecated*/
+/*#define USER_TR_TEXTEDIT (1 << 4) deprecated*/
+#define USER_DOTRANSLATE (1 << 5)
+#define USER_USETEXTUREFONT (1 << 6)
+/*#define CONVERT_TO_UTF8 (1 << 7) deprecated*/
/* dupflag */
-typedef enum eDupli_ID_Flags {
- USER_DUP_MESH = (1 << 0),
- USER_DUP_CURVE = (1 << 1),
- USER_DUP_SURF = (1 << 2),
- USER_DUP_FONT = (1 << 3),
- USER_DUP_MBALL = (1 << 4),
- USER_DUP_LAMP = (1 << 5),
- USER_DUP_IPO = (1 << 6),
- USER_DUP_MAT = (1 << 7),
- USER_DUP_TEX = (1 << 8),
- USER_DUP_ARM = (1 << 9),
- USER_DUP_ACT = (1 << 10),
- USER_DUP_PSYS = (1 << 11)
-} eDupli_ID_Flags;
+#define USER_DUP_MESH (1 << 0)
+#define USER_DUP_CURVE (1 << 1)
+#define USER_DUP_SURF (1 << 2)
+#define USER_DUP_FONT (1 << 3)
+#define USER_DUP_MBALL (1 << 4)
+#define USER_DUP_LAMP (1 << 5)
+#define USER_DUP_IPO (1 << 6)
+#define USER_DUP_MAT (1 << 7)
+#define USER_DUP_TEX (1 << 8)
+#define USER_DUP_ARM (1 << 9)
+#define USER_DUP_ACT (1 << 10)
+#define USER_DUP_PSYS (1 << 11)
/* gameflags */
-typedef enum eOpenGL_RenderingOptions {
- /* USER_DEPRECATED_FLAG = (1 << 0), */
- /* USER_DISABLE_SOUND = (1 << 1), */ /* deprecated, don't use without checking for */
- /* backwards compatibilty in do_versions! */
- USER_DISABLE_MIPMAP = (1 << 2),
- USER_DISABLE_VBO = (1 << 3),
- USER_DISABLE_AA = (1 << 4),
-} eOpenGL_RenderingOptions;
+// #define USER_DEPRECATED_FLAG 1
+// #define USER_DISABLE_SOUND 2 deprecated, don't use without checking for
+// backwards compatibilty in do_versions!
+#define USER_DISABLE_MIPMAP 4
+#define USER_DISABLE_VBO 8
+#define USER_DISABLE_AA 16
/* wm draw method */
-typedef enum eWM_DrawMethod {
- USER_DRAW_TRIPLE = 0,
- USER_DRAW_OVERLAP = 1,
- USER_DRAW_FULL = 2,
- USER_DRAW_AUTOMATIC = 3,
- USER_DRAW_OVERLAP_FLIP = 4,
-} eWM_DrawMethod;
-
-/* text draw options */
-typedef enum eText_Draw_Options {
- USER_TEXT_DISABLE_AA = (1 << 0),
-} eText_Draw_Options;
+#define USER_DRAW_TRIPLE 0
+#define USER_DRAW_OVERLAP 1
+#define USER_DRAW_FULL 2
+#define USER_DRAW_AUTOMATIC 3
+#define USER_DRAW_OVERLAP_FLIP 4
+
+/* text draw options*/
+#define USER_TEXT_DISABLE_AA (1 << 0)
/* tw_flag (transform widget) */
/* gp_settings (Grease Pencil Settings) */
-typedef enum eGP_UserdefSettings {
- GP_PAINT_DOSMOOTH = (1 << 0),
- GP_PAINT_DOSIMPLIFY = (1 << 1),
-} eGP_UserdefSettings;
+#define GP_PAINT_DOSMOOTH (1<<0)
+#define GP_PAINT_DOSIMPLIFY (1<<1)
/* color picker types */
-typedef enum eColorPicker_Types {
- USER_CP_CIRCLE = 0,
- USER_CP_SQUARE_SV = 1,
- USER_CP_SQUARE_HS = 2,
- USER_CP_SQUARE_HV = 3,
-} eColorPicker_Types;
+#define USER_CP_CIRCLE 0
+#define USER_CP_SQUARE_SV 1
+#define USER_CP_SQUARE_HS 2
+#define USER_CP_SQUARE_HV 3
/* timecode display styles */
-typedef enum eTimecodeStyles {
/* as little info as is necessary to show relevant info
* with '+' to denote the frames
* i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS
*/
- USER_TIMECODE_MINIMAL = 0,
-
+#define USER_TIMECODE_MINIMAL 0
/* reduced SMPTE - (HH:)MM:SS:FF */
- USER_TIMECODE_SMPTE_MSF = 1,
-
+#define USER_TIMECODE_SMPTE_MSF 1
/* full SMPTE - HH:MM:SS:FF */
- USER_TIMECODE_SMPTE_FULL = 2,
-
+#define USER_TIMECODE_SMPTE_FULL 2
/* milliseconds for sub-frames - HH:MM:SS.sss */
- USER_TIMECODE_MILLISECONDS = 3,
-
+#define USER_TIMECODE_MILLISECONDS 3
/* seconds only */
- USER_TIMECODE_SECONDS_ONLY = 4,
-} eTimecodeStyles;
+#define USER_TIMECODE_SECONDS_ONLY 4
/* theme drawtypes */
-/* XXX: These are probably only for the old UI engine? */
-typedef enum eTheme_DrawTypes {
- TH_MINIMAL = 0,
- TH_ROUNDSHADED = 1,
- TH_ROUNDED = 2,
- TH_OLDSKOOL = 3,
- TH_SHADED = 4
-} eTheme_DrawTypes;
+#define TH_MINIMAL 0
+#define TH_ROUNDSHADED 1
+#define TH_ROUNDED 2
+#define TH_OLDSKOOL 3
+#define TH_SHADED 4
/* ndof_flag (3D mouse options) */
-typedef enum eNdof_Flag {
- NDOF_SHOW_GUIDE = (1 << 0),
- NDOF_FLY_HELICOPTER = (1 << 1),
- NDOF_LOCK_HORIZON = (1 << 2),
-
- /* the following might not need to be saved between sessions,
- * but they do need to live somewhere accessible... */
- NDOF_SHOULD_PAN = (1 << 3),
- NDOF_SHOULD_ZOOM = (1 << 4),
- NDOF_SHOULD_ROTATE = (1 << 5),
-
- /* orbit navigation modes
- * only two options, so it's sort of a hybrid bool/enum
- * if ((U.ndof_flag & NDOF_ORBIT_MODE) == NDOF_OM_OBJECT)... */
-
- // NDOF_ORBIT_MODE = (1 << 6),
- // #define NDOF_OM_TARGETCAMERA 0
- // #define NDOF_OM_OBJECT NDOF_ORBIT_MODE
-
- /* actually... users probably don't care about what the mode
- * is called, just that it feels right */
- /* zoom is up/down if this flag is set (otherwise forward/backward) */
- NDOF_ZOOM_UPDOWN = (1 << 7),
- NDOF_ZOOM_INVERT = (1 << 8),
- NDOF_ROTATE_INVERT_AXIS = (1 << 9),
- NDOF_TILT_INVERT_AXIS = (1 << 10),
- NDOF_ROLL_INVERT_AXIS = (1 << 11),
- NDOF_PANX_INVERT_AXIS = (1 << 12),
- NDOF_PANY_INVERT_AXIS = (1 << 13),
- NDOF_PANZ_INVERT_AXIS = (1 << 14),
- NDOF_TURNTABLE = (1 << 15),
-} eNdof_Flag;
+#define NDOF_SHOW_GUIDE (1 << 0)
+#define NDOF_FLY_HELICOPTER (1 << 1)
+#define NDOF_LOCK_HORIZON (1 << 2)
+/* the following might not need to be saved between sessions,
+ * but they do need to live somewhere accessible... */
+#define NDOF_SHOULD_PAN (1 << 3)
+#define NDOF_SHOULD_ZOOM (1 << 4)
+#define NDOF_SHOULD_ROTATE (1 << 5)
+/* orbit navigation modes
+ * only two options, so it's sort of a hybrid bool/enum
+ * if ((U.ndof_flag & NDOF_ORBIT_MODE) == NDOF_OM_OBJECT)... */
+
+// #define NDOF_ORBIT_MODE (1 << 6)
+// #define NDOF_OM_TARGETCAMERA 0
+// #define NDOF_OM_OBJECT NDOF_ORBIT_MODE
+
+/* actually... users probably don't care about what the mode
+ * is called, just that it feels right */
+/* zoom is up/down if this flag is set (otherwise forward/backward) */
+#define NDOF_ZOOM_UPDOWN (1 << 7)
+#define NDOF_ZOOM_INVERT (1 << 8)
+#define NDOF_ROTATE_INVERT_AXIS (1 << 9)
+#define NDOF_TILT_INVERT_AXIS (1 << 10)
+#define NDOF_ROLL_INVERT_AXIS (1 << 11)
+#define NDOF_PANX_INVERT_AXIS (1 << 12)
+#define NDOF_PANY_INVERT_AXIS (1 << 13)
+#define NDOF_PANZ_INVERT_AXIS (1 << 14)
+#define NDOF_TURNTABLE (1 << 15)
/* compute_device_type */
-typedef enum eCompute_Device_Type {
- USER_COMPUTE_DEVICE_NONE = 0,
- USER_COMPUTE_DEVICE_OPENCL = 1,
- USER_COMPUTE_DEVICE_CUDA = 2,
-} eCompute_Device_Type;
+#define USER_COMPUTE_DEVICE_NONE 0
+#define USER_COMPUTE_DEVICE_OPENCL 1
+#define USER_COMPUTE_DEVICE_CUDA 2
#ifdef __cplusplus
}
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 079f2768352..fec3aa22e92 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -485,15 +485,11 @@ static int preprocess_include(char *maindata, int len)
}
/* do not copy when: */
- if (comment) {
- /* pass */
- }
- else if (cp[0] == ' ' && cp[1] == ' ') {
- /* pass */
- }
- else if (cp[-1] == '*' && cp[0] == ' ') {
- /* pointers with a space */
- } /* skip special keywords */
+ if (comment) ;
+ else if (cp[0] == ' ' && cp[1] == ' ') ;
+ else if (cp[-1] == '*' && cp[0] == ' ') ; /* pointers with a space */
+
+ /* skip special keywords */
else if (strncmp("DNA_DEPRECATED", cp, 14) == 0) {
/* single values are skipped already, so decrement 1 less */
a -= 13;
@@ -1032,9 +1028,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
if (debugSDNA > -1) printf("Writing file ... ");
- if (nr_names == 0 || nr_structs == 0) {
- /* pass */
- }
+ if (nr_names == 0 || nr_structs == 0) ;
else {
strcpy(str, "SDNA");
dna_write(file, str, 4);
@@ -1192,19 +1186,7 @@ int main(int argc, char **argv)
return(return_status);
}
-/* handy but fails on struct bounds which makesdna doesnt care about
- * unless structs are nested */
-#if 0
/* include files for automatic dependencies */
-
-/* extra safety check that we are aligned,
- * warnings here are easier to fix the makesdna's */
-#ifdef __GNUC__
-# pragma GCC diagnostic error "-Wpadded"
-#endif
-
-#endif /* if 0 */
-
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index 0f9a00de7b6..b651d4d5e5c 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -38,7 +38,6 @@ extern EnumPropertyItem DummyRNA_NULL_items[];
extern EnumPropertyItem DummyRNA_DEFAULT_items[];
extern EnumPropertyItem object_mode_items[];
-extern EnumPropertyItem object_empty_drawtype_items[];
extern EnumPropertyItem metaelem_type_items[];
extern EnumPropertyItem proportional_falloff_items[];
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index b1fdfccd0be..12a41f213b7 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -41,8 +41,6 @@
#include "BLI_utildefines.h"
-#include "BLF_translation.h"
-
/* Always keep in alphabetical order */
EnumPropertyItem actuator_type_items[] = {
{ACT_ACTION, "ACTION", 0, "Action", ""},
@@ -973,13 +971,11 @@ static void rna_def_sound_actuator(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Volume", "Initial volume of the sound");
- RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2);
RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound");
- RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats - 3D Parameters */
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index d7e59f3b9dd..c47cb8ef2af 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -721,7 +721,7 @@ static void rna_def_bpoint(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Number values */
- prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alfa");
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3D View");
@@ -808,14 +808,13 @@ static void rna_def_beztriple(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_points");
/* Number values */
- prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_ANGLE);
+ prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alfa");
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3D View");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop = RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "weight");
+ prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -1164,7 +1163,7 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
- RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+ RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
#if 0
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
@@ -1191,7 +1190,7 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
- RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+ RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
#if 0
func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index d899b5833bb..24b14fdb884 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -1497,7 +1497,7 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "add", "rna_FKeyframe_points_add");
RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve");
- RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
+ RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
func = RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove");
RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve");
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index b0fcfb9b540..131611d3002 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -40,15 +40,6 @@
#ifdef RNA_RUNTIME
-#include "WM_api.h"
-
-#include "BKE_gpencil.h"
-
-static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
-{
- WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
-}
-
static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
{
bGPDlayer *gpl = (bGPDlayer *)ptr->data;
@@ -62,7 +53,6 @@ static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr)
{
-
bGPdata *gpd = ptr->id.data;
if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */
@@ -111,154 +101,6 @@ static void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value)
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
}
-static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count)
-{
- if (count > 0) {
- if (stroke->points == NULL)
- stroke->points = MEM_callocN(sizeof(bGPDspoint) * count, "gp_stroke_points");
- else
- stroke->points = MEM_reallocN(stroke->points, sizeof(bGPDspoint) * (stroke->totpoints + count));
-
- stroke->totpoints += count;
- }
-}
-
-static void rna_GPencil_stroke_point_pop(bGPDstroke *stroke, ReportList *reports, int index)
-{
- bGPDspoint *pt_tmp = stroke->points;
-
- /* python style negative indexing */
- if (index < 0) {
- index += stroke->totpoints;
- }
-
- if (stroke->totpoints <= index || index < 0) {
- BKE_report(reports, RPT_ERROR, "GPencilStrokePoints.pop: index out of range");
- return;
- }
-
- stroke->totpoints--;
-
- stroke->points = MEM_callocN(sizeof(bGPDspoint) * stroke->totpoints, "gp_stroke_points");
-
- if (index > 0)
- memcpy(stroke->points, pt_tmp, sizeof(bGPDspoint) * index);
-
- if (index < stroke->totpoints)
- memcpy(&stroke->points[index], &pt_tmp[index + 1], sizeof(bGPDspoint) * (stroke->totpoints - index));
-
- /* free temp buffer */
- MEM_freeN(pt_tmp);
-
- WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
-}
-
-static bGPDstroke *rna_GPencil_stroke_new(bGPDframe *frame)
-{
- bGPDstroke *stroke = MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
-
- BLI_addtail(&frame->strokes, stroke);
-
- return stroke;
-}
-
-static void rna_GPencil_stroke_remove(bGPDframe *frame, ReportList *reports, bGPDstroke *stroke)
-{
- if (BLI_findindex(&frame->strokes, stroke) == -1) {
- BKE_reportf(reports, RPT_ERROR, "Stroke not found in grease pencil frame");
- return;
- }
-
- BLI_freelinkN(&frame->strokes, stroke);
-
- WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
-}
-
-static bGPDframe *rna_GPencil_frame_new(bGPDlayer *layer, ReportList *reports, int frame_number)
-{
- bGPDframe *frame;
-
- if (BKE_gpencil_layer_find_frame(layer, frame_number)) {
- BKE_reportf(reports, RPT_ERROR, "Frame already exists on this frame number");
- return NULL;
- }
-
- frame = gpencil_frame_addnew(layer, frame_number);
-
- WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
-
- return frame;
-}
-
-static void rna_GPencil_frame_remove(bGPDlayer *layer, ReportList *reports, bGPDframe *frame)
-{
- if (BLI_findindex(&layer->frames, frame) == -1) {
- BKE_reportf(reports, RPT_ERROR, "Frame not found in grease pencil layer");
- return;
- }
-
- gpencil_layer_delframe(layer, frame);
-
- WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
-}
-
-static bGPDframe *rna_GPencil_frame_copy(bGPDlayer *layer, bGPDframe *src)
-{
- bGPDframe *frame = gpencil_frame_duplicate(src);
-
- while (BKE_gpencil_layer_find_frame(layer, frame->framenum)) {
- frame->framenum++;
- }
-
- BLI_addtail(&layer->frames, frame);
-
- WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
-
- return frame;
-}
-
-static bGPDlayer *rna_GPencil_layer_new(bGPdata *gpd, const char *name, int setactive)
-{
- bGPDlayer *gl = gpencil_layer_addnew(gpd, name, setactive);
-
- WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
-
- return gl;
-}
-
-static void rna_GPencil_layer_remove(bGPdata *gpd, ReportList *reports, bGPDlayer *layer)
-{
- if (BLI_findindex(&gpd->layers, layer) == -1) {
- BKE_reportf(reports, RPT_ERROR, "Layer not found in grease pencil data");
- return;
- }
-
- gpencil_layer_delete(gpd, layer);
-
- WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
-}
-
-static void rna_GPencil_frame_clear(bGPDframe *frame)
-{
- free_gpencil_strokes(frame);
-
- WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
-}
-
-static void rna_GPencil_layer_clear(bGPDlayer *layer)
-{
- free_gpencil_frames(layer);
-
- WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
-}
-
-static void rna_GPencil_clear(bGPdata *gpd)
-{
- free_gpencil_layers(&gpd->layers);
-
- WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
-}
-
#else
static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
@@ -274,49 +116,19 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Coordinates", "");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pressure");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-}
-
-static void rna_def_gpencil_stroke_points_api(BlenderRNA *brna, PropertyRNA *cprop)
-{
- StructRNA *srna;
-
- FunctionRNA *func;
- /* PropertyRNA *parm; */
-
- RNA_def_property_srna(cprop, "GPencilStrokePoints");
- srna = RNA_def_struct(brna, "GPencilStrokePoints", NULL);
- RNA_def_struct_sdna(srna, "bGPDstroke");
- RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Points", "Collection of grease pencil stroke points");
-
- func = RNA_def_function(srna, "add", "rna_GPencil_stroke_point_add");
- RNA_def_function_ui_description(func, "Add a new grease pencil stroke point");
- RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the stroke", 0, INT_MAX);
-
- func = RNA_def_function(srna, "pop", "rna_GPencil_stroke_point_pop");
- RNA_def_function_ui_description(func, "Remove a grease pencil stroke point");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_int(func, "index", -1, INT_MIN, INT_MAX, "Index", "point index", INT_MIN, INT_MAX);
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
}
static void rna_def_gpencil_stroke(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
- static EnumPropertyItem stroke_draw_mode_items[] = {
- {0, "SCREEN", 0, "Screen", "Stroke is in screen-space"},
- {GP_STROKE_3DSPACE, "3DSPACE", 0, "3D Space", "Stroke is in 3D-space"},
- {GP_STROKE_2DSPACE, "2DSPACE", 0, "2D Space", "Stroke is in 2D-space"},
- {GP_STROKE_2DIMAGE, "2DIMAGE", 0, "2D Image", "Stroke is in 2D-space (but with special 'image' scaling)"},
- {0, NULL, 0, NULL, NULL}
- };
srna = RNA_def_struct(brna, "GPencilStroke", NULL);
RNA_def_struct_sdna(srna, "bGPDstroke");
@@ -327,45 +139,15 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints");
RNA_def_property_struct_type(prop, "GPencilStrokePoint");
RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points");
- rna_def_gpencil_stroke_points_api(brna, prop);
-
- prop = RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
- RNA_def_property_enum_items(prop, stroke_draw_mode_items);
- RNA_def_property_ui_text(prop, "Draw Mode", "");
- RNA_def_property_update(prop, 0, "rna_GPencil_update");
-}
-
-static void rna_def_gpencil_strokes_api(BlenderRNA *brna, PropertyRNA *cprop)
-{
- StructRNA *srna;
-
- FunctionRNA *func;
- PropertyRNA *parm;
-
- RNA_def_property_srna(cprop, "GPencilStrokes");
- srna = RNA_def_struct(brna, "GPencilStrokes", NULL);
- RNA_def_struct_sdna(srna, "bGPDframe");
- RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil frames");
-
- func = RNA_def_function(srna, "new", "rna_GPencil_stroke_new");
- RNA_def_function_ui_description(func, "Add a new grease pencil frame");
- parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "", "The newly created stroke");
- RNA_def_function_return(func, parm);
-
- func = RNA_def_function(srna, "remove", "rna_GPencil_stroke_remove");
- RNA_def_function_ui_description(func, "Remove a grease pencil frame");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to remove");
- RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
+
+ /* Flags - Readonly type-info really... */
+ /* TODO... */
}
static void rna_def_gpencil_frame(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
- FunctionRNA *func;
srna = RNA_def_struct(brna, "GPencilFrame", NULL);
RNA_def_struct_sdna(srna, "bGPDframe");
@@ -376,8 +158,7 @@ static void rna_def_gpencil_frame(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL);
RNA_def_property_struct_type(prop, "GPencilStroke");
RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame");
- rna_def_gpencil_strokes_api(brna, prop);
-
+
/* Frame Number */
prop = RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "framenum");
@@ -392,51 +173,12 @@ static void rna_def_gpencil_frame(BlenderRNA *brna)
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT);
RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the DopeSheet");
-
- func = RNA_def_function(srna, "clear", "rna_GPencil_frame_clear");
- RNA_def_function_ui_description(func, "Remove all the grease pencil frame data");
-}
-
-static void rna_def_gpencil_frames_api(BlenderRNA *brna, PropertyRNA *cprop)
-{
- StructRNA *srna;
-
- FunctionRNA *func;
- PropertyRNA *parm;
-
- RNA_def_property_srna(cprop, "GPencilFrames");
- srna = RNA_def_struct(brna, "GPencilFrames", NULL);
- RNA_def_struct_sdna(srna, "bGPDlayer");
- RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil frames");
-
- func = RNA_def_function(srna, "new", "rna_GPencil_frame_new");
- RNA_def_function_ui_description(func, "Add a new grease pencil frame");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm = RNA_def_int(func, "frame_number", 1, MINFRAME, MAXFRAME, "Frame Number", "The frame on which this sketch appears", MINFRAME, MAXFRAME);
- RNA_def_property_flag(parm, PROP_REQUIRED);
- parm = RNA_def_pointer(func, "frame", "GPencilFrame", "", "The newly created frame");
- RNA_def_function_return(func, parm);
-
- func = RNA_def_function(srna, "remove", "rna_GPencil_frame_remove");
- RNA_def_function_ui_description(func, "Remove a grease pencil frame");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm = RNA_def_pointer(func, "frame", "GPencilFrame", "Frame", "The frame to remove");
- RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
-
- func = RNA_def_function(srna, "copy", "rna_GPencil_frame_copy");
- RNA_def_function_ui_description(func, "Copy a grease pencil frame");
- parm = RNA_def_pointer(func, "source", "GPencilFrame", "Source", "The source frame");
- RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
- parm = RNA_def_pointer(func, "copy", "GPencilFrame", "", "The newly copied frame");
- RNA_def_function_return(func, parm);
}
static void rna_def_gpencil_layer(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
- FunctionRNA *func;
srna = RNA_def_struct(brna, "GPencilLayer", NULL);
RNA_def_struct_sdna(srna, "bGPDlayer");
@@ -447,47 +189,44 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Info", "Layer name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
-
+
/* Frames */
prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
RNA_def_property_struct_type(prop, "GPencilFrame");
RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames");
- rna_def_gpencil_frames_api(brna, prop);
-
+
/* Active Frame */
prop = RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "actframe");
RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer");
RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
-
+
/* Drawing Color */
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color[3]");
RNA_def_property_range(prop, 0.3, 1.0f);
RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* Line Thickness */
prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "thickness");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* Onion-Skinning */
prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
prop = RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gstep");
@@ -495,23 +234,23 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Max Ghost Range",
"Maximum number of frames on either side of the active frame to show "
"(0 = show the 'first' available sketch on either side)");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* Flags */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK);
RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* expose as layers.active */
#if 0
@@ -519,56 +258,54 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Set active layer for editing");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
#endif
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the DopeSheet");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* XXX keep this option? */
prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)");
- RNA_def_property_update_runtime(prop, "rna_GPencil_update");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* X-Ray */
prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY);
RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-
- func = RNA_def_function(srna, "clear", "rna_GPencil_layer_clear");
- RNA_def_function_ui_description(func, "Remove all the grease pencil layer data");
+ RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
}
-static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop)
+static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
PropertyRNA *prop;
- FunctionRNA *func;
- PropertyRNA *parm;
+/* FunctionRNA *func; */
+/* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "GreasePencilLayers");
srna = RNA_def_struct(brna, "GreasePencilLayers", NULL);
RNA_def_struct_sdna(srna, "bGPdata");
RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers");
+#if 0
func = RNA_def_function(srna, "new", "rna_GPencil_layer_new");
- RNA_def_function_ui_description(func, "Add a new grease pencil layer");
- parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve");
+ parm = RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_boolean(func, "set_active", 0, "Set Active", "Set the newly created layer to the active layer");
- parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer");
+ parm = RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
- RNA_def_function_ui_description(func, "Remove a grease pencil layer");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to remove");
+ parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
+#endif
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "GreasePencil");
@@ -581,8 +318,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- FunctionRNA *func;
-
+
static EnumPropertyItem draw_mode_items[] = {
{GP_DATA_VIEWALIGN, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"},
{0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weird, GP_DATA_VIEWALIGN is inverted */
@@ -601,22 +337,19 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
RNA_def_property_struct_type(prop, "GPencilLayer");
RNA_def_property_ui_text(prop, "Layers", "");
- rna_def_gpencil_layers_api(brna, prop);
+ rna_def_gpencil_layers(brna, prop);
/* Flags */
prop = RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, draw_mode_items);
RNA_def_property_ui_text(prop, "Draw Mode", "");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_DEPTH_STROKE_ENDPOINTS);
RNA_def_property_ui_text(prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
- func = RNA_def_function(srna, "clear", "rna_GPencil_clear");
- RNA_def_function_ui_description(func, "Remove all the grease pencil data");
+
}
/* --- */
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index ffc78ef8ca4..6e20375d9c6 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -409,7 +409,7 @@ int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct Poi
/* Internal functions that cycles uses so we need to declare (tsk tsk) */
struct Mesh *rna_Object_to_mesh(struct Object *ob, struct ReportList *reports, struct Scene *sce, int apply_modifiers, int settings);
void rna_Main_meshes_remove(struct Main *bmain, struct ReportList *reports, struct Mesh *mesh);
-void rna_Object_create_duplilist(struct Object *ob, struct ReportList *reports, struct Scene *sce, int settings);
+void rna_Object_create_duplilist(struct Object *ob, struct ReportList *reports, struct Scene *sce);
void rna_Object_free_duplilist(struct Object *ob);
void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values);
void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values);
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index e4a29d9c674..d4082cf3d9f 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -240,12 +240,6 @@ static void rna_def_latticepoint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Deformed Location", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
- prop = RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "weight");
- RNA_def_property_range(prop, 0.01f, 100.0f);
- RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
- RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
-
prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next",
"rna_iterator_array_end", "rna_iterator_array_get",
@@ -326,7 +320,7 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next",
"rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Points", "Points of the lattice");
-
+
/* pointers */
rna_def_animdata_common(srna);
}
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index cd9b3965713..f5c59aa583a 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -71,7 +71,6 @@
#include "BKE_speaker.h"
#include "BKE_movieclip.h"
#include "BKE_mask.h"
-#include "BKE_gpencil.h"
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
@@ -93,7 +92,6 @@
#include "DNA_node_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_mask_types.h"
-#include "DNA_gpencil_types.h"
#include "ED_screen.h"
@@ -563,19 +561,6 @@ static void rna_Main_masks_remove(Main *bmain, Mask *mask)
/* XXX python now has invalid pointer? */
}
-static void rna_Main_grease_pencil_remove(Main *bmain, ReportList *reports, bGPdata *gpd)
-{
- if (ID_REAL_USERS(gpd) <= 0) {
- BKE_gpencil_free(gpd);
- BKE_libblock_free(&bmain->gpencil, gpd);
- }
- else
- BKE_reportf(reports, RPT_ERROR, "Grease Pencil \"%s\" must have zero users to be removed, found %d",
- gpd->id.name + 2, ID_REAL_USERS(gpd));
-
- /* XXX python now has invalid pointer? */
-}
-
/* tag functions, all the same */
static void rna_Main_cameras_tag(Main *bmain, int value) { tag_main_lb(&bmain->camera, value); }
static void rna_Main_scenes_tag(Main *bmain, int value) { tag_main_lb(&bmain->scene, value); }
@@ -1524,20 +1509,6 @@ void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func = RNA_def_function(srna, "new", "gpencil_data_addnew");
- RNA_def_function_flag(func, FUNC_NO_SELF);
- parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the datablock");
- RNA_def_property_flag(parm, PROP_REQUIRED);
- /* return type */
- parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "New grease pencil datablock");
- RNA_def_function_return(func, parm);
-
- func = RNA_def_function(srna, "remove", "rna_Main_grease_pencil_remove");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a grease pencil instance from the current blendfile");
- parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
- RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
-
prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_gpencil_is_updated_get", NULL);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 1b26c0447ff..eb4660c18e8 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -3007,7 +3007,7 @@ static void rna_def_modifier_remesh(BlenderRNA *brna)
prop = RNA_def_property(srna, "octree_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "depth");
- RNA_def_property_range(prop, 1, 12);
+ RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Octree Depth", "Resolution of the octree; higher values give finer details");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index d650c8dbf69..af3a8691e08 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1720,16 +1720,6 @@ static void def_sh_tex_wave(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Node_update");
}
-static void def_sh_tex_coord(StructRNA *srna)
-{
- PropertyRNA *prop;
-
- prop = RNA_def_property(srna, "from_dupli", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
- RNA_def_property_ui_text(prop, "From Dupli", "Use the parent of the dupli object if possible");
- RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
-}
-
static void def_glossy(StructRNA *srna)
{
PropertyRNA *prop;
@@ -2205,14 +2195,14 @@ static void def_cmp_inpaint(StructRNA *srna)
{
PropertyRNA *prop;
-#if 0
+/*
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Type", "Type of inpaint algorithm");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
-#endif
+*/
prop = RNA_def_property(srna, "distance", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index db1e1e16adf..0baa4cc0838 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -92,7 +92,7 @@ DefNode( ShaderNode, SH_NODE_TEX_MUSGRAVE, def_sh_tex_musgrave, "TE
DefNode( ShaderNode, SH_NODE_TEX_VORONOI, def_sh_tex_voronoi, "TEX_VORONOI", TexVoronoi, "Voronoi Texture", "" )
DefNode( ShaderNode, SH_NODE_TEX_CHECKER, def_sh_tex_checker, "TEX_CHECKER", TexChecker, "Checker Texture", "" )
DefNode( ShaderNode, SH_NODE_TEX_BRICK, def_sh_tex_brick, "TEX_BRICK", TexBrick, "Brick Texture", "" )
-DefNode( ShaderNode, SH_NODE_TEX_COORD, def_sh_tex_coord, "TEX_COORD", TexCoord, "Texture Coordinate","" )
+DefNode( ShaderNode, SH_NODE_TEX_COORD, 0, "TEX_COORD", TexCoord, "Texture Coordinate","" )
DefNode( CompositorNode, CMP_NODE_VIEWER, def_cmp_viewer, "VIEWER", Viewer, "Viewer", "" )
DefNode( CompositorNode, CMP_NODE_RGB, 0, "RGB", RGB, "RGB", "" )
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 0b8afef0364..a10c153515a 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -69,19 +69,6 @@ EnumPropertyItem object_mode_items[] = {
{0, NULL, 0, NULL, NULL}
};
-EnumPropertyItem object_empty_drawtype_items[] = {
- {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
- {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
- {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
- {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
- {OB_CUBE, "CUBE", 0, "Cube", ""},
- {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
- {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
- {OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
-
static EnumPropertyItem parent_type_items[] = {
{PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"},
{PARCURVE, "CURVE", 0, "Curve", "The object is parented to a curve"},
@@ -93,7 +80,7 @@ static EnumPropertyItem parent_type_items[] = {
{PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"},
{0, NULL, 0, NULL, NULL}
};
-
+
static EnumPropertyItem collision_bounds_items[] = {
{OB_BOUND_BOX, "BOX", 0, "Box", ""},
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
@@ -1887,6 +1874,18 @@ static void rna_def_object(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+
+ static EnumPropertyItem empty_drawtype_items[] = {
+ {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
+ {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
+ {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
+ {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
+ {OB_CUBE, "CUBE", 0, "Cube", ""},
+ {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
+ {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
+ {OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
static EnumPropertyItem track_items[] = {
{OB_POSX, "POS_X", 0, "+X", ""},
@@ -2268,7 +2267,7 @@ static void rna_def_object(BlenderRNA *brna)
/* empty */
prop = RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype");
- RNA_def_property_enum_items(prop, object_empty_drawtype_items);
+ RNA_def_property_enum_items(prop, empty_drawtype_items);
RNA_def_property_ui_text(prop, "Empty Display Type", "Viewport display style for empties");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
@@ -2573,16 +2572,7 @@ static void rna_def_dupli_object(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Particle Index", "Index in the lowest-level particle dupli list");
- prop = RNA_def_property(srna, "orco", PROP_FLOAT, PROP_TRANSLATION);
- RNA_def_property_float_sdna(prop, NULL, "orco");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Generated Coordinates", "Generated coordinates in parent object space");
-
- prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "uv");
- RNA_def_property_array(prop, 2);
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "UV Coordinates", "UV coordinates in parent object space");
+ /* TODO: DupliObject has more properties that can be wrapped */
}
static void rna_def_object_base(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 879a77527cd..4d2fd89921b 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -340,10 +340,8 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e
dupli_render_particle_set(scene, go->ob, level + 1, enable);
}
/* When no longer needed, duplilist should be freed with Object.free_duplilist */
-void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce, int settings)
+void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce)
{
- int for_render = settings == eModifierMode_Render;
-
if (!(ob->transflag & OB_DUPLI)) {
BKE_report(reports, RPT_ERROR, "Object does not have duplis");
return;
@@ -358,7 +356,7 @@ void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce, in
}
if (G.is_rendering)
dupli_render_particle_set(sce, ob, 0, 1);
- ob->duplilist = object_duplilist(sce, ob, for_render);
+ ob->duplilist = object_duplilist(sce, ob);
if (G.is_rendering)
dupli_render_particle_set(sce, ob, 0, 0);
/* ob->duplilist should now be freed with Object.free_duplilist */
@@ -613,7 +611,6 @@ void RNA_api_object(StructRNA *srna)
"objects real matrix and layers");
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis");
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
- parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Generate texture coordinates for rendering");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist");
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 39f85ebc742..1c896133408 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -1307,7 +1307,7 @@ static void rna_def_field(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_2d_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_2D);
- RNA_def_property_ui_text(prop, "2D", "Apply force only in 2D");
+ RNA_def_property_ui_text(prop, "2D", "Apply force only in 2d");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop = RNA_def_property(srna, "use_root_coords", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 363d2dc020a..89638389fd2 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -2135,7 +2135,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_float_default(prop, 0.2);
RNA_def_property_ui_text(prop, "Adaptive Subframe Threshold",
"The relative distance a particle can move before requiring more subframes "
- "(target current number); 0.1-0.3 is the recommended range");
+ "(target Courant number); 0.1-0.3 is the recommended range");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop = RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index a3616e0845a..c11051d2a2e 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3106,7 +3106,6 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "Audio volume");
- RNA_def_property_translation_context(prop, "Audio");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
#endif
@@ -4518,7 +4517,6 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "audio.volume");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "Audio volume");
- RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_update(prop, NC_SCENE, NULL);
RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL);
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index d8ca1aea5dd..4792934887f 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -50,8 +50,6 @@
#include "WM_types.h"
#include "BLI_math.h"
-#include "BLF_translation.h"
-
typedef struct EffectInfo {
const char *struct_name;
const char *ui_name;
@@ -1675,14 +1673,14 @@ static void rna_def_effect_inputs(StructRNA *srna, int count)
RNA_def_property_ui_text(prop, "Input 2", "Second input for the effect strip");
}
-#if 0
+ /*
if (count == 3) { // not used by any effects (perhaps one day plugins?)
prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq3");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip");
}
-#endif
+ */
}
static void rna_def_image(BlenderRNA *brna)
@@ -1860,7 +1858,6 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
- RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
@@ -1868,7 +1865,6 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
- RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index bfd0f731626..ff5f4988cc1 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1324,7 +1324,7 @@ static void rna_def_background_image(BlenderRNA *brna)
srna = RNA_def_struct(brna, "BackgroundImage", NULL);
RNA_def_struct_sdna(srna, "BGpic");
- RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3D View background");
+ RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background");
prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "source");
diff --git a/source/blender/makesrna/intern/rna_speaker.c b/source/blender/makesrna/intern/rna_speaker.c
index a160aaf94e2..1e3c8df9273 100644
--- a/source/blender/makesrna/intern/rna_speaker.c
+++ b/source/blender/makesrna/intern/rna_speaker.c
@@ -35,8 +35,6 @@
#include "DNA_speaker_types.h"
#include "DNA_sound_types.h"
-#include "BLF_translation.h"
-
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -47,6 +45,7 @@
#include "WM_api.h"
#include "WM_types.h"
+
#else
static void rna_def_speaker(BlenderRNA *brna)
@@ -152,7 +151,6 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "How loud the sound is");
- RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
/* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL); */
/* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
@@ -160,7 +158,6 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
- RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
/* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL); */
/* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 202c53cb75d..45e3d15b9be 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -71,7 +71,7 @@ EnumPropertyItem texture_type_items[] = {
{TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""},
{TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - create a fractal noise texture"},
{TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - create cell-like patterns based on Worley noise"},
- {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3D texture based on volumetric data"},
+ {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"},
{TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - wave generated bands or rings, with optional noise"},
{TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", "Use a texture generated by an Ocean modifier"},
{0, NULL, 0, NULL, NULL}
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 4b744b160fc..0c62a280935 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -567,6 +567,18 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
"Limit speed of tracking to make visual feedback easier "
"(this does not affect the tracking quality)");
+ /* keyframe_a */
+ prop = RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_int_sdna(prop, NULL, "keyframe1");
+ RNA_def_property_ui_text(prop, "Keyframe A", "First keyframe used for reconstruction initialization");
+
+ /* keyframe_b */
+ prop = RNA_def_property(srna, "keyframe_b", PROP_INT, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_int_sdna(prop, NULL, "keyframe2");
+ RNA_def_property_ui_text(prop, "Keyframe B", "Second keyframe used for reconstruction initialization");
+
/* intrinsics refinement during bundle adjustment */
prop = RNA_def_property(srna, "refine_intrinsics", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "refine_camera_intrinsics");
@@ -1381,18 +1393,6 @@ static void rna_def_trackingObject(BlenderRNA *brna)
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Scale", "Scale of object solution in camera space");
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_trackingObject_flushUpdate");
-
- /* keyframe_a */
- prop = RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_int_sdna(prop, NULL, "keyframe1");
- RNA_def_property_ui_text(prop, "Keyframe A", "First keyframe used for reconstruction initialization");
-
- /* keyframe_b */
- prop = RNA_def_property(srna, "keyframe_b", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_int_sdna(prop, NULL, "keyframe2");
- RNA_def_property_ui_text(prop, "Keyframe B", "Second keyframe used for reconstruction initialization");
}
static void rna_def_trackingObjects(BlenderRNA *brna, PropertyRNA *cprop)
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index e1cf7a13f59..9c989121aa4 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2745,11 +2745,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available",
"Automatic keyframe insertion in available F-Curves");
-
- prop = RNA_def_property(srna, "use_auto_keying_warning", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_NOWARNING);
- RNA_def_property_ui_text(prop, "Show Auto Keying Warning",
- "Show warning indicators when transforming Object and Bones if Auto Keying is enabled");
/* keyframing settings */
prop = RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index 0d86ada8026..68bafd94ce4 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -515,9 +515,9 @@ static int setExecutableNodes(bNodeTreeExec *exec, ThreadData *thd)
static void freeExecutableNode(bNodeTreeExec *exec)
{
/* node outputs can be freed when:
- * - not a render result or image node
- * - when node outputs go to nodes all being set NODE_FINISHED
- */
+ - not a render result or image node
+ - when node outputs go to nodes all being set NODE_FINISHED
+ */
bNodeTree *ntree = exec->nodetree;
bNodeExec *nodeexec;
bNode *node;
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c
index 62b1cabd491..86f71f6f05b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c
@@ -57,7 +57,7 @@ void register_node_type_sh_tex_coord(bNodeTreeType *ttype)
{
static bNodeType ntype;
- node_type_base(ttype, &ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, NODE_OPTIONS);
+ node_type_base(ttype, &ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_tex_coord_out);
node_type_size(&ntype, 150, 60, 200);
diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c
index fdd3b97ad59..ce22bc00a55 100644
--- a/source/blender/nodes/texture/nodes/node_texture_output.c
+++ b/source/blender/nodes/texture/nodes/node_texture_output.c
@@ -65,7 +65,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
tex_input_rgba(&target->tr, in[0], &params, cdata->thread);
target->tin = (target->tr + target->tg + target->tb) / 3.0f;
- target->talpha = TRUE;
+ target->talpha = 1;
if (target->nor) {
if (in[1] && in[1]->hasinput)
diff --git a/source/blender/python/rna_dump.py b/source/blender/python/rna_dump.py
index 15cc60d997e..489f011e693 100644
--- a/source/blender/python/rna_dump.py
+++ b/source/blender/python/rna_dump.py
@@ -95,7 +95,7 @@ def seek(r, txt, recurs):
if GEN_PATH:
newtxt = txt + '.' + item
- if item == 'rna_type' and VERBOSE_TYPE is False: # just avoid because it spits out loads of data
+ if item == 'rna_type' and VERBOSE_TYPE == False: # just avoid because it spits out loads of data
continue
value = getattr(r, item, None)
@@ -114,7 +114,7 @@ def seek(r, txt, recurs):
except:
length = 0
- if VERBOSE is False and length >= 4:
+ if VERBOSE == False and length >= 4:
for i in (0, length - 1):
if i > 0:
if PRINT_DATA:
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 46ab3aeb21f..78b4c3b8787 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -4106,12 +4106,8 @@ static void set_fullsample_trace_flag(Render *re, ObjectRen *obr)
vlr->flag |= R_FULL_OSA;
}
else if (trace) {
- if (mode & MA_SHLESS) {
- /* pass */
- }
- else if (vlr->mat->material_type == MA_TYPE_VOLUME) {
- /* pass */
- }
+ if (mode & MA_SHLESS);
+ else if (vlr->mat->material_type == MA_TYPE_VOLUME);
else if ((mode & MA_RAYMIRROR) || ((mode & MA_TRANSP) && (mode & MA_RAYTRANSP))) {
/* for blurry reflect/refract, better to take more samples
* inside the raytrace than as OSA samples */
@@ -4899,7 +4895,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
/* create list of duplis generated by this object, particle
* system need to have render settings set for dupli particles */
dupli_render_particle_set(re, ob, timeoffset, 0, 1);
- lb= object_duplilist(re->scene, ob, TRUE);
+ lb= object_duplilist(re->scene, ob);
dupli_render_particle_set(re, ob, timeoffset, 0, 0);
for (dob= lb->first; dob; dob= dob->next) {
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 154292a3065..6c86f2a2999 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -150,13 +150,8 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
fx-= xs;
fy-= ys;
- if ( (tex->flag & TEX_CHECKER_ODD) == 0) {
- if ((xs + ys) & 1) {
- /* pass */
- }
- else {
- return retval;
- }
+ if ( (tex->flag & TEX_CHECKER_ODD)==0) {
+ if ((xs+ys) & 1);else return retval;
}
if ( (tex->flag & TEX_CHECKER_EVEN)==0) {
if ((xs+ys) & 1) return retval;
@@ -479,9 +474,7 @@ static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres)
muly= 1.0;
- if (starty==endy) {
- /* pass */
- }
+ if (starty==endy);
else {
if (y==starty) muly= 1.0f-(rf->ymin - y);
if (y==endy) muly= (rf->ymax - y);
@@ -1460,12 +1453,8 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
image_mipmap_test(tex, ibuf);
if (tex->imaflag & TEX_USEALPHA) {
- if (tex->imaflag & TEX_CALCALPHA) {
- /* pass */
- }
- else {
- texres->talpha = TRUE;
- }
+ if (tex->imaflag & TEX_CALCALPHA);
+ else texres->talpha= 1;
}
texr.talpha= texres->talpha;
@@ -1561,17 +1550,11 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
if (boundary==0) {
if ( (tex->flag & TEX_CHECKER_ODD)==0) {
- if ((xs + ys) & 1) {
- /* pass */
- }
- else {
- return retval;
- }
+ if ((xs+ys) & 1);
+ else return retval;
}
if ( (tex->flag & TEX_CHECKER_EVEN)==0) {
- if ((xs + ys) & 1) {
- return retval;
- }
+ if ((xs+ys) & 1) return retval;
}
fx-= xs;
fy-= ys;
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index 895c5d6c8fb..c8aad21b322 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -232,9 +232,9 @@ static void occ_build_shade(Render *re, OcclusionTree *tree)
/* ------------------------- Spherical Harmonics --------------------------- */
/* Use 2nd order SH => 9 coefficients, stored in this order:
- * 0 = (0,0),
- * 1 = (1,-1), 2 = (1,0), 3 = (1,1),
- * 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
+* 0 = (0,0),
+* 1 = (1,-1), 2 = (1,0), 3 = (1,1),
+* 4 = (2,-2), 5 = (2,-1), 6 = (2,0), 7 = (2,1), 8 = (2,2) */
static void sh_copy(float *shresult, float *sh)
{
@@ -625,12 +625,9 @@ static void occ_build_sh_normalize(OccNode *node)
sh_mul(node->sh, 1.0f / node->area);
for (b = 0; b < TOTCHILD; b++) {
- if (node->childflag & (1 << b)) {
- /* pass */
- }
- else if (node->child[b].node) {
+ if (node->childflag & (1 << b)) ;
+ else if (node->child[b].node)
occ_build_sh_normalize(node->child[b].node);
- }
}
}
@@ -1059,8 +1056,8 @@ static float occ_quad_form_factor(float *p, float *n, float *q0, float *q1, floa
static __m128 sse_approx_acos(__m128 x)
{
/* needs a better approximation than taylor expansion of acos, since that
- * gives big erros for near 1.0 values, sqrt(2*x)*acos(1-x) should work
- * better, see http://www.tom.womack.net/projects/sse-fast-arctrig.html */
+ * gives big erros for near 1.0 values, sqrt(2*x)*acos(1-x) should work
+ * better, see http://www.tom.womack.net/projects/sse-fast-arctrig.html */
return _mm_set_ps1(1.0f);
}
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 1859de0039d..d7d901fc97f 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -505,9 +505,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
if (re->r.scemode & R_PREVIEWBUTS) {
- if (re->result && re->result->rectx == re->rectx && re->result->recty == re->recty) {
- /* pass */
- }
+ if (re->result && re->result->rectx == re->rectx && re->result->recty == re->recty) ;
else {
render_result_free(re->result);
re->result = NULL;
@@ -656,12 +654,8 @@ static void *do_part_thread(void *pa_v)
}
else if (render_display_draw_enabled(&R)) {
/* on break, don't merge in result for preview renders, looks nicer */
- if (R.test_break(R.tbh) && (R.r.scemode & R_PREVIEWBUTS)) {
- /* pass */
- }
- else {
- render_result_merge(R.result, pa->result);
- }
+ if (R.test_break(R.tbh) && (R.r.scemode & R_PREVIEWBUTS)) ;
+ else render_result_merge(R.result, pa->result);
}
}
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index a93dde7e813..49c2bf1d053 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -481,7 +481,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
case TEX_PD_COLOR_PARTAGE:
if (pd->coba) {
if (do_colorband(pd->coba, age, col)) {
- texres->talpha = TRUE;
+ texres->talpha= 1;
copy_v3_v3(&texres->tr, col);
texres->tin *= col[3];
texres->ta = texres->tin;
@@ -494,7 +494,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
if (pd->coba) {
if (do_colorband(pd->coba, speed, col)) {
- texres->talpha = TRUE;
+ texres->talpha= 1;
copy_v3_v3(&texres->tr, col);
texres->tin *= col[3];
texres->ta = texres->tin;
@@ -503,7 +503,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
break;
}
case TEX_PD_COLOR_PARTVEL:
- texres->talpha = TRUE;
+ texres->talpha= 1;
mul_v3_fl(vec, pd->speed_scale);
copy_v3_v3(&texres->tr, vec);
texres->ta = texres->tin;
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 0511b03b42d..982f7e7d824 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -887,12 +887,12 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, const float n[3],
fx = (t[0] + 1.0f) / 2.0f;
fy = (t[1] + 1.0f) / 2.0f;
}
- else if (wrap == MTEX_TUBE) map_to_tube( &fx, &fy, t[0], t[1], t[2]);
- else if (wrap == MTEX_SPHERE) map_to_sphere(&fx, &fy, t[0], t[1], t[2]);
+ else if (wrap==MTEX_TUBE) map_to_tube( &fx, &fy, t[0], t[1], t[2]);
+ else if (wrap==MTEX_SPHERE) map_to_sphere(&fx, &fy, t[0], t[1], t[2]);
else {
- if (texco == TEXCO_OBJECT) cubemap_ob(ob, n, t[0], t[1], t[2], &fx, &fy);
- else if (texco == TEXCO_GLOB) cubemap_glob(n, t[0], t[1], t[2], &fx, &fy);
- else cubemap(mtex, vlr, n, t[0], t[1], t[2], &fx, &fy);
+ if (texco==TEXCO_OBJECT) cubemap_ob(ob, n, t[0], t[1], t[2], &fx, &fy);
+ else if (texco==TEXCO_GLOB) cubemap_glob(n, t[0], t[1], t[2], &fx, &fy);
+ else cubemap(mtex, vlr, n, t[0], t[1], t[2], &fx, &fy);
}
/* repeat */
@@ -953,17 +953,10 @@ static void do_2d_mapping(MTex *mtex, float *t, VlakRen *vlr, const float n[3],
if (t[1]<=0.0f) {
fx= t[0]+dxt[0];
fy= t[0]+dyt[0];
- if (fx>=0.0f && fy>=0.0f && t[0]>=0.0f) {
- /* pass */
- }
- else if (fx<=0.0f && fy<=0.0f && t[0]<=0.0f) {
- /* pass */
- }
- else {
- ok = 0;
- }
+ if (fx>=0.0f && fy>=0.0f && t[0]>=0.0f);
+ else if (fx<=0.0f && fy<=0.0f && t[0]<=0.0f);
+ else ok= 0;
}
-
if (ok) {
if (wrap==MTEX_TUBE) {
map_to_tube(area, area+1, t[0], t[1], t[2]);
@@ -1103,7 +1096,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
float tmpvec[3];
int retval=0; /* return value, int:0, col:1, nor:2, everything:3 */
- texres->talpha = FALSE; /* is set when image texture returns alpha (considered premul) */
+ texres->talpha= 0; /* is set when image texture returns alpha (considered premul) */
if (tex->use_nodes && tex->nodetree) {
retval = ntreeTexExecTree(tex->nodetree, texres, texvec, dxt, dyt, osatex, thread,
@@ -1200,7 +1193,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
if (tex->flag & TEX_COLORBAND) {
float col[4];
if (do_colorband(tex->coba, texres->tin, col)) {
- texres->talpha = TRUE;
+ texres->talpha= 1;
texres->tr= col[0];
texres->tg= col[1];
texres->tb= col[2];
@@ -2452,9 +2445,7 @@ void do_material_tex(ShadeInput *shi, Render *re)
copy_v3_v3(nor, texres.nor);
- if (mtex->normapspace == MTEX_NSPACE_CAMERA) {
- /* pass */
- }
+ if (mtex->normapspace == MTEX_NSPACE_CAMERA);
else if (mtex->normapspace == MTEX_NSPACE_WORLD) {
mul_mat3_m4_v3(re->viewmat, nor);
}
@@ -2931,14 +2922,10 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float col_r[4])
}
if (mtex->mapto & MAP_ALPHA) {
if (rgb) {
- if (texres.talpha) {
- texres.tin = texres.ta;
- }
- else {
- texres.tin = rgb_to_bw(&texres.tr);
- }
+ if (texres.talpha) texres.tin= texres.ta;
+ else texres.tin = rgb_to_bw(&texres.tr);
}
-
+
col_r[3]*= texres.tin;
}
}
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 285cd02c4ff..0d894073cee 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -271,26 +271,16 @@ static void halo_tile(RenderPart *pa, RenderLayer *rl)
har= R.sortedhalos[a];
/* layer test, clip halo with y */
- if ((har->lay & lay) == 0) {
- /* pass */
- }
- else if (testrect.ymin > har->maxy) {
- /* pass */
- }
- else if (testrect.ymax < har->miny) {
- /* pass */
- }
+ if ((har->lay & lay)==0);
+ else if (testrect.ymin > har->maxy);
+ else if (testrect.ymax < har->miny);
else {
minx= floor(har->xs-har->rad);
maxx= ceil(har->xs+har->rad);
- if (testrect.xmin > maxx) {
- /* pass */
- }
- else if (testrect.xmax < minx) {
- /* pass */
- }
+ if (testrect.xmin > maxx);
+ else if (testrect.xmax < minx);
else {
minx= MAX2(minx, testrect.xmin);
@@ -990,9 +980,7 @@ static void convert_to_key_alpha(RenderPart *pa, RenderLayer *rl)
float *rectf= rlpp[sample]->rectf;
for (y= pa->rectx*pa->recty; y>0; y--, rectf+=4) {
- if (rectf[3] >= 1.0f) {
- /* pass */
- }
+ if (rectf[3] >= 1.0f);
else if (rectf[3] > 0.0f) {
rectf[0] /= rectf[3];
rectf[1] /= rectf[3];
@@ -1845,23 +1833,16 @@ static void renderhalo_post(RenderResult *rr, float *rectf, HaloRen *har) /* pos
har->miny= miny= haloys - har->rad/R.ycor;
har->maxy= maxy= haloys + har->rad/R.ycor;
- if (maxy < 0) {
- /* pass */
- }
- else if (rr->recty < miny) {
- /* pass */
- }
+ if (maxy<0);
+ else if (rr->recty<miny);
else {
- minx = floor(haloxs - har->rad);
- maxx = ceil(haloxs + har->rad);
+ minx= floor(haloxs-har->rad);
+ maxx= ceil(haloxs+har->rad);
- if (maxx < 0) {
- /* pass */
- }
- else if (rr->rectx < minx) {
- /* pass */
- }
+ if (maxx<0);
+ else if (rr->rectx<minx);
else {
+
if (minx<0) minx= 0;
if (maxx>=rr->rectx) maxx= rr->rectx-1;
if (miny<0) miny= 0;
@@ -2118,9 +2099,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
copy_v3_v3(nor, shi->vn);
- if (R.r.bake_normal_space == R_BAKE_SPACE_CAMERA) {
- /* pass */
- }
+ if (R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
else if (R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
float mat[3][3], imat[3][3];
diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c
index 172af3a6c6f..6395a04b534 100644
--- a/source/blender/render/intern/source/renderdatabase.c
+++ b/source/blender/render/intern/source/renderdatabase.c
@@ -976,13 +976,10 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma,
if (ma->mtex[0]) {
- if (ma->mode & MA_HALOTEX) {
- har->tex = 1;
- }
- else if (har->mat->septex & (1 << 0)) {
- /* only 1 level textures */
- }
+ if ( (ma->mode & MA_HALOTEX) ) har->tex= 1;
+ else if (har->mat->septex & (1<<0)); /* only 1 level textures */
else {
+
mtex= ma->mtex[0];
copy_v3_v3(texvec, vec);
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 36e9f4cb785..ff543b8ce06 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -87,6 +87,12 @@ extern struct Render R;
*
*/
+#define VECADDISFAC(v1,v3,fac) { \
+ *(v1 + 0) += *(v3 + 0) * (fac); \
+ *(v1 + 1) += *(v3 + 1) * (fac); \
+ *(v1 + 2) += *(v3 + 2) * (fac); \
+} (void)0
+
/* initialize material variables in shadeinput,
* doing inverse gamma correction where applicable */
void shade_input_init_material(ShadeInput *shi)
@@ -115,13 +121,13 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
shi->depth--;
/* a couple of passes */
- madd_v3_v3fl(shr->combined, shr_t.combined, fac);
+ VECADDISFAC(shr->combined, shr_t.combined, fac);
if (shi->passflag & SCE_PASS_SPEC)
- madd_v3_v3fl(shr->spec, shr_t.spec, fac);
+ VECADDISFAC(shr->spec, shr_t.spec, fac);
if (shi->passflag & SCE_PASS_DIFFUSE)
- madd_v3_v3fl(shr->diff, shr_t.diff, fac);
+ VECADDISFAC(shr->diff, shr_t.diff, fac);
if (shi->passflag & SCE_PASS_SHADOW)
- madd_v3_v3fl(shr->shad, shr_t.shad, fac);
+ VECADDISFAC(shr->shad, shr_t.shad, fac);
negate_v3(shi->vn);
negate_v3(shi->facenor);
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 873657ec6ba..6883710d1be 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -123,45 +123,30 @@ float mistfactor(float zcor, float const co[3])
{
float fac, hi;
- fac = zcor - R.wrld.miststa; /* zcor is calculated per pixel */
+ fac= zcor - R.wrld.miststa; /* zcor is calculated per pixel */
/* fac= -co[2]-R.wrld.miststa; */
- if (fac > 0.0f) {
- if (fac < R.wrld.mistdist) {
+ if (fac>0.0f) {
+ if (fac< R.wrld.mistdist) {
- fac = (fac / R.wrld.mistdist);
+ fac= (fac/(R.wrld.mistdist));
- if (R.wrld.mistype == 0) {
- fac *= fac;
- }
- else if (R.wrld.mistype == 1) {
- /* pass */
- }
- else {
- fac = sqrt(fac);
- }
- }
- else {
- fac = 1.0f;
+ if (R.wrld.mistype==0) fac*= fac;
+ else if (R.wrld.mistype==1);
+ else fac= sqrt(fac);
}
+ else fac= 1.0f;
}
- else {
- fac = 0.0f;
- }
+ else fac= 0.0f;
/* height switched off mist */
if (R.wrld.misthi!=0.0f && fac!=0.0f) {
/* at height misthi the mist is completely gone */
- hi = R.viewinv[0][2] * co[0] +
- R.viewinv[1][2] * co[1] +
- R.viewinv[2][2] * co[2] +
- R.viewinv[3][2];
+ hi= R.viewinv[0][2]*co[0]+R.viewinv[1][2]*co[1]+R.viewinv[2][2]*co[2]+R.viewinv[3][2];
- if (hi > R.wrld.misthi) {
- fac = 0.0f;
- }
+ if (hi>R.wrld.misthi) fac= 0.0f;
else if (hi>0.0f) {
hi= (R.wrld.misthi-hi)/R.wrld.misthi;
fac*= hi*hi;
@@ -1366,9 +1351,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
/* this complex construction screams for a nicer implementation! (ton) */
if (R.r.mode & R_SHADOW) {
if (ma->mode & MA_SHADOW) {
- if (lar->type == LA_HEMI || lar->type == LA_AREA) {
- /* pass */
- }
+ if (lar->type==LA_HEMI || lar->type==LA_AREA);
else if ((ma->mode & MA_RAYBIAS) && (lar->mode & LA_SHAD_RAY) && (vlr->flag & R_SMOOTH)) {
float thresh= shi->obr->ob->smoothresh;
if (inp>thresh)
@@ -1483,10 +1466,8 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
if (shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC) && !(lar->mode & LA_ONLYSHADOW)) {
- if (!(passflag & (SCE_PASS_COMBINED | SCE_PASS_SPEC))) {
- /* pass */
- }
- else if (lar->type == LA_HEMI) {
+ if (!(passflag & (SCE_PASS_COMBINED|SCE_PASS_SPEC)));
+ else if (lar->type==LA_HEMI) {
float t;
/* hemi uses no spec shaders (yet) */
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index 9b7a521db41..69e738e840d 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -238,9 +238,7 @@ static void approximate_Rd_rgb(ScatterSettings **ss, float rr, float *rd)
float indexf, t, idxf;
int index;
- if (rr > (RD_TABLE_RANGE_2 * RD_TABLE_RANGE_2)) {
- /* pass */
- }
+ if (rr > (RD_TABLE_RANGE_2*RD_TABLE_RANGE_2));
else if (rr > RD_TABLE_RANGE) {
rr= sqrt(rr);
indexf= rr*(RD_TABLE_SIZE/RD_TABLE_RANGE_2);
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index ba62baae897..bf6962d0087 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -2038,9 +2038,7 @@ static void zmask_rect(int *rectz, int *rectp, int xs, int ys, int neg)
MEM_freeN(temprectp);
- if (neg) {
- /* z values for negative are already correct */
- }
+ if (neg); /* z values for negative are already correct */
else {
/* clear not filled z values */
for (len= xs*ys -1; len>=0; len--) {
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index e7b7f679ce3..ac05331095b 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -273,7 +273,7 @@ int WM_gesture_lines_cancel(struct bContext *C, struct wmOperator *op);
int WM_gesture_lasso_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_lasso_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_lasso_cancel(struct bContext *C, struct wmOperator *op);
-const int (*WM_gesture_lasso_path_to_array(struct bContext *C, struct wmOperator *op, int *mcords_tot))[2];
+int (*WM_gesture_lasso_path_to_array(struct bContext *C, struct wmOperator *op, int *mcords_tot))[2];
int WM_gesture_straightline_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_straightline_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
int WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op);
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index ad828cef6d5..f9b22331f37 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -238,7 +238,6 @@ typedef struct wmNotifier {
#define NC_LOGIC (19<<24)
#define NC_MOVIECLIP (20<<24)
#define NC_MASK (21<<24)
-#define NC_GPENCIL (22<<24)
/* data type, 256 entries is enough, it can overlap */
#define NOTE_DATA 0x00FF0000
@@ -509,11 +508,7 @@ typedef struct wmOperatorType {
* parameters may be provided through operator properties. cannot use
* any interface code or input device state.
* - see defines below for return values */
- int (*exec)(struct bContext *, struct wmOperator *)
-#ifdef __GNUC__
- __attribute__((warn_unused_result))
-#endif
- ;
+ int (*exec)(struct bContext *, struct wmOperator *);
/* this callback executes on a running operator whenever as property
* is changed. It can correct its own properties or report errors for
@@ -525,17 +520,9 @@ typedef struct wmOperatorType {
* any further events are handled in modal. if the operation is
* canceled due to some external reason, cancel is called
* - see defines below for return values */
- int (*invoke)(struct bContext *, struct wmOperator *, struct wmEvent *)
-#ifdef __GNUC__
- __attribute__((warn_unused_result))
-#endif
- ;
+ int (*invoke)(struct bContext *, struct wmOperator *, struct wmEvent *);
int (*cancel)(struct bContext *, struct wmOperator *);
- int (*modal)(struct bContext *, struct wmOperator *, struct wmEvent *)
-#ifdef __GNUC__
- __attribute__((warn_unused_result))
-#endif
- ;
+ int (*modal)(struct bContext *, struct wmOperator *, struct wmEvent *);
/* verify if the operator can be executed in the current context, note
* that the operator might still fail to execute even if this return true */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index ef9e25e0fef..2f238cd22e7 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -255,12 +255,8 @@ void wm_event_do_notifiers(bContext *C)
for (win = wm->windows.first; win; win = win->next) {
/* filter out notifiers */
- if (note->category == NC_SCREEN && note->reference && note->reference != win->screen) {
- /* pass */
- }
- else if (note->category == NC_SCENE && note->reference && note->reference != win->screen->scene) {
- /* pass */
- }
+ if (note->category == NC_SCREEN && note->reference && note->reference != win->screen) ;
+ else if (note->category == NC_SCENE && note->reference && note->reference != win->screen->scene) ;
else {
ScrArea *sa;
ARegion *ar;
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index c6bd912e89b..7b78dbedb31 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -190,12 +190,9 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
/* cases 1 and 2 */
if (oldwmlist->first == NULL) {
- if (G.main->wm.first) {
- /* nothing todo */
- }
- else {
+ if (G.main->wm.first) ; /* nothing todo */
+ else
wm_add_default(C);
- }
}
else {
/* cases 3 and 4 */
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index ec25e8dcffb..00e3559fae4 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2291,8 +2291,6 @@ static int border_apply_rect(wmOperator *op)
static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
{
- int retval;
-
if (!border_apply_rect(op))
return 0;
@@ -2300,9 +2298,7 @@ static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
if (RNA_struct_find_property(op->ptr, "gesture_mode") )
RNA_int_set(op->ptr, "gesture_mode", gesture_mode);
- retval = op->type->exec(C, op);
- OPERATOR_RETVAL_CHECK(retval);
-
+ op->type->exec(C, op);
return 1;
}
@@ -2428,11 +2424,8 @@ static void gesture_circle_apply(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "y", rect->ymin);
RNA_int_set(op->ptr, "radius", rect->xmax);
- if (op->type->exec) {
- int retval;
- retval = op->type->exec(C, op);
- OPERATOR_RETVAL_CHECK(retval);
- }
+ if (op->type->exec)
+ op->type->exec(C, op);
#ifdef GESTURE_MEMORY
circle_select_size = rect->xmax;
#endif
@@ -2652,10 +2645,8 @@ static void gesture_lasso_apply(bContext *C, wmOperator *op)
wm_gesture_end(C, op);
- if (op->type->exec) {
- int retval = op->type->exec(C, op);
- OPERATOR_RETVAL_CHECK(retval);
- }
+ if (op->type->exec)
+ op->type->exec(C, op);
}
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
@@ -2738,7 +2729,7 @@ int WM_gesture_lines_cancel(bContext *C, wmOperator *op)
*
* caller must free.
*/
-const int (*WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *mcords_tot))[2]
+int (*WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *mcords_tot))[2]
{
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "path");
int (*mcords)[2] = NULL;
@@ -2768,8 +2759,7 @@ const int (*WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op,
*mcords_tot = 0;
}
- /* cast for 'const' */
- return (const int (*)[2])mcords;
+ return mcords;
}
#if 0
@@ -2824,10 +2814,8 @@ static int straightline_apply(bContext *C, wmOperator *op)
RNA_int_set(op->ptr, "xend", rect->xmax);
RNA_int_set(op->ptr, "yend", rect->ymax);
- if (op->type->exec) {
- int retval = op->type->exec(C, op);
- OPERATOR_RETVAL_CHECK(retval);
- }
+ if (op->type->exec)
+ op->type->exec(C, op);
return 1;
}
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
index 0b41cceb646..4f450bcd668 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
@@ -33,7 +33,6 @@
#include "KX_BlenderCanvas.h"
#include "DNA_screen_types.h"
#include <stdio.h>
-#include <assert.h>
KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, RAS_Rect &rect, struct ARegion *ar) :
@@ -45,8 +44,6 @@ m_frame_rect(rect)
// area boundaries needed for mouse coordinates in Letterbox framing mode
m_area_left = ar->winrct.xmin;
m_area_top = ar->winrct.ymax;
-
- glGetIntegerv(GL_VIEWPORT, (GLint*)m_viewport);
}
KX_BlenderCanvas::~KX_BlenderCanvas()
@@ -169,31 +166,10 @@ SetViewPort(
m_area_rect.SetRight(minx + x2);
m_area_rect.SetTop(miny + y2);
- m_viewport[0] = minx+x1;
- m_viewport[1] = miny+y1;
- m_viewport[2] = vp_width;
- m_viewport[3] = vp_height;
-
glViewport(minx + x1, miny + y1, vp_width, vp_height);
glScissor(minx + x1, miny + y1, vp_width, vp_height);
}
- const int*
-KX_BlenderCanvas::
-GetViewPort() {
-#ifdef DEBUG
- // If we're in a debug build, we might as well make sure our values don't differ
- // from what the gpu thinks we have. This could lead to nasty, hard to find bugs.
- int viewport[4];
- glGetIntegerv(GL_VIEWPORT, viewport);
- assert(viewport[0] == m_viewport[0]);
- assert(viewport[1] == m_viewport[1]);
- assert(viewport[2] == m_viewport[2]);
- assert(viewport[3] == m_viewport[3]);
-#endif
-
- return m_viewport;
-}
void KX_BlenderCanvas::SetMouseState(RAS_MouseState mousestate)
{
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
index 004f7dd0dd9..ee7997abb39 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
@@ -61,7 +61,6 @@ private:
/** Rect that defines the area used for rendering,
relative to the context */
RAS_Rect m_displayarea;
- int m_viewport[4];
public:
/* Construct a new canvas.
@@ -151,8 +150,6 @@ public:
int x1, int y1,
int x2, int y2
);
- const int*
- GetViewPort();
void
SetMouseState(
diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
index b5c1c29238a..7581484a41f 100644
--- a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
@@ -57,8 +57,6 @@ GPC_Canvas::GPC_Canvas(
m_displayarea.m_y1 = 0;
m_displayarea.m_x2 = width;
m_displayarea.m_y2 = height;
-
- glGetIntegerv(GL_VIEWPORT, (GLint*)m_viewport);
}
@@ -123,31 +121,11 @@ void GPC_Canvas::SetViewPort(int x1, int y1, int x2, int y2)
* whole canvas/rendertools mess.
*/
glEnable(GL_SCISSOR_TEST);
-
- m_viewport[0] = x1;
- m_viewport[1] = y1;
- m_viewport[2] = x2-x1 + 1;
- m_viewport[3] = y2-y1 + 1;
glViewport(x1,y1,x2-x1 + 1,y2-y1 + 1);
glScissor(x1,y1,x2-x1 + 1,y2-y1 + 1);
};
-const int *GPC_Canvas::GetViewPort()
-{
-#ifdef DEBUG
- // If we're in a debug build, we might as well make sure our values don't differ
- // from what the gpu thinks we have. This could lead to nasty, hard to find bugs.
- int viewport[4];
- glGetIntegerv(GL_VIEWPORT, viewport);
- assert(viewport[0] == m_viewport[0]);
- assert(viewport[1] == m_viewport[1]);
- assert(viewport[2] == m_viewport[2]);
- assert(viewport[3] == m_viewport[3]);
-#endif
-
- return m_viewport;
-}
void GPC_Canvas::ClearBuffer(
int type
diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h
index 2a597c4c43d..453b9505183 100644
--- a/source/gameengine/GamePlayer/common/GPC_Canvas.h
+++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h
@@ -90,8 +90,6 @@ protected:
* relative to the context */
RAS_Rect m_displayarea;
- int *m_viewport;
-
/** Storage for the banners to display. */
TBannerMap m_banners;
/** State of banner display. */
@@ -155,7 +153,6 @@ public:
);
void SetViewPort(int x1, int y1, int x2, int y2);
- const int *GetViewPort();
void ClearColor(float r, float g, float b, float a);
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
index 4bf81bf543e..9cd6715f3d2 100644
--- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
@@ -359,8 +359,7 @@ void GPC_RenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
glGetIntegerv(GL_LIGHTING, (GLint*)&light);
glDisable(GL_LIGHTING);
- glDisable(GL_DEPTH_TEST);
-
+
// Set up viewing settings
glMatrixMode(GL_PROJECTION);
glPushMatrix();
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 90912409af1..c0071ab22f6 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -956,7 +956,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, getScreenPosition,
}
}
- const GLint *viewport;
+ GLint viewport[4];
GLdouble win[3];
GLdouble modelmatrix[16];
GLdouble projmatrix[16];
@@ -967,7 +967,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, getScreenPosition,
m_modelmatrix.getValue(modelmatrix);
m_projmatrix.getValue(projmatrix);
- viewport = KX_GetActiveEngine()->GetCanvas()->GetViewPort();
+ glGetIntegerv(GL_VIEWPORT, viewport);
gluProject(vect[0], vect[1], vect[2], modelmatrix, projmatrix, viewport, &win[0], &win[1], &win[2]);
@@ -999,7 +999,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenVect,
MT_Vector3 vect;
MT_Point3 campos, screenpos;
- const GLint *viewport;
+ GLint viewport[4];
GLdouble win[3];
GLdouble modelmatrix[16];
GLdouble projmatrix[16];
@@ -1010,7 +1010,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenVect,
m_modelmatrix.getValue(modelmatrix);
m_projmatrix.getValue(projmatrix);
- viewport = KX_GetActiveEngine()->GetCanvas()->GetViewPort();
+ glGetIntegerv(GL_VIEWPORT, viewport);
vect[0] = x * viewport[2];
vect[1] = y * viewport[3];
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index 87b0cfc1269..fd3a18a9d2a 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -90,7 +90,8 @@ KX_Dome::KX_Dome (
}
//setting the viewport size
- const int *viewport = m_canvas->GetViewPort();
+ GLuint viewport[4]={0};
+ glGetIntegerv(GL_VIEWPORT,(GLint *)viewport);
SetViewPort(viewport);
@@ -177,7 +178,7 @@ KX_Dome::~KX_Dome (void)
glDeleteLists(dlistId, (GLsizei) m_numimages);
}
-void KX_Dome::SetViewPort(const int viewport[4])
+void KX_Dome::SetViewPort(GLuint viewport[4])
{
if (canvaswidth != m_viewport.GetWidth() || canvasheight != m_viewport.GetHeight())
{
diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h
index 17eec3a5fcb..24177af5d60 100644
--- a/source/gameengine/Ketsji/KX_Dome.h
+++ b/source/gameengine/Ketsji/KX_Dome.h
@@ -119,7 +119,7 @@ public:
void RenderDomeFrame(KX_Scene* scene, KX_Camera* cam, int i);
void BindImages(int i);
- void SetViewPort(const int viewport[4]);
+ void SetViewPort(GLuint viewport[4]);
void CalculateFrustum(KX_Camera* cam);
void RotateCamera(KX_Camera* cam, int i);
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 3cfb670d227..fe8419d5343 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -109,8 +109,6 @@ KX_GameObject::KX_GameObject(
m_xray(false),
m_pHitObject(NULL),
m_pObstacleSimulation(NULL),
- m_pInstanceObjects(NULL),
- m_pDupliGroupObject(NULL),
m_actionManager(NULL),
m_isDeformable(false)
#ifdef WITH_PYTHON
@@ -170,16 +168,6 @@ KX_GameObject::~KX_GameObject()
KX_GetActiveScene()->RemoveAnimatedObject(this);
delete m_actionManager;
}
-
- if (m_pDupliGroupObject)
- {
- m_pDupliGroupObject->Release();
- }
-
- if (m_pInstanceObjects)
- {
- m_pInstanceObjects->Release();
- }
#ifdef WITH_PYTHON
if (m_attr_dict) {
PyDict_Clear(m_attr_dict); /* in case of circular refs or other weird cases */
@@ -241,46 +229,6 @@ KX_IPhysicsController* KX_GameObject::GetPhysicsController()
return m_pPhysicsController1;
}
-KX_GameObject* KX_GameObject::GetDupliGroupObject()
-{
- return m_pDupliGroupObject;
-}
-
-CListValue* KX_GameObject::GetInstanceObjects()
-{
- return m_pInstanceObjects;
-}
-
-void KX_GameObject::AddInstanceObjects(KX_GameObject* obj)
-{
- if(!m_pInstanceObjects)
- m_pInstanceObjects = new CListValue();
-
- obj->AddRef();
- m_pInstanceObjects->Add(obj);
-}
-
-void KX_GameObject::RemoveInstanceObject(KX_GameObject* obj)
-{
- assert(m_pInstanceObjects);
- m_pInstanceObjects->RemoveValue(obj);
- obj->Release();
-}
-
-void KX_GameObject::RemoveDupliGroupObject()
-{
- if(m_pDupliGroupObject) {
- m_pDupliGroupObject->Release();
- m_pDupliGroupObject = NULL;
- }
-}
-
-void KX_GameObject::SetDupliGroupObject(KX_GameObject* obj)
-{
- obj->AddRef();
- m_pDupliGroupObject = obj;
-}
-
KX_GameObject* KX_GameObject::GetParent()
{
KX_GameObject* result = NULL;
@@ -1681,9 +1629,6 @@ PyMethodDef KX_GameObject::Methods[] = {
PyAttributeDef KX_GameObject::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("name", KX_GameObject, pyattr_get_name),
KX_PYATTRIBUTE_RO_FUNCTION("parent", KX_GameObject, pyattr_get_parent),
- KX_PYATTRIBUTE_RO_FUNCTION("group_children", KX_GameObject, pyattr_get_group_children),
- KX_PYATTRIBUTE_RO_FUNCTION("group_parent", KX_GameObject, pyattr_get_group_parent),
- KX_PYATTRIBUTE_RO_FUNCTION("scene", KX_GameObject, pyattr_get_scene),
KX_PYATTRIBUTE_RO_FUNCTION("life", KX_GameObject, pyattr_get_life),
KX_PYATTRIBUTE_RW_FUNCTION("mass", KX_GameObject, pyattr_get_mass, pyattr_set_mass),
KX_PYATTRIBUTE_RW_FUNCTION("linVelocityMin", KX_GameObject, pyattr_get_lin_vel_min, pyattr_set_lin_vel_min),
@@ -1979,37 +1924,6 @@ PyObject *KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DE
Py_RETURN_NONE;
}
-PyObject *KX_GameObject::pyattr_get_group_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
- CListValue* instances = self->GetInstanceObjects();
- if (instances) {
- return instances->GetProxy();
- }
- Py_RETURN_NONE;
-}
-
-PyObject* KX_GameObject::pyattr_get_scene(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_GameObject *self = static_cast<KX_GameObject*>(self_v);
- SG_Node *node = self->GetSGNode();
- KX_Scene *scene = static_cast<KX_Scene *>(node->GetSGClientInfo());
- if (scene) {
- return scene->GetProxy();
- }
- Py_RETURN_NONE;
-}
-
-PyObject *KX_GameObject::pyattr_get_group_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
- KX_GameObject* pivot = self->GetDupliGroupObject();
- if (pivot) {
- return pivot->GetProxy();
- }
- Py_RETURN_NONE;
-}
-
PyObject *KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index 621dd988e00..ea75ca4a917 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -116,8 +116,6 @@ protected:
KX_ObstacleSimulation* m_pObstacleSimulation;
- CListValue* m_pInstanceObjects;
- KX_GameObject* m_pDupliGroupObject;
// The action manager is used to play/stop/update actions
BL_ActionManager* m_actionManager;
@@ -210,33 +208,6 @@ public:
void RemoveParent(KX_Scene *scene);
/*********************************
- * group reference API
- *********************************/
-
- KX_GameObject*
- GetDupliGroupObject(
- );
-
- CListValue*
- GetInstanceObjects(
- );
-
- void
- SetDupliGroupObject(KX_GameObject*
- );
-
- void
- AddInstanceObjects(KX_GameObject*
- );
-
- void
- RemoveDupliGroupObject(
- );
-
- void
- RemoveInstanceObject(KX_GameObject*
- );
- /*********************************
* Animation API
*********************************/
@@ -978,10 +949,6 @@ public:
static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_group_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_group_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_scene(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
-
static PyObject* pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index e446e5338bc..c2857141058 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -275,7 +275,8 @@ void KX_KetsjiEngine::InitDome(short res, short mode, short angle, float resbuf,
void KX_KetsjiEngine::RenderDome()
{
- const GLint *viewport = m_canvas->GetViewPort();
+ GLuint viewport[4]={0};
+ glGetIntegerv(GL_VIEWPORT,(GLint *)viewport);
m_dome->SetViewPort(viewport);
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index f6ab9af261e..652ed2ab2dd 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -769,13 +769,6 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level)
// we can now add the graphic controller to the physic engine
replica->ActivateGraphicController(true);
- // set references for dupli-group
- // groupobj holds a list of all objects, that belongs to this group
- groupobj->AddInstanceObjects(replica);
-
- // every object gets the reference to its dupli-group object
- replica->SetDupliGroupObject(groupobj);
-
// done with replica
replica->Release();
}
@@ -1024,20 +1017,6 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
m_timemgr->RemoveTimeProperty(propval);
}
}
-
- // if the object is the dupligroup proxy, you have to cleanup all m_pDupliGroupObject's in all
- // instances refering to this group
- if(newobj->GetInstanceObjects()) {
- for (int i = 0; i < newobj->GetInstanceObjects()->GetCount(); i++) {
- KX_GameObject* instance = (KX_GameObject*)newobj->GetInstanceObjects()->GetValue(i);
- instance->RemoveDupliGroupObject();
- }
- }
-
- // if this object was part of a group, make sure to remove it from that group's instance list
- KX_GameObject* group = newobj->GetDupliGroupObject();
- if (group)
- group->RemoveInstanceObject(newobj);
newobj->RemoveMeshes();
ret = 1;
@@ -1502,15 +1481,7 @@ void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam, int
planes[4].setValue(cplanes[2].getValue()); // top
planes[5].setValue(cplanes[3].getValue()); // bottom
CullingInfo info(layer);
-
- double mvmat[16] = {0};
- cam->GetModelviewMatrix().getValue(mvmat);
- double pmat[16] = {0};
- cam->GetProjectionMatrix().getValue(pmat);
-
- dbvt_culling = m_physicsEnvironment->cullingTest(PhysicsCullingCallback,&info,planes,5,m_dbvt_occlusion_res,
- KX_GetActiveEngine()->GetCanvas()->GetViewPort(),
- mvmat, pmat);
+ dbvt_culling = m_physicsEnvironment->cullingTest(PhysicsCullingCallback,&info,planes,5,m_dbvt_occlusion_res);
}
if (!dbvt_culling) {
// the physics engine couldn't help us, do it the hard way
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 240bda811f0..81bf66d9536 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -895,22 +895,18 @@ void CcdPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dloc
return;
}
+ // btRigidBody* body = GetRigidBody(); // not used anymore
+
btVector3 dloc(dlocX,dlocY,dlocZ);
btTransform xform = m_object->getWorldTransform();
if (local)
- dloc = xform.getBasis()*dloc;
-
- if (m_characterController)
{
- m_characterController->setWalkDirection(dloc/GetPhysicsEnvironment()->getNumTimeSubSteps());
+ dloc = xform.getBasis()*dloc;
}
- else
- {
- xform.setOrigin(xform.getOrigin() + dloc);
- SetCenterOfMassTransform(xform);
- }
+ xform.setOrigin(xform.getOrigin() + dloc);
+ SetCenterOfMassTransform(xform);
}
}
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index 82a60e756d7..55bbc0d33b9 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -57,6 +57,7 @@ btRaycastVehicle::btVehicleTuning gTuning;
#include "LinearMath/btAabbUtil2.h"
#include "MT_Matrix4x4.h"
#include "MT_Vector3.h"
+#include "GL/glew.h"
#ifdef WIN32
void DrawRasterizerLine(const float* from,const float* to,int color);
@@ -1308,19 +1309,22 @@ struct OcclusionBuffer
m[14] = btScalar(m1[ 2]*m2[12]+m1[ 6]*m2[13]+m1[10]*m2[14]+m1[14]*m2[15]);
m[15] = btScalar(m1[ 3]*m2[12]+m1[ 7]*m2[13]+m1[11]*m2[14]+m1[15]*m2[15]);
}
- void setup(int size, const int *view, double modelview[16], double projection[16])
+ void setup(int size)
{
m_initialized=false;
m_occlusion=false;
// compute the size of the buffer
+ GLint v[4];
+ GLdouble m[16],p[16];
int maxsize;
double ratio;
- maxsize = (view[2] > view[3]) ? view[2] : view[3];
+ glGetIntegerv(GL_VIEWPORT,v);
+ maxsize = (v[2] > v[3]) ? v[2] : v[3];
assert(maxsize > 0);
ratio = 1.0/(2*maxsize);
// ensure even number
- m_sizes[0] = 2*((int)(size*view[2]*ratio+0.5));
- m_sizes[1] = 2*((int)(size*view[3]*ratio+0.5));
+ m_sizes[0] = 2*((int)(size*v[2]*ratio+0.5));
+ m_sizes[1] = 2*((int)(size*v[3]*ratio+0.5));
m_scales[0]=btScalar(m_sizes[0]/2);
m_scales[1]=btScalar(m_sizes[1]/2);
m_offsets[0]=m_scales[0]+0.5f;
@@ -1328,8 +1332,10 @@ struct OcclusionBuffer
// prepare matrix
// at this time of the rendering, the modelview matrix is the
// world to camera transformation and the projection matrix is
- // camera to clip transformation. combine both so that
- CMmat4mul(m_wtc, projection, modelview);
+ // camera to clip transformation. combine both so that
+ glGetDoublev(GL_MODELVIEW_MATRIX,m);
+ glGetDoublev(GL_PROJECTION_MATRIX,p);
+ CMmat4mul(m_wtc,p,m);
}
void initialize()
{
@@ -1789,7 +1795,7 @@ struct DbvtCullingCallback : btDbvt::ICollide
};
static OcclusionBuffer gOcb;
-bool CcdPhysicsEnvironment::cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4 *planes, int nplanes, int occlusionRes, const int *viewport, double modelview[16], double projection[16])
+bool CcdPhysicsEnvironment::cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4 *planes, int nplanes, int occlusionRes)
{
if (!m_cullingTree)
return false;
@@ -1806,7 +1812,7 @@ bool CcdPhysicsEnvironment::cullingTest(PHY_CullingCallback callback, void* user
// if occlusionRes != 0 => occlusion culling
if (occlusionRes)
{
- gOcb.setup(occlusionRes, viewport, modelview, projection);
+ gOcb.setup(occlusionRes);
dispatcher.m_ocb = &gOcb;
// occlusion culling, the direction of the view is taken from the first plan which MUST be the near plane
btDbvt::collideOCL(m_cullingTree->m_sets[1].m_root,planes_n,planes_o,planes_n[0],nplanes,dispatcher);
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index 453380b69ca..c499a1ef75c 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -115,11 +115,6 @@ protected:
virtual void setLinearAirDamping(float damping);
virtual void setUseEpa(bool epa);
- int getNumTimeSubSteps()
- {
- return m_numTimeSubSteps;
- }
-
virtual void beginFrame();
virtual void endFrame() {}
/// Perform an integration step of duration 'timeStep'.
@@ -188,7 +183,7 @@ protected:
btTypedConstraint* getConstraintById(int constraintId);
virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
- virtual bool cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4* planes, int nplanes, int occlusionRes, const int *viewport, double modelview[16], double projection[16]);
+ virtual bool cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4* planes, int nplanes, int occlusionRes);
//Methods for gamelogic collision/physics callbacks
diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
index 4ddfe4d69e0..9c109168b18 100644
--- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
@@ -73,7 +73,7 @@ public:
}
virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
- virtual bool cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4* planes, int nplanes, int occlusionRes, const int *viewport, double modelview[16], double projection[16]) { return false; }
+ virtual bool cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4* planes, int nplanes, int occlusionRes) { return false; }
//gamelogic callbacks
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
index 77016859c3f..3f8699d25d2 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
@@ -161,7 +161,7 @@ class PHY_IPhysicsEnvironment
//culling based on physical broad phase
// the plane number must be set as follow: near, far, left, right, top, botton
// the near plane must be the first one and must always be present, it is used to get the direction of the view
- virtual bool cullingTest(PHY_CullingCallback callback, void *userData, PHY__Vector4* planeNormals, int planeNumber, int occlusionRes, const int *viewport, double modelview[16], double projection[16]) = 0;
+ virtual bool cullingTest(PHY_CullingCallback callback, void *userData, PHY__Vector4* planeNormals, int planeNumber, int occlusionRes) = 0;
//Methods for gamelogic collision/physics callbacks
//todo:
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index 0ae8908e946..7312b521788 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -398,7 +398,8 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
if (num_filters <= 0)
return;
- const GLint *viewport = canvas->GetViewPort();
+ GLuint viewport[4]={0};
+ glGetIntegerv(GL_VIEWPORT,(GLint *)viewport);
RAS_Rect rect = canvas->GetWindowArea();
int rect_width = rect.GetWidth()+1, rect_height = rect.GetHeight()+1;
diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h
index f045eb7e423..713a06845ac 100644
--- a/source/gameengine/Rasterizer/RAS_ICanvas.h
+++ b/source/gameengine/Rasterizer/RAS_ICanvas.h
@@ -180,13 +180,6 @@ public:
int x2, int y2
) = 0;
- /**
- * Get the visible viewport
- */
- virtual
- const int*
- GetViewPort() = 0;
-
virtual
void
SetMouseState(
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
index c890f0c3dc5..183da9d252e 100644
--- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
+++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
@@ -147,7 +147,7 @@ void RAS_MeshSlot::begin(RAS_MeshSlot::iterator& it)
int startvertex, endvertex;
int startindex, endindex;
- it.array = m_displayArrays.empty() ? NULL : m_displayArrays[m_startarray];
+ it.array = (m_displayArrays.size() > 0)? m_displayArrays[m_startarray]: NULL;
if (it.array == NULL || it.array->m_index.size() == 0 || it.array->m_vertex.size() == 0) {
it.array = NULL;
@@ -368,7 +368,7 @@ bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance)
size_t i;
// verify if we can join
- if (m_joinSlot || (m_joinedSlots.empty() == false) || target->m_joinSlot)
+ if (m_joinSlot || m_joinedSlots.size() || target->m_joinSlot)
return false;
if (!Equals(target))
@@ -461,7 +461,7 @@ bool RAS_MeshSlot::Split(bool force)
abort();
}
- if (target->m_displayArrays.empty() == false) {
+ if (target->m_displayArrays.size()) {
target->m_endvertex = target->m_displayArrays.back()->m_vertex.size();
target->m_endindex = target->m_displayArrays.back()->m_index.size();
}
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index a0da1c79baa..67423123a7a 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -359,7 +359,7 @@ void RAS_OpenGLRasterizer::ClearCachingInfo(void)
void RAS_OpenGLRasterizer::FlushDebugShapes()
{
- if (m_debugShapes.empty())
+ if (!m_debugShapes.size())
return;
// DrawDebugLines
diff --git a/source/tests/batch_import.py b/source/tests/batch_import.py
index 177ab8ea0b0..5c228c014ca 100644
--- a/source/tests/batch_import.py
+++ b/source/tests/batch_import.py
@@ -63,12 +63,12 @@ def clear_scene():
def batch_import(operator="",
- path="",
- save_path="",
- match="",
- start=0,
- end=sys.maxsize,
- ):
+ path="",
+ save_path="",
+ match="",
+ start=0,
+ end=sys.maxsize,
+ ):
import addon_utils
_reset_all = addon_utils.reset_all # XXX, hack
diff --git a/source/tests/bl_load_addons.py b/source/tests/bl_load_addons.py
index 5d9ac750362..21a0101d684 100644
--- a/source/tests/bl_load_addons.py
+++ b/source/tests/bl_load_addons.py
@@ -36,7 +36,7 @@ def reload_addons(do_reload=True, do_reverse=True):
for mod_name in list(addons.keys()):
addon_utils.disable(mod_name)
- assert(bool(addons) is False)
+ assert(bool(addons) == False)
# Run twice each time.
for i in (0, 1):
diff --git a/source/tests/bl_load_py_modules.py b/source/tests/bl_load_py_modules.py
index b634b4c4385..619cad67cb8 100644
--- a/source/tests/bl_load_py_modules.py
+++ b/source/tests/bl_load_py_modules.py
@@ -49,7 +49,7 @@ def load_addons():
for mod_name in list(addons.keys()):
addon_utils.disable(mod_name)
- assert(bool(addons) is False)
+ assert(bool(addons) == False)
for mod in modules:
mod_name = mod.__name__
diff --git a/source/tests/bl_mesh_modifiers.py b/source/tests/bl_mesh_modifiers.py
index 92fae25df16..390679800f6 100644
--- a/source/tests/bl_mesh_modifiers.py
+++ b/source/tests/bl_mesh_modifiers.py
@@ -846,7 +846,7 @@ if __name__ == "__main__":
@persistent
def load_handler(dummy):
print("Load Handler:", bpy.data.filepath)
- if load_handler.first is False:
+ if load_handler.first == False:
bpy.app.handlers.scene_update_post.remove(load_handler)
try:
main()