Blender
V3.3
|
#include "blender/session.h"
#include "blender/sync.h"
#include "blender/util.h"
#include "scene/camera.h"
#include "scene/colorspace.h"
#include "scene/mesh.h"
#include "scene/object.h"
#include "scene/scene.h"
#include "subd/patch.h"
#include "subd/split.h"
#include "util/algorithm.h"
#include "util/color.h"
#include "util/disjoint_set.h"
#include "util/foreach.h"
#include "util/hash.h"
#include "util/log.h"
#include "util/math.h"
#include "mikktspace.h"
Go to the source code of this file.
Classes | |
struct | MikkUserData |
class | VertexAverageComparator |
Functions | |
static int | mikk_get_num_faces (const SMikkTSpaceContext *context) |
static int | mikk_get_num_verts_of_face (const SMikkTSpaceContext *context, const int face_num) |
static int | mikk_vertex_index (const Mesh *mesh, const int face_num, const int vert_num) |
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 void | mikk_get_texture_coordinate (const SMikkTSpaceContext *context, float uv[2], const int face_num, const int vert_num) |
static void | mikk_get_normal (const SMikkTSpaceContext *context, float N[3], const int face_num, const int vert_num) |
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 | mikk_compute_tangents (const BL::Mesh &b_mesh, const char *layer_name, Mesh *mesh, bool need_sign, bool active_render) |
template<typename TypeInCycles , typename GetValueAtIndex > | |
static void | fill_generic_attribute (BL::Mesh &b_mesh, TypeInCycles *data, const BL::Attribute::domain_enum b_domain, const bool subdivision, const GetValueAtIndex &get_value_at_index) |
static void | attr_create_motion (Mesh *mesh, BL::Attribute &b_attribute, const float motion_scale) |
static void | attr_create_generic (Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, const bool subdivision, const bool need_motion, const float motion_scale) |
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_pointiness (Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivision) |
static void | attr_create_random_per_island (Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivision) |
static void | create_mesh (Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, const array< Node * > &used_shaders, const bool need_motion, const float motion_scale, const bool subdivision=false, const bool subdivide_uvs=true) |
static void | create_subd_mesh (Scene *scene, Mesh *mesh, BObjectInfo &b_ob_info, BL::Mesh &b_mesh, const array< Node * > &used_shaders, const bool need_motion, const float motion_scale, float dicing_rate, int max_subdivisions) |
|
static |
Definition at line 386 of file blender/mesh.cpp.
References AttributeSet::add(), attr_create_motion(), ATTR_ELEMENT_CORNER, ATTR_ELEMENT_CORNER_BYTE, ATTR_ELEMENT_FACE, ATTR_ELEMENT_NONE, ATTR_ELEMENT_VERTEX, ATTR_STD_VERTEX_COLOR, Attribute, AttributeSet::attributes, Geometry::attributes, Freestyle::c, color_float4_to_uchar4(), color_linear_to_srgb_v4(), data, Attribute::data_float(), Attribute::data_float2(), Attribute::data_float3(), Attribute::data_float4(), Attribute::data_uchar4(), element, fill_generic_attribute(), AttributeSet::find(), get_float4(), make_float2, make_float3, make_float4, mesh, Geometry::need_attribute(), scene, Attribute::std, TypeFloat2(), TypeRGBA(), and v.
Referenced by create_mesh().
|
static |
Definition at line 356 of file blender/mesh.cpp.
References AttributeSet::add(), ATTR_STD_MOTION_VERTEX_POSITION, Geometry::attributes, Attribute::data_float3(), AttributeSet::find(), get_float3(), mesh, P(), and Mesh::size.
Referenced by attr_create_generic().
|
static |
Definition at line 694 of file blender/mesh.cpp.
References AttributeSet::add(), angle(), ATTR_STD_POINTINESS, Geometry::attributes, EdgeMap::clear(), counter, data, blender::math::dot(), e, EdgeMap::exists(), vector< value_type, allocator_type >::free_memory(), get_float3(), EdgeMap::insert(), len_squared(), M_1_PI_F, mesh, Geometry::need_attribute(), normal, blender::math::normalize(), safe_acosf(), scene, sort(), v1, float3::x, float3::y, float3::z, and zero_float3().
Referenced by create_mesh().
|
static |
Definition at line 844 of file blender/mesh.cpp.
References AttributeSet::add(), ATTR_STD_RANDOM_PER_ISLAND, attribute, Geometry::attributes, data, e, DisjointSet::find(), hash_uint_to_float(), DisjointSet::join(), mesh, Geometry::need_attribute(), scene, and t.
Referenced by create_mesh().
|
static |
Definition at line 602 of file blender/mesh.cpp.
References ATTR_ELEMENT_CORNER, ATTR_STD_GENERATED, ATTR_STD_NONE, ATTR_STD_UV, ATTR_STD_UV_TANGENT, ATTR_STD_UV_TANGENT_SIGN, ATTR_SUBDIVIDED, Attribute::data_float2(), Attribute::flags, get_float2(), l, mesh, mikk_compute_tangents(), Geometry::need_attribute(), NULL, scene, and TypeFloat2().
Referenced by create_mesh().
Definition at line 538 of file blender/mesh.cpp.
References AttributeSet::add(), ATTR_ELEMENT_CORNER, ATTR_STD_GENERATED, ATTR_STD_NONE, ATTR_STD_UV, ATTR_STD_UV_TANGENT, ATTR_STD_UV_TANGENT_SIGN, Geometry::attributes, Attribute::data_float2(), get_float2(), get_int3(), l, mesh, mikk_compute_tangents(), Geometry::need_attribute(), NULL, AttributeSet::remove(), scene, t, and TypeFloat2().
Referenced by create_mesh().
|
static |
Definition at line 882 of file blender/mesh.cpp.
References AttributeSet::add(), Mesh::add_subd_face(), Mesh::add_triangle(), Mesh::add_vertex(), attr_create_generic(), attr_create_pointiness(), attr_create_random_per_island(), attr_create_subd_uv_map(), attr_create_uv_map(), ATTR_STD_GENERATED, ATTR_STD_GENERATED_TRANSFORM, ATTR_STD_UV_TANGENT, ATTR_STD_VERTEX_NORMAL, ATTR_SUBDIVIDED, Geometry::attributes, blender::math::clamp(), BMVert::co, Attribute::data_float3(), Attribute::data_transform(), Attribute::flags, get_float3(), get_int3(), make_float3, mesh, mesh_texture_space(), N, Geometry::need_attribute(), Mesh::reserve_mesh(), Mesh::reserve_subd_faces(), scene, array< T, alignment >::size(), size(), smooth(), Mesh::SUBDIVISION_CATMULL_CLARK, t, transform_scale(), transform_translate(), and v.
Referenced by create_subd_mesh().
|
static |
Definition at line 1024 of file blender/mesh.cpp.
References Mesh::add_edge_crease(), Mesh::add_vertex_crease(), Freestyle::c, create_mesh(), e, get_transform(), max, mesh, BObjectInfo::real_object, Mesh::reserve_subd_creases(), RNA_float_get(), RNA_pointer_get(), and scene.
|
static |
Definition at line 271 of file blender/mesh.cpp.
References count, data, e, float(), and t.
Referenced by attr_create_generic().
|
static |
Definition at line 209 of file blender/mesh.cpp.
References AttributeSet::add(), ATTR_ELEMENT_CORNER, ATTR_STD_UV_TANGENT, ATTR_STD_UV_TANGENT_SIGN, Geometry::attributes, blender::compositor::context, Attribute::data_float(), genTangSpaceDefault(), Mesh::get_num_subd_faces(), if(), SMikkTSpaceInterface::m_getNormal, SMikkTSpaceInterface::m_getNumFaces, SMikkTSpaceInterface::m_getNumVerticesOfFace, SMikkTSpaceInterface::m_getPosition, SMikkTSpaceInterface::m_getTexCoord, SMikkTSpaceInterface::m_setTSpaceBasic, mesh, mikk_get_normal(), mikk_get_num_faces(), mikk_get_num_verts_of_face(), mikk_get_position(), mikk_get_texture_coordinate(), mikk_set_tangent_space(), and NULL.
Referenced by attr_create_subd_uv_map(), and attr_create_uv_map().
|
static |
Definition at line 107 of file blender/mesh.cpp.
References Mesh::get_num_subd_faces(), Mesh::get_subd_face(), mesh, and Mesh::SubdFace::start_corner.
Referenced by mikk_get_texture_coordinate(), and mikk_set_tangent_space().
|
static |
Definition at line 161 of file blender/mesh.cpp.
References Mesh::Triangle::compute_normal(), blender::compositor::context, Mesh::get_num_subd_faces(), Mesh::get_subd_face(), Mesh::get_triangle(), if(), MikkUserData::mesh, mesh, mikk_vertex_index(), N, Mesh::SubdFace::normal(), Mesh::SubdFace::smooth, and MikkUserData::vertex_normal.
Referenced by mikk_compute_tangents().
|
static |
Definition at line 73 of file blender/mesh.cpp.
References blender::compositor::context, Mesh::get_num_subd_faces(), if(), MikkUserData::mesh, and Mesh::num_triangles().
Referenced by mikk_compute_tangents().
|
static |
Definition at line 84 of file blender/mesh.cpp.
References blender::compositor::context, Mesh::get_num_subd_faces(), if(), MikkUserData::mesh, and mesh.
Referenced by mikk_compute_tangents().
|
static |
Definition at line 118 of file blender/mesh.cpp.
References blender::compositor::context, MikkUserData::mesh, mesh, mikk_vertex_index(), P(), float3::x, float3::y, and float3::z.
Referenced by mikk_compute_tangents().
|
static |
Definition at line 132 of file blender/mesh.cpp.
References blender::compositor::context, if(), map_to_sphere(), MikkUserData::mesh, mesh, mikk_corner_index(), mikk_vertex_index(), NULL, MikkUserData::orco, MikkUserData::orco_loc, MikkUserData::orco_size, MikkUserData::texface, float2::x, and float2::y.
Referenced by mikk_compute_tangents().
|
static |
Definition at line 194 of file blender/mesh.cpp.
References blender::compositor::context, make_float3, MikkUserData::mesh, mesh, mikk_corner_index(), NULL, KDL::sign(), T, MikkUserData::tangent, and MikkUserData::tangent_sign.
Referenced by mikk_compute_tangents().
|
static |
Definition at line 96 of file blender/mesh.cpp.
References Mesh::get_num_subd_faces(), Mesh::get_subd_face(), mesh, and Mesh::SubdFace::start_corner.
Referenced by mikk_get_normal(), mikk_get_position(), and mikk_get_texture_coordinate().