24 PassMain particle_ps_ = {
"particle_ps_"};
29 PassSimple edit_particle_ps_ = {
"edit_particle_ps_"};
33 bool show_weight_ =
false;
34 bool show_point_inner_ =
false;
35 bool show_point_tip_ =
false;
37 bool enabled_ =
false;
58 auto &pass = particle_ps_;
61 state.clipping_plane_count);
64 auto &sub = pass.sub(
"Dots");
71 auto &sub = pass.
sub(
"Shapes");
78 auto &sub = pass.
sub(
"Hair");
81 sub.push_constant(
"colorType",
state.v3d->shading.wire_color_type);
82 sub.push_constant(
"isTransform", is_transform);
88 auto &pass = edit_particle_ps_;
91 state.clipping_plane_count);
94 auto &sub = pass.sub(
"Dots");
98 sub.push_constant(
"useWeight", show_weight_);
99 sub.push_constant(
"useGreasePencil",
false);
100 edit_vert_ps_ = ⊂
103 auto &sub = pass.
sub(
"Edges");
107 sub.push_constant(
"useWeight",
false);
108 sub.push_constant(
"useGreasePencil",
false);
109 edit_edge_ps_ = ⊂
123 if (collection !=
nullptr) {
124 dupli_mat[3] -=
float4(
float3(collection->instance_offset), 0.0f);
126 dupli_mat = ob_ref.
dupli_parent->object_to_world() * dupli_mat;
129 dupli_mat = ob_ref.
object->object_to_world() *
158 if (edit ==
nullptr) {
163 auto find_active_evaluated_psys =
169 return particle_systems_eval.get(psys_index);
178 if (psys ==
nullptr) {
179 printf(
"Error getting evaluated particle system for edit.\n");
189 edit_edge_ps_->
draw(geom, handle);
191 if (show_point_inner_) {
193 edit_vert_ps_->
draw(geom, handle);
195 if (show_point_tip_) {
197 edit_vert_ps_->
draw(geom, handle);
216 if (handle.raw == 0u) {
225 sub.push_constant(
"ucolor",
float4(ma ?
float3(&ma->r) :
float3(0.6f), part->draw_size));
228 blender::gpu::Batch *geom =
nullptr;
229 const int draw_as = (part->draw_as ==
PART_DRAW_REND) ? part->ren_as : part->draw_as;
290 manager.
submit(particle_ps_, view);
300 manager.
submit(edit_particle_ps_, view);
struct Material * BKE_object_material_get_eval(struct Object *ob, short act)
ID * DEG_get_original_id(ID *id)
Object * DEG_get_original_object(Object *object)
Object groups, one object can be in many groups at once.
PTCacheEdit * PE_get_current_from_psys(ParticleSystem *psys)
ParticleEditSettings * PE_settings(Scene *scene)
PTCacheEdit * PE_create_current(Depsgraph *depsgraph, Scene *scene, Object *ob)
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
static bNodeSocket * set_color(bNode *node, COLLADAFW::Color col)
ResourceHandle resource_handle_for_psys(const ObjectRef &ref, const float4x4 &model_matrix)
void submit(PassSimple &pass, View &view)
void draw(gpu::Batch *batch, uint instance_len=-1, uint vertex_len=-1, uint vertex_first=-1, ResourceHandle handle={0}, uint custom_id=0)
PassBase< DrawCommandBufType > & sub(const char *name)
void push_constant(const char *name, const float &data)
void draw_expand(gpu::Batch *batch, GPUPrimType primitive_type, uint primitive_len, uint instance_len, uint vertex_len=-1, uint vertex_first=-1, ResourceHandle handle={0}, uint custom_id=0)
void shader_set(GPUShader *shader)
void edit_object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state)
void draw(Framebuffer &framebuffer, Manager &manager, View &view)
void draw_no_line(Framebuffer &framebuffer, Manager &manager, View &view)
void begin_sync(Resources &res, const State &state)
static float4x4 dupli_matrix_get(const ObjectRef &ob_ref)
void object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state)
ShaderPtr particle_edit_edge
ShaderPtr particle_edit_vert
blender::gpu::Batch * DRW_cache_particles_get_dots(Object *object, ParticleSystem *psys)
blender::gpu::Batch * DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
blender::gpu::Batch * DRW_cache_particles_get_edit_strands(Object *object, ParticleSystem *psys, PTCacheEdit *edit, bool use_weight)
blender::gpu::Batch * DRW_cache_particles_get_edit_tip_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
blender::gpu::Batch * DRW_cache_particles_get_edit_inner_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys)
@ DRW_STATE_DEPTH_LESS_EQUAL
CartesianBasis invert(const CartesianBasis &basis)
VecBase< float, 4 > float4
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
VecBase< float, 3 > float3
#define PART_SHAPE_CIRCLE
#define PARTICLE_SHAPE_CIRCLE_RESOLUTION
struct Collection * instance_collection
static MatBase identity()
DupliObject * dupli_object
TextureRef weight_ramp_tx
GPUUniformBuf * globals_buf
void select_bind(PassSimple &pass)
const ID select_id(const ObjectRef &ob_ref, uint sub_object_id=0)