Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Feb 2017 21:09:09 +0000 (22:09 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Feb 2017 21:09:09 +0000 (22:09 +0100)
541 files changed:
.gitmodules
CMakeLists.txt
GNUmakefile
build_files/build_environment/install_deps.sh
build_files/cmake/macros.cmake
intern/cycles/blender/addon/ui.py
intern/ghost/intern/GHOST_ContextCGL.h
intern/ghost/intern/GHOST_ContextCGL.mm
intern/ghost/intern/GHOST_ContextGLX.cpp
intern/ghost/intern/GHOST_ContextWGL.cpp
intern/ghost/intern/GHOST_ContextWGL.h
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowX11.cpp
make.bat
release/darwin/blender.app/Contents/Info.plist
release/scripts/addons
release/scripts/modules/bpy_extras/object_utils.py
release/scripts/presets/keyconfig/3dsmax.py
release/scripts/presets/keyconfig/maya.py
release/scripts/startup/bl_operators/clip.py
release/scripts/startup/bl_operators/freestyle.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_operators/rigidbody.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_collection.py [new file with mode: 0644]
release/scripts/startup/bl_ui/properties_physics_cloth.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/properties_render_layer.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_outliner.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/templates_py/batch_export.py
release/scripts/templates_py/operator_modal_view3d_raycast.py
source/blender/CMakeLists.txt
source/blender/alembic/intern/abc_exporter.cc
source/blender/alembic/intern/abc_exporter.h
source/blender/alembic/intern/abc_util.cc
source/blender/alembic/intern/abc_util.h
source/blender/alembic/intern/alembic_capi.cc
source/blender/blenfont/BLF_api.h
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_internal.h
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_collection.h [new file with mode: 0644]
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_group.h
source/blender/blenkernel/BKE_layer.h [new file with mode: 0644]
source/blender/blenkernel/BKE_mesh_render.h [new file with mode: 0644]
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/armature_update.c
source/blender/blenkernel/intern/cachefile.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/collection.c [new file with mode: 0644]
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/icons.c
source/blender/blenkernel/intern/layer.c [new file with mode: 0644]
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/library_query.c
source/blender/blenkernel/intern/library_remap.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mball_tessellate.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_render.c [new file with mode: 0644]
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/object_dupli.c
source/blender/blenkernel/intern/object_update.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/rigidbody.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/BLI_iterator.h [new file with mode: 0644]
source/blender/blenlib/BLI_math_color.h
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/math_color_inline.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/math_vector.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/scanfill_utils.c
source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/readfile.h
source/blender/blenloader/intern/versioning_250.c
source/blender/blenloader/intern/versioning_270.c
source/blender/blenloader/intern/versioning_280.c [new file with mode: 0644]
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/tools/bmesh_intersect.c
source/blender/collada/DocumentImporter.cpp
source/blender/collada/EffectExporter.cpp
source/blender/depsgraph/CMakeLists.txt
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_nodes.h
source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.h
source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
source/blender/depsgraph/intern/depsgraph_eval.cc
source/blender/depsgraph/intern/depsgraph_tag.cc
source/blender/depsgraph/util/deg_util_foreach.h
source/blender/depsgraph/util/deg_util_function.h
source/blender/draw/CMakeLists.txt [new file with mode: 0644]
source/blender/draw/DRW_engine.h [new file with mode: 0644]
source/blender/draw/engines/clay/clay.c [new file with mode: 0644]
source/blender/draw/engines/clay/clay.h [new file with mode: 0644]
source/blender/draw/engines/clay/shaders/clay_frag.glsl [new file with mode: 0644]
source/blender/draw/engines/clay/shaders/clay_vert.glsl [new file with mode: 0644]
source/blender/draw/engines/clay/shaders/ssao_alchemy.glsl [new file with mode: 0644]
source/blender/draw/engines/clay/shaders/ssao_groundtruth.glsl [new file with mode: 0644]
source/blender/draw/intern/DRW_render.h [new file with mode: 0644]
source/blender/draw/intern/draw_armature.c [new file with mode: 0644]
source/blender/draw/intern/draw_cache.c [new file with mode: 0644]
source/blender/draw/intern/draw_cache.h [new file with mode: 0644]
source/blender/draw/intern/draw_manager.c [new file with mode: 0644]
source/blender/draw/intern/draw_mode_pass.c [new file with mode: 0644]
source/blender/draw/intern/draw_mode_pass.h [new file with mode: 0644]
source/blender/draw/intern/draw_view.c [new file with mode: 0644]
source/blender/draw/intern/draw_view.h [new file with mode: 0644]
source/blender/draw/modes/edit_armature_mode.c [new file with mode: 0644]
source/blender/draw/modes/edit_armature_mode.h [new file with mode: 0644]
source/blender/draw/modes/edit_mesh_mode.c [new file with mode: 0644]
source/blender/draw/modes/edit_mesh_mode.h [new file with mode: 0644]
source/blender/draw/modes/object_mode.c [new file with mode: 0644]
source/blender/draw/modes/object_mode.h [new file with mode: 0644]
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_relations.c
source/blender/editors/armature/armature_select.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/pose_select.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editcurve_paint.c
source/blender/editors/curve/editfont.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_brush.c
source/blender/editors/gpencil/gpencil_convert.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/gpencil/gpencil_utils.c
source/blender/editors/include/BIF_glutil.h
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_keyframes_draw.h
source/blender/editors/include/ED_node.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_screen.h
source/blender/editors/include/ED_transform.h
source/blender/editors/include/ED_uvedit.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_interface.h
source/blender/editors/include/UI_interface_icons.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_eyedropper.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/mask/mask_draw.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/physics/rigidbody_constraint.c
source/blender/editors/physics/rigidbody_object.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/CMakeLists.txt
source/blender/editors/screen/area.c
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_context.c
source/blender/editors/screen/screen_draw.c [new file with mode: 0644]
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_intern.h
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/clip_dopesheet_draw.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_graph_draw.c
source/blender/editors/space_clip/clip_intern.h
source/blender/editors/space_clip/clip_utils.c
source/blender/editors/space_clip/tracking_ops_orient.c
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_stats.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_outliner/CMakeLists.txt
source/blender/editors/space_outliner/outliner_collections.c [new file with mode: 0644]
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_ops.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_view3d/CMakeLists.txt
source/blender/editors/space_view3d/drawanimviz.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawsimdebug.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_draw_legacy.c [new file with mode: 0644]
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ruler.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/space_view3d/view3d_walk.c
source/blender/editors/transform/CMakeLists.txt
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/transform/transform_snap_object.c
source/blender/editors/util/ed_util.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
source/blender/gpu/CMakeLists.txt
source/blender/gpu/GPU_basic_shader.h
source/blender/gpu/GPU_batch.h [new file with mode: 0644]
source/blender/gpu/GPU_debug.h
source/blender/gpu/GPU_draw.h
source/blender/gpu/GPU_extensions.h
source/blender/gpu/GPU_framebuffer.h
source/blender/gpu/GPU_immediate.h [new file with mode: 0644]
source/blender/gpu/GPU_matrix.h [new file with mode: 0644]
source/blender/gpu/GPU_shader.h
source/blender/gpu/GPU_texture.h
source/blender/gpu/GPU_uniformbuffer.h [new file with mode: 0644]
source/blender/gpu/GPU_viewport.h [new file with mode: 0644]
source/blender/gpu/gawain/attrib_binding.c [new file with mode: 0644]
source/blender/gpu/gawain/attrib_binding.h [new file with mode: 0644]
source/blender/gpu/gawain/batch.c [new file with mode: 0644]
source/blender/gpu/gawain/batch.h [new file with mode: 0644]
source/blender/gpu/gawain/buffer_id.cpp [new file with mode: 0644]
source/blender/gpu/gawain/buffer_id.h [new file with mode: 0644]
source/blender/gpu/gawain/common.h [new file with mode: 0644]
source/blender/gpu/gawain/element.c [new file with mode: 0644]
source/blender/gpu/gawain/element.h [new file with mode: 0644]
source/blender/gpu/gawain/imm_util.c [new file with mode: 0644]
source/blender/gpu/gawain/imm_util.h [new file with mode: 0644]
source/blender/gpu/gawain/immediate.c [new file with mode: 0644]
source/blender/gpu/gawain/immediate.h [new file with mode: 0644]
source/blender/gpu/gawain/vertex_buffer.c [new file with mode: 0644]
source/blender/gpu/gawain/vertex_buffer.h [new file with mode: 0644]
source/blender/gpu/gawain/vertex_format.c [new file with mode: 0644]
source/blender/gpu/gawain/vertex_format.h [new file with mode: 0644]
source/blender/gpu/intern/gpu_basic_shader.c
source/blender/gpu/intern/gpu_batch.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_compositing.c
source/blender/gpu/intern/gpu_debug.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_framebuffer.c
source/blender/gpu/intern/gpu_immediate.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_init_exit.c
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/intern/gpu_matrix.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_shader.c
source/blender/gpu/intern/gpu_shader_private.h [new file with mode: 0644]
source/blender/gpu/intern/gpu_texture.c
source/blender/gpu/intern/gpu_uniformbuffer.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_viewport.c [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_smooth_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_smooth_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_smooth_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_2D_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_groundline_geom.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_groundpoint_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_image_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_passthrough_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_outline_smooth_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_smooth_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_3D_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_basic_frag.glsl
source/blender/gpu/shaders/gpu_shader_basic_geom.glsl
source/blender/gpu/shaders/gpu_shader_checker_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_depth_only_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_diag_stripes_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_edges_front_back_ortho_vert.glsl [new file with mode: 0755]
source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_geom.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_vert.glsl [new file with mode: 0755]
source/blender/gpu/shaders/gpu_shader_edges_overlay_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_edges_overlay_geom.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_edges_overlay_simple_geom.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_edges_overlay_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_image_interlace_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_image_mask_uniform_color_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_image_modulate_alpha_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_image_rect_modulate_alpha_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_instance_screen_aligned_axis_name_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_instance_screenspace_variying_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_instance_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_keyframe_diamond_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_point_uniform_color_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_smooth_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_point_uniform_color_smooth_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_point_varying_color_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_point_varying_color_outline_smooth_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_text_frag.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_text_vert.glsl [new file with mode: 0644]
source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl [new file with mode: 0644]
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_gpencil_types.h
source/blender/makesdna/DNA_layer_types.h [new file with mode: 0644]
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_outliner_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_group.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_cast.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_correctivesmooth.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_datatransfer.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_dynamicpaint.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_fluidsim.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_laplaciandeform.c
source/blender/modifiers/intern/MOD_laplaciansmooth.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_meshcache.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_meshsequencecache.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_multires.c
source/blender/modifiers/intern/MOD_none.c
source/blender/modifiers/intern/MOD_normal_edit.c
source/blender/modifiers/intern/MOD_ocean.c
source/blender/modifiers/intern/MOD_particleinstance.c
source/blender/modifiers/intern/MOD_particlesystem.c
source/blender/modifiers/intern/MOD_remesh.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/modifiers/intern/MOD_shapekey.c
source/blender/modifiers/intern/MOD_shrinkwrap.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/modifiers/intern/MOD_skin.c
source/blender/modifiers/intern/MOD_smoke.c
source/blender/modifiers/intern/MOD_smooth.c
source/blender/modifiers/intern/MOD_softbody.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_subsurf.c
source/blender/modifiers/intern/MOD_surface.c
source/blender/modifiers/intern/MOD_triangulate.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_uvwarp.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/modifiers/intern/MOD_weightvgedit.c
source/blender/modifiers/intern/MOD_weightvgmix.c
source/blender/modifiers/intern/MOD_weightvgproximity.c
source/blender/modifiers/intern/MOD_wireframe.c
source/blender/python/generic/bgl.c
source/blender/python/generic/blf_py_api.c
source/blender/render/CMakeLists.txt
source/blender/render/extern/include/RE_engine.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_dragdrop.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_stereo.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/manipulators/WM_manipulator_api.h [new file with mode: 0644]
source/blender/windowmanager/manipulators/WM_manipulator_types.h [new file with mode: 0644]
source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_intern.h [new file with mode: 0644]
source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_utils.c [new file with mode: 0644]
source/blender/windowmanager/manipulators/intern/wm_manipulator.c [new file with mode: 0644]
source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h [new file with mode: 0644]
source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c [new file with mode: 0644]
source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c [new file with mode: 0644]
source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h [new file with mode: 0644]
source/blender/windowmanager/wm.h
source/blender/windowmanager/wm_draw.h
source/blender/windowmanager/wm_event_system.h
source/blender/windowmanager/wm_event_types.h
source/blenderplayer/bad_level_call_stubs/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator_args.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_Light.h
tests/python/CMakeLists.txt
tests/python/render_layer/CMakeLists.txt [new file with mode: 0644]
tests/python/render_layer/render_layer_common.py [new file with mode: 0644]
tests/python/render_layer/test_active_collection.py [new file with mode: 0644]
tests/python/render_layer/test_evaluation_visibility_a.py [new file with mode: 0644]
tests/python/render_layer/test_evaluation_visibility_b.py [new file with mode: 0644]
tests/python/render_layer/test_layer_linking.py [new file with mode: 0644]
tests/python/render_layer/test_link.py [new file with mode: 0644]
tests/python/render_layer/test_object_add.py [new file with mode: 0644]
tests/python/render_layer/test_object_copy.py [new file with mode: 0644]
tests/python/render_layer/test_object_delete.py [new file with mode: 0644]
tests/python/render_layer/test_operator_context.py [new file with mode: 0644]
tests/python/render_layer/test_scene_copy.py [new file with mode: 0644]
tests/python/render_layer/test_scene_write_read.py [new file with mode: 0644]
tests/python/render_layer/test_syncing.py [new file with mode: 0644]

index 0b8228e3f142f56c164896655f9809a1b96fb0c8..02875320630e6240f0801021cf3808ab82484662 100644 (file)
@@ -1,16 +1,20 @@
 [submodule "release/scripts/addons"]
        path = release/scripts/addons
        url = ../blender-addons.git
+       branch = blender2.8
        ignore = all
 [submodule "release/scripts/addons_contrib"]
        path = release/scripts/addons_contrib
        url = ../blender-addons-contrib.git
+       branch = master
        ignore = all
 [submodule "release/datafiles/locale"]
        path = release/datafiles/locale
        url = ../blender-translations.git
+       branch = master
        ignore = all
 [submodule "source/tools"]
        path = source/tools
        url = ../blender-dev-tools.git
+       branch = master
        ignore = all
index 1cc3e02e03a1d6a6770378bbf5aadd1f141b5bfd..e16f0cddfd7ba546a776bddbb22c8566466ad662 100644 (file)
@@ -242,6 +242,8 @@ endif()
 option(WITH_PLAYER        "Build Player" OFF)
 option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
 
+option(WITH_CLAY_ENGINE    "Enable New Clay engine (Breaks Mac and Intel compatibility)" ON)
+
 # Compositor
 option(WITH_COMPOSITOR         "Enable the tile based nodal compositor" ON)
 
@@ -498,11 +500,10 @@ endif()
 # We default options to whatever default standard in the current compiler.
 if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
        set(_c11_init ON)
-       set(_cxx11_init ON)
 else()
        set(_c11_init OFF)
-       set(_cxx11_init OFF)
 endif()
+set(_cxx11_init ON)
 
 option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
 mark_as_advanced(WITH_C11)
index 1fda1a25a9266767ff6eca126803afb09da6a06d..8fa9571dca61d0b2e3fd9dfc3d8ce15dfa4fb877 100644 (file)
@@ -402,7 +402,7 @@ update: .FORCE
                svn update ../lib/* ; \
        fi
        git pull --rebase
-       git submodule foreach git pull --rebase origin master
+       git submodule update --remote
 
 
 # -----------------------------------------------------------------------------
index ee49f83b38dc49f86ceca45a40edccb3399cab94..c167d39210011e60f007667de48b83ca185deb72 100755 (executable)
@@ -25,7 +25,7 @@
 ARGS=$( \
 getopt \
 -o s:i:t:h \
---long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
+--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
 with-all,with-opencollada,\
 ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
 force-all,force-python,force-numpy,force-boost,\
@@ -104,11 +104,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
     --no-confirm
         Disable any interaction with user (suitable for automated run).
 
-    --use-cxx11
-        Build all libraries in cpp11 'mode' (will be mandatory soon in blender2.8 branch).
-        NOTE: If your compiler is gcc-6.0 or above, you probably *want* to enable this option (since it's default
-              standard starting from this version).
-
     --with-all
         By default, a number of optional and not-so-often needed libraries are not installed.
         This option will try to install them, at the cost of potential conflicts (depending on
@@ -287,7 +282,7 @@ SUDO="sudo"
 
 NO_BUILD=false
 NO_CONFIRM=false
-USE_CXX11=false
+USE_CXX11=true  # Mandatory in blender2.8
 
 PYTHON_VERSION="3.5.2"
 PYTHON_VERSION_MIN="3.5"
@@ -499,9 +494,6 @@ while true; do
     --no-confirm)
       NO_CONFIRM=true; shift; continue
     ;;
-    --use-cxx11)
-      USE_CXX11=true; shift; continue
-    ;;
     --with-all)
       WITH_ALL=true; shift; continue
     ;;
@@ -793,7 +785,7 @@ FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
 
 CXXFLAGS_BACK=$CXXFLAGS
 if [ "$USE_CXX11" = true ]; then
-  WARNING "You are trying to use c++11, this *should* go smoothely with any very recent distribution
+  WARNING "C++11 is now mandatory for blender2.8, this *should* go smoothly with any very recent distribution.
 However, if you are experiencing linking errors (also when building Blender itself), please try the following:
     * Re-run this script with '--build-all --force-all' options.
     * Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
index 09428953a468b8afffb9f61012adb2c1083e8da9..311228eab307a72ac794cbdbf663d90900c7bd8c 100644 (file)
@@ -597,6 +597,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
                bf_modifiers
                bf_bmesh
                bf_gpu
+               bf_draw
                bf_blenloader
                bf_blenkernel
                bf_physics
index 44af5f7efedbe8e180194cef6f12adb09e37af0d..eb89f0b1efaf48646acc1cc24bec72c1f53f6973 100644 (file)
@@ -1585,6 +1585,7 @@ class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel):
         row.prop(rd, "simplify_subdivision", text="Viewport")
         row.prop(rd, "simplify_subdivision_render", text="Render")
 
+
         col = layout.column(align=True)
         col.label(text="Child Particles")
         row = col.row(align=True)
index dd49b81b561ee04acf910b8923e83d83ef716240..8186eaa759d54ea6fc667a85f4816e23b596bab5 100644 (file)
@@ -134,6 +134,8 @@ private:
        /** The OpenGL drawing context */
        NSOpenGLContext *m_openGLContext;
 
+       bool m_coreProfile;
+
        //static CGLEWContext *s_cglewContext;
 
        const bool m_debug;
index 03c45f9945bc8ff3f803ac10e073bb1b084af07e..64db70197bbe3686e45685bc93999ccf6e9a0c32 100644 (file)
@@ -63,6 +63,23 @@ GHOST_ContextCGL::GHOST_ContextCGL(
       m_debug(contextFlags)
 {
        assert(openGLView != nil);
+
+       // for now be very strict about OpenGL version requested
+       switch (contextMajorVersion) {
+               case 2:
+                       assert(contextMinorVersion == 1);
+                       assert(contextProfileMask == 0);
+                       m_coreProfile = false;
+                       break;
+               case 3:
+                       // Apple didn't implement 3.0 or 3.1
+                       assert(contextMinorVersion == 2);
+                       assert(contextProfileMask == GL_CONTEXT_CORE_PROFILE_BIT);
+                       m_coreProfile = true;
+                       break;
+               default:
+                       assert(false);
+       }
 }
 
 
@@ -170,6 +187,7 @@ GHOST_TSuccess GHOST_ContextCGL::updateDrawingContext()
 
 static void makeAttribList(
         std::vector<NSOpenGLPixelFormatAttribute>& attribs,
+        bool coreProfile, 
         bool stereoVisual,
         int numOfAASamples,
         bool needAlpha,
@@ -178,6 +196,9 @@ static void makeAttribList(
 {
        attribs.clear();
 
+       attribs.push_back(NSOpenGLPFAOpenGLProfile);
+       attribs.push_back(coreProfile ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy);
+       
        // Pixel Format Attributes for the windowed NSOpenGLContext
        attribs.push_back(NSOpenGLPFADoubleBuffer);
 
@@ -190,8 +211,7 @@ static void makeAttribList(
                attribs.push_back(NSOpenGLPFANoRecovery);
        }
 
-       /* Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway */
-       //attribs.push_back(NSOpenGLPFAAllowOfflineRenderers);
+       attribs.push_back(NSOpenGLPFAAllowOfflineRenderers); // for automatic GPU switching
 
        attribs.push_back(NSOpenGLPFADepthSize);
        attribs.push_back((NSOpenGLPixelFormatAttribute) 32);
@@ -263,7 +283,7 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
        NSOpenGLPixelFormat *pixelFormat;
        // TODO: keep pixel format for subsequent windows/contexts instead of recreating each time
 
-       makeAttribList(attribs, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil, softwareGL);
+       makeAttribList(attribs, m_coreProfile, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil, softwareGL);
 
        pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
 
@@ -274,7 +294,7 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
                // (Now that I think about it, does WGL really require the code that it has for finding a lesser match?)
 
                attribs.clear();
-               makeAttribList(attribs, m_stereoVisual, 0, needAlpha, needStencil, softwareGL);
+               makeAttribList(attribs, m_coreProfile, m_stereoVisual, 0, needAlpha, needStencil, softwareGL);
                pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
        }
 
@@ -316,7 +336,7 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
                [m_openGLContext release];
 
                // create software GL context
-               makeAttribList(attribs, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil, softwareGL);
+               makeAttribList(attribs, m_coreProfile, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil, softwareGL);
                pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
                m_openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:s_sharedOpenGLContext];
                [pixelFormat release];
index 9ac61db40412dde946ac8e5c691e38f08aa0436f..60cdce83602d910993f7c1aa22726ce4f898a6f7 100644 (file)
@@ -255,9 +255,6 @@ const bool GLXEW_ARB_create_context_robustness =
                if (m_contextMajorVersion != 0) {
                        attribs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
                        attribs[i++] = m_contextMajorVersion;
-               }
-
-               if (m_contextMinorVersion != 0) {
                        attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
                        attribs[i++] = m_contextMinorVersion;
                }
@@ -300,8 +297,8 @@ const bool GLXEW_ARB_create_context_robustness =
                }
        }
        else {
-               /* Create legacy context */
-               m_context = glXCreateContext(m_display, m_visualInfo, s_sharedContext, True);
+               /* Don't create legacy context */
+               fprintf(stderr, "Warning! GLX_ARB_create_context not available.\n");
        }
 
        GHOST_TSuccess success;
@@ -328,8 +325,14 @@ const bool GLXEW_ARB_create_context_robustness =
 
                version = glGetString(GL_VERSION);
 
-               if (!version || version[0] < '2' || ((version[0] == '2') &&  (version[2] < '1'))) {
-                       fprintf(stderr, "Error! Blender requires OpenGL 2.1 to run. Try updating your drivers.\n");
+#if 0 // enable this when Blender switches to 3.3 core profile
+               if (!version || version[0] < '3' || ((version[0] == '3') && (version[2] < '3'))) {
+                       fprintf(stderr, "Error! Blender requires OpenGL 3.3 to run. Try updating your drivers.\n");
+#else
+               // with Mesa, the closest thing to 3.3 compatibility profile is 3.0
+               if (!version || version[0] < '3') {
+                       fprintf(stderr, "Error! Blender requires OpenGL 3.0 (soon 3.3) to run. Try updating your drivers.\n");
+#endif
                        fflush(stderr);
                        /* ugly, but we get crashes unless a whole bunch of systems are patched. */
                        exit(0);
index 64ee692797b5ee87c861a77bd3a5de837ffa3d5d..39ef63fa723054a030ec154717a0352843c94457 100644 (file)
@@ -962,7 +962,7 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
             strcmp(renderer, "GDI Generic") == 0) && version[0] == '1' && version[2] == '1')
        {
                MessageBox(m_hWnd, "Your system does not use 3D hardware acceleration.\n"
-                                  "Blender requires a graphics driver with OpenGL 2.1 support.\n\n"
+                                  "Blender requires a graphics driver with OpenGL 3.3 support.\n\n"
                                   "This may be caused by:\n"
                                   "* A missing or faulty graphics driver installation.\n"
                                   "  Blender needs a graphics card driver to work correctly.\n"
@@ -973,8 +973,8 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
                           MB_OK | MB_ICONERROR);
                exit(0);
        }
-       else if (version[0] < '2' || (version[0] == '2' && version[2] < '1')) {
-               MessageBox(m_hWnd, "Blender requires a graphics driver with OpenGL 2.1 support.\n\n"
+       else if (version[0] < '3' || (version[0] == '3' && version[2] < '3')) {
+               MessageBox(m_hWnd, "Blender requires a graphics driver with OpenGL 3.3 support.\n\n"
                                   "The program will now close.",
                           "Blender - Unsupported Graphics Driver!",
                           MB_OK | MB_ICONERROR);
index 580b4dcb82f1e29087b40206c0ba05dae7e1989e..99efcc5ebd7d5721d12e28b126fdc81a72be6169 100644 (file)
 extern "C" WGLEWContext *wglewContext;
 #endif
 
-#ifndef GHOST_OPENGL_WGL_CONTEXT_FLAGS
-#  ifdef WITH_GPU_DEBUG
-#    define GHOST_OPENGL_WGL_CONTEXT_FLAGS WGL_CONTEXT_DEBUG_BIT_ARB
-#  else
-#    define GHOST_OPENGL_WGL_CONTEXT_FLAGS 0
-#  endif
-#endif
-
 #ifndef GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY
 #define GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY 0
 #endif
index 97615dcea96b32af675c48154449572d95aba5c8..b0feb11a6afc079a1076cf40542043891d169d25 100644 (file)
@@ -1086,82 +1086,23 @@ GHOST_TSuccess GHOST_WindowCocoa::setOrder(GHOST_TWindowOrder order)
 GHOST_Context *GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType type)
 {
        if (type == GHOST_kDrawingContextTypeOpenGL) {
-#if !defined(WITH_GL_EGL)
 
-#if defined(WITH_GL_PROFILE_CORE)
-               GHOST_Context *context = new GHOST_ContextCGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_openGLView,
-                       GL_CONTEXT_CORE_PROFILE_BIT,
-                       3, 2,
-                       GHOST_OPENGL_CGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_CGL_RESET_NOTIFICATION_STRATEGY);
-#elif defined(WITH_GL_PROFILE_ES20)
                GHOST_Context *context = new GHOST_ContextCGL(
                        m_wantStereoVisual,
                        m_wantNumOfAASamples,
                        m_window,
                        m_openGLView,
-                       CGL_CONTEXT_ES2_PROFILE_BIT_EXT,
-                       2, 0,
-                       GHOST_OPENGL_CGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_CGL_RESET_NOTIFICATION_STRATEGY);
-#elif defined(WITH_GL_PROFILE_COMPAT)
-               GHOST_Context *context = new GHOST_ContextCGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_openGLView,
-                       0, // profile bit
-                       0, 0,
-                       m_debug_context,
-                       GHOST_OPENGL_CGL_RESET_NOTIFICATION_STRATEGY);
-#else
-#  error
-#endif
-
-#else
 
 #if defined(WITH_GL_PROFILE_CORE)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_openGLView,
-                       EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+                       GL_CONTEXT_CORE_PROFILE_BIT,
                        3, 2,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_API);
-#elif defined(WITH_GL_PROFILE_ES20)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_openGLView,
-                       0, // profile bit
-                       2, 0,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_ES_API);
-#elif defined(WITH_GL_PROFILE_COMPAT)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_openGLView,
-                       0, // profile bit
-                       0, 0,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_API);
 #else
-#  error
+                       0, // no profile bit
+                       2, 1,
 #endif
+                       GHOST_OPENGL_CGL_CONTEXT_FLAGS,
+                       GHOST_OPENGL_CGL_RESET_NOTIFICATION_STRATEGY);
 
-#endif
                if (context->initializeDrawingContext())
                        return context;
                else
index 7d80aa43a401fdf1038940a3b8d6a116c4280126..58aa0b87045a0fe9730ff5a7c10ae97abe86ff72 100644 (file)
@@ -610,97 +610,37 @@ GHOST_TSuccess GHOST_WindowWin32::invalidate()
 GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType type)
 {
        if (type == GHOST_kDrawingContextTypeOpenGL) {
-#if !defined(WITH_GL_EGL)
 
+               const int profile_mask =
 #if defined(WITH_GL_PROFILE_CORE)
-               GHOST_Context *context = new GHOST_ContextWGL(
-                       m_wantStereoVisual,
-                       m_wantAlphaBackground,
-                       m_wantNumOfAASamples,
-                       m_hWnd,
-                       m_hDC,
-                       WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
-                       3, 2,
-                       GHOST_OPENGL_WGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
-#elif defined(WITH_GL_PROFILE_ES20)
-               GHOST_Context *context = new GHOST_ContextWGL(
-                       m_wantStereoVisual,
-                       m_wantAlphaBackground,
-                       m_wantNumOfAASamples,
-                       m_hWnd,
-                       m_hDC,
-                       WGL_CONTEXT_ES2_PROFILE_BIT_EXT,
-                       2, 0,
-                       GHOST_OPENGL_WGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
+                       WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
 #elif defined(WITH_GL_PROFILE_COMPAT)
+                       WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+#else
+#  error // must specify either core or compat at build time
+#endif
+
                GHOST_Context *context = new GHOST_ContextWGL(
                        m_wantStereoVisual,
                        m_wantAlphaBackground,
                        m_wantNumOfAASamples,
                        m_hWnd,
                        m_hDC,
-#if 1
-                       0, // profile bit
-                       2, 1, // GL version requested
+                       profile_mask,
+#if 0
+                       3, 3, // specific GL version requested
+                             // AMD gives us exactly this version
+                             // NVIDIA gives at least this version <-- desired behavior
 #else
-                       // switch to this for Blender 2.8 development
-                       WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
-                       3, 2,
+                       2, 1, // any GL version >= 2.1 (hopefully the latest)
+                             // we check later to ensure it's >= 3.3 on Windows
+                             // TODO(merwin): fix properly!
+                             //               2.1 ignores the profile bit & is incompatible with core profile
+                             //               query version of initial dummy context, request that + profile + debug
 #endif
                        (m_debug_context ? WGL_CONTEXT_DEBUG_BIT_ARB : 0),
                        GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
-#else
-#  error
-#endif
-
-#else
 
-#if defined(WITH_GL_PROFILE_CORE)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_hWnd,
-                       m_hDC,
-                       EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
-                       3, 2,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_API);
-#elif defined(WITH_GL_PROFILE_ES20)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_hWnd,
-                       m_hDC,
-                       0, // profile bit
-                       2, 0,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_ES_API);
-#elif defined(WITH_GL_PROFILE_COMPAT)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_hWnd,
-                       m_hDC,
-#if 1
-                       0, // profile bit
-                       2, 1, // GL version requested
-#else
-                       // switch to this for Blender 2.8 development
-                       EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT,
-                       3, 2,
-#endif
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_API);
-#else
-#  error
-#endif
-
-#endif
                if (context->initializeDrawingContext())
                        return context;
                else
index 47fbe1256b1d363a3e3c1ae07cd54476ccaeb936..8cee785cdf6e00e0aec458889e03b42f95f1ccf6 100644 (file)
@@ -1314,88 +1314,77 @@ GHOST_WindowX11::
 GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type)
 {
        if (type == GHOST_kDrawingContextTypeOpenGL) {
-#if !defined(WITH_GL_EGL)
 
+               // During development:
+               //   try 4.x compatibility profile
+               //   try 3.3 compatibility profile
+               //   fall back to 3.0 if needed
+               //
+               // Final Blender 2.8:
+               //   try 4.x core profile
+               //   try 3.3 core profile
+               //   no fallbacks
+
+               const int profile_mask =
 #if defined(WITH_GL_PROFILE_CORE)
-               GHOST_Context *context = new GHOST_ContextGLX(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_display,
-                       m_visualInfo,
-                       (GLXFBConfig)m_fbconfig,
-                       GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
-                       3, 2,
-                       GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
-                       GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
-#elif defined(WITH_GL_PROFILE_ES20)
-               GHOST_Context *context = new GHOST_ContextGLX(
+                       GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
+#elif defined(WITH_GL_PROFILE_COMPAT)
+                       GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+#else
+#  error // must specify either core or compat at build time
+#endif
+
+               GHOST_Context *context;
+
+               for (int minor = 5; minor >= 0; --minor) {
+                       context = new GHOST_ContextGLX(
+                               m_wantStereoVisual,
+                               m_wantNumOfAASamples,
+                               m_window,
+                               m_display,
+                               m_visualInfo,
+                               (GLXFBConfig)m_fbconfig,
+                               profile_mask,
+                               4, minor,
+                               GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
+                               GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
+
+                       if (context->initializeDrawingContext())
+                               return context;
+                       else
+                               delete context;
+               }
+
+               context = new GHOST_ContextGLX(
                        m_wantStereoVisual,
                        m_wantNumOfAASamples,
                        m_window,
                        m_display,
                        m_visualInfo,
                        (GLXFBConfig)m_fbconfig,
-                       GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
-                       2, 0,
+                       profile_mask,
+                       3, 3,
                        GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
                        GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
-#elif defined(WITH_GL_PROFILE_COMPAT)
-               GHOST_Context *context = new GHOST_ContextGLX(
+
+               if (context->initializeDrawingContext())
+                       return context;
+               else
+                       delete context;
+
+               // since that failed try 3.0 (mostly for Mesa, which doesn't implement compatibility profile)
+               context = new GHOST_ContextGLX(
                        m_wantStereoVisual,
                        m_wantNumOfAASamples,
                        m_window,
                        m_display,
                        m_visualInfo,
                        (GLXFBConfig)m_fbconfig,
-                       0, // profile bit
-                       0, 0,
+                       0, // no profile bit
+                       3, 0,
                        GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
                        GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
-#else
-#  error
-#endif
-
-#else
-
-#if defined(WITH_GL_PROFILE_CORE)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_display,
-                       EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
-                       3, 2,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_API);
-#elif defined(WITH_GL_PROFILE_ES20)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_display,
-                       0, // profile bit
-                       2, 0,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_ES_API);
-#elif defined(WITH_GL_PROFILE_COMPAT)
-               GHOST_Context *context = new GHOST_ContextEGL(
-                       m_wantStereoVisual,
-                       m_wantNumOfAASamples,
-                       m_window,
-                       m_display,
-                       0, // profile bit
-                       0, 0,
-                       GHOST_OPENGL_EGL_CONTEXT_FLAGS,
-                       GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
-                       EGL_OPENGL_API);
-#else
-#  error
-#endif
 
-#endif
                if (context->initializeDrawingContext())
                        return context;
                else
index dd82b1ca8a72f4d0ec17c3bfeaf522bd9d28b0c3..7a088a802f63aa1d1d30d9f702694e66e4c04dea 100644 (file)
--- a/make.bat
+++ b/make.bat
@@ -90,7 +90,7 @@ if NOT "%1" == "" (
        ) else if "%1" == "update" (
                svn up ../lib/*
                git pull --rebase
-               git submodule foreach git pull --rebase origin master
+               git submodule update --remote
                goto EOF
        ) else if "%1" == "clean" (
                set MUST_CLEAN=1
index 0649a2075cd5e328b126f75ed7690a73ab5e844e..36cb5d2ccafcc2f19b8da7af24d4e3432c84efde 100644 (file)
@@ -2,6 +2,8 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+       <key>LSMinimumSystemVersion</key>
+       <string>10.7.0</string>
        <key>CFBundleDocumentTypes</key>
        <array>
                <dict>
@@ -47,5 +49,7 @@
        <string>NSApplication</string>
        <key>NSHighResolutionCapable</key>
        <true/>
+       <key>NSSupportsAutomaticGraphicsSwitching</key>
+       <true/>
 </dict>
 </plist>
index 371960484a38fc64e0a2635170a41a0d8ab2f6bd..f2bb66b68b4071c6554cae881010a783b3ebbdf0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 371960484a38fc64e0a2635170a41a0d8ab2f6bd
+Subproject commit f2bb66b68b4071c6554cae881010a783b3ebbdf0
index c48f03c133d69ec3381741f50bda8e31214830d0..d740137b0c3ae9e71267706c7632261f06075abc 100644 (file)
@@ -103,9 +103,9 @@ def add_object_align_init(context, operator):
     return location * rotation
 
 
-def object_data_add(context, obdata, operator=None, use_active_layer=True, name=None):
+def object_data_add(context, obdata, operator=None, name=None):
     """
-    Add an object using the view context and preference to to initialize the
+    Add an object using the view context and preference to initialize the
     location, rotation and layer.
 
     :arg context: The context to use.
@@ -117,52 +117,24 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name=
     :arg name: Optional name
     :type name: string
     :return: the newly created object in the scene.
-    :rtype: :class:`bpy.types.ObjectBase`
+    :rtype: :class:`bpy.types.Object`
     """
     scene = context.scene
+    layer = context.render_layer
+    scene_collection = context.scene_collection
 
-    # ugh, could be made nicer
-    for ob in scene.objects:
-        ob.select = False
+    bpy.ops.object.select_all(action='DESELECT')
 
     if name is None:
         name = "Object" if obdata is None else obdata.name
 
     obj_new = bpy.data.objects.new(name, obdata)
-
-    base = scene.objects.link(obj_new)
-    base.select = True
-
-    v3d = None
-    if context.space_data and context.space_data.type == 'VIEW_3D':
-        v3d = context.space_data
-
-    if v3d and v3d.local_view:
-        base.layers_from_view(context.space_data)
-
-    if operator is not None and any(operator.layers):
-        base.layers = operator.layers
-    else:
-        if use_active_layer:
-            if v3d and v3d.local_view:
-                base.layers[scene.active_layer] = True
-            else:
-                if v3d and not v3d.lock_camera_and_layers:
-                    base.layers = [True if i == v3d.active_layer
-                                   else False for i in range(len(v3d.layers))]
-                else:
-                    base.layers = [True if i == scene.active_layer
-                                   else False for i in range(len(scene.layers))]
-        else:
-            if v3d:
-                base.layers_from_view(context.space_data)
-
-        if operator is not None:
-            operator.layers = base.layers
+    scene_collection.objects.link(obj_new)
+    obj_new.select_set(action='SELECT')
 
     obj_new.matrix_world = add_object_align_init(context, operator)
 
-    obj_act = scene.objects.active
+    obj_act = layer.objects.active
 
     # XXX
     # caused because entering edit-mode does not add a empty undo slot!
@@ -174,8 +146,8 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name=
             _obdata = bpy.data.meshes.new(name)
             obj_act = bpy.data.objects.new(_obdata.name, _obdata)
             obj_act.matrix_world = obj_new.matrix_world
-            scene.objects.link(obj_act)
-            scene.objects.active = obj_act
+            scene_collection.objects.link(obj_act)
+            layer.objects.active = obj_act
             bpy.ops.object.mode_set(mode='EDIT')
             # need empty undo step
             bpy.ops.ed.undo_push(message="Enter Editmode")
@@ -185,7 +157,7 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name=
         bpy.ops.mesh.select_all(action='DESELECT')
         bpy.ops.object.mode_set(mode='OBJECT')
 
-        obj_act.select = True
+        obj_act.select_set(action='SELECT')
         scene.update()  # apply location
         # scene.objects.active = obj_new
 
@@ -200,16 +172,14 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name=
         bpy.ops.object.join()  # join into the active.
         if obdata:
             bpy.data.meshes.remove(obdata)
-        # base is freed, set to active object
-        base = scene.object_bases.active
 
         bpy.ops.object.mode_set(mode='EDIT')
     else:
-        scene.objects.active = obj_new
+        layer.objects.active = obj_new
         if context.user_preferences.edit.use_enter_edit_mode:
             bpy.ops.object.mode_set(mode='EDIT')
 
-    return base
+    return obj_new
 
 
 class AddObjectHelper:
@@ -230,12 +200,6 @@ class AddObjectHelper:
             name="Rotation",
             subtype='EULER',
             )
-    layers = BoolVectorProperty(
-            name="Layers",
-            size=20,
-            subtype='LAYER',
-            options={'HIDDEN', 'SKIP_SAVE'},
-            )
 
     @classmethod
     def poll(self, context):
index 7694e338d68462448280bc2aa99d12aab1bdc270..b6b0a0c926f495ce6a1d8f295aa568625012fb32 100644 (file)
@@ -330,7 +330,6 @@ kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', shift=True)
 kmi.properties.unselected = True
 kmi = km.keymap_items.new('object.hide_render_clear', 'H', 'PRESS', ctrl=True, alt=True)
 kmi = km.keymap_items.new('object.hide_render_set', 'H', 'PRESS', ctrl=True)
-kmi = km.keymap_items.new('object.move_to_layer', 'M', 'PRESS')
 kmi = km.keymap_items.new('object.delete', 'X', 'PRESS')
 kmi.properties.use_global = False
 kmi = km.keymap_items.new('object.delete', 'X', 'PRESS', shift=True)
index 67fd1fddcac76a49b07556747a904700fd84c531..f542ecf810b7752571acb5a87bd9cffd36764e27 100644 (file)
@@ -384,7 +384,6 @@ kmi = km.keymap_items.new('object.hide_view_clear', 'H', 'PRESS', shift=True, ct
 kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', ctrl=True)
 kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', alt=True)
 kmi.properties.unselected = True
-kmi = km.keymap_items.new('object.move_to_layer', 'M', 'PRESS')
 kmi = km.keymap_items.new('object.delete', 'BACK_SPACE', 'PRESS')
 kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS')
 kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True)
index 0c77ea2ab7e3d41dcede76a5389f1bbb62402e99..d60703236d65d57ae8c804ae9f57c9b3bc18ac7d 100644 (file)
@@ -232,7 +232,7 @@ class CLIP_OT_track_to_empty(Operator):
         ob = None
 
         ob = bpy.data.objects.new(name=track.name, object_data=None)
-        ob.select = True
+        ob.select_set(action='SELECT')
         context.scene.objects.link(ob)
         context.scene.objects.active = ob
 
@@ -506,7 +506,7 @@ object's movement caused by this constraint"""
         # XXX, should probably use context.selected_editable_objects
         # since selected objects can be from a lib or in hidden layer!
         for ob in scene.objects:
-            if ob.select:
+            if ob.select_set(action='SELECT'):
                 self._bake_object(scene, ob)
 
         return {'FINISHED'}
index fe3b00d54cd17f92e3648b5ff75b7d526012716f..43cd3110bebe3a29369043f217cebb61087c8095 100644 (file)
@@ -102,7 +102,7 @@ class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
             m.range_max = max_dist
             return {'FINISHED'}
         # Find selected mesh objects
-        selection = [ob for ob in scene.objects if ob.select and ob.type == 'MESH' and ob.name != ref.name]
+        selection = [ob for ob in scene.objects if ob.select_get() and ob.type == 'MESH' and ob.name != source.name]
         if selection:
             # Compute the min/max distance from the reference to mesh vertices
             min_dist = sys.float_info.max
index 6356da216b1cc8d7f0f88c08c7caa4bed47559ab..be680a6df0c939f684bf9bdc791ebcdabe5c07da 100644 (file)
@@ -81,16 +81,18 @@ class SelectPattern(Operator):
         # Can be pose bones or objects
         for item in items:
             if pattern_match(item.name, self.pattern):
-                item.select = True
 
                 # hrmf, perhaps there should be a utility function for this.
                 if is_ebone:
+                    item.select = True
                     item.select_head = True
                     item.select_tail = True
                     if item.use_connect:
                         item_parent = item.parent
                         if item_parent is not None:
                             item_parent.select_tail = True
+                else:
+                    item.select_set(action='SELECT')
 
         return {'FINISHED'}
 
@@ -136,7 +138,7 @@ class SelectCamera(Operator):
                 bpy.ops.object.select_all(action='DESELECT')
             scene.objects.active = camera
             camera.hide = False
-            camera.select = True
+            camera.select_set(action='SELECT')
             return {'FINISHED'}
 
         return {'CANCELLED'}
@@ -202,7 +204,7 @@ class SelectHierarchy(Operator):
                 bpy.ops.object.select_all(action='DESELECT')
 
             for obj in select_new:
-                obj.select = True
+                obj.select_set(action='SELECT')
 
             scene.objects.active = act_new
             return {'FINISHED'}
@@ -644,8 +646,8 @@ class MakeDupliFace(Operator):
             ob_new.use_dupli_faces_scale = True
             ob_new.dupli_faces_scale = 1.0 / SCALE_FAC
 
-            ob_inst.select = True
-            ob_new.select = True
+            ob_inst.select_set(action='SELECT')
+            ob_new.select_set(action='SELECT')
 
     def execute(self, context):
         self._main(context)
@@ -664,7 +666,7 @@ class IsolateTypeRender(Operator):
 
         for obj in context.visible_objects:
 
-            if obj.select:
+            if obj.select_get():
                 obj.hide_render = False
             else:
                 if obj.type == act_type:
@@ -1029,8 +1031,8 @@ class LodGenerate(Operator):
             for level in ob.lod_levels[1:]:
                 level.object.hide = level.object.hide_render = True
 
-        lod.select = False
-        ob.select = True
+        lod.select_set(action='DESELECT')
+        ob.select_set(action='SELECT')
         scene.objects.active = ob
 
         return {'FINISHED'}
index 750a5b0bf0f8cbbbd5d390ca2f6ea9e10246be2a..cba49c629be01e2aa193073e7758d5be23f1569f 100644 (file)
@@ -63,7 +63,7 @@ class CopyRigidbodySettings(Operator):
         # deselect all but mesh objects
         for o in context.selected_objects:
             if o.type != 'MESH':
-                o.select = False
+                o.select_set(action='DESELECT')
             elif o.rigid_body is None:
                 # Add rigidbody to object!
                 scene.objects.active = o
@@ -125,7 +125,7 @@ class BakeToKeyframes(Operator):
         # filter objects selection
         for obj in context.selected_objects:
             if not obj.rigid_body or obj.rigid_body.type != 'ACTIVE':
-                obj.select = False
+                obj.select_set(action='DESELECT')
 
         objects = context.selected_objects
 
@@ -258,7 +258,7 @@ class ConnectRigidBodies(Operator):
         ob.location = loc
         context.scene.objects.link(ob)
         context.scene.objects.active = ob
-        ob.select = True
+        ob.select_set(action='SELECT')
 
         bpy.ops.rigidbody.constraint_add()
         con_obj = context.active_object
@@ -303,7 +303,7 @@ class ConnectRigidBodies(Operator):
             # restore selection
             bpy.ops.object.select_all(action='DESELECT')
             for obj in objects:
-                obj.select = True
+                obj.select_set(action='SELECT')
             scene.objects.active = obj_act
             return {'FINISHED'}
         else:
index 2389be6787d2dfc5cd7f213918e357b754a147f5..7ce5733c6e2c145e6bcf54f8a4ef644d50120429 100644 (file)
@@ -29,6 +29,7 @@ if "bpy" in locals():
 
 _modules = [
     "properties_animviz",
+    "properties_collection",
     "properties_constraint",
     "properties_data_armature",
     "properties_data_bone",
diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py
new file mode 100644 (file)
index 0000000..1e7bf94
--- /dev/null
@@ -0,0 +1,133 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Panel
+
+
+class CollectionButtonsPanel:
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "collection"
+
+
+class COLLECTION_PT_context_collection(CollectionButtonsPanel, Panel):
+    bl_label = ""
+    bl_options = {'HIDE_HEADER'}
+
+    def draw(self, context):
+        layout = self.layout
+        space = context.space_data
+
+        collection = context.layer_collection
+        name = collection.name
+        if name == 'Master Collection':
+            layout.label(text=name, icon='COLLAPSEMENU')
+        else:
+            layout.prop(collection, "name", text="", icon='COLLAPSEMENU')
+
+
+def template_engine_settings(col, settings, name, use_icon_view=False):
+    icons = {
+            False: 'ZOOMIN',
+            True: 'X',
+            }
+
+    use_name = "{0}_use".format(name)
+    use = getattr(settings, use_name)
+
+    row = col.row()
+    col = row.column()
+    col.active = use
+
+    if use_icon_view:
+        col.template_icon_view(settings, name)
+    else:
+        col.prop(settings, name)
+
+    row.prop(settings, "{}_use".format(name), text="", icon=icons[use], emboss=False)
+
+
+class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel):
+    bl_label = "Render Settings"
+    COMPAT_ENGINES = {'BLENDER_CLAY'}
+
+    @classmethod
+    def poll(cls, context):
+        scene = context.scene
+        return scene and (scene.render.engine in cls.COMPAT_ENGINES)
+
+    def draw(self, context):
+        layout = self.layout
+
+        collection = context.layer_collection
+        settings = collection.get_engine_settings()
+
+        col = layout.column()
+        template_engine_settings(col, settings, "type")
+        template_engine_settings(col, settings, "matcap_icon", use_icon_view=True)
+        template_engine_settings(col, settings, "matcap_rotation")
+        template_engine_settings(col, settings, "matcap_hue")
+        template_engine_settings(col, settings, "matcap_saturation")
+        template_engine_settings(col, settings, "matcap_value")
+        template_engine_settings(col, settings, "ssao_factor_cavity")
+        template_engine_settings(col, settings, "ssao_factor_edge")
+        template_engine_settings(col, settings, "ssao_distance")
+        template_engine_settings(col, settings, "ssao_attenuation")
+
+
+class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel):
+    bl_label = "Object Mode Settings"
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        return ob and (ob.mode == 'OBJECT')
+
+    def draw(self, context):
+        layout = self.layout
+
+        collection = context.layer_collection
+        settings = collection.get_mode_settings('OBJECT')
+
+        col = layout.column()
+        template_engine_settings(col, settings, "show_wire")
+        template_engine_settings(col, settings, "show_backface_culling")
+
+
+class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel):
+    bl_label = "Edit Mode Settings"
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        return ob and (ob.mode == 'EDIT')
+
+    def draw(self, context):
+        layout = self.layout
+
+        collection = context.layer_collection
+        settings = collection.get_mode_settings('EDIT')
+
+        col = layout.column()
+        template_engine_settings(col, settings, "show_occlude_wire")
+
+
+if __name__ == "__main__":  # only for live edit.
+    bpy.utils.register_module(__name__)
index 3ebf2691b4c6c41935b37363d64ec8b8d795d185..54581c9276d83dbb32a8868aa1b48918b7ba2c4c 100644 (file)
@@ -64,6 +64,8 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
 
         split = layout.split(percentage=0.25)
 
+        col = split.column()
+
         split.label(text="Presets:")
         sub = split.row(align=True)
         sub.menu("CLOTH_MT_presets", text=bpy.types.CLOTH_MT_presets.bl_label)
index 6d23c07152e3a39963279f590a8d55d9f2eda847..90d46a6ee47a2b83129efc1f332d98aa5a2fb36b 100644 (file)
@@ -584,5 +584,24 @@ class RENDER_PT_bake(RenderButtonsPanel, Panel):
             sub.prop(rd, "bake_user_scale", text="User Scale")
 
 
+class RENDER_PT_clay(RenderButtonsPanel, Panel):
+    bl_label = "Default Clay"
+    COMPAT_ENGINES = {'BLENDER_CLAY'}
+
+    def draw(self, context):
+        layout = self.layout;
+        settings = context.scene.active_engine_settings
+        layout.template_icon_view(settings, "matcap_icon")
+        layout.prop(settings, "matcap_rotation")
+        layout.prop(settings, "matcap_hue")
+        layout.prop(settings, "matcap_saturation")
+        layout.prop(settings, "matcap_value")
+        layout.prop(settings, "ssao_factor_cavity")
+        layout.prop(settings, "ssao_factor_edge")
+        layout.prop(settings, "ssao_distance")
+        layout.prop(settings, "ssao_attenuation")
+        layout.prop(settings, "ssao_samples")
+
+
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)
index 9b8bc237db96dfdc65434bb46db96fcc78c43ced..2545eadc792db91ce4866ecd57ddd8944e35f79a 100644 (file)
@@ -35,7 +35,7 @@ class RenderLayerButtonsPanel:
 
 class RENDERLAYER_UL_renderlayers(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
-        # assert(isinstance(item, bpy.types.SceneRenderLayer)
+        # assert(isinstance(item, bpy.types.SceneLayer)
         layer = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             layout.prop(layer, "name", text="", icon_value=icon, emboss=False)
@@ -48,7 +48,7 @@ class RENDERLAYER_UL_renderlayers(UIList):
 class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel):
     bl_label = "Layer List"
     bl_options = {'HIDE_HEADER'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'}
 
     def draw(self, context):
         layout = self.layout
@@ -62,7 +62,7 @@ class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel):
 
         row = layout.row()
         col = row.column()
-        col.template_list("RENDERLAYER_UL_renderlayers", "", rd, "layers", rd.layers, "active_index", rows=2)
+        col.template_list("RENDERLAYER_UL_renderlayers", "", scene, "render_layers", scene.render_layers, "active_index", rows=2)
 
         col = row.column()
         sub = col.column(align=True)
@@ -71,103 +71,6 @@ class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel):
         col.prop(rd, "use_single_layer", icon_only=True)
 
 
-class RENDERLAYER_PT_layer_options(RenderLayerButtonsPanel, Panel):
-    bl_label = "Layer"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
-
-    def draw(self, context):
-        layout = self.layout
-
-        scene = context.scene
-        rd = scene.render
-        rl = rd.layers.active
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(scene, "layers", text="Scene")
-        col.label(text="")
-        col.prop(rl, "light_override", text="Lights")
-        col.prop(rl, "material_override", text="Material")
-
-        col = split.column()
-        col.prop(rl, "layers", text="Layer")
-        col.prop(rl, "layers_zmask", text="Mask Layer")
-
-        layout.separator()
-        layout.label(text="Include:")
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(rl, "use_zmask")
-        row = col.row()
-        row.prop(rl, "invert_zmask", text="Negate")
-        row.active = rl.use_zmask
-        col.prop(rl, "use_all_z")
-
-        col = split.column()
-        col.prop(rl, "use_solid")
-        col.prop(rl, "use_halo")
-        col.prop(rl, "use_ztransp")
-
-        col = split.column()
-        col.prop(rl, "use_sky")
-        col.prop(rl, "use_edge_enhance")
-        col.prop(rl, "use_strand")
-        if bpy.app.build_options.freestyle:
-            row = col.row()
-            row.prop(rl, "use_freestyle")
-            row.active = rd.use_freestyle
-
-
-class RENDERLAYER_PT_layer_passes(RenderLayerButtonsPanel, Panel):
-    bl_label = "Passes"
-    bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
-
-    @staticmethod
-    def draw_pass_type_buttons(box, rl, pass_type):
-        # property names
-        use_pass_type = "use_pass_" + pass_type
-        exclude_pass_type = "exclude_" + pass_type
-        # draw pass type buttons
-        row = box.row()
-        row.prop(rl, use_pass_type)
-        row.prop(rl, exclude_pass_type, text="")
-
-    def draw(self, context):
-        layout = self.layout
-
-        scene = context.scene
-        rd = scene.render
-        rl = rd.layers.active
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(rl, "use_pass_combined")
-        col.prop(rl, "use_pass_z")
-        col.prop(rl, "use_pass_vector")
-        col.prop(rl, "use_pass_normal")
-        col.prop(rl, "use_pass_uv")
-        col.prop(rl, "use_pass_mist")
-        col.prop(rl, "use_pass_object_index")
-        col.prop(rl, "use_pass_material_index")
-        col.prop(rl, "use_pass_color")
-
-        col = split.column()
-        col.prop(rl, "use_pass_diffuse")
-        self.draw_pass_type_buttons(col, rl, "specular")
-        self.draw_pass_type_buttons(col, rl, "shadow")
-        self.draw_pass_type_buttons(col, rl, "emit")
-        self.draw_pass_type_buttons(col, rl, "ambient_occlusion")
-        self.draw_pass_type_buttons(col, rl, "environment")
-        self.draw_pass_type_buttons(col, rl, "indirect")
-        self.draw_pass_type_buttons(col, rl, "reflection")
-        self.draw_pass_type_buttons(col, rl, "refraction")
-
-
 class RENDERLAYER_UL_renderviews(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
         # assert(isinstance(item, bpy.types.SceneRenderView)
index 2a085b8aadafc557db20546907b2f15e7893fa6e..fcb301307309ac937fc8ccdd200069cc7cdd90af 100644 (file)
@@ -40,7 +40,7 @@ class INFO_HT_header(Header):
             layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
             layout.separator()
         else:
-            layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
+            layout.template_ID_preview(context.window, "screen", new="screen.new", unlink="screen.delete", rows=2, cols=6)
             layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
 
         layout.separator()
index 6f7c535fe2199c2217f82922500f9cc05d360a55..56b6ea46229cbe6ba56d9d598aad2cc1b0035a8f 100644 (file)
@@ -60,6 +60,15 @@ class OUTLINER_HT_header(Header):
         elif space.display_mode == 'ORPHAN_DATA':
             layout.operator("outliner.orphans_purge")
 
+        elif space.display_mode == 'COLLECTIONS':
+            row = layout.row(align=True)
+
+            row.operator("outliner.collection_new", text="", icon='NEW')
+            row.operator("outliner.collection_override_new", text="", icon='LINK_AREA')
+            row.operator("outliner.collection_link", text="", icon='LINKED')
+            row.operator("outliner.collection_unlink", text="", icon='UNLINKED')
+            row.operator("outliner.collection_delete", text="", icon='X')
+
 
 class OUTLINER_MT_editor_menus(Menu):
     bl_idname = "OUTLINER_MT_editor_menus"
index b6479df3047049c235257388d2ffea3bc754f109..cba7502dd96346163b8b015fcb6d9755a0cc4eb9 100644 (file)
@@ -634,7 +634,6 @@ class VIEW3D_MT_select_object(Menu):
         layout.operator("object.select_all", text="Inverse").action = 'INVERT'
         layout.operator("object.select_random", text="Random")
         layout.operator("object.select_mirror", text="Mirror")
-        layout.operator("object.select_by_layer", text="Select All by Layer")
         layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
         layout.operator("object.select_camera", text="Select Camera")
 
@@ -710,7 +709,6 @@ class VIEW3D_MT_select_particle(Menu):
         layout = self.layout
 
         layout.operator("view3d.select_border")
-        layout.operator("view3d.select_circle")
 
         layout.separator()
 
@@ -1312,15 +1310,6 @@ class VIEW3D_MT_object(Menu):
 
         layout.separator()
 
-        if is_local_view:
-            layout.operator_context = 'EXEC_REGION_WIN'
-            layout.operator("object.move_to_layer", text="Move out of Local View")
-            layout.operator_context = 'INVOKE_REGION_WIN'
-        else:
-            layout.operator("object.move_to_layer", text="Move to Layer...")
-
-        layout.menu("VIEW3D_MT_object_showhide")
-
         layout.operator_menu_enum("object.convert", "target")
 
 
@@ -1598,17 +1587,6 @@ class VIEW3D_MT_object_quick_effects(Menu):
         layout.operator("object.quick_fluid")
 
 
-class VIEW3D_MT_object_showhide(Menu):
-    bl_label = "Show/Hide"
-
-    def draw(self, context):
-        layout = self.layout
-
-        layout.operator("object.hide_view_clear", text="Show Hidden")
-        layout.operator("object.hide_view_set", text="Hide Selected").unselected = False
-        layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
-
-
 class VIEW3D_MT_make_single_user(Menu):
     bl_label = "Make Single User"
 
@@ -3133,6 +3111,47 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu):
 # ********** Panel **********
 
 
+class VIEW3D_PT_viewport_debug(Panel):
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'UI'
+    bl_label = "Modern Viewport"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        view = context.space_data
+        return (view)
+
+    def draw_header(self, context):
+        view = context.space_data
+        self.layout.prop(view, "use_modern_viewport", text="")
+
+    def draw(self, context):
+        layout = self.layout
+        view = context.space_data
+
+        layout.active = view.use_modern_viewport
+
+        col = layout.column()
+        col.label(text="Placeholder for debugging options")
+        col.separator()
+
+        row = col.row()
+        row.active = not view.show_combined_depth
+        row.prop(view, "show_scene_depth")
+        row = col.row()
+        row.active = not view.show_scene_depth
+        row.prop(view, "show_combined_depth")
+
+        row = col.row(align=True)
+        row.active = view.show_scene_depth or view.show_combined_depth
+        row.prop(view, "debug_near")
+        row.prop(view, "debug_far")
+
+        col.label(text="Background:")
+        col.row(align=True).prop(view, "debug_background", expand=True)
+
+
 class VIEW3D_PT_grease_pencil(GreasePencilDataPanel, Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
@@ -3246,7 +3265,7 @@ class VIEW3D_PT_view3d_display(Panel):
     @classmethod
     def poll(cls, context):
         view = context.space_data
-        return (view)
+        return (view) and not view.use_modern_viewport
 
     def draw(self, context):
         layout = self.layout
@@ -3346,6 +3365,11 @@ class VIEW3D_PT_view3d_shading(Panel):
     bl_region_type = 'UI'
     bl_label = "Shading"
 
+    @classmethod
+    def poll(cls, context):
+        view = context.space_data
+        return (view) and not view.use_modern_viewport
+
     def draw(self, context):
         layout = self.layout
 
index 6c77c5d6a1ab599522f2dd7e4a7fb40a7b2e8342..8de7a5e290397f8e829e6dd127ed5562f6dab19f 100644 (file)
@@ -18,7 +18,7 @@ bpy.ops.object.select_all(action='DESELECT')
 
 for obj in selection:
 
-    obj.select = True
+    obj.select_set(action='SELECT')
 
     # some exporters only use the active object
     scene.objects.active = obj
@@ -31,7 +31,7 @@ for obj in selection:
     ## Can be used for multiple formats
     # bpy.ops.export_scene.x3d(filepath=fn + ".x3d", use_selection=True)
 
-    obj.select = False
+    obj.select_set(action='DESELECT')
 
     print("written:", fn)
 
@@ -39,4 +39,4 @@ for obj in selection:
 scene.objects.active = obj_active
 
 for obj in selection:
-    obj.select = True
+    obj.select_set(action='SELECT')
index c4d661b4c1f819a63d29cf45626957c267107d72..e3b63813fc4a749a4032e670c0fd0a4e27ad1573 100644 (file)
@@ -67,7 +67,7 @@ def main(context, event):
     # now we have the object under the mouse cursor,
     # we could do lots of stuff but for the example just select.
     if best_obj is not None:
-        best_obj.select = True
+        best_obj.select_set(action='SELECT')
         context.scene.objects.active = best_obj
 
 
index 6f2b78e084529a69af4bef6dc81f39a06ed00e40..47ebed8f791ad2bbbf872368d3afc92af60b4334 100644 (file)
@@ -100,6 +100,7 @@ add_subdirectory(windowmanager)
 add_subdirectory(blenkernel)
 add_subdirectory(blenlib)
 add_subdirectory(bmesh)
+add_subdirectory(draw)
 add_subdirectory(render)
 add_subdirectory(blenfont)
 add_subdirectory(blentranslation)
index 90a99469389acb2cbcb1cd1ab36e5567e587f8cb..45c31279b50bf9fcb7c30977938bbbe2d061d28f 100644 (file)
@@ -123,19 +123,19 @@ static bool object_is_shape(Object *ob)
        }
 }
 
-static bool export_object(const ExportSettings * const settings, Object *ob)
+static bool export_object(const ExportSettings * const settings, const Base * const ob_base)
 {
-       if (settings->selected_only && !parent_selected(ob)) {
+       if (settings->selected_only && !object_selected(ob_base)) {
                return false;
        }
-
-       if (settings->visible_layers_only && !(settings->scene->lay & ob->lay)) {
+       // FIXME Sybren: handle these cleanly (maybe just remove code), now using active scene layer instead.
+       if (settings->visible_layers_only && (ob_base->flag & BASE_VISIBLED) == 0) {
                return false;
        }
 
-       if (settings->renderable_only && (ob->restrictflag & OB_RESTRICT_RENDER)) {
-               return false;
-       }
+       //      if (settings->renderable_only && (ob->restrictflag & OB_RESTRICT_RENDER)) {
+       //              return false;
+       //      }
 
        return true;
 }
@@ -341,12 +341,10 @@ void AbcExporter::operator()(Main *bmain, float &progress, bool &was_canceled)
 
 void AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx)
 {
-       Base *base = static_cast<Base *>(m_scene->base.first);
-
-       while (base) {
+       for(Base *base = static_cast<Base *>(m_settings.sl->object_bases.first); base; base = base->next) {
                Object *ob = base->object;
 
-               if (export_object(&m_settings, ob)) {
+               if (export_object(&m_settings, base)) {
                        switch(ob->type) {
                                case OB_LAMP:
                                case OB_LATTICE:
@@ -356,53 +354,49 @@ void AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx)
                                        break;
 
                                default:
-                                       exploreTransform(eval_ctx, ob, ob->parent, NULL);
+                                       exploreTransform(eval_ctx, base, ob->parent, NULL);
                        }
                }
-
-               base = base->next;
        }
 }
 
 void AbcExporter::createTransformWritersFlat()
 {
-       Base *base = static_cast<Base *>(m_scene->base.first);
-
-       while (base) {
+       for(Base *base = static_cast<Base *>(m_settings.sl->object_bases.first); base; base = base->next) {
                Object *ob = base->object;
 
-               if (export_object(&m_settings, ob) && object_is_shape(ob)) {
+               if (!export_object(&m_settings, base)) {
                        std::string name = get_id_name(ob);
                        m_xforms[name] = new AbcTransformWriter(ob, m_writer->archive().getTop(), 0, m_trans_sampling_index, m_settings);
                }
-
-               base = base->next;
        }
 }
 
-void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Object *ob, Object *parent, Object *dupliObParent)
+void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Base *ob_base, Object *parent, Object *dupliObParent)
 {
+       Object *ob = ob_base->object;
 
-       if (export_object(&m_settings, ob) && object_is_shape(ob)) {
+       if (export_object(&m_settings, ob_base) && object_is_shape(ob)) {
                createTransformWriter(ob, parent, dupliObParent);
        }
 
        ListBase *lb = object_duplilist(eval_ctx, m_scene, ob);
 
        if (lb) {
-               DupliObject *link = static_cast<DupliObject *>(lb->first);
-               Object *dupli_ob = NULL;
-               Object *dupli_parent = NULL;
-               
-               while (link) {
+               Base fake_base = *ob_base;  // copy flags (like selection state) from the real object.
+               fake_base.next = fake_base.prev = NULL;
+
+               for (DupliObject *link = static_cast<DupliObject *>(lb->first); link; link = link->next) {
+                       Object *dupli_ob = NULL;
+                       Object *dupli_parent = NULL;
+
                        if (link->type == OB_DUPLIGROUP) {
                                dupli_ob = link->ob;
                                dupli_parent = (dupli_ob->parent) ? dupli_ob->parent : ob;
 
-                               exploreTransform(eval_ctx, dupli_ob, dupli_parent, ob);
+                               fake_base.object = dupli_ob;
+                               exploreTransform(eval_ctx, &fake_base, dupli_parent, ob);
                        }
-
-                       link = link->next;
                }
        }
 
@@ -460,44 +454,42 @@ void AbcExporter::createTransformWriter(Object *ob, Object *parent, Object *dupl
 
 void AbcExporter::createShapeWriters(EvaluationContext *eval_ctx)
 {
-       Base *base = static_cast<Base *>(m_scene->base.first);
-
-       while (base) {
-               Object *ob = base->object;
-               exploreObject(eval_ctx, ob, NULL);
-
-               base = base->next;
+       for(Base *base = static_cast<Base *>(m_settings.sl->object_bases.first); base; base = base->next) {
+               exploreObject(eval_ctx, base, NULL);
        }
 }
 
-void AbcExporter::exploreObject(EvaluationContext *eval_ctx, Object *ob, Object *dupliObParent)
+void AbcExporter::exploreObject(EvaluationContext *eval_ctx, Base *ob_base, Object *dupliObParent)
 {
+       Object *ob = ob_base->object;
        ListBase *lb = object_duplilist(eval_ctx, m_scene, ob);
        
-       createShapeWriter(ob, dupliObParent);
+       createShapeWriter(ob_base, dupliObParent);
        
        if (lb) {
-               DupliObject *dupliob = static_cast<DupliObject *>(lb->first);
+               Base fake_base = *ob_base;  // copy flags (like selection state) from the real object.
+               fake_base.next = fake_base.prev = NULL;
 
-               while (dupliob) {
+               for (DupliObject *dupliob = static_cast<DupliObject *>(lb->first); dupliob; dupliob = dupliob->next) {
                        if (dupliob->type == OB_DUPLIGROUP) {
-                               exploreObject(eval_ctx, dupliob->ob, ob);
+                               fake_base.object = dupliob->ob;
+                               exploreObject(eval_ctx, &fake_base, ob);
                        }
-
-                       dupliob = dupliob->next;
                }
        }
 
        free_object_duplilist(lb);
 }
 
-void AbcExporter::createShapeWriter(Object *ob, Object *dupliObParent)
+void AbcExporter::createShapeWriter(Base *ob_base, Object *dupliObParent)
 {
+       Object *ob = ob_base->object;
+
        if (!object_is_shape(ob)) {
                return;
        }
 
-       if (!export_object(&m_settings, ob)) {
+       if (!export_object(&m_settings, ob_base)) {
                return;
        }
 
index b0eb8e185d6766b3682e82e3cf22a1839bb28c93..80fee067c04301806fe45859a915adf738984d97 100644 (file)
@@ -36,11 +36,14 @@ struct EvaluationContext;
 struct Main;
 struct Object;
 struct Scene;
+struct SceneLayer;
+struct Base;
 
 struct ExportSettings {
        ExportSettings();
 
        Scene *scene;
+       SceneLayer *sl;  // Scene layer to export; all its objects will be exported, unless selected_only=true
 
        bool selected_only;
        bool visible_layers_only;
@@ -105,10 +108,10 @@ private:
        void createTransformWritersHierarchy(EvaluationContext *eval_ctx);
        void createTransformWritersFlat();
        void createTransformWriter(Object *ob,  Object *parent, Object *dupliObParent);
-       void exploreTransform(EvaluationContext *eval_ctx, Object *ob, Object *parent, Object *dupliObParent = NULL);
-       void exploreObject(EvaluationContext *eval_ctx, Object *ob, Object *dupliObParent);
+       void exploreTransform(EvaluationContext *eval_ctx, Base *ob_base, Object *parent, Object *dupliObParent);
+       void exploreObject(EvaluationContext *eval_ctx, Base *ob_base, Object *dupliObParent);
        void createShapeWriters(EvaluationContext *eval_ctx);
-       void createShapeWriter(Object *ob, Object *dupliObParent);
+       void createShapeWriter(Base *ob_base, Object *dupliObParent);
 
        AbcTransformWriter *getXForm(const std::string &name);
 
index 08c94f437e6d7764ed2930653780a4c660d73957..bb375eb956156c876fdf7493911b3f47d90c7609 100644 (file)
@@ -35,6 +35,7 @@
 
 extern "C" {
 #include "DNA_object_types.h"
+#include "DNA_layer_types.h"
 
 #include "BLI_math.h"
 }
@@ -58,6 +59,16 @@ std::string get_id_name(ID *id)
        return name;
 }
 
+
+/**
+ * @brief get_object_dag_path_name returns the name under which the object
+ *  will be exported in the Alembic file. It is of the form
+ *  "[../grandparent/]parent/object" if dupli_parent is NULL, or
+ *  "dupli_parent/[../grandparent/]parent/object" otherwise.
+ * @param ob
+ * @param dupli_parent
+ * @return
+ */
 std::string get_object_dag_path_name(Object *ob, Object *dupli_parent)
 {
        std::string name = get_id_name(ob);
@@ -76,31 +87,9 @@ std::string get_object_dag_path_name(Object *ob, Object *dupli_parent)
        return name;
 }
 
-bool object_selected(Object *ob)
+bool object_selected(const Base * const ob_base)
 {
-       return ob->flag & SELECT;
-}
-
-bool parent_selected(Object *ob)
-{
-       if (object_selected(ob)) {
-               return true;
-       }
-
-       bool do_export = false;
-
-       Object *parent = ob->parent;
-
-       while (parent != NULL) {
-               if (object_selected(parent)) {
-                       do_export = true;
-                       break;
-               }
-
-               parent = parent->parent;
-       }
-
-       return do_export;
+       return ob_base->flag & SELECT;
 }
 
 Imath::M44d convert_matrix(float mat[4][4])
index a7ac9df91c7bdef0dec732ab0671fe76d71d4e71..328f2c41a8788ec2245f8bc5537a53ccbb019337 100644 (file)
@@ -43,13 +43,13 @@ struct ImportSettings;
 
 struct ID;
 struct Object;
+struct Base;
 
 std::string get_id_name(ID *id);
 std::string get_id_name(Object *ob);
 std::string get_object_dag_path_name(Object *ob, Object *dupli_parent);
 
-bool object_selected(Object *ob);
-bool parent_selected(Object *ob);
+bool object_selected(const Base * const ob_base);
 
 Imath::M44d convert_matrix(float mat[4][4]);
 void create_transform_matrix(float r_mat[4][4]);
index d8d017119b174437bb29efa3dbc30c141f5afa9c..fcfe634924f7f43d17d467cf9f4cb518dd722125 100644 (file)
@@ -332,21 +332,37 @@ void ABC_export(
        BLI_strncpy(job->filename, filepath, 1024);
 
        job->settings.scene = job->scene;
+
+       /* Sybren: for now we only export the active scene layer.
+        * Later in the 2.8 development process this may be replaced by using
+        * a specific collection for Alembic I/O, which can then be toggled
+        * between "real" objects and cached Alembic files. */
+       job->settings.sl = CTX_data_scene_layer(C);
+
        job->settings.frame_start = params->frame_start;
        job->settings.frame_end = params->frame_end;
        job->settings.frame_step_xform = params->frame_step_xform;
        job->settings.frame_step_shape = params->frame_step_shape;
        job->settings.shutter_open = params->shutter_open;
        job->settings.shutter_close = params->shutter_close;
+
+       /* Sybren: For now this is ignored, until we can get selection
+        * detection working through Base pointers (instead of ob->flags). */
        job->settings.selected_only = params->selected_only;
+
        job->settings.export_face_sets = params->face_sets;
        job->settings.export_normals = params->normals;
        job->settings.export_uvs = params->uvs;
        job->settings.export_vcols = params->vcolors;
        job->settings.apply_subdiv = params->apply_subdiv;
        job->settings.flatten_hierarchy = params->flatten_hierarchy;
+
+       /* Sybren: visible_layer & renderable only is ignored for now,
+        * to be replaced with collections later in the 2.8 dev process
+        * (also see note above). */
        job->settings.visible_layers_only = params->visible_layers_only;
        job->settings.renderable_only = params->renderable_only;
+
        job->settings.use_subdiv_schema = params->use_subdiv_schema;
        job->settings.export_ogawa = (params->compression_type == ABC_ARCHIVE_OGAWA);
        job->settings.pack_uv = params->packuv;
index 1f38d64924c88af54961c7141a70176506802993..1b967f889c03dcde5d925f08741ffd0be518875e 100644 (file)
@@ -34,6 +34,9 @@
 
 #include "BLI_compiler_attrs.h"
 
+/* enable this only if needed (unused circa 2016) */
+#define BLF_BLUR_ENABLE 0
+
 struct rctf;
 struct ColorManagedDisplay;
 struct ResultBLF;
@@ -42,6 +45,7 @@ int BLF_init(int points, int dpi);
 void BLF_exit(void);
 void BLF_default_dpi(int dpi);
 void BLF_default_set(int fontid);
+int BLF_default(void); /* get default font ID so we can pass it to other functions */
 
 void BLF_cache_clear(void);
 
@@ -61,6 +65,17 @@ void BLF_aspect(int fontid, float x, float y, float z);
 void BLF_position(int fontid, float x, float y, float z);
 void BLF_size(int fontid, int size, int dpi);
 
+/* goal: small but useful color API */
+void BLF_color4ubv(int fontid, const unsigned char rgba[4]);
+void BLF_color3ubv(int fontid, const unsigned char rgb[3]);
+void BLF_color3ubv_alpha(int fontid, const unsigned char rgb[3], unsigned char alpha);
+void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b);
+void BLF_color4f(int fontid, float r, float g, float b, float a);
+void BLF_color4fv(int fontid, const float rgba[4]);
+void BLF_color3f(int fontid, float r, float g, float b);
+void BLF_color3fv_alpha(int fontid, const float rgb[3], float alpha);
+/* also available: UI_FontThemeColor(fontid, colorid) */
+
 /* Set a 4x4 matrix to be multiplied before draw the text.
  * Remember that you need call BLF_enable(BLF_MATRIX)
  * to enable this.
@@ -122,29 +137,16 @@ void BLF_width_and_height(int fontid, const char *str, size_t len, float *r_widt
  */
 float BLF_fixed_width(int fontid) ATTR_WARN_UNUSED_RESULT;
 
-/* and this two function return the width and height
- * of the string, using the default font and both value
- * are multiplied by the aspect of the font.
- */
-void  BLF_width_and_height_default(const char *str, size_t len, float *r_width, float *r_height) ATTR_NONNULL();
-float BLF_width_default(const char *str, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-float BLF_height_default(const char *str, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-
-/* Set rotation for default font. */
-void BLF_rotation_default(float angle);
-
-/* Enable/disable options to the default font. */
-void BLF_enable_default(int option);
-void BLF_disable_default(int option);
-
 /* By default, rotation and clipping are disable and
  * have to be enable/disable using BLF_enable/disable.
  */
 void BLF_rotation(int fontid, float angle);
 void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax);
-void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax);
 void BLF_wordwrap(int fontid, int wrap_width);
+
+#if BLF_BLUR_ENABLE
 void BLF_blur(int fontid, int size);
+#endif
 
 void BLF_enable(int fontid, int option);
 void BLF_disable(int fontid, int option);
index 132a0ec38086178cecf6394dbb4ca260b1ec820b..ab7c831f95c50c128186865f3a4fe8f899bf67df 100644 (file)
 #include "BLI_math.h"
 #include "BLI_threads.h"
 
-#include "BIF_gl.h"
 #include "BLF_api.h"
 
 #include "IMB_colormanagement.h"
 
 #ifndef BLF_STANDALONE
-#include "GPU_basic_shader.h"
+#include "GPU_shader.h"
+#include "GPU_matrix.h"
+#include "GPU_immediate.h"
 #endif
 
 #include "blf_internal_types.h"
@@ -174,6 +175,12 @@ void BLF_default_set(int fontid)
        }
 }
 
+int BLF_default(void)
+{
+       ASSERT_DEFAULT_SET;
+       return global_font_default;
+}
+
 int BLF_load(const char *name)
 {
        FontBLF *font;
@@ -357,24 +364,6 @@ void BLF_disable(int fontid, int option)
        }
 }
 
-void BLF_enable_default(int option)
-{
-       FontBLF *font = blf_get(global_font_default);
-
-       if (font) {
-               font->flags |= option;
-       }
-}
-
-void BLF_disable_default(int option)
-{
-       FontBLF *font = blf_get(global_font_default);
-
-       if (font) {
-               font->flags &= ~option;
-       }
-}
-
 void BLF_aspect(int fontid, float x, float y, float z)
 {
        FontBLF *font = blf_get(fontid);
@@ -453,6 +442,7 @@ void BLF_size(int fontid, int size, int dpi)
        }
 }
 
+#if BLF_BLUR_ENABLE
 void BLF_blur(int fontid, int size)
 {
        FontBLF *font = blf_get(fontid);
@@ -461,6 +451,77 @@ void BLF_blur(int fontid, int size)
                font->blur = size;
        }
 }
+#endif
+
+void BLF_color4ubv(int fontid, const unsigned char rgba[4])
+{
+       FontBLF *font = blf_get(fontid);
+
+       if (font) {
+               font->color[0] = rgba[0];
+               font->color[1] = rgba[1];
+               font->color[2] = rgba[2];
+               font->color[3] = rgba[3];
+       }
+}
+
+void BLF_color3ubv_alpha(int fontid, const unsigned char rgb[3], unsigned char alpha)
+{
+       FontBLF *font = blf_get(fontid);
+
+       if (font) {
+               font->color[0] = rgb[0];
+               font->color[1] = rgb[1];
+               font->color[2] = rgb[2];
+               font->color[3] = alpha;
+       }
+}
+
+void BLF_color3ubv(int fontid, const unsigned char rgb[3])
+{
+       BLF_color3ubv_alpha(fontid, rgb, 255);
+}
+
+void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
+{
+       FontBLF *font = blf_get(fontid);
+
+       if (font) {
+               font->color[0] = r;
+               font->color[1] = g;
+               font->color[2] = b;
+               font->color[3] = 255;
+       }
+}
+
+void BLF_color4fv(int fontid, const float rgba[4])
+{
+       FontBLF *font = blf_get(fontid);
+
+       if (font) {
+               rgba_float_to_uchar(font->color, rgba);
+       }
+}
+
+void BLF_color4f(int fontid, float r, float g, float b, float a)
+{
+       float rgba[4] = { r, g, b, a };
+       BLF_color4fv(fontid, rgba);
+}
+
+void BLF_color3fv_alpha(int fontid, const float rgb[3], float alpha)
+{
+       float rgba[4];
+       copy_v3_v3(rgba, rgb);
+       rgba[3] = alpha;
+       BLF_color4fv(fontid, rgba);
+}
+
+void BLF_color3f(int fontid, float r, float g, float b)
+{
+       float rgba[4] = { r, g, b, 1.0f };
+       BLF_color4fv(fontid, rgba);
+}
 
 void BLF_draw_default(float x, float y, float z, const char *str, size_t len)
 {
@@ -481,16 +542,7 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l
        BLF_draw_ascii(global_font_default, str, len); /* XXX, use real length */
 }
 
-void BLF_rotation_default(float angle)
-{
-       FontBLF *font = blf_get(global_font_default);
-
-       if (font) {
-               font->angle = angle;
-       }
-}
-
-static void blf_draw_gl__start(FontBLF *font, GLint *mode)
+static void blf_draw_gl__start(FontBLF *font)
 {
        /*
         * The pixmap alignment hack is handle
@@ -500,52 +552,44 @@ static void blf_draw_gl__start(FontBLF *font, GLint *mode)
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
-#ifndef BLF_STANDALONE
-       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
-#endif
-
-       /* Save the current matrix mode. */
-       glGetIntegerv(GL_MATRIX_MODE, mode);
-
-       glMatrixMode(GL_TEXTURE);
-       glPushMatrix();
-       glLoadIdentity();
-
-       glMatrixMode(GL_MODELVIEW);
-       glPushMatrix();
+       gpuMatrixBegin3D_legacy();
 
        if (font->flags & BLF_MATRIX)
-               glMultMatrixf(font->m);
+               gpuMultMatrix3D((float (*)[4])font->m);
 
-       glTranslate3fv(font->pos);
+       gpuTranslate3fv(font->pos);
 
        if (font->flags & BLF_ASPECT)
-               glScalef(font->aspect[0], font->aspect[1], font->aspect[2]);
+               gpuScale3fv(font->aspect);
 
        if (font->flags & BLF_ROTATION)  /* radians -> degrees */
-               glRotatef(font->angle * (float)(180.0 / M_PI), 0.0f, 0.0f, 1.0f);
+               gpuRotateAxis(RAD2DEG(font->angle), 'Z');
 
-       if (font->shadow || font->blur)
-               glGetFloatv(GL_CURRENT_COLOR, font->orig_col);
+#ifndef BLF_STANDALONE
+       VertexFormat *format = immVertexFormat();
+       unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+       unsigned texCoord = add_attrib(format, "texCoord", GL_FLOAT, 2, KEEP_FLOAT);
+       unsigned color = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT);
+
+       BLI_assert(pos == BLF_POS_ID);
+       BLI_assert(texCoord == BLF_COORD_ID);
+       BLI_assert(color == BLF_COLOR_ID);
+
+       immBindBuiltinProgram(GPU_SHADER_TEXT);
+#endif
 
        /* always bind the texture for the first glyph */
        font->tex_bind_state = -1;
 }
 
-static void blf_draw_gl__end(GLint mode)
+static void blf_draw_gl__end(void)
 {
-       glMatrixMode(GL_TEXTURE);
-       glPopMatrix();
-
-       glMatrixMode(GL_MODELVIEW);
-       glPopMatrix();
-
-       if (mode != GL_MODELVIEW)
-               glMatrixMode(mode);
+       gpuMatrixEnd();
 
 #ifndef BLF_STANDALONE
-       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
+       immUnbindProgram();
 #endif
+
        glDisable(GL_BLEND);
 }
 
@@ -554,23 +598,26 @@ void BLF_draw_ex(
         struct ResultBLF *r_info)
 {
        FontBLF *font = blf_get(fontid);
-       GLint mode;
 
        BLF_RESULT_CHECK_INIT(r_info);
 
        if (font && font->glyph_cache) {
-               blf_draw_gl__start(font, &mode);
+               blf_draw_gl__start(font);
                if (font->flags & BLF_WORD_WRAP) {
                        blf_font_draw__wrap(font, str, len, r_info);
                }
                else {
                        blf_font_draw(font, str, len, r_info);
                }
-               blf_draw_gl__end(mode);
+               blf_draw_gl__end();
        }
 }
 void BLF_draw(int fontid, const char *str, size_t len)
 {
+       if (len == 0 || str[0] == '\0') {
+               return;
+       }
+
        BLF_draw_ex(fontid, str, len, NULL);
 }
 
@@ -579,12 +626,11 @@ void BLF_draw_ascii_ex(
         struct ResultBLF *r_info)
 {
        FontBLF *font = blf_get(fontid);
-       GLint mode;
 
        BLF_RESULT_CHECK_INIT(r_info);
 
        if (font && font->glyph_cache) {
-               blf_draw_gl__start(font, &mode);
+               blf_draw_gl__start(font);
                if (font->flags & BLF_WORD_WRAP) {
                        /* use non-ascii draw function for word-wrap */
                        blf_font_draw__wrap(font, str, len, r_info);
@@ -592,24 +638,31 @@ void BLF_draw_ascii_ex(
                else {
                        blf_font_draw_ascii(font, str, len, r_info);
                }
-               blf_draw_gl__end(mode);
+               blf_draw_gl__end();
        }
 }
 void BLF_draw_ascii(int fontid, const char *str, size_t len)
 {
+       if (len == 0 || str[0] == '\0') {
+               return;
+       }
+
        BLF_draw_ascii_ex(fontid, str, len, NULL);
 }
 
 int BLF_draw_mono(int fontid, const char *str, size_t len, int cwidth)
 {
+       if (len == 0 || str[0] == '\0') {
+               return 0;
+       }
+
        FontBLF *font = blf_get(fontid);
-       GLint mode;
        int columns = 0;
 
        if (font && font->glyph_cache) {
-               blf_draw_gl__start(font, &mode);
+               blf_draw_gl__start(font);
                columns = blf_font_draw_mono(font, str, len, cwidth);
-               blf_draw_gl__end(mode);
+               blf_draw_gl__end();
        }
 
        return columns;
@@ -689,14 +742,6 @@ void BLF_width_and_height(int fontid, const char *str, size_t len, float *r_widt
        }
 }
 
-void BLF_width_and_height_default(const char *str, size_t len, float *r_width, float *r_height)
-{
-       ASSERT_DEFAULT_SET;
-
-       BLF_size(global_font_default, global_font_points, global_font_dpi);
-       BLF_width_and_height(global_font_default, str, len, r_width, r_height);
-}
-
 float BLF_width_ex(
         int fontid, const char *str, size_t len,
         struct ResultBLF *r_info)
@@ -727,14 +772,6 @@ float BLF_fixed_width(int fontid)
        return 0.0f;
 }
 
-float BLF_width_default(const char *str, size_t len)
-{
-       ASSERT_DEFAULT_SET;
-
-       BLF_size(global_font_default, global_font_points, global_font_dpi);
-       return BLF_width(global_font_default, str, len);
-}
-
 float BLF_height_ex(
         int fontid, const char *str, size_t len,
         struct ResultBLF *r_info)
@@ -798,15 +835,6 @@ float BLF_ascender(int fontid)
        return 0.0f;
 }
 
-float BLF_height_default(const char *str, size_t len)
-{
-       ASSERT_DEFAULT_SET;
-
-       BLF_size(global_font_default, global_font_points, global_font_dpi);
-
-       return BLF_height(global_font_default, str, len);
-}
-
 void BLF_rotation(int fontid, float angle)
 {
        FontBLF *font = blf_get(fontid);
@@ -828,18 +856,6 @@ void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax)
        }
 }
 
-void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax)
-{
-       FontBLF *font = blf_get(global_font_default);
-
-       if (font) {
-               font->clip_rec.xmin = xmin;
-               font->clip_rec.ymin = ymin;
-               font->clip_rec.xmax = xmax;
-               font->clip_rec.ymax = ymax;
-       }
-}
-
 void BLF_wordwrap(int fontid, int wrap_width)
 {
        FontBLF *font = blf_get(fontid);
@@ -855,7 +871,7 @@ void BLF_shadow(int fontid, int level, const float rgba[4])
 
        if (font) {
                font->shadow = level;
-               copy_v4_v4(font->shadow_col, rgba);
+               rgba_float_to_uchar(font->shadow_color, rgba);
        }
 }
 
index 44a1d08f1fdb642334b33e545eac1ebde9ec4647..d0293eccf3ad2543ef7f38d006c90f3d48db07fe 100644 (file)
@@ -58,6 +58,8 @@
 #include "BIF_gl.h"
 #include "BLF_api.h"
 
+#include "GPU_immediate.h"
+
 #include "blf_internal_types.h"
 #include "blf_internal.h"
 
@@ -172,6 +174,23 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
        }                                                                            \
 } (void)0
 
+static unsigned verts_needed(const FontBLF *font, const char *str, size_t len)
+{
+       unsigned length = (unsigned)((len == INT_MAX) ? strlen(str) : len);
+       unsigned quad_ct = 1;
+
+       if (font->flags & BLF_SHADOW) {
+               if (font->shadow == 0)
+                       quad_ct += 1;
+               if (font->shadow <= 4)
+                       quad_ct += 9; /* 3x3 kernel */
+               else
+                       quad_ct += 25; /* 5x5 kernel */
+       }
+
+       return length * quad_ct * 4;
+}
+
 static void blf_font_draw_ex(
         FontBLF *font, const char *str, size_t len, struct ResultBLF *r_info,
         int pen_y)
@@ -187,6 +206,9 @@ static void blf_font_draw_ex(
 
        blf_font_ensure_ascii_table(font);
 
+       immBeginAtMost(GL_QUADS, verts_needed(font, str, len));
+       /* at most because some glyphs might be clipped & not drawn */
+
        while ((i < len) && str[i]) {
                BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
 
@@ -204,6 +226,8 @@ static void blf_font_draw_ex(
                g_prev = g;
        }
 
+       immEnd();
+
        if (r_info) {
                r_info->lines = 1;
                r_info->width = pen_x;
@@ -229,6 +253,8 @@ static void blf_font_draw_ascii_ex(
 
        blf_font_ensure_ascii_table(font);
 
+       immBeginAtMost(GL_QUADS, verts_needed(font, str, len));
+
        while ((c = *(str++)) && len--) {
                BLI_assert(c < 128);
                if ((g = glyph_ascii_table[c]) == NULL)
@@ -243,6 +269,8 @@ static void blf_font_draw_ascii_ex(
                g_prev = g;
        }
 
+       immEnd();
+
        if (r_info) {
                r_info->lines = 1;
                r_info->width = pen_x;
@@ -265,6 +293,8 @@ int blf_font_draw_mono(FontBLF *font, const char *str, size_t len, int cwidth)
 
        blf_font_ensure_ascii_table(font);
 
+       immBeginAtMost(GL_QUADS, verts_needed(font, str, len));
+
        while ((i < len) && str[i]) {
                BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
 
@@ -284,6 +314,8 @@ int blf_font_draw_mono(FontBLF *font, const char *str, size_t len, int cwidth)
                pen_x += cwidth * col;
        }
 
+       immEnd();
+
        return columns;
 }
 
@@ -901,8 +933,6 @@ void blf_font_free(FontBLF *font)
 
 static void blf_font_fill(FontBLF *font)
 {
-       unsigned int i;
-
        font->aspect[0] = 1.0f;
        font->aspect[1] = 1.0f;
        font->aspect[2] = 1.0f;
@@ -910,9 +940,15 @@ static void blf_font_fill(FontBLF *font)
        font->pos[1] = 0.0f;
        font->angle = 0.0f;
 
-       for (i = 0; i < 16; i++)
+       for (int i = 0; i < 16; i++)
                font->m[i] = 0;
 
+       /* annoying bright color so we can see where to add BLF_color calls */
+       font->color[0] = 255;
+       font->color[1] = 255;
+       font->color[2] = 0;
+       font->color[3] = 255;
+
        font->clip_rec.xmin = 0.0f;
        font->clip_rec.xmax = 0.0f;
        font->clip_rec.ymin = 0.0f;
@@ -922,7 +958,9 @@ static void blf_font_fill(FontBLF *font)
        font->size = 0;
        BLI_listbase_clear(&font->cache);
        font->glyph_cache = NULL;
+#if BLF_BLUR_ENABLE
        font->blur = 0;
+#endif
        font->max_tex_size = -1;
 
        font->buf_info.fbuf = NULL;
index aa7d539538b0249c71c1656c0280414e8efa2628..b1bab13f3ae23b66a61c8e611e2ac1556cb52219 100644 (file)
@@ -56,7 +56,7 @@
 #include "BLF_api.h"
 
 #ifndef BLF_STANDALONE
-#include "GPU_basic_shader.h"
+#include "GPU_immediate.h"
 #endif
 
 #include "blf_internal_types.h"
@@ -182,17 +182,6 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-
-#ifndef BLF_STANDALONE
-       /* needed since basic shader doesn't support alpha-only textures,
-        * while we could add support this is only used in a few places
-        * (an alternative could be to have a simple shader for BLF). */
-       if (GLEW_ARB_texture_swizzle && GPU_basic_shader_use_glsl_get()) {
-               GLint swizzle_mask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
-               glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle_mask);
-       }
-#endif
-
        glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA8, gc->p2_width, gc->p2_height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, NULL);
 }
 
@@ -326,73 +315,73 @@ void blf_glyph_free(GlyphBLF *g)
        MEM_freeN(g);
 }
 
-static void blf_texture_draw(float uv[2][2], float dx, float y1, float dx1, float y2)
+static void blf_texture_draw(const unsigned char color[4], float uv[2][2], float dx, float y1, float dx1, float y2)
 {
-       glBegin(GL_QUADS);
-       glTexCoord2f(uv[0][0], uv[0][1]);
-       glVertex2f(dx, y1);
-       
-       glTexCoord2f(uv[0][0], uv[1][1]);
-       glVertex2f(dx, y2);
-       
-       glTexCoord2f(uv[1][0], uv[1][1]);
-       glVertex2f(dx1, y2);
-       
-       glTexCoord2f(uv[1][0], uv[0][1]);
-       glVertex2f(dx1, y1);
-       glEnd();
+       immAttrib2f(BLF_COORD_ID, uv[0][0], uv[0][1]);
+       immSkipAttrib(BLF_COLOR_ID); /* skip color of most vertices */
+       immVertex2f(BLF_POS_ID, dx, y1);
+
+       immAttrib2f(BLF_COORD_ID, uv[0][0], uv[1][1]);
+       immSkipAttrib(BLF_COLOR_ID);
+       immVertex2f(BLF_POS_ID, dx, y2);
+
+       immAttrib2f(BLF_COORD_ID, uv[1][0], uv[1][1]);
+       immSkipAttrib(BLF_COLOR_ID);
+       immVertex2f(BLF_POS_ID, dx1, y2);
+
+       immAttrib2f(BLF_COORD_ID, uv[1][0], uv[0][1]);
+       immAttrib4ubv(BLF_COLOR_ID, color); /* set color of provoking vertex */
+       immVertex2f(BLF_POS_ID, dx1, y1);
 }
 
-static void blf_texture5_draw(const float shadow_col[4], float uv[2][2], float x1, float y1, float x2, float y2)
+static void blf_texture5_draw(const unsigned char color_in[4], float uv[2][2], float x1, float y1, float x2, float y2)
 {
        const float soft[25] = {1 / 60.0f, 1 / 60.0f, 2 / 60.0f, 1 / 60.0f, 1 / 60.0f,
                                1 / 60.0f, 3 / 60.0f, 5 / 60.0f, 3 / 60.0f, 1 / 60.0f,
                                2 / 60.0f, 5 / 60.0f, 8 / 60.0f, 5 / 60.0f, 2 / 60.0f,
                                1 / 60.0f, 3 / 60.0f, 5 / 60.0f, 3 / 60.0f, 1 / 60.0f,
                                1 / 60.0f, 1 / 60.0f, 2 / 60.0f, 1 / 60.0f, 1 / 60.0f};
-       
+
        const float *fp = soft;
-       float color[4];
+       unsigned char color[4];
        float dx, dy;
 
-       color[0] = shadow_col[0];
-       color[1] = shadow_col[1];
-       color[2] = shadow_col[2];
-       
+       color[0] = color_in[0];
+       color[1] = color_in[1];
+       color[2] = color_in[2];
+
+       const float alpha_in = (1 / 255.0f) * color_in[3];
+
        for (dx = -2; dx < 3; dx++) {
                for (dy = -2; dy < 3; dy++, fp++) {
-                       color[3] = *(fp) * shadow_col[3];
-                       glColor4fv(color);
-                       blf_texture_draw(uv, x1 + dx, y1 + dy, x2 + dx, y2 + dy);
+                       color[3] = FTOCHAR(*fp * alpha_in);
+                       blf_texture_draw(color, uv, x1 + dx, y1 + dy, x2 + dx, y2 + dy);
                }
        }
-       
-       glColor4fv(color);
 }
 
-static void blf_texture3_draw(const float shadow_col[4], float uv[2][2], float x1, float y1, float x2, float y2)
+static void blf_texture3_draw(const unsigned char color_in[4], float uv[2][2], float x1, float y1, float x2, float y2)
 {
        const float soft[9] = {1 / 16.0f, 2 / 16.0f, 1 / 16.0f,
                               2 / 16.0f, 4 / 16.0f, 2 / 16.0f,
                               1 / 16.0f, 2 / 16.0f, 1 / 16.0f};
 
        const float *fp = soft;
-       float color[4];
+       unsigned char color[4];
        float dx, dy;
 
-       color[0] = shadow_col[0];
-       color[1] = shadow_col[1];
-       color[2] = shadow_col[2];
+       color[0] = color_in[0];
+       color[1] = color_in[1];
+       color[2] = color_in[2];
+
+       const float alpha_in = (1 / 255.0f) * color_in[3];
 
        for (dx = -1; dx < 2; dx++) {
                for (dy = -1; dy < 2; dy++, fp++) {
-                       color[3] = *(fp) * shadow_col[3];
-                       glColor4fv(color);
-                       blf_texture_draw(uv, x1 + dx, y1 + dy, x2 + dx, y2 + dy);
+                       color[3] = FTOCHAR(*fp * alpha_in);
+                       blf_texture_draw(color, uv, x1 + dx, y1 + dy, x2 + dx, y2 + dy);
                }
        }
-       
-       glColor4fv(color);
 }
 
 static void blf_glyph_calc_rect(rctf *rect, GlyphBLF *g, float x, float y)
@@ -486,39 +475,37 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
                glBindTexture(GL_TEXTURE_2D, (font->tex_bind_state = g->tex));
        }
 
+       /* TODO: blur & shadow in shader, single quad per glyph */
+
        if (font->flags & BLF_SHADOW) {
                rctf rect_ofs;
                blf_glyph_calc_rect(&rect_ofs, g,
                                    x + (float)font->shadow_x,
                                    y + (float)font->shadow_y);
 
-               switch (font->shadow) {
-                       case 3:
-                               blf_texture3_draw(font->shadow_col, g->uv, rect_ofs.xmin, rect_ofs.ymin, rect_ofs.xmax, rect_ofs.ymax);
-                               break;
-                       case 5:
-                               blf_texture5_draw(font->shadow_col, g->uv, rect_ofs.xmin, rect_ofs.ymin, rect_ofs.xmax, rect_ofs.ymax);
-                               break;
-                       default:
-                               glColor4fv(font->shadow_col);
-                               blf_texture_draw(g->uv, rect_ofs.xmin, rect_ofs.ymin, rect_ofs.xmax, rect_ofs.ymax);
-                               break;
+               if (font->shadow == 0) {
+                       blf_texture_draw(font->shadow_color, g->uv, rect_ofs.xmin, rect_ofs.ymin, rect_ofs.xmax, rect_ofs.ymax);
+               }
+               else if (font->shadow <= 4) {
+                       blf_texture3_draw(font->shadow_color, g->uv, rect_ofs.xmin, rect_ofs.ymin, rect_ofs.xmax, rect_ofs.ymax);
+               }
+               else {
+                       blf_texture5_draw(font->shadow_color, g->uv, rect_ofs.xmin, rect_ofs.ymin, rect_ofs.xmax, rect_ofs.ymax);
                }
-
-               glColor4fv(font->orig_col);
        }
 
+#if BLF_BLUR_ENABLE
        switch (font->blur) {
                case 3:
-                       blf_texture3_draw(font->orig_col, g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+                       blf_texture3_draw(font->color, g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
                        break;
                case 5:
-                       blf_texture5_draw(font->orig_col, g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+                       blf_texture5_draw(font->color, g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
                        break;
                default:
-                       blf_texture_draw(g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
-                       break;
+                       blf_texture_draw(font->color, g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
        }
-
-       return;
+#else
+       blf_texture_draw(font->color, g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+#endif
 }
index d9d758ce548b84c7b04183dca01bd1fd83400269..ba17e0503997a63b80aa2ceb54467bb1a851f9b6 100644 (file)
@@ -37,6 +37,11 @@ struct GlyphBLF;
 struct GlyphCacheBLF;
 struct rctf;
 
+/* vertex attribute IDs (fixed IDs so we don't have to pass them around) */
+#define BLF_POS_ID 0
+#define BLF_COORD_ID 1
+#define BLF_COLOR_ID 2
+
 unsigned int blf_next_p2(unsigned int x);
 unsigned int blf_hash(unsigned int val);
 
index 0fac576a8ccb399cb00050100bf26d6a9cfb2ad0..9164a02b2ccf5684cb3be4a73e7ba2528bcc09d0 100644 (file)
@@ -175,8 +175,10 @@ typedef struct FontBLF {
        /* angle in radians. */
        float angle;
        
+#if 0 /* BLF_BLUR_ENABLE */
        /* blur: 3 or 5 large kernel */
        int blur;
+#endif
 
        /* shadow level. */
        int shadow;
@@ -186,10 +188,10 @@ typedef struct FontBLF {
        int shadow_y;
 
        /* shadow color. */
-       float shadow_col[4];
+       unsigned char shadow_color[4];
 
-       /* store color here when drawing shadow or blur. */
-       float orig_col[4];
+       /* main text color. */
+       unsigned char color[4];
 
        /* Multiplied this matrix with the current one before
         * draw the text! see blf_draw__start.
index 78d6f6c7cb975544ffca33c7bccc2e7b4b528138..c2323100205bb57e97f47cea2b46498e36e56f4c 100644 (file)
@@ -97,7 +97,6 @@ void BKE_armature_where_is(struct bArmature *arm);
 void BKE_armature_where_is_bone(struct Bone *bone, struct Bone *prevbone, const bool use_recursion);
 void BKE_pose_clear_pointers(struct bPose *pose);
 void BKE_pose_rebuild(struct Object *ob, struct bArmature *arm);
-void BKE_pose_rebuild_ex(struct Object *ob, struct bArmature *arm, const bool sort_bones);
 void BKE_pose_where_is(struct Scene *scene, struct Object *ob);
 void BKE_pose_where_is_bone(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime, bool do_extra);
 void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan);
diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h
new file mode 100644 (file)
index 0000000..644bcef
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * ***** 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): Dalai Felinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BKE_COLLECTION_H__
+#define __BKE_COLLECTION_H__
+
+/** \file blender/blenkernel/BKE_collection.h
+ *  \ingroup bke
+ */
+
+#include "BLI_ghash.h"
+#include "BLI_iterator.h"
+#include "DNA_listBase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct Iterator;
+struct SceneCollection;
+struct Object;
+struct Base;
+struct Main;
+struct Scene;
+
+struct SceneCollection *BKE_collection_add(struct Scene *scene, struct SceneCollection *sc_parent, const char *name);
+bool BKE_collection_remove(struct Scene *scene, struct SceneCollection *sc);
+struct SceneCollection *BKE_collection_master(const struct Scene *scene);
+void BKE_collection_master_free(struct Scene *scene);
+void BKE_collection_object_add(struct Scene *scene, struct SceneCollection *sc, struct Object *object);
+void BKE_collection_object_add_from(struct Scene *scene, struct Object *ob_src, struct Object *ob_dst);
+void BKE_collection_object_remove(struct Main *bmain, struct Scene *scene, struct SceneCollection *sc, struct Object *object, const bool free_us);
+void BKE_collections_object_remove(struct Main *bmain, struct Scene *scene, struct Object *object, const bool free_us);
+
+typedef void (*BKE_scene_objects_Cb)(struct Object *ob, void *data);
+typedef void (*BKE_scene_collections_Cb)(struct SceneCollection *ob, void *data);
+
+void BKE_scene_collections_callback(struct Scene *scene, BKE_scene_collections_Cb callback, void *data);
+void BKE_scene_objects_callback(struct Scene *scene, BKE_scene_objects_Cb callback, void *data);
+
+/* iterators */
+void BKE_scene_collections_Iterator_begin(struct Iterator *iter, void *data_in);
+void BKE_scene_collections_Iterator_next(struct Iterator *iter);
+void BKE_scene_collections_Iterator_end(struct Iterator *iter);
+
+void BKE_scene_objects_Iterator_begin(struct Iterator *iter, void *data_in);
+void BKE_scene_objects_Iterator_next(struct Iterator *iter);
+void BKE_scene_objects_Iterator_end(struct Iterator *iter);
+
+#define FOREACH_SCENE_COLLECTION(scene, _instance)                            \
+       ITER_BEGIN(BKE_scene_collections_Iterator_begin,                          \
+                  BKE_scene_collections_Iterator_next,                           \
+                  BKE_scene_collections_Iterator_end,                            \
+                  scene, SceneCollection *, _instance)
+
+#define FOREACH_SCENE_COLLECTION_END                                          \
+       ITER_END
+
+#define FOREACH_SCENE_OBJECT(scene, _instance)                                \
+       ITER_BEGIN(BKE_scene_objects_Iterator_begin,                              \
+                  BKE_scene_objects_Iterator_next,                               \
+                  BKE_scene_objects_Iterator_end,                                \
+                  scene, Object *, _instance)
+
+#define FOREACH_SCENE_OBJECT_END                                              \
+       ITER_END
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BKE_COLLECTION_H__ */
index 4da6a61cbfacb8eaa933c9f7e272f8c3c1bd3d28..606b045dff849d42ebab3cbe3f9519346b466a45 100644 (file)
@@ -40,12 +40,16 @@ extern "C" {
 struct ARegion;
 struct bScreen;
 struct CacheFile;
+struct LayerCollection;
 struct ListBase;
 struct Main;
 struct Object;
+struct Base;
 struct PointerRNA;
 struct ReportList;
 struct Scene;
+struct SceneCollection;
+struct SceneLayer;
 struct ScrArea;
 struct SpaceLink;
 struct View3D;
@@ -239,6 +243,9 @@ int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBas
 
 struct Main *CTX_data_main(const bContext *C);
 struct Scene *CTX_data_scene(const bContext *C);
+struct LayerCollection *CTX_data_layer_collection(const bContext *C);
+struct SceneCollection *CTX_data_scene_collection(const bContext *C);
+struct SceneLayer *CTX_data_scene_layer(const bContext *C);
 struct ToolSettings *CTX_data_tool_settings(const bContext *C);
 
 const char *CTX_data_mode_string(const bContext *C);
index 09a069ee36fafb36365d399b0bff86f4e5d69041..f718e9c85558835378df76ed3018d3c2fa7ff75e 100644 (file)
@@ -33,6 +33,7 @@
  *  \author nzc
  */
 
+struct BaseLegacy;
 struct Base;
 struct EvaluationContext;
 struct Group;
@@ -44,8 +45,8 @@ void          BKE_group_free(struct Group *group);
 struct Group *BKE_group_add(struct Main *bmain, const char *name);
 struct Group *BKE_group_copy(struct Main *bmain, struct Group *group);
 void          BKE_group_make_local(struct Main *bmain, struct Group *group, const bool lib_local);
-bool          BKE_group_object_add(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
-bool          BKE_group_object_unlink(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
+bool          BKE_group_object_add(struct Group *group, struct Object *ob);
+bool          BKE_group_object_unlink(struct Group *group, struct Object *ob);
 struct Group *BKE_group_object_find(struct Group *group, struct Object *ob);
 bool          BKE_group_object_exists(struct Group *group, struct Object *ob);
 bool          BKE_group_object_cyclic_check(struct Main *bmain, struct Object *object, struct Group *group);
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h
new file mode 100644 (file)
index 0000000..d208cee
--- /dev/null
@@ -0,0 +1,238 @@
+/*
+ * ***** 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): Blender Foundation, Dalai Felinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BKE_LAYER_H__
+#define __BKE_LAYER_H__
+
+/** \file blender/blenkernel/BKE_layer.h
+ *  \ingroup bke
+ */
+
+#include "BKE_collection.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TODO_LAYER_SYNC /* syncing of SceneCollection and LayerCollection trees*/
+#define TODO_LAYER_SYNC_FILTER /* syncing of filter_objects across all trees */
+#define TODO_LAYER_OVERRIDE /* CollectionOverride */
+#define TODO_LAYER_CONTEXT /* get/set current (context) SceneLayer */
+#define TODO_LAYER_BASE /* BaseLegacy to Base related TODO */
+#define TODO_LAYER_OPERATORS /* collection mamanger and property panel operators */
+#define TODO_LAYER_DEPSGRAPH /* placeholder for real Depsgraph fix */
+#define TODO_LAYER /* generic todo */
+
+struct CollectionEngineSettings;
+struct LayerCollection;
+struct ID;
+struct ListBase;
+struct Main;
+struct Object;
+struct Base;
+struct RenderEngine;
+struct Scene;
+struct SceneCollection;
+struct SceneLayer;
+
+struct SceneLayer *BKE_scene_layer_render_active(const struct Scene *scene);
+struct SceneLayer *BKE_scene_layer_context_active(struct Scene *scene);
+struct SceneLayer *BKE_scene_layer_add(struct Scene *scene, const char *name);
+
+bool BKE_scene_layer_remove(struct Main *bmain, struct Scene *scene, struct SceneLayer *sl);
+
+void BKE_scene_layer_free(struct SceneLayer *sl);
+
+void BKE_scene_layer_engine_set(struct SceneLayer *sl, const char *engine);
+
+void BKE_scene_layer_selected_objects_tag(struct SceneLayer *sl, const int tag);
+
+struct SceneLayer *BKE_scene_layer_find_from_collection(struct Scene *scene, struct LayerCollection *lc);
+struct Base *BKE_scene_layer_base_find(struct SceneLayer *sl, struct Object *ob);
+void BKE_scene_layer_base_deselect_all(struct SceneLayer *sl);
+void BKE_scene_layer_base_select(struct SceneLayer *sl, struct Base *selbase);
+void BKE_scene_layer_base_flag_recalculate(struct SceneLayer *sl);
+
+void BKE_scene_layer_engine_settings_recalculate(struct SceneLayer *sl);
+void BKE_scene_layer_engine_settings_object_recalculate(struct SceneLayer *sl, struct Object *ob);
+void BKE_scene_layer_engine_settings_collection_recalculate(struct SceneLayer *sl, struct LayerCollection *lc);
+void BKE_scene_layer_engine_settings_update(struct SceneLayer *sl);
+
+void BKE_layer_collection_free(struct SceneLayer *sl, struct LayerCollection *lc);
+
+struct LayerCollection *BKE_layer_collection_active(struct SceneLayer *sl);
+
+int BKE_layer_collection_count(struct SceneLayer *sl);
+
+int BKE_layer_collection_findindex(struct SceneLayer *sl, struct LayerCollection *lc);
+void BKE_layer_collection_reinsert_after(const struct Scene *scene, struct SceneLayer *sl,
+                                         struct LayerCollection *lc_reinsert, struct LayerCollection *lc_after);
+
+struct LayerCollection *BKE_collection_link(struct SceneLayer *sl, struct SceneCollection *sc);
+
+void BKE_collection_unlink(struct SceneLayer *sl, struct LayerCollection *lc);
+
+bool BKE_scene_layer_has_collection(struct SceneLayer *sl, struct SceneCollection *sc);
+bool BKE_scene_has_object(struct Scene *scene, struct Object *ob);
+
+/* syncing */
+
+void BKE_layer_sync_new_scene_collection(struct Scene *scene, const struct SceneCollection *sc_parent, struct SceneCollection *sc);
+void BKE_layer_sync_object_link(struct Scene *scene, struct SceneCollection *sc, struct Object *ob);
+void BKE_layer_sync_object_unlink(struct Scene *scene, struct SceneCollection *sc, struct Object *ob);
+
+/* override */
+
+void BKE_collection_override_datablock_add(struct LayerCollection *lc, const char *data_path, struct ID *id);
+
+/* engine settings */
+typedef void (*CollectionEngineSettingsCB)(struct RenderEngine *engine, struct CollectionEngineSettings *ces);
+struct CollectionEngineSettings *BKE_layer_collection_engine_get(struct LayerCollection *lc, const int type, const char *engine_name);
+struct CollectionEngineSettings *BKE_object_collection_engine_get(struct Object *ob, const int type, const char *engine_name);
+void BKE_layer_collection_engine_settings_callback_register(struct Main *bmain, const char *engine_name, CollectionEngineSettingsCB func);
+void BKE_layer_collection_engine_settings_callback_free(void);
+
+struct CollectionEngineSettings *BKE_layer_collection_engine_settings_create(const char *engine_name);
+void BKE_layer_collection_engine_settings_free(struct CollectionEngineSettings *ces);
+void BKE_layer_collection_engine_settings_list_free(struct ListBase *lb);
+
+void BKE_collection_engine_property_add_float(struct CollectionEngineSettings *ces, const char *name, float value);
+void BKE_collection_engine_property_add_int(struct CollectionEngineSettings *ces, const char *name, int value);
+void BKE_collection_engine_property_add_bool(struct CollectionEngineSettings *ces, const char *name, bool value);
+struct CollectionEngineProperty *BKE_collection_engine_property_get(struct CollectionEngineSettings *ces, const char *name);
+int BKE_collection_engine_property_value_get_int(struct CollectionEngineSettings *ces, const char *name);
+float BKE_collection_engine_property_value_get_float(struct CollectionEngineSettings *ces, const char *name);
+bool BKE_collection_engine_property_value_get_bool(struct CollectionEngineSettings *ces, const char *name);
+void BKE_collection_engine_property_value_set_int(struct CollectionEngineSettings *ces, const char *name, int value);
+void BKE_collection_engine_property_value_set_float(struct CollectionEngineSettings *ces, const char *name, float value);
+void BKE_collection_engine_property_value_set_bool(struct CollectionEngineSettings *ces, const char *name, bool value);
+bool BKE_collection_engine_property_use_get(struct CollectionEngineSettings *ces, const char *name);
+void BKE_collection_engine_property_use_set(struct CollectionEngineSettings *ces, const char *name, bool value);
+
+/* iterators */
+
+void BKE_selected_objects_Iterator_begin(Iterator *iter, void *data_in);
+void BKE_selected_objects_Iterator_next(Iterator *iter);
+void BKE_selected_objects_Iterator_end(Iterator *iter);
+
+void BKE_visible_objects_Iterator_begin(Iterator *iter, void *data_in);
+void BKE_visible_objects_Iterator_next(Iterator *iter);
+void BKE_visible_objects_Iterator_end(Iterator *iter);
+
+void BKE_visible_bases_Iterator_begin(Iterator *iter, void *data_in);
+void BKE_visible_bases_Iterator_next(Iterator *iter);
+void BKE_visible_bases_Iterator_end(Iterator *iter);
+
+#define FOREACH_SELECTED_OBJECT(sl, _instance)                                \
+       ITER_BEGIN(BKE_selected_objects_Iterator_begin,                           \
+                  BKE_selected_objects_Iterator_next,                            \
+                  BKE_selected_objects_Iterator_end,                             \
+                  sl, Object *, _instance)
+
+#define FOREACH_SELECTED_OBJECT_END                                           \
+       ITER_END
+
+#define FOREACH_VISIBLE_OBJECT(sl, _instance)                                 \
+       ITER_BEGIN(BKE_visible_objects_Iterator_begin,                            \
+                  BKE_visible_objects_Iterator_next,                             \
+                  BKE_visible_objects_Iterator_end,                              \
+                  sl, Object *, _instance)
+
+#define FOREACH_VISIBLE_OBJECT_END                                            \
+       ITER_END
+
+
+#define FOREACH_VISIBLE_BASE(sl, _instance)                                   \
+       ITER_BEGIN(BKE_visible_bases_Iterator_begin,                              \
+                  BKE_visible_bases_Iterator_next,                               \
+                  BKE_visible_bases_Iterator_end,                                \
+                  sl, Base *, _instance)
+
+#define FOREACH_VISIBLE_BASE_END                                              \
+       ITER_END
+
+
+#define FOREACH_OBJECT(sl, _instance)                                         \
+{                                                                             \
+       Object *_instance;                                                        \
+       Base *base;                                                               \
+       for (base = (sl)->object_bases.first; base; base = base->next) {          \
+           _instance = base->object;
+
+#define FOREACH_OBJECT_END                                                    \
+    }                                                                         \
+}
+
+#define FOREACH_OBJECT_FLAG(scene, sl, flag, _instance)                       \
+{                                                                             \
+       IteratorBeginCb func_begin;                                               \
+       IteratorCb func_next, func_end;                                           \
+       void *data_in;                                                            \
+                                                                                 \
+       if (flag == SELECT) {                                                     \
+           func_begin = &BKE_selected_objects_Iterator_begin;                    \
+           func_next = &BKE_selected_objects_Iterator_next;                      \
+           func_end = &BKE_selected_objects_Iterator_end;                        \
+           data_in = (sl);                                                       \
+    }                                                                         \
+       else {                                                                    \
+           func_begin = BKE_scene_objects_Iterator_begin;                        \
+           func_next = BKE_scene_objects_Iterator_next;                          \
+           func_end = BKE_scene_objects_Iterator_end;                            \
+           data_in = (scene);                                                    \
+    }                                                                         \
+       ITER_BEGIN(func_begin, func_next, func_end, data_in, Object *, _instance)
+
+
+#define FOREACH_OBJECT_FLAG_END                                               \
+       ITER_END                                                                  \
+}
+
+/* temporary hacky solution waiting for final depsgraph evaluation */
+#define DEG_OBJECT_ITER(sl_, instance_)                                       \
+{                                                                             \
+       Object *instance_;                                                        \
+       /* temporary solution, waiting for depsgraph update */                    \
+       BKE_scene_layer_engine_settings_update(sl_);                              \
+                                                                                 \
+       /* flush all the data to objects*/                                        \
+       Base *base_;                                                              \
+       for (base_ = (sl_)->object_bases.first; base_; base_ = base_->next) {     \
+       if ((base_->flag & BASE_VISIBLED) == 0) {                             \
+               continue;                                                         \
+       }                                                                     \
+                                                                                 \
+           instance_ = base_->object;                                                    \
+           instance_->base_flag = base_->flag;
+
+#define DEG_OBJECT_ITER_END                                                   \
+    }                                                                         \
+}
+
+/* temporary doversion functions */
+void BKE_scene_layer_doversion_update(struct Main *bmain);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BKE_LAYER_H__ */
diff --git a/source/blender/blenkernel/BKE_mesh_render.h b/source/blender/blenkernel/BKE_mesh_render.h
new file mode 100644 (file)
index 0000000..f4e322f
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * ***** 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.
+ *
+ * The Original Code is Copyright (C) 2017 by Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation, Mike Erwin, Dalai Felinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef __BKE_MESH_RENDER_H__
+#define __BKE_MESH_RENDER_H__
+
+/** \file BKE_mesh_render.h
+ *  \ingroup bke
+ */
+
+struct Batch;
+struct Mesh;
+
+void BKE_mesh_batch_cache_dirty(struct Mesh *me);
+void BKE_mesh_batch_cache_clear(struct Mesh *me);
+void BKE_mesh_batch_cache_free(struct Mesh *me);
+struct Batch *BKE_mesh_batch_cache_get_all_edges(struct Mesh *me);
+struct Batch *BKE_mesh_batch_cache_get_all_triangles(struct Mesh *me);
+struct Batch *BKE_mesh_batch_cache_get_triangles_with_normals(struct Mesh *me);
+struct Batch *BKE_mesh_batch_cache_get_all_verts(struct Mesh *me);
+struct Batch *BKE_mesh_batch_cache_get_fancy_edges(struct Mesh *me);
+struct Batch *BKE_mesh_batch_cache_get_overlay_edges(struct Mesh *me);
+
+#endif /* __BKE_MESH_RENDER_H__ */
index b241b5ca5b72bd00467c076fb7f1ee73cf6fe754..7a522cba2826a7d1025aa9668e19925b5a6c91d3 100644 (file)
@@ -260,15 +260,6 @@ typedef struct ModifierTypeInfo {
         */
        bool (*isDisabled)(struct ModifierData *md, int userRenderParams);
 
-       /* Add the appropriate relations to the DEP graph depending on the
-        * modifier data. 
-        *
-        * This function is optional.
-        */
-       void (*updateDepgraph)(struct ModifierData *md, struct DagForest *forest,
-                              struct Main *bmain, struct Scene *scene,
-                              struct Object *ob, struct DagNode *obNode);
-
        /* Add the appropriate relations to the dependency graph.
         *
         * This function is optional.
index 546f0d97c2b26d9db592440805532fa2fa83cd0b..67f7fa5e029861c943c841e48c6af6ab804f651c 100644 (file)
@@ -687,6 +687,13 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
 }
 /** \} */
 
+
+/* -------------------------------------------------------------------- */
+/** \name Node Tree
+ */
+
+void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree, struct Scene *scene, const int layer_index);
+
 /* -------------------------------------------------------------------- */
 /** \name Shader Nodes
  */
index 89adbc4338f2e5357b9a600848d719aa5bdaea5c..b3b67d0924a8005ea4f886c3180cb58b19e2ffef 100644 (file)
@@ -35,12 +35,13 @@ extern "C" {
 
 #include "BLI_compiler_attrs.h"
 
-struct Base;
+struct BaseLegacy;
 struct EvaluationContext;
 struct Scene;
 struct Object;
 struct BoundBox;
 struct View3D;
+struct SceneLayer;
 struct SoftBody;
 struct BulletSoftBody;
 struct MovieClip;
@@ -89,9 +90,9 @@ struct Object *BKE_object_add_only_object(
         int type, const char *name)
         ATTR_NONNULL(1) ATTR_RETURNS_NONNULL;
 struct Object *BKE_object_add(
-        struct Main *bmain, struct Scene *scene,
+        struct Main *bmain, struct Scene *scene, struct SceneLayer *sl,
         int type, const char *name)
-        ATTR_NONNULL(1, 2) ATTR_RETURNS_NONNULL;
+        ATTR_NONNULL(1, 2, 3) ATTR_RETURNS_NONNULL;
 void *BKE_object_obdata_add_from_type(
         struct Main *bmain,
         int type, const char *name)
@@ -199,6 +200,7 @@ void BKE_object_eval_uber_transform(struct EvaluationContext *eval_ctx,
 void BKE_object_eval_uber_data(struct EvaluationContext *eval_ctx,
                                struct Scene *scene,
                                struct Object *ob);
+void BKE_object_eval_shading(struct EvaluationContext *eval_ctx, struct Object *ob);
 
 void BKE_object_handle_data_update(struct EvaluationContext *eval_ctx,
                                    struct Scene *scene,
@@ -252,7 +254,7 @@ typedef enum eObjectSet {
 
 struct LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet objectSet, eObRelationTypes includeFilter);
 struct LinkNode *BKE_object_groups(struct Object *ob);
-void             BKE_object_groups_clear(struct Scene *scene, struct Base *base, struct Object *object);
+void             BKE_object_groups_clear(struct Object *object);
 
 struct KDTree *BKE_object_as_kdtree(struct Object *ob, int *r_tot);
 
index d2152950bff48a82bc883f1cf7dd194a22ce8cc1..bed643c213366aa57e647a9a02098b01a1a9077f 100644 (file)
@@ -38,14 +38,16 @@ extern "C" {
 #endif
 
 struct AviCodecData;
-struct Base;
+struct BaseLegacy;
 struct EvaluationContext;
 struct Main;
 struct Object;
+struct Base;
 struct QuicktimeCodecData;
 struct RenderData;
 struct SceneRenderLayer;
 struct Scene;
+struct SceneLayer;
 struct UnitSettings;
 struct Main;
 
@@ -70,13 +72,15 @@ void BKE_scene_free(struct Scene *sce);
 void BKE_scene_init(struct Scene *sce);
 struct Scene *BKE_scene_add(struct Main *bmain, const char *name);
 
+void BKE_scene_remove_rigidbody_object(struct Scene *scene, struct Object *ob);
+
 /* base functions */
-struct Base *BKE_scene_base_find_by_name(struct Scene *scene, const char *name);
-struct Base *BKE_scene_base_find(struct Scene *scene, struct Object *ob);
-struct Base *BKE_scene_base_add(struct Scene *sce, struct Object *ob);
-void         BKE_scene_base_unlink(struct Scene *sce, struct Base *base);
+struct BaseLegacy *BKE_scene_base_find_by_name(struct Scene *scene, const char *name);
+struct BaseLegacy *BKE_scene_base_find(struct Scene *scene, struct Object *ob);
+struct BaseLegacy *BKE_scene_base_add(struct Scene *sce, struct Object *ob);
+void         BKE_scene_base_unlink(struct Scene *sce, struct BaseLegacy *base);
 void         BKE_scene_base_deselect_all(struct Scene *sce);
-void         BKE_scene_base_select(struct Scene *sce, struct Base *selbase);
+void         BKE_scene_base_select(struct Scene *sce, struct BaseLegacy *selbase);
 
 /* Scene base iteration function.
  * Define struct here, so no need to bother with alloc/free it.
@@ -90,10 +94,14 @@ typedef struct SceneBaseIter {
 } SceneBaseIter;
 
 int BKE_scene_base_iter_next(struct EvaluationContext *eval_ctx, struct SceneBaseIter *iter,
-                             struct Scene **scene, int val, struct Base **base, struct Object **ob);
+                             struct Scene **scene, int val, struct BaseLegacy **base, struct Object **ob);
 
-void BKE_scene_base_flag_to_objects(struct Scene *scene);
+void BKE_scene_base_flag_to_objects(struct SceneLayer *sl);
 void BKE_scene_base_flag_from_objects(struct Scene *scene);
+void BKE_scene_base_flag_sync_from_base(struct BaseLegacy *base);
+void BKE_scene_base_flag_sync_from_object(struct BaseLegacy *base);
+void BKE_scene_object_base_flag_sync_from_base(struct Base *base);
+void BKE_scene_object_base_flag_sync_from_object(struct Base *base);
 
 void BKE_scene_set_background(struct Main *bmain, struct Scene *sce);
 struct Scene *BKE_scene_set_name(struct Main *bmain, const char *name);
index 14e978b23f239c4446c88a193b246237aa2283bf..010810ad0cc7abc517abc6e4e548846d4abd60d4 100644 (file)
@@ -49,6 +49,7 @@ struct bScreen;
 struct uiLayout;
 struct uiList;
 struct wmKeyConfig;
+struct wmManipulatorMap;
 struct wmNotifier;
 struct wmWindow;
 struct wmWindowManager;
@@ -96,6 +97,9 @@ typedef struct SpaceType {
        /* on startup, define dropboxes for spacetype+regions */
        void (*dropboxes)(void);
 
+       /* initialize manipulator-map-types and manipulator-group-types with the region */
+       void (*manipulators)(void);
+
        /* return context data */
        int (*context)(const struct bContext *, const char *, struct bContextDataResult *);
 
@@ -284,6 +288,8 @@ void BKE_spacedata_id_unref(struct ScrArea *sa, struct SpaceLink *sl, struct ID
 struct ARegion *BKE_area_region_copy(struct SpaceType *st, struct ARegion *ar);
 void            BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
 void            BKE_screen_area_free(struct ScrArea *sa);
+/* Manipulator-maps of a region need to be freed with the region. Uses callback to avoid low-level call. */
+void BKE_region_callback_free_manipulatormap_set(void (*callback)(struct wmManipulatorMap *));
 
 struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type);
 struct ARegion *BKE_area_find_region_active_win(struct ScrArea *sa);
index 157c4408d6ac8713ebfe8b9bc959ed499da62e5a..b665183a37b467789e30b7027103c7358de9b997 100644 (file)
@@ -30,6 +30,7 @@ set(INC
        ../blenloader
        ../blentranslation
        ../depsgraph
+       ../draw
        ../gpu
        ../ikplugin
        ../imbuf
@@ -85,6 +86,7 @@ set(SRC
        intern/camera.c
        intern/cdderivedmesh.c
        intern/cloth.c
+       intern/collection.c
        intern/collision.c
        intern/colortools.c
        intern/constraint.c
@@ -133,6 +135,7 @@ set(SRC
        intern/mesh_evaluate.c
        intern/mesh_mapping.c
        intern/mesh_remap.c
+       intern/mesh_render.c
        intern/mesh_validate.c
        intern/modifier.c
        intern/modifiers_bmesh.c
@@ -156,6 +159,7 @@ set(SRC
        intern/pbvh_bmesh.c
        intern/pointcache.c
        intern/property.c
+       intern/layer.c
        intern/report.c
        intern/rigidbody.c
        intern/sca.c
@@ -213,6 +217,7 @@ set(SRC
        BKE_ccg.h
        BKE_cdderivedmesh.h
        BKE_cloth.h
+       BKE_collection.h
        BKE_collision.h
        BKE_colortools.h
        BKE_constraint.h
@@ -257,6 +262,7 @@ set(SRC
        BKE_mesh.h
        BKE_mesh_mapping.h
        BKE_mesh_remap.h
+       BKE_mesh_render.h
        BKE_modifier.h
        BKE_movieclip.h
        BKE_multires.h
@@ -272,6 +278,7 @@ set(SRC
        BKE_pbvh.h
        BKE_pointcache.h
        BKE_property.h
+       BKE_layer.h
        BKE_report.h
        BKE_rigidbody.h
        BKE_sca.h
@@ -535,8 +542,4 @@ endif()
 #      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
 #endif()
 
-if(WITH_LEGACY_DEPSGRAPH)
-       add_definitions(-DWITH_LEGACY_DEPSGRAPH)
-endif()
-
 blender_add_lib(bf_blenkernel "${SRC}" "${INC}" "${INC_SYS}")
index 160adcc398868fea718ce6234694f89bd70695dd..39f1db0b886d8f7bb77d2487b91a4df51c8c0f8f 100644 (file)
@@ -317,7 +317,7 @@ void DM_init(
        dm->numPolyData = numPolys;
 
        DM_init_funcs(dm);
-       
+
        dm->needsFree = 1;
        dm->auto_bump_scale = -1.0f;
        dm->dirty = 0;
@@ -377,6 +377,7 @@ int DM_release(DerivedMesh *dm)
        if (dm->needsFree) {
                bvhcache_free(&dm->bvhCache);
                GPU_drawobject_free(dm);
+
                CustomData_free(&dm->vertData, dm->numVertData);
                CustomData_free(&dm->edgeData, dm->numEdgeData);
                CustomData_free(&dm->faceData, dm->numTessFaceData);
index 2f65e71c6d29f863431452432aa47ec3f9b9b6ef..237e4e8017279fd62329b8e3e1b33d359f000ef5 100644 (file)
@@ -283,7 +283,7 @@ void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
 /* tweak the object ordering to trick depsgraph into making MotionPath calculations run faster */
 static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets)
 {
-       Base *base, *baseNext;
+       BaseLegacy *base, *baseNext;
        MPathTarget *mpt;
        
        /* make sure our temp-tag isn't already in use */
@@ -321,7 +321,7 @@ static void motionpaths_calc_update_scene(Scene *scene)
                BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene, scene->lay);
        }
        else { /* otherwise we can optimize by restricting updates */
-               Base *base, *last = NULL;
+               BaseLegacy *base, *last = NULL;
                
                /* only stuff that moves or needs display still */
                DAG_scene_update_flags(G.main, scene, scene->lay, true, false);
index 02cc31e5977452287de2a73692594bf02503507f..2565eb1900c1c53e1ace99fc1877a7b8f0607504 100644 (file)
@@ -1930,7 +1930,7 @@ void BKE_pose_clear_pointers(bPose *pose)
 
 /* only after leave editmode, duplicating, validating older files, library syncing */
 /* NOTE: pose->flag is set for it */
-void BKE_pose_rebuild_ex(Object *ob, bArmature *arm, const bool sort_bones)
+void BKE_pose_rebuild(Object *ob, bArmature *arm)
 {
        Bone *bone;
        bPose *pose;
@@ -1974,25 +1974,12 @@ void BKE_pose_rebuild_ex(Object *ob, bArmature *arm, const bool sort_bones)
 
        BKE_pose_update_constraint_flags(ob->pose); /* for IK detection for example */
 
-#ifdef WITH_LEGACY_DEPSGRAPH
-       /* the sorting */
-       /* Sorting for new dependnecy graph is done on the scene graph level. */
-       if (counter > 1 && sort_bones) {
-               DAG_pose_sort(ob);
-       }
-#endif
-
        ob->pose->flag &= ~POSE_RECALC;
        ob->pose->flag |= POSE_WAS_REBUILT;
 
        BKE_pose_channels_hash_make(ob->pose);
 }
 
-void BKE_pose_rebuild(Object *ob, bArmature *arm)
-{
-       BKE_pose_rebuild_ex(ob, arm, true);
-}
-
 /* ********************** THE POSE SOLVER ******************* */
 
 /* loc/rot/size to given mat4 */
index 3bc81a69c867fb579891c4946cbacfbf9c702ff5..a8ab1e9357bc74eb8869cec4e27d1160e45c1c53 100644 (file)
 
 #include "DEG_depsgraph.h"
 
-#ifdef WITH_LEGACY_DEPSGRAPH
-#  define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH) printf
-#else
-#  define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
-#endif
+#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
 
 /* ********************** SPLINE IK SOLVER ******************* */
 
index 3dce08eb756be7a839a2a42a1be27c2dd7fd8017..8630e8562b07bdf20e05b8ea9356eb49aa8f4e0f 100644 (file)
@@ -205,7 +205,7 @@ float BKE_cachefile_time_offset(CacheFile *cache_file, const float time, const f
 /* TODO(kevin): replace this with some depsgraph mechanism, or something similar. */
 void BKE_cachefile_clean(Scene *scene, CacheFile *cache_file)
 {
-       for (Base *base = scene->base.first; base; base = base->next) {
+       for (BaseLegacy *base = scene->base.first; base; base = base->next) {
                Object *ob = base->object;
 
                ModifierData *md = modifiers_findByType(ob, eModifierType_MeshSequenceCache);
index 9cb553aa27b59f79b5688138073247d5831280b9..978204f1cf5028b6612ecac82e0c6b1fbf8dd36a 100644 (file)
@@ -853,7 +853,7 @@ static Object *camera_multiview_advanced(Scene *scene, Object *camera, const cha
        }
 
        if (name[0] != '\0') {
-               Base *base = BKE_scene_base_find_by_name(scene, name);
+               BaseLegacy *base = BKE_scene_base_find_by_name(scene, name);
                if (base) {
                        return base->object;
                }
index 28ef3f6f24819d7e8db4da59606d96c6398f49ac..162525c7cd527e606526ccd85c6a5c53c5ddd726 100644 (file)
@@ -478,7 +478,6 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
                return;
        }
 
-       if (!can_simulate)
                return;
 
        /* if on second frame, write cache for first frame */
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
new file mode 100644 (file)
index 0000000..18af757
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * ***** 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): Dalai Felinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenkernel/intern/collection.c
+ *  \ingroup bke
+ */
+
+#include "BLI_blenlib.h"
+#include "BLI_ghash.h"
+#include "BLI_iterator.h"
+#include "BLI_listbase.h"
+#include "BLT_translation.h"
+#include "BLI_string_utils.h"
+
+#include "BKE_collection.h"
+#include "BKE_layer.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_scene.h"
+
+#include "DNA_ID.h"
+#include "DNA_layer_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#include "MEM_guardedalloc.h"
+
+
+/**
+ * Add a collection to a collection ListBase and syncronize all render layers
+ * The ListBase is NULL when the collection is to be added to the master collection
+ */
+SceneCollection *BKE_collection_add(Scene *scene, SceneCollection *sc_parent, const char *name)
+{
+       SceneCollection *sc_master = BKE_collection_master(scene);
+       SceneCollection *sc = MEM_callocN(sizeof(SceneCollection), "New Collection");
+
+       if (!name) {
+               name = DATA_("New Collection");
+       }
+
+       if (!sc_parent) {
+               sc_parent = sc_master;
+       }
+
+       BLI_strncpy(sc->name, name, sizeof(sc->name));
+       BLI_uniquename(&sc_master->scene_collections, sc, DATA_("Collection"), '.', offsetof(SceneCollection, name), sizeof(sc->name));
+
+       BLI_addtail(&sc_parent->scene_collections, sc);
+
+       BKE_layer_sync_new_scene_collection(scene, sc_parent, sc);
+       return sc;
+}
+
+/**
+ * Free the collection items recursively
+ */
+static void collection_free(SceneCollection *sc)
+{
+       for (LinkData *link = sc->objects.first; link; link = link->next) {
+               id_us_min(link->data);
+       }
+       BLI_freelistN(&sc->objects);
+
+       for (LinkData *link = sc->filter_objects.first; link; link = link->next) {
+               id_us_min(link->data);
+       }
+       BLI_freelistN(&sc->filter_objects);
+
+       for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
+               collection_free(nsc);
+       }
+       BLI_freelistN(&sc->scene_collections);
+}
+
+/**
+ * Unlink the collection recursively
+ * \return true if unlinked.
+ */
+static bool collection_remlink(SceneCollection *sc_parent, SceneCollection *sc_gone)
+{
+       for (SceneCollection *sc = sc_parent->scene_collections.first; sc; sc = sc->next) {
+               if (sc == sc_gone) {
+                       BLI_remlink(&sc_parent->scene_collections, sc_gone);
+                       return true;
+               }
+
+               if (collection_remlink(sc, sc_gone)) {
+                       return true;
+               }
+       }
+       return false;
+}
+
+/**
+ * Recursively remove any instance of this SceneCollection
+ */
+static void layer_collection_remove(SceneLayer *sl, ListBase *lb, const SceneCollection *sc)
+{
+       LayerCollection *lc = lb->first;
+       while (lc) {
+               if (lc->scene_collection == sc) {
+                       BKE_scene_layer_engine_settings_collection_recalculate(sl, lc);
+                       BKE_layer_collection_free(sl, lc);
+                       BLI_remlink(lb, lc);
+
+                       LayerCollection *lc_next = lc->next;
+                       MEM_freeN(lc);
+                       lc = lc_next;
+
+                       /* only the "top-level" layer collections may have the
+                        * same SceneCollection in a sibling tree.
+                        */
+                       if (lb != &sl->layer_collections) {
+                               return;
+                       }
+               }
+
+               else {
+                       layer_collection_remove(sl, &lc->layer_collections, sc);
+                       lc = lc->next;
+               }
+       }
+}
+
+/**
+ * Remove a collection from the scene, and syncronize all render layers
+ */
+bool BKE_collection_remove(Scene *scene, SceneCollection *sc)
+{
+       SceneCollection *sc_master = BKE_collection_master(scene);
+
+       /* the master collection cannot be removed */
+       if (sc == sc_master) {
+               return false;
+       }
+
+       /* unlink from the respective collection tree */
+       if (!collection_remlink(sc_master, sc)) {
+               BLI_assert(false);
+       }
+
+       /* clear the collection items */
+       collection_free(sc);
+
+       /* check all layers that use this collection and clear them */
+       for (SceneLayer *sl = scene->render_layers.first; sl; sl = sl->next) {
+               layer_collection_remove(sl, &sl->layer_collections, sc);
+               BKE_scene_layer_base_flag_recalculate(sl);
+               sl->active_collection = 0;
+       }
+
+       MEM_freeN(sc);
+       return true;
+}
+
+/**
+ * Returns the master collection
+ */
+SceneCollection *BKE_collection_master(const Scene *scene)
+{
+       return scene->collection;
+}
+
+/**
+ * Free (or release) any data used by the master collection (does not free the master collection itself).
+ * Used only to clear the entire scene data since it's not doing re-syncing of the LayerCollection tree
+ */
+void BKE_collection_master_free(Scene *scene)
+{
+       collection_free(BKE_collection_master(scene));
+}
+
+static void collection_object_add(Scene *scene, SceneCollection *sc, Object *ob)
+{
+       BLI_addtail(&sc->objects, BLI_genericNodeN(ob));
+       id_us_plus((ID *)ob);
+       BKE_layer_sync_object_link(scene, sc, ob);
+}
+
+/**
+ * Add object to collection
+ */
+void BKE_collection_object_add(Scene *scene, SceneCollection *sc, Object *ob)
+{
+       if (BLI_findptr(&sc->objects, ob, offsetof(LinkData, data))) {
+               /* don't add the same object twice */
+               return;
+       }
+       collection_object_add(scene, sc, ob);
+}
+
+/**
+ * Add object to all collections that reference objects is in
+ * (used to copy objects)
+ */
+void BKE_collection_object_add_from(Scene *scene, Object *ob_src, Object *ob_dst)
+{
+       FOREACH_SCENE_COLLECTION(scene, sc)
+       {
+               if (BLI_findptr(&sc->objects, ob_src, offsetof(LinkData, data))) {
+                       collection_object_add(scene, sc, ob_dst);
+               }
+       }
+       FOREACH_SCENE_COLLECTION_END
+}
+
+/**
+ * Remove object from collection
+ */
+void BKE_collection_object_remove(Main *bmain, Scene *scene, SceneCollection *sc, Object *ob, const bool free_us)
+{
+
+       LinkData *link = BLI_findptr(&sc->objects, ob, offsetof(LinkData, data));
+
+       if (link == NULL) {
+               return;
+       }
+
+       BLI_remlink(&sc->objects, link);
+       MEM_freeN(link);
+
+       TODO_LAYER_SYNC_FILTER; /* need to remove all instances of ob in scene collections -> filter_objects */
+       BKE_layer_sync_object_unlink(scene, sc, ob);
+
+       if (free_us) {
+               BKE_libblock_free_us(bmain, ob);
+       }
+       else {
+               id_us_min(&ob->id);
+       }
+}
+
+/**
+ * Remove object from all collections of scene
+ */
+void BKE_collections_object_remove(Main *bmain, Scene *scene, Object *ob, const bool free_us)
+{
+       BKE_scene_remove_rigidbody_object(scene, ob);
+
+       FOREACH_SCENE_COLLECTION(scene, sc)
+       {
+               BKE_collection_object_remove(bmain, scene, sc, ob, free_us);
+       }
+       FOREACH_SCENE_COLLECTION_END
+}
+
+/* ---------------------------------------------------------------------- */
+/* Iteractors */
+/* scene collection iteractor */
+
+typedef struct SceneCollectionsIteratorData {
+       Scene *scene;
+       void **array;
+       int tot, cur;
+} SceneCollectionsIteratorData;
+
+static void scene_collection_callback(SceneCollection *sc, BKE_scene_collections_Cb callback, void *data)
+{
+       callback(sc, data);
+
+       for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
+               scene_collection_callback(nsc, callback, data);
+       }
+}
+
+static void scene_collections_count(SceneCollection *UNUSED(sc), void *data)
+{
+       int *tot = data;
+       (*tot)++;
+}
+
+static void scene_collections_build_array(SceneCollection *sc, void *data)
+{
+       SceneCollection ***array = data;
+       **array = sc;
+       (*array)++;
+}
+
+static void scene_collections_array(Scene *scene, SceneCollection ***collections_array, int *tot)
+{
+       SceneCollection *sc = BKE_collection_master(scene);
+       SceneCollection **array;
+
+       *collections_array = NULL;
+       *tot = 0;
+
+       if (scene == NULL)
+               return;
+
+       scene_collection_callback(sc, scene_collections_count, tot);
+
+       if (*tot == 0)
+               return;
+
+       *collections_array = array = MEM_mallocN(sizeof(SceneCollection *) * (*tot), "SceneCollectionArray");
+       scene_collection_callback(sc, scene_collections_build_array, &array);
+}
+
+/**
+ * Only use this in non-performance critical situations
+ * (it iterates over all scene collections twice)
+ */
+void BKE_scene_collections_Iterator_begin(Iterator *iter, void *data_in)
+{
+       Scene *scene = data_in;
+       SceneCollectionsIteratorData *data = MEM_callocN(sizeof(SceneCollectionsIteratorData), __FUNCTION__);
+
+       data->scene = scene;
+       iter->data = data;
+
+       scene_collections_array(scene, (SceneCollection ***)&data->array, &data->tot);
+       BLI_assert(data->tot != 0);
+
+       data->cur = 0;
+       iter->current = data->array[data->cur];
+       iter->valid = true;
+}
+
+void BKE_scene_collections_Iterator_next(struct Iterator *iter)
+{
+       SceneCollectionsIteratorData *data = iter->data;
+
+       if (++data->cur < data->tot) {
+               iter->current = data->array[data->cur];
+       }
+       else {
+               iter->valid = false;
+       }
+}
+
+void BKE_scene_collections_Iterator_end(struct Iterator *iter)
+{
+       SceneCollectionsIteratorData *data = iter->data;
+
+       if (data) {
+               if (data->array) {
+                       MEM_freeN(data->array);
+               }
+               MEM_freeN(data);
+       }
+       iter->valid = false;
+}
+
+
+/* scene objects iteractor */
+
+typedef struct SceneObjectsIteratorData {
+       GSet *visited;
+       LinkData *link;
+       Iterator scene_collection_iter;
+} SceneObjectsIteratorData;
+
+void BKE_scene_objects_Iterator_begin(Iterator *iter, void *data_in)
+{
+       Scene *scene = data_in;
+       SceneObjectsIteratorData *data = MEM_callocN(sizeof(SceneObjectsIteratorData), __FUNCTION__);
+       iter->data = data;
+
+       /* lookup list ot make sure each object is object called once */
+       data->visited = BLI_gset_ptr_new(__func__);
+
+       /* we wrap the scenecollection iterator here to go over the scene collections */
+       BKE_scene_collections_Iterator_begin(&data->scene_collection_iter, scene);
+
+       SceneCollection *sc = data->scene_collection_iter.current;
+       iter->current = sc->objects.first;
+       iter->valid = true;
+
+       if (iter->current == NULL) {
+               BKE_scene_objects_Iterator_next(iter);
+       }
+}
+
+/**
+ * Gets the first unique object in the sequence
+ */
+static LinkData *object_base_unique(GSet *gs, LinkData *link)
+{
+       if (link == NULL) {
+               return NULL;
+       }
+
+       Object *ob = link->data;
+       if (!BLI_gset_haskey(gs, ob)) {
+               BLI_gset_add(gs, ob);
+               return link;
+       }
+       else {
+               return object_base_unique(gs, link->next);
+       }
+}
+
+void BKE_scene_objects_Iterator_next(Iterator *iter)
+{
+       SceneObjectsIteratorData *data = iter->data;
+       LinkData *link = data->link ? object_base_unique(data->visited, data->link->next) : NULL;
+
+       if (link) {
+               data->link = link;
+               iter->current = link->data;
+       }
+       else {
+               /* if this is the last object of this ListBase look at the next SceneCollection */
+               SceneCollection *sc;
+               BKE_scene_collections_Iterator_next(&data->scene_collection_iter);
+               do {
+                       sc = data->scene_collection_iter.current;
+                       /* get the first unique object of this collection */
+                       LinkData *new_link = object_base_unique(data->visited, sc->objects.first);
+                       if (new_link) {
+                               data->link = new_link;
+                               iter->current = data->link->data;
+                               return;
+                       }
+                       BKE_scene_collections_Iterator_next(&data->scene_collection_iter);
+               } while (data->scene_collection_iter.valid);
+
+               if (!data->scene_collection_iter.valid) {
+                       iter->valid = false;
+               }
+       }
+}
+
+void BKE_scene_objects_Iterator_end(Iterator *iter)
+{
+       SceneObjectsIteratorData *data = iter->data;
+       if (data) {
+               BKE_scene_collections_Iterator_end(&data->scene_collection_iter);
+               BLI_gset_free(data->visited, NULL);
+               MEM_freeN(data);
+       }
+}
index ee25be368555533097de01492c034b3a5dbb916b..23cfee721ae6a0f765ee089a8b765f1759ede552 100644 (file)
@@ -512,7 +512,7 @@ static void add_collision_object(Object ***objs, unsigned int *numobj, unsigned
 
 // return all collision objects in scene
 // collision object will exclude self 
-Object **get_collisionobjects_ext(Scene *scene, Object *self, Group *group, int layer, unsigned int *numcollobj, unsigned int modifier_type, bool dupli)
+Object **get_collisionobjects_ext(Scene *scene, Object *self, Group *group, int UNUSED(layer), unsigned int *numcollobj, unsigned int modifier_type, bool dupli)
 {
        Base *base;
        Object **objs;
@@ -532,9 +532,9 @@ Object **get_collisionobjects_ext(Scene *scene, Object *self, Group *group, int
                Scene *sce_iter;
                /* add objects in same layer in scene */
                for (SETLOOPER(scene, sce_iter, base)) {
-                       if ( base->lay & layer )
+                       if ((base->flag & BASE_VISIBLED) != 0) {
                                add_collision_object(&objs, &numobj, &maxobj, base->object, self, level, modifier_type);
-
+                       }
                }
        }
 
@@ -600,7 +600,7 @@ ListBase *get_collider_cache(Scene *scene, Object *self, Group *group)
 
                /* add objects in same layer in scene */
                for (SETLOOPER(scene, sce_iter, base)) {
-                       if (!self || (base->lay & self->lay))
+                       if (!self || ((base->flag & BASE_VISIBLED) != 0))
                                add_collider_cache_object(&objs, base->object, self, 0);
 
                }
index 4c01bfd35f21cefac047c8c5f0e50a4348610ef9..560d84c1d2d7078a778cfca6f7af3fa0454e5423 100644 (file)
@@ -47,6 +47,7 @@
 #include "BLT_translation.h"
 
 #include "BKE_context.h"
+#include "BKE_layer.h"
 #include "BKE_main.h"
 #include "BKE_screen.h"
 #include "BKE_sound.h"
@@ -836,8 +837,9 @@ void CTX_wm_window_set(bContext *C, wmWindow *win)
 void CTX_wm_screen_set(bContext *C, bScreen *screen)
 {
        C->wm.screen = screen;
-       if (C->wm.screen)
-               C->data.scene = C->wm.screen->scene;
+       if (C->wm.screen) {
+               CTX_data_scene_set(C, C->wm.screen->scene);
+       }
        C->wm.area = NULL;
        C->wm.region = NULL;
 }
@@ -896,6 +898,59 @@ Scene *CTX_data_scene(const bContext *C)
                return C->data.scene;
 }
 
+SceneLayer *CTX_data_scene_layer(const bContext *C)
+{
+       SceneLayer *sl;
+
+       if (ctx_data_pointer_verify(C, "render_layer", (void *)&sl)) {
+               return sl;
+       }
+       else {
+               return BKE_scene_layer_context_active(CTX_data_scene(C));
+       }
+}
+
+/**
+ * This is tricky. Sometimes the user overrides the render_layer
+ * but not the scene_collection. In this case what to do?
+ *
+ * If the scene_collection is linked to the SceneLayer we use it.
+ * Otherwise we fallback to the active one of the SceneLayer.
+ */
+LayerCollection *CTX_data_layer_collection(const bContext *C)
+{
+       SceneLayer *sl = CTX_data_scene_layer(C);
+       LayerCollection *lc;
+
+       if (ctx_data_pointer_verify(C, "layer_collection", (void *)&lc)) {
+               if (BKE_scene_layer_has_collection(sl, lc->scene_collection)) {
+                       return lc;
+               }
+       }
+
+       /* fallback */
+       return BKE_layer_collection_active(sl);
+}
+
+SceneCollection *CTX_data_scene_collection(const bContext *C)
+{
+       SceneCollection *sc;
+       if (ctx_data_pointer_verify(C, "scene_collection", (void *)&sc)) {
+               if (BKE_scene_layer_has_collection(CTX_data_scene_layer(C), sc)) {
+                       return sc;
+               }
+       }
+
+       LayerCollection *lc = CTX_data_layer_collection(C);
+       if (lc) {
+               return lc->scene_collection;
+       }
+
+       /* fallback */
+       Scene *scene = CTX_data_scene(C);
+       return BKE_collection_master(scene);
+}
+
 int CTX_data_mode_enum(const bContext *C)
 {
        Object *obedit = CTX_data_edit_object(C);
index 294a4ce76b7f9fe3440ade7cfd2ae51461e2df98..c5b8a18fd65714263f5b580035e13becb6823990 100644 (file)
 #endif
 
 #include "BLI_utildefines.h"
-#include "BLI_listbase.h"
-#include "BLI_ghash.h"
-#include "BLI_threads.h"
 
-#include "DNA_anim_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_cachefile_types.h"
-#include "DNA_group_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_key_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_node_types.h"
+#include "DNA_object_types.h"
 #include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
-#include "DNA_movieclip_types.h"
-#include "DNA_mask_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_rigidbody_types.h"
 
-#include "BKE_anim.h"
-#include "BKE_animsys.h"
-#include "BKE_action.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_collision.h"
-#include "BKE_effect.h"
-#include "BKE_fcurve.h"
 #include "BKE_global.h"
-#include "BKE_idcode.h"
-#include "BKE_image.h"
-#include "BKE_key.h"
-#include "BKE_library.h"
 #include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_material.h"
-#include "BKE_mball.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_paint.h"
-#include "BKE_particle.h"
-#include "BKE_pointcache.h"
-#include "BKE_scene.h"
-#include "BKE_screen.h"
-#include "BKE_tracking.h"
 
-#include "GPU_buffers.h"
-
-#include "atomic_ops.h"
-
-#include "depsgraph_private.h"
-
-#include "DEG_depsgraph.h"
-#include "DEG_depsgraph_build.h"
-#include "DEG_depsgraph_debug.h"
-#include "DEG_depsgraph_query.h"
-
-#ifdef WITH_LEGACY_DEPSGRAPH
-
-static SpinLock threaded_update_lock;
-
-void DAG_init(void)
-{
-       BLI_spin_init(&threaded_update_lock);
-       DEG_register_node_types();
-}
-
-void DAG_exit(void)
-{
-       BLI_spin_end(&threaded_update_lock);
-       DEG_free_node_types();
-}
-
-/* Queue and stack operations for dag traversal 
- *
- * the queue store a list of freenodes to avoid successive alloc/dealloc
- */
-
-DagNodeQueue *queue_create(int slots)
-{
-       DagNodeQueue *queue;
-       DagNodeQueueElem *elem;
-       int i;
-       
-       queue = MEM_mallocN(sizeof(DagNodeQueue), "DAG queue");
-       queue->freenodes = MEM_mallocN(sizeof(DagNodeQueue), "DAG queue");
-       queue->count = 0;
-       queue->maxlevel = 0;
-       queue->first = queue->last = NULL;
-       elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem3");
-       elem->node = NULL;
-       elem->next = NULL;
-       queue->freenodes->first = queue->freenodes->last = elem;
-       
-       for (i = 1; i < slots; i++) {
-               elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem4");
-               elem->node = NULL;
-               elem->next = NULL;
-               queue->freenodes->last->next = elem;
-               queue->freenodes->last = elem;
-       }
-       queue->freenodes->count = slots;
-       return queue;
-}
-
-void queue_raz(DagNodeQueue *queue)
-{
-       DagNodeQueueElem *elem;
-       
-       elem = queue->first;
-       if (queue->freenodes->last)
-               queue->freenodes->last->next = elem;
-       else
-               queue->freenodes->first = queue->freenodes->last = elem;
-       
-       elem->node = NULL;
-       queue->freenodes->count++;
-       while (elem->next) {
-               elem = elem->next;
-               elem->node = NULL;
-               queue->freenodes->count++;
-       }
-       queue->freenodes->last = elem;
-       queue->count = 0;
-}
-
-void queue_delete(DagNodeQueue *queue)
-{
-       DagNodeQueueElem *elem;
-       DagNodeQueueElem *temp;
-       
-       elem = queue->first;
-       while (elem) {
-               temp = elem;
-               elem = elem->next;
-               MEM_freeN(temp);
-       }
-       
-       elem = queue->freenodes->first;
-       while (elem) {
-               temp = elem;
-               elem = elem->next;
-               MEM_freeN(temp);
-       }
-       
-       MEM_freeN(queue->freenodes);
-       MEM_freeN(queue);
-}
-
-/* insert in queue, remove in front */
-void push_queue(DagNodeQueue *queue, DagNode *node)
-{
-       DagNodeQueueElem *elem;
-       int i;
-
-       if (node == NULL) {
-               fprintf(stderr, "pushing null node\n");
-               return;
-       }
-       /*fprintf(stderr, "BFS push : %s %d\n", ((ID *) node->ob)->name, queue->count);*/
-
-       elem = queue->freenodes->first;
-       if (elem != NULL) {
-               queue->freenodes->first = elem->next;
-               if (queue->freenodes->last == elem) {
-                       queue->freenodes->last = NULL;
-                       queue->freenodes->first = NULL;
-               }
-               queue->freenodes->count--;
-       }
-       else { /* alllocating more */
-               elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem1");
-               elem->node = NULL;
-               elem->next = NULL;
-               queue->freenodes->first = queue->freenodes->last = elem;
-
-               for (i = 1; i < DAGQUEUEALLOC; i++) {
-                       elem = MEM_mallocN(sizeof(DagNodeQueueElem), "DAG queue elem2");
-                       elem->node = NULL;
-                       elem->next = NULL;
-                       queue->freenodes->last->next = elem;
-                       queue->freenodes->last = elem;
-               }
-               queue->freenodes->count = DAGQUEUEALLOC;
-                       
-               elem = queue->freenodes->first;
-               queue->freenodes->first = elem->next;
-       }
-       elem->next = NULL;
-       elem->node = node;
-       if (queue->last != NULL)
-               queue->last->next = elem;
-       queue->last = elem;
-       if (queue->first == NULL) {
-               queue->first = elem;
-       }
-       queue->count++;
-}
-
-
-/* insert in front, remove in front */
-void push_stack(DagNodeQueue *queue, DagNode *node)
-{
-       DagNodeQueueElem *elem;
-       int i;
-
-       elem = queue->freenodes->first;
-       if (elem != NULL) {
-               queue->freenodes->first = elem->next;
-               if (queue->freenodes->last == elem) {
-                       queue->freenodes->last = NULL;
-                       queue->freenodes->first&nb