45 const char *layer_name,
57 if (layer_name ==
NULL) {
67 if (attr_uv !=
NULL) {
101 return mesh->get_subd_num_corners()[face_num];
115 return mesh->get_triangles()[face_num * 3 + vert_num];
126 return face_num * 3 + vert_num;
138 const float3 vP =
mesh->get_verts()[vertex_index];
161 const float3 orco = (userdata->
orco[vertex_index] + orco_loc) / orco_size;
192 if (
mesh->get_smooth()[face_num]) {
222 const BL::Mesh &b_mesh,
const char *layer_name,
Mesh *
mesh,
bool need_sign,
bool active_render)
230 name = ustring((
string(layer_name) +
".tangent").c_str());
233 name = ustring(
"orco.tangent");
241 float3 *tangent = attr->data_float3();
243 float *tangent_sign =
NULL;
247 if (layer_name !=
NULL) {
248 name_sign = ustring((
string(layer_name) +
".tangent_sign").c_str());
251 name_sign = ustring(
"orco.tangent_sign");
266 memset(&sm_interface, 0,
sizeof(sm_interface));
276 context.m_pUserData = &userdata;
277 context.m_pInterface = &sm_interface;
288 for (BL::MeshVertColorLayer &
l : b_mesh.sculpt_vertex_colors) {
289 const bool active_render =
l.active_render();
291 ustring vcol_name = ustring(
l.name().c_str());
302 vcol_attr->
std = vcol_std;
304 float4 *cdata = vcol_attr->data_float4();
305 int numverts = b_mesh.vertices.length();
307 for (
int i = 0; i < numverts; i++) {
313 template<
typename TypeInCycles,
typename GetValueAtIndex>
317 const GetValueAtIndex &get_value_at_index)
321 for (BL::MeshLoopTriangle &
t : b_mesh.loop_triangles) {
322 const int index =
t.index() * 3;
323 BL::Array<int, 3> loops =
t.loops();
324 data[index] = get_value_at_index(loops[0]);
325 data[index + 1] = get_value_at_index(loops[1]);
326 data[index + 2] = get_value_at_index(loops[2]);
331 const int num_verts = b_mesh.vertices.length();
332 for (
int i = 0; i < num_verts; i++) {
333 data[i] = get_value_at_index(i);
338 for (BL::MeshLoopTriangle &
t : b_mesh.loop_triangles) {
339 data[
t.index()] = get_value_at_index(
t.polygon_index());
358 for (BL::Attribute &b_attribute : b_mesh.attributes) {
359 const ustring name{b_attribute.name().c_str()};
363 if (attributes.
find(name)) {
367 const BL::Attribute::domain_enum b_domain = b_attribute.domain();
368 const BL::Attribute::data_type_enum b_data_type = b_attribute.data_type();
372 case BL::Attribute::domain_CORNER:
375 case BL::Attribute::domain_POINT:
378 case BL::Attribute::domain_FACE:
388 switch (b_data_type) {
389 case BL::Attribute::data_type_FLOAT: {
390 BL::FloatAttribute b_float_attribute{b_attribute};
394 b_mesh,
data,
element, [&](
int i) {
return b_float_attribute.data[i].value(); });
397 case BL::Attribute::data_type_BOOLEAN: {
398 BL::BoolAttribute b_bool_attribute{b_attribute};
402 b_mesh,
data,
element, [&](
int i) {
return (
float)b_bool_attribute.data[i].value(); });
405 case BL::Attribute::data_type_INT: {
406 BL::IntAttribute b_int_attribute{b_attribute};
410 b_mesh,
data,
element, [&](
int i) {
return (
float)b_int_attribute.data[i].value(); });
413 case BL::Attribute::data_type_FLOAT_VECTOR: {
414 BL::FloatVectorAttribute b_vector_attribute{b_attribute};
418 BL::Array<float, 3>
v = b_vector_attribute.data[i].vector();
423 case BL::Attribute::data_type_FLOAT_COLOR: {
424 BL::FloatColorAttribute b_color_attribute{b_attribute};
428 BL::Array<float, 4>
v = b_color_attribute.data[i].color();
433 case BL::Attribute::data_type_FLOAT2: {
434 BL::Float2Attribute b_float2_attribute{b_attribute};
438 BL::Array<float, 2>
v = b_float2_attribute.data[i].vector();
453 for (BL::MeshLoopColorLayer &
l : b_mesh.vertex_colors) {
454 const bool active_render =
l.active_render();
456 ustring vcol_name = ustring(
l.name().c_str());
469 vcol_attr =
mesh->subd_attributes.add(vcol_std, vcol_name);
477 for (BL::MeshPolygon &p : b_mesh.polygons) {
478 int n = p.loop_total();
479 for (
int i = 0; i < n; i++) {
480 float4 color =
get_float4(
l.data[p.loop_start() + i].color());
496 for (BL::MeshLoopTriangle &
t : b_mesh.loop_triangles) {
516 if (b_mesh.uv_layers.length() != 0) {
517 for (BL::MeshUVLoopLayer &
l : b_mesh.uv_layers) {
518 const bool active_render =
l.active_render();
520 ustring uv_name = ustring(
l.name().c_str());
522 ustring tangent_name = ustring((
string(
l.name().c_str()) +
".tangent").c_str());
536 if (need_uv || need_tangent) {
546 for (BL::MeshLoopTriangle &
t : b_mesh.loop_triangles) {
558 ustring sign_name = ustring((
string(
l.name().c_str()) +
".tangent_sign").c_str());
564 if (!need_uv && uv_attr !=
NULL) {
580 if (b_mesh.uv_layers.length() != 0) {
581 BL::Mesh::uv_layers_iterator
l;
584 for (b_mesh.uv_layers.begin(
l);
l != b_mesh.uv_layers.end(); ++
l, ++i) {
585 bool active_render =
l->active_render();
587 ustring uv_name = ustring(
l->name().c_str());
589 ustring tangent_name = ustring((
string(
l->name().c_str()) +
".tangent").c_str());
601 if (need_uv || need_tangent) {
603 uv_attr =
mesh->subd_attributes.add(uv_std, uv_name);
613 for (BL::MeshPolygon &p : b_mesh.polygons) {
614 int n = p.loop_total();
615 for (
int j = 0; j < n; j++) {
616 *(fdata++) =
get_float2(
l->data[p.loop_start() + j].uv());
624 ustring sign_name = ustring((
string(
l->name().c_str()) +
".tangent_sign").c_str());
630 if (!need_uv && uv_attr !=
NULL) {
631 mesh->subd_attributes.remove(uv_attr);
653 bool operator()(
const int &vert_idx_a,
const int &vert_idx_b)
657 if (vert_a == vert_b) {
659 return vert_idx_a > vert_idx_b;
661 const float x1 = vert_a.
x + vert_a.
y + vert_a.
z;
662 const float x2 = vert_b.
x + vert_b.
y + vert_b.
z;
675 const int num_verts = b_mesh.vertices.length();
676 if (num_verts == 0) {
683 for (
int vert_index = 0; vert_index < num_verts; ++vert_index) {
684 sorted_vert_indeices[vert_index] = vert_index;
687 sort(sorted_vert_indeices.begin(), sorted_vert_indeices.end(), compare);
692 for (
int sorted_vert_index = 0; sorted_vert_index < num_verts; ++sorted_vert_index) {
693 const int vert_index = sorted_vert_indeices[sorted_vert_index];
694 const float3 &vert_co =
mesh->get_verts()[vert_index];
696 for (
int other_sorted_vert_index = sorted_vert_index + 1; other_sorted_vert_index < num_verts;
697 ++other_sorted_vert_index) {
698 const int other_vert_index = sorted_vert_indeices[other_sorted_vert_index];
699 const float3 &other_vert_co =
mesh->get_verts()[other_vert_index];
701 if ((other_vert_co.
x + other_vert_co.
y + other_vert_co.
z) -
702 (vert_co.
x + vert_co.
y + vert_co.
z) >
707 if (
len_squared(other_vert_co - vert_co) < FLT_EPSILON) {
709 vert_orig_index[vert_index] = other_vert_index;
714 vert_orig_index[vert_index] = vert_index;
718 for (
int vert_index = 0; vert_index < num_verts; ++vert_index) {
719 int orig_index = vert_orig_index[vert_index];
720 while (orig_index != vert_orig_index[orig_index]) {
721 orig_index = vert_orig_index[orig_index];
723 vert_orig_index[vert_index] = orig_index;
731 for (
int vert_index = 0; vert_index < num_verts; ++vert_index) {
733 const int orig_index = vert_orig_index[vert_index];
734 vert_normal[orig_index] +=
normal;
739 for (
int vert_index = 0; vert_index < num_verts; ++vert_index) {
740 const int orig_index = vert_orig_index[vert_index];
741 vert_normal[vert_index] =
normalize(vert_normal[orig_index]);
747 BL::Mesh::edges_iterator
e;
750 memset(&counter[0], 0,
sizeof(
int) * counter.size());
751 for (b_mesh.edges.begin(
e);
e != b_mesh.edges.end(); ++
e, ++edge_index) {
752 const int v0 = vert_orig_index[b_mesh.edges[edge_index].vertices()[0]],
753 v1 = vert_orig_index[b_mesh.edges[edge_index].vertices()[1]];
760 edge_accum[v0] += edge;
761 edge_accum[
v1] += -edge;
765 for (
int vert_index = 0; vert_index < num_verts; ++vert_index) {
766 const int orig_index = vert_orig_index[vert_index];
767 if (orig_index != vert_index) {
771 if (counter[vert_index] > 0) {
777 raw_data[vert_index] = 0.0f;
783 float *
data = attr->data_float();
784 memcpy(
data, &raw_data[0],
sizeof(
float) * raw_data.size());
785 memset(&counter[0], 0,
sizeof(
int) * counter.size());
787 visited_edges.
clear();
788 for (b_mesh.edges.begin(
e);
e != b_mesh.edges.end(); ++
e, ++edge_index) {
789 const int v0 = vert_orig_index[b_mesh.edges[edge_index].vertices()[0]],
790 v1 = vert_orig_index[b_mesh.edges[edge_index].vertices()[1]];
800 for (
int vert_index = 0; vert_index < num_verts; ++vert_index) {
801 data[vert_index] /= counter[vert_index] + 1;
804 for (
int vert_index = 0; vert_index < num_verts; ++vert_index) {
805 const int orig_index = vert_orig_index[vert_index];
806 data[vert_index] =
data[orig_index];
829 int number_of_vertices = b_mesh.vertices.length();
830 if (number_of_vertices == 0) {
836 for (BL::MeshEdge &
e : b_mesh.edges) {
837 vertices_sets.
join(
e.vertices()[0],
e.vertices()[1]);
842 float *
data = attribute->data_float();
845 for (BL::MeshLoopTriangle &
t : b_mesh.loop_triangles) {
850 for (BL::MeshPolygon &p : b_mesh.polygons) {
862 bool subdivision =
false,
863 bool subdivide_uvs =
true)
866 int numverts = b_mesh.vertices.length();
867 int numfaces = (!subdivision) ? b_mesh.loop_triangles.length() : b_mesh.polygons.length();
871 bool use_loop_normals = b_mesh.use_auto_smooth() &&
883 for (BL::MeshPolygon &p : b_mesh.polygons) {
884 numngons += (p.loop_total() == 4) ? 0 : 1;
885 numcorners += p.loop_total();
897 BL::Mesh::vertices_iterator
v;
898 for (b_mesh.vertices.begin(
v);
v != b_mesh.vertices.end(); ++
v)
903 float3 *
N = attr_N->data_float3();
905 for (b_mesh.vertices.begin(
v);
v != b_mesh.vertices.end(); ++
v, ++
N)
907 N = attr_N->data_float3();
910 const bool need_default_tangent = (subdivision ==
false) && (b_mesh.uv_layers.length() == 0) &&
922 for (b_mesh.vertices.begin(
v);
v != b_mesh.vertices.end(); ++
v) {
929 for (BL::MeshLoopTriangle &
t : b_mesh.loop_triangles) {
930 BL::MeshPolygon p = b_mesh.polygons[
t.polygon_index()];
934 bool smooth = p.use_smooth() || use_loop_normals;
936 if (use_loop_normals) {
937 BL::Array<float, 9> loop_normals =
t.split_normals();
938 for (
int i = 0; i < 3; i++) {
940 loop_normals[i * 3], loop_normals[i * 3 + 1], loop_normals[i * 3 + 2]);
954 for (BL::MeshPolygon &p : b_mesh.polygons) {
955 int n = p.loop_total();
957 bool smooth = p.use_smooth() || use_loop_normals;
960 for (
int i = 0; i < n; i++) {
962 vi[i] = b_mesh.loops[p.loop_start() + i].vertex_index();
1006 int max_subdivisions)
1008 BL::SubsurfModifier subsurf_mod(b_ob.modifiers[b_ob.modifiers.length() - 1]);
1009 bool subdivide_uvs = subsurf_mod.uv_smooth() != BL::SubsurfModifier::uv_smooth_NONE;
1014 size_t num_creases = 0;
1016 for (BL::MeshEdge &
e : b_mesh.edges) {
1017 if (
e.crease() != 0.0f) {
1024 for (BL::MeshEdge &
e : b_mesh.edges) {
1025 if (
e.crease() != 0.0f) {
1032 float subd_dicing_rate =
max(0.1f,
RNA_float_get(&cobj,
"dicing_rate") * dicing_rate);
1034 mesh->set_subd_dicing_rate(subd_dicing_rate);
1035 mesh->set_subd_max_level(max_subdivisions);
1043 if (b_ob.modifiers.length() > 0) {
1044 BL::Modifier b_mod = b_ob.modifiers[b_ob.modifiers.length() - 1];
1046 if (b_mod.type() == BL::Modifier::type_MESH_SEQUENCE_CACHE) {
1047 BL::MeshSequenceCacheModifier mesh_cache = BL::MeshSequenceCacheModifier(b_mod);
1049 if (MeshSequenceCacheModifier_has_velocity_get(&mesh_cache.ptr)) {
1065 if (!b_mesh_cache) {
1069 if (!MeshSequenceCacheModifier_read_velocity_get(&b_mesh_cache.ptr)) {
1073 const size_t numverts =
mesh->get_verts().
size();
1075 if (b_mesh_cache.vertex_velocities.length() != numverts) {
1088 float motion_times[2] = {-1.0f, 1.0f};
1089 for (
int step = 0; step < 2; step++) {
1093 BL::MeshSequenceCacheModifier::vertex_velocities_iterator vvi;
1096 for (b_mesh_cache.vertex_velocities.begin(vvi); vvi != b_mesh_cache.vertex_velocities.end();
1098 mP[i] =
P[i] +
get_float3(vvi->velocity()) * relative_time;
1110 if (!b_fluid_domain)
1114 if (b_fluid_domain.mesh_vertices.length() !=
mesh->get_verts().
size())
1126 float motion_times[2] = {-1.0f, 1.0f};
1127 for (
int step = 0; step < 2; step++) {
1131 BL::FluidDomainSettings::mesh_vertices_iterator svi;
1134 for (b_fluid_domain.mesh_vertices.begin(svi); svi != b_fluid_domain.mesh_vertices.end();
1136 mP[i] =
P[i] +
get_float3(svi->velocity()) * relative_time;
1148 new_mesh.set_used_shaders(used_shaders);
1150 if (view_layer.use_surfaces) {
1160 b_data, b_ob, b_depsgraph, need_undeformed, new_mesh.get_subdivision_type());
1169 new_mesh.get_used_shaders(),
1173 create_mesh(scene, &new_mesh, b_mesh, new_mesh.get_used_shaders(),
false);
1191 if (socket.
name ==
"use_motion_blur" || socket.
name ==
"motion_steps" ||
1192 socket.
name ==
"used_shaders") {
1199 mesh->subd_attributes.update(std::move(new_mesh.subd_attributes));
1204 bool rebuild = (
mesh->triangles_is_modified()) || (
mesh->subd_num_corners_is_modified()) ||
1205 (
mesh->subd_shader_is_modified()) || (
mesh->subd_smooth_is_modified()) ||
1206 (
mesh->subd_ptex_offset_is_modified()) ||
1207 (
mesh->subd_start_corner_is_modified()) ||
1208 (
mesh->subd_face_corners_is_modified());
1213 void BlenderSync::sync_mesh_motion(
BL::Depsgraph b_depsgraph,
1220 if (b_fluid_domain) {
1231 size_t numverts =
mesh->get_verts().
size();
1232 if (numverts == 0) {
1251 bool new_attribute =
false;
1258 new_attribute =
true;
1266 BL::Mesh::vertices_iterator
v;
1268 for (b_mesh.vertices.begin(
v);
v != b_mesh.vertices.end() && i < numverts; ++
v, ++i) {
1273 if (new_attribute) {
1275 if (b_mesh.vertices.length() != numverts ||
1276 memcmp(mP, &
mesh->get_verts()[0],
sizeof(
float3) * numverts) == 0) {
1278 if (b_mesh.vertices.length() != numverts) {
1279 VLOG(1) <<
"Topology differs, disabling motion blur for object " << b_ob.name();
1282 VLOG(1) <<
"No actual deformation motion for object " << b_ob.name();
1288 else if (motion_step > 0) {
1289 VLOG(1) <<
"Filling deformation motion for object " << b_ob.name();
1294 for (
int step = 0; step < motion_step; step++) {
1302 if (b_mesh.vertices.length() != numverts) {
1303 VLOG(1) <<
"Topology differs, discarding motion blur for object " << b_ob.name()
1304 <<
" at time " << motion_step;
1305 memcpy(mP, &
mesh->get_verts()[0],
sizeof(
float3) * numverts);
int BKE_object_is_deform_modified(struct Scene *scene, struct Object *ob)
MINLINE float safe_acosf(float a)
void map_to_sphere(float *r_u, float *r_v, const float x, const float y, const float z)
struct Depsgraph Depsgraph
struct FluidDomainSettings FluidDomainSettings
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
static int mikk_corner_index(const Mesh *mesh, const int face_num, const int vert_num)
static void mikk_get_position(const SMikkTSpaceContext *context, float P[3], const int face_num, const int vert_num)
static BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object &b_ob)
static void attr_create_random_per_island(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivision)
static void create_subd_mesh(Scene *scene, Mesh *mesh, BL::Object &b_ob, BL::Mesh &b_mesh, const array< Node * > &used_shaders, float dicing_rate, int max_subdivisions)
static void attr_create_sculpt_vertex_color(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivision)
static void sync_mesh_fluid_motion(BL::Object &b_ob, Scene *scene, Mesh *mesh)
static int mikk_get_num_verts_of_face(const SMikkTSpaceContext *context, const int face_num)
static void fill_generic_attribute(BL::Mesh &b_mesh, TypeInCycles *data, const AttributeElement element, const GetValueAtIndex &get_value_at_index)
static int mikk_vertex_index(const Mesh *mesh, const int face_num, const int vert_num)
static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, const array< Node * > &used_shaders, bool subdivision=false, bool subdivide_uvs=true)
static void mikk_get_texture_coordinate(const SMikkTSpaceContext *context, float uv[2], const int face_num, const int vert_num)
static void attr_create_uv_map(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh)
static void attr_create_subd_uv_map(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivide_uvs)
static void attr_create_vertex_color(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivision)
static void mikk_set_tangent_space(const SMikkTSpaceContext *context, const float T[], const float sign, const int face_num, const int vert_num)
static void sync_mesh_cached_velocities(BL::Object &b_ob, Scene *scene, Mesh *mesh)
static void mikk_compute_tangents(const BL::Mesh &b_mesh, const char *layer_name, Mesh *mesh, bool need_sign, bool active_render)
static int mikk_get_num_faces(const SMikkTSpaceContext *context)
static void attr_create_pointiness(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivision)
static void attr_create_generic(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivision)
static void mikk_get_normal(const SMikkTSpaceContext *context, float N[3], const int face_num, const int vert_num)
static float4 get_float4(const BL::Array< float, 4 > &array)
static BL::FluidDomainSettings object_fluid_liquid_domain_find(BL::Object &b_ob)
static float3 get_float3(const BL::Array< float, 2 > &array)
static int3 get_int3(const BL::Array< int, 3 > &array)
static float2 get_float2(const BL::Array< float, 2 > &array)
static Mesh::SubdivisionType object_subdivision_type(BL::Object &b_ob, bool preview, bool experimental)
static BL::Mesh object_to_mesh(BL::BlendData &, BL::Object &object, BL::Depsgraph &, bool, Mesh::SubdivisionType subdivision_type)
static void free_object_to_mesh(BL::BlendData &, BL::Object &object, BL::Mesh &mesh)
static Transform get_transform(const BL::Array< float, 16 > &array)
static void mesh_texture_space(BL::Mesh &b_mesh, float3 &loc, float3 &size)
ATTR_WARN_UNUSED_RESULT const void * element
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Attribute * add(ustring name, TypeDesc type, AttributeElement element)
void update(AttributeSet &&new_attributes)
Attribute * find(ustring name) const
void remove(ustring name)
Transform * data_transform()
void join(size_t x, size_t y)
void insert(int v0, int v1)
bool exists(int v0, int v1)
bool need_attribute(Scene *scene, AttributeStandard std)
void tag_update(Scene *scene, bool rebuild)
VertexAverageComparator(const array< float3 > &verts)
bool operator()(const int &vert_idx_a, const int &vert_idx_b)
const array< float3 > & verts_
IconTextureDrawCall normal
#define CCL_NAMESPACE_END
#define make_float2(x, y)
#define make_float4(x, y, z, w)
#define make_float3(x, y, z)
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
@ ATTR_STD_GENERATED_TRANSFORM
@ ATTR_STD_MOTION_VERTEX_NORMAL
@ ATTR_STD_MOTION_VERTEX_POSITION
@ ATTR_STD_UV_TANGENT_SIGN
@ ATTR_STD_RANDOM_PER_ISLAND
@ ATTR_ELEMENT_CORNER_BYTE
tbool genTangSpaceDefault(const SMikkTSpaceContext *pContext)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
const PointerRNA PointerRNA_NULL
float RNA_float_get(PointerRNA *ptr, const char *name)
struct SELECTID_Context context
float3 normal(const Mesh *mesh) const
float3 compute_normal(const float3 *verts) const
void reserve_subd_faces(int numfaces, int num_ngons, int numcorners)
size_t get_num_subd_faces() const
void reserve_subd_creases(size_t num_creases)
Triangle get_triangle(size_t i) const
void copy_center_to_motion_step(const int motion_step)
void reserve_mesh(int numverts, int numfaces)
@ SUBDIVISION_CATMULL_CLARK
size_t num_triangles() const
void set_num_subd_faces(size_t num_subd_faces_)
void add_crease(int v0, int v1, float weight)
void add_vertex(float3 P)
void add_triangle(int v0, int v1, int v2, int shader, bool smooth)
void add_subd_face(int *corners, int num_corners, int shader_, bool smooth_)
SubdFace get_subd_face(size_t index) const
MikkUserData(const BL::Mesh &b_mesh, const char *layer_name, const Mesh *mesh, float3 *tangent, float *tangent_sign)
vector< SocketType, std::allocator< SocketType > > inputs
void set_value(const SocketType &input, const Node &other, const SocketType &other_input)
void(* m_getNormal)(const SMikkTSpaceContext *pContext, float fvNormOut[], const int iFace, const int iVert)
void(* m_getPosition)(const SMikkTSpaceContext *pContext, float fvPosOut[], const int iFace, const int iVert)
void(* m_getTexCoord)(const SMikkTSpaceContext *pContext, float fvTexcOut[], const int iFace, const int iVert)
void(* m_setTSpaceBasic)(const SMikkTSpaceContext *pContext, const float fvTangent[], const float fSign, const int iFace, const int iVert)
int(* m_getNumFaces)(const SMikkTSpaceContext *pContext)
int(* m_getNumVerticesOfFace)(const SMikkTSpaceContext *pContext, const int iFace)
BakeManager * bake_manager
float motion_shutter_time()
ccl_device uchar4 color_float4_to_uchar4(float4 c)
ccl_device_inline float hash_uint_to_float(uint kx)
ccl_device_inline int clamp(int a, int mn, int mx)
ccl_device_inline float2 normalize(const float2 &a)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline float3 zero_float3()
ccl_device_inline float len_squared(const float3 a)
static constexpr TypeDesc TypeRGBA(TypeDesc::FLOAT, TypeDesc::VEC4, TypeDesc::COLOR)
CCL_NAMESPACE_BEGIN static constexpr OIIO_NAMESPACE_USING TypeDesc TypeFloat2(TypeDesc::FLOAT, TypeDesc::VEC2)