|
Blender V5.0
|
#include <overlay_grease_pencil.hh>
Inherits blender::draw::overlay::Overlay.
Public Member Functions | |
| void | begin_sync (Resources &res, const State &state) final |
| void | edit_object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state) final |
| void | paint_object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state) |
| void | sculpt_object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state) |
| void | object_sync (Manager &, const ObjectRef &ob_ref, Resources &, const State &state) final |
| void | draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final |
| void | draw_color_only (Framebuffer &framebuffer, Manager &manager, View &view) final |
Static Public Member Functions | |
| static void | compute_depth_planes (Manager &manager, View &view, Resources &res, const State &) |
| static void | draw_grease_pencil (Resources &res, PassMain::Sub &pass, const Scene *scene, Object *ob, ResourceHandleRange res_handle, select::ID select_id=select::SelectMap::select_invalid_id()) |
Draw grease pencil overlays. Also contains grease pencil helper functions for other overlays.
Definition at line 35 of file overlay_grease_pencil.hh.
|
inlinefinalvirtual |
Synchronization creates and fill render passes based on context state and scene state.
It runs for every scene update, so keep computation overhead low. If it is triggered, everything in the scene is considered updated. Note that this only concerns the render passes, the mesh batch caches are updated on a per object-data basis.
IMPORTANT: Synchronization must be view agnostic. That is, not rely on view position, projection matrix or frame-buffer size to do conditional pass creation. This is because, by design, syncing can happen once and rendered multiple time (multi view rendering, stereo rendering, orbiting view ...). Conditional pass creation, must be done in the drawing callbacks, but they should remain the exception. Also there will be no access to object data at this point. Creates passes used for object sync and enabling / disabling internal overlay types (e.g. vertices, edges, faces in edit mode). Runs once at the start of the sync cycle. Should also contain passes setup for overlays that are not per object overlays (e.g. Grid).
This method must be implemented.
Implements blender::draw::overlay::Overlay.
Definition at line 57 of file overlay_grease_pencil.hh.
References CURVE_HANDLE_NONE, DRW_CLIPPING_UBO_SLOT, DRW_STATE_BLEND_ALPHA, DRW_STATE_DEPTH_ALWAYS, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, ELEM, blender::draw::overlay::Overlay::enabled_, View3D::gp_flag, GP_PROJECT_DEPTH_STROKE, GP_PROJECT_DEPTH_VIEW, GP_SCULPT_MASK_SELECTMODE_POINT, GP_SCULPT_MASK_SELECTMODE_SEGMENT, GP_SELECTMODE_POINT, GP_SELECTMODE_SEGMENT, GP_VERTEX_MASK_SELECTMODE_POINT, GP_VERTEX_MASK_SELECTMODE_SEGMENT, ToolSettings::gpencil_selectmode_edit, ToolSettings::gpencil_selectmode_sculpt, ToolSettings::gpencil_selectmode_vertex, ToolSettings::gpencil_v3d_align, OB_MODE_EDIT, OB_MODE_PAINT_GREASE_PENCIL, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_VERTEX_GREASE_PENCIL, OB_MODE_WEIGHT_GREASE_PENCIL, OVERLAY_GLOBALS_SLOT, state, V3D_GP_SHOW_EDIT_LINES, V3D_GP_SHOW_GRID, V3D_GP_SHOW_GRID_XRAY, V3D_GP_SHOW_MATERIAL_NAME, and V3D_GP_SHOW_STROKE_DIRECTION.
|
inlinestatic |
Definition at line 270 of file overlay_grease_pencil.hh.
References blender::draw::overlay::GreasePencilDepthPlane::bounds, blender::draw::overlay::Resources::depth_planes, blender::draw::overlay::Resources::depth_planes_count, blender::draw::overlay::GreasePencilDepthPlane::handle, i, blender::draw::Manager::matrix_buf, blender::draw::overlay::GreasePencilDepthPlane::plane, blender::draw::ResourceHandleRange::resource_index(), and view.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 293 of file overlay_grease_pencil.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), and view.
|
inlinestatic |
Definition at line 305 of file overlay_grease_pencil.hh.
References blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), BKE_gpencil_material_settings(), BKE_object_boundbox_get(), blender::draw::overlay::GreasePencilDepthPlane::bounds, blender::bke::Curve, blender::draw::overlay::Resources::depth_planes, blender::draw::overlay::Resources::depth_planes_count, blender::draw::detail::PassBase< DrawCommandBufType >::draw(), blender::draw::DRW_cache_grease_pencil_color_buffer_get(), blender::draw::DRW_cache_grease_pencil_get(), blender::draw::DRW_cache_grease_pencil_position_buffer_get(), DRW_object_get_data_for_drawing(), GreasePencil::flag, MaterialGPencilStyle::flag, blender::index_mask::IndexMask::foreach_index(), GP_MATERIAL_FILL_SHOW, GP_MATERIAL_HIDE, GP_MATERIAL_STROKE_SHOW, GREASE_PENCIL_STROKE_ORDER_3D, blender::draw::overlay::GreasePencilDepthPlane::handle, blender::bke::AttributeAccessor::lookup_or_default(), blender::draw::overlay::GreasePencilDepthPlane::plane, blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), blender::ed::greasepencil::retrieve_visible_drawings(), blender::ed::greasepencil::retrieve_visible_strokes(), blender::draw::select::SelectMap::select_invalid_id(), and blender::IndexRange::size().
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 283 of file overlay_grease_pencil.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), and view.
|
inlinefinalvirtual |
Fills passes or buffers for each object in edit mode. Runs for each individual object state for a specific mode. IMPORTANT: Can run only once for instances using the same state (ObjectRef might contains instancing data).
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 182 of file overlay_grease_pencil.hh.
References blender::draw::DRW_cache_grease_pencil_edit_handles_get(), blender::draw::DRW_cache_grease_pencil_edit_lines_get(), blender::draw::DRW_cache_grease_pencil_edit_points_get(), blender::draw::DRW_cache_grease_pencil_weight_lines_get(), blender::draw::DRW_cache_grease_pencil_weight_points_get(), blender::draw::overlay::Overlay::enabled_, GPU_PRIM_TRIS, and state.
Referenced by blender::draw::overlay::Instance::object_sync(), paint_object_sync(), and sculpt_object_sync().
|
inlinefinalvirtual |
Fills passes or buffers for each object. Runs for each individual object state. IMPORTANT: Can run only once for instances using the same state (ObjectRef might contains instancing data).
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 238 of file overlay_grease_pencil.hh.
References blender::draw::overlay::Overlay::enabled_, blender::math::from_loc_scale(), GPU_PRIM_LINES, blender::MatBase< T, NumCol, NumRow, Alignment >::location(), state, blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::y_axis().
Referenced by blender::draw::overlay::Instance::object_sync().
|
inline |
Definition at line 220 of file overlay_grease_pencil.hh.
References edit_object_sync(), and state.
Referenced by blender::draw::overlay::Instance::object_sync().
|
inline |
Definition at line 229 of file overlay_grease_pencil.hh.
References edit_object_sync(), and state.
Referenced by blender::draw::overlay::Instance::object_sync().