Blender
V3.3
|
#include "multires_reshape.h"
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "BLI_bitmap.h"
#include "BLI_math_vector.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "BKE_customdata.h"
#include "BKE_multires.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_eval.h"
#include "BKE_subdiv_foreach.h"
#include "BKE_subdiv_mesh.h"
#include "opensubdiv_converter_capi.h"
#include "opensubdiv_evaluator_capi.h"
#include "opensubdiv_topology_refiner_capi.h"
#include "atomic_ops.h"
#include "subdiv_converter.h"
Go to the source code of this file.
Classes | |
struct | SurfacePoint |
struct | SurfaceGrid |
struct | Vertex |
struct | Corner |
struct | Face |
struct | Edge |
struct | LinearGridElement |
struct | LinearGrid |
struct | LinearGrids |
struct | MultiresReshapeSmoothContext |
struct | ForeachTopLevelGridCoordTaskData |
Typedefs | |
Local Structs | |
typedef struct SurfacePoint | SurfacePoint |
typedef struct SurfaceGrid | SurfaceGrid |
typedef struct Vertex | Vertex |
typedef struct Corner | Corner |
typedef struct Face | Face |
typedef struct Edge | Edge |
typedef struct LinearGridElement | LinearGridElement |
typedef struct LinearGrid | LinearGrid |
typedef struct LinearGrids | LinearGrids |
typedef struct MultiresReshapeSmoothContext | MultiresReshapeSmoothContext |
Functions | |
Linear grids manipulation | |
static void | linear_grids_init (LinearGrids *linear_grids) |
static void | linear_grids_allocate (LinearGrids *linear_grids, int num_grids, int level) |
static LinearGridElement * | linear_grid_element_get (const LinearGrids *linear_grids, const GridCoord *grid_coord) |
static void | linear_grids_free (LinearGrids *linear_grids) |
static void | linear_grid_element_init (LinearGridElement *linear_grid_element) |
static void | linear_grid_element_sub (LinearGridElement *result, const LinearGridElement *a, const LinearGridElement *b) |
static void | linear_grid_element_interpolate (LinearGridElement *result, const LinearGridElement elements[4], const float weights[4]) |
Surface | |
static void | base_surface_grids_allocate (MultiresReshapeSmoothContext *reshape_smooth_context) |
static void | base_surface_grids_free (MultiresReshapeSmoothContext *reshape_smooth_context) |
static SurfacePoint * | base_surface_grids_read (const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord) |
static void | base_surface_grids_write (const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord, float P[3], float tangent_matrix[3][3]) |
Generation of a topology information for OpenSubdiv converter | |
Calculates vertices, their coordinates in the original grids, and connections of them so then it's easy to create OpenSubdiv's topology refiner. | |
static int | get_reshape_level_resolution (const MultiresReshapeContext *reshape_context) |
static bool | is_crease_supported (const MultiresReshapeSmoothContext *reshape_smooth_context) |
static char | get_effective_crease_char (const MultiresReshapeSmoothContext *reshape_smooth_context, const MEdge *base_edge) |
static float | get_effective_crease_float (const MultiresReshapeSmoothContext *reshape_smooth_context, const float crease) |
static void | context_init (MultiresReshapeSmoothContext *reshape_smooth_context, const MultiresReshapeContext *reshape_context, const eMultiresSubdivideModeType mode) |
static void | context_free_geometry (MultiresReshapeSmoothContext *reshape_smooth_context) |
static void | context_free_subdiv (MultiresReshapeSmoothContext *reshape_smooth_context) |
static void | context_free (MultiresReshapeSmoothContext *reshape_smooth_context) |
static bool | foreach_topology_info (const SubdivForeachContext *foreach_context, const int num_vertices, const int num_edges, const int num_loops, const int num_polygons, const int *UNUSED(subdiv_polygon_offset)) |
static void | foreach_single_vertex (const SubdivForeachContext *foreach_context, const GridCoord *grid_coord, const int coarse_vertex_index, const int subdiv_vertex_index) |
static void | foreach_vertex (const SubdivForeachContext *foreach_context, const PTexCoord *ptex_coord, const int coarse_vertex_index, const int subdiv_vertex_index) |
static void | foreach_vertex_inner (const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int UNUSED(coarse_poly_index), const int UNUSED(coarse_corner), const int subdiv_vertex_index) |
static void | foreach_vertex_every_corner (const struct SubdivForeachContext *foreach_context, void *UNUSED(tls_v), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int coarse_vertex_index, const int UNUSED(coarse_face_index), const int UNUSED(coarse_face_corner), const int subdiv_vertex_index) |
static void | foreach_vertex_every_edge (const struct SubdivForeachContext *foreach_context, void *UNUSED(tls_v), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int UNUSED(coarse_edge_index), const int UNUSED(coarse_face_index), const int UNUSED(coarse_face_corner), const int subdiv_vertex_index) |
static void | foreach_loop (const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int UNUSED(ptex_face_index), const float UNUSED(ptex_face_u), const float UNUSED(ptex_face_v), const int UNUSED(coarse_loop_index), const int coarse_poly_index, const int coarse_corner, const int subdiv_loop_index, const int subdiv_vertex_index, const int UNUSED(subdiv_edge_index)) |
static void | foreach_poly (const SubdivForeachContext *foreach_context, void *UNUSED(tls), const int UNUSED(coarse_poly_index), const int subdiv_poly_index, const int start_loop_index, const int num_loops) |
static void | foreach_vertex_of_loose_edge (const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int UNUSED(coarse_edge_index), const float UNUSED(u), const int vertex_index) |
static void | store_edge (MultiresReshapeSmoothContext *reshape_smooth_context, const int subdiv_v1, const int subdiv_v2, const char crease) |
static void | foreach_edge (const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int coarse_edge_index, const int UNUSED(subdiv_edge_index), const bool is_loose, const int subdiv_v1, const int subdiv_v2) |
static void | geometry_init_loose_information (MultiresReshapeSmoothContext *reshape_smooth_context) |
static void | geometry_create (MultiresReshapeSmoothContext *reshape_smooth_context) |
Linearly interpolated data | |
static LinearGridElement | linear_grid_element_orig_get (const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord) |
static LinearGridElement | linear_grid_element_final_get (const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord) |
static void | linear_grid_element_delta_interpolate (const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord, LinearGridElement *result) |
static void | evaluate_linear_delta_grids_callback (const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *UNUSED(ptex_coord), const GridCoord *grid_coord, void *UNUSED(userdata_v)) |
static void | evaluate_linear_delta_grids (MultiresReshapeSmoothContext *reshape_smooth_context) |
static void | propagate_linear_data_delta (const MultiresReshapeSmoothContext *reshape_smooth_context, ReshapeGridElement *final_grid_element, const GridCoord *grid_coord) |
Evaluation of base surface | |
static void | evaluate_base_surface_grids_callback (const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *UNUSED(userdata_v)) |
static void | evaluate_base_surface_grids (const MultiresReshapeSmoothContext *reshape_smooth_context) |
Evaluation of new surface | |
static void | evaluate_final_original_point (const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord, float r_orig_final_P[3]) |
static void | evaluate_higher_grid_positions_with_details_callback (const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *UNUSED(userdata_v)) |
static void | evaluate_higher_grid_positions_with_details (const MultiresReshapeSmoothContext *reshape_smooth_context) |
static void | evaluate_higher_grid_positions_callback (const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *UNUSED(userdata_v)) |
static void | evaluate_higher_grid_positions (const MultiresReshapeSmoothContext *reshape_smooth_context) |
Entry point | |
void | multires_reshape_smooth_object_grids_with_details (const MultiresReshapeContext *reshape_context) |
void | multires_reshape_smooth_object_grids (const MultiresReshapeContext *reshape_context, const eMultiresSubdivideModeType mode) |
Evaluation of subdivision surface at a reshape level | |
typedef void(* | ForeachTopLevelGridCoordCallback) (const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *userdata_v) |
typedef struct ForeachTopLevelGridCoordTaskData | ForeachHighLevelCoordTaskData |
static int | get_face_grid_index (const MultiresReshapeSmoothContext *reshape_smooth_context, const Face *face) |
static GridCoord * | vertex_grid_coord_with_grid_index (const Vertex *vertex, const int grid_index) |
static void | grid_coords_from_face_vertices (const MultiresReshapeSmoothContext *reshape_smooth_context, const Face *face, const GridCoord *grid_coords[]) |
static float | lerp (float t, float a, float b) |
static void | interpolate_grid_coord (GridCoord *result, const GridCoord *face_grid_coords[4], const float u, const float v) |
static void | foreach_toplevel_grid_coord_task (void *__restrict userdata_v, const int face_index, const TaskParallelTLS *__restrict UNUSED(tls)) |
static void | foreach_toplevel_grid_coord (const MultiresReshapeSmoothContext *reshape_smooth_context, ForeachTopLevelGridCoordCallback callback, void *callback_userdata_v) |
typedef struct ForeachTopLevelGridCoordTaskData ForeachHighLevelCoordTaskData |
typedef void(* ForeachTopLevelGridCoordCallback) (const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *userdata_v) |
Definition at line 311 of file multires_reshape_smooth.c.
typedef struct LinearGrid LinearGrid |
typedef struct LinearGridElement LinearGridElement |
typedef struct LinearGrids LinearGrids |
typedef struct MultiresReshapeSmoothContext MultiresReshapeSmoothContext |
typedef void() ReshapeSubdivCoarsePositionCb(const MultiresReshapeSmoothContext *reshape_smooth_context, const Vertex *vertex, float r_P[3]) |
Definition at line 1086 of file multires_reshape_smooth.c.
typedef struct SurfaceGrid SurfaceGrid |
typedef struct SurfacePoint SurfacePoint |
|
static |
Definition at line 247 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::base_surface_grids, MultiresReshapeContext::grid_size, MEM_calloc_arrayN, MEM_malloc_arrayN, MultiresReshapeContext::num_grids, SurfaceGrid::points, MultiresReshapeSmoothContext::reshape_context, and MultiresReshapeContext::top.
Referenced by multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 265 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::base_surface_grids, MEM_freeN, NULL, MultiresReshapeContext::num_grids, SurfaceGrid::points, and MultiresReshapeSmoothContext::reshape_context.
Referenced by context_free().
|
static |
Definition at line 280 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::base_surface_grids, GridCoord::grid_index, MultiresReshapeContext::grid_size, SurfaceGrid::points, MultiresReshapeSmoothContext::reshape_context, MultiresReshapeContext::top, GridCoord::u, and GridCoord::v.
Referenced by base_surface_grids_write(), and evaluate_higher_grid_positions_with_details_callback().
|
static |
Definition at line 295 of file multires_reshape_smooth.c.
References base_surface_grids_read(), copy_m3_m3(), copy_v3_v3(), P(), and point.
Referenced by evaluate_base_surface_grids_callback().
|
static |
Definition at line 555 of file multires_reshape_smooth.c.
References base_surface_grids_free(), context_free_geometry(), context_free_subdiv(), MEM_freeN, and MultiresReshapeSmoothContext::non_loose_base_edge_map.
Referenced by multires_reshape_smooth_object_grids(), and multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 532 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::corners, MultiresReshapeSmoothContext::edges, MultiresReshapeSmoothContext::faces, MultiresReshapeSmoothContext::geometry, Vertex::grid_coords, MultiresReshapeSmoothContext::linear_delta_grids, linear_grids_free(), MEM_SAFE_FREE, NULL, MultiresReshapeSmoothContext::num_vertices, and MultiresReshapeSmoothContext::vertices.
Referenced by context_free().
|
static |
Definition at line 547 of file multires_reshape_smooth.c.
References BKE_subdiv_free(), NULL, and MultiresReshapeSmoothContext::reshape_subdiv.
Referenced by context_free().
|
static |
Definition at line 504 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::base_surface_grids, MultiresReshapeSmoothContext::corners, MultiresReshapeSmoothContext::edges, MultiresReshapeSmoothContext::faces, MultiresReshapeSmoothContext::geometry, MultiresReshapeSmoothContext::linear_delta_grids, linear_grids_init(), MultiresReshapeSmoothContext::max_edges, MultiresReshapeSmoothContext::non_loose_base_edge_map, NULL, MultiresReshapeSmoothContext::num_corners, MultiresReshapeSmoothContext::num_edges, MultiresReshapeSmoothContext::num_faces, MultiresReshapeSmoothContext::num_vertices, MultiresReshapeSmoothContext::reshape_context, MultiresReshapeSmoothContext::reshape_subdiv, MultiresReshapeSmoothContext::smoothing_type, and MultiresReshapeSmoothContext::vertices.
Referenced by multires_reshape_smooth_object_grids(), and multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 1027 of file multires_reshape_smooth.c.
References OpenSubdiv_Converter::finishUVLayer, OpenSubdiv_Converter::freeUserData, get_edge_sharpness(), get_edge_vertices(), get_face_vertices(), get_fvar_linear_interpolation(), get_num_edges(), get_num_face_vertices(), get_num_faces(), get_num_vertices(), get_scheme_type(), get_vertex_sharpness(), get_vtx_boundary_interpolation(), OpenSubdiv_Converter::getEdgeFaces, OpenSubdiv_Converter::getEdgeSharpness, OpenSubdiv_Converter::getEdgeVertices, OpenSubdiv_Converter::getFaceCornerUVIndex, OpenSubdiv_Converter::getFaceEdges, OpenSubdiv_Converter::getFaceVertices, OpenSubdiv_Converter::getFVarLinearInterpolation, OpenSubdiv_Converter::getNumEdgeFaces, OpenSubdiv_Converter::getNumEdges, OpenSubdiv_Converter::getNumFaces, OpenSubdiv_Converter::getNumFaceVertices, OpenSubdiv_Converter::getNumUVCoordinates, OpenSubdiv_Converter::getNumUVLayers, OpenSubdiv_Converter::getNumVertexEdges, OpenSubdiv_Converter::getNumVertexFaces, OpenSubdiv_Converter::getNumVertices, OpenSubdiv_Converter::getSchemeType, OpenSubdiv_Converter::getVertexEdges, OpenSubdiv_Converter::getVertexFaces, OpenSubdiv_Converter::getVertexSharpness, OpenSubdiv_Converter::getVtxBoundaryInterpolation, is_infinite_sharp_vertex(), OpenSubdiv_Converter::isInfiniteSharpVertex, NULL, OpenSubdiv_Converter::precalcUVLayer, specifies_full_topology(), OpenSubdiv_Converter::specifiesFullTopology, and OpenSubdiv_Converter::user_data.
Referenced by reshape_subdiv_create().
|
static |
Definition at line 1349 of file multires_reshape_smooth.c.
References evaluate_base_surface_grids_callback(), foreach_toplevel_grid_coord(), and NULL.
Referenced by multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 1335 of file multires_reshape_smooth.c.
References base_surface_grids_write(), and reshape_subdiv_evaluate_limit_at_grid().
Referenced by evaluate_base_surface_grids().
|
static |
Definition at line 1362 of file multires_reshape_smooth.c.
References add_v3_v3v3(), ReshapeConstGridElement::displacement, mul_v3_m3v3(), multires_reshape_evaluate_limit_at_grid(), multires_reshape_orig_grid_element_for_grid_coord(), and MultiresReshapeSmoothContext::reshape_context.
Referenced by evaluate_higher_grid_positions_with_details_callback().
|
static |
Definition at line 1467 of file multires_reshape_smooth.c.
References evaluate_higher_grid_positions_callback(), foreach_toplevel_grid_coord(), and NULL.
Referenced by multires_reshape_smooth_object_grids().
|
static |
Definition at line 1444 of file multires_reshape_smooth.c.
References BKE_subdiv_eval_limit_point(), copy_v3_v3(), ReshapeGridElement::displacement, multires_reshape_grid_element_for_grid_coord(), P(), propagate_linear_data_delta(), PTexCoord::ptex_face_index, MultiresReshapeSmoothContext::reshape_context, MultiresReshapeSmoothContext::reshape_subdiv, PTexCoord::u, and PTexCoord::v.
Referenced by evaluate_higher_grid_positions().
|
static |
Definition at line 1437 of file multires_reshape_smooth.c.
References evaluate_higher_grid_positions_with_details_callback(), foreach_toplevel_grid_coord(), and NULL.
Referenced by multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 1387 of file multires_reshape_smooth.c.
References add_v3_v3v3(), base_surface_grids_read(), ReshapeGridElement::displacement, evaluate_final_original_point(), invert_m3_m3(), mul_v3_m3v3(), multires_reshape_grid_element_for_grid_coord(), SurfacePoint::P, propagate_linear_data_delta(), MultiresReshapeSmoothContext::reshape_context, reshape_subdiv_evaluate_limit_at_grid(), sub_v3_v3v3(), and SurfacePoint::tangent_matrix.
Referenced by evaluate_higher_grid_positions_with_details().
|
static |
Definition at line 1300 of file multires_reshape_smooth.c.
References evaluate_linear_delta_grids_callback(), foreach_toplevel_grid_coord(), MultiresReshapeContext::level, MultiresReshapeSmoothContext::linear_delta_grids, linear_grids_allocate(), NULL, MultiresReshapeContext::num_grids, MultiresReshapeSmoothContext::reshape_context, and MultiresReshapeContext::top.
Referenced by multires_reshape_smooth_object_grids(), and multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 1288 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::linear_delta_grids, linear_grid_element_delta_interpolate(), and linear_grid_element_get().
Referenced by evaluate_linear_delta_grids().
|
static |
Definition at line 808 of file multires_reshape_smooth.c.
References MultiresReshapeContext::base_mesh, BLI_BITMAP_TEST_BOOL, get_effective_crease_char(), Mesh::medge, MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE, MultiresReshapeSmoothContext::non_loose_base_edge_map, ORIGINDEX_NONE, MultiresReshapeSmoothContext::reshape_context, MultiresReshapeSmoothContext::smoothing_type, store_edge(), and SubdivForeachContext::user_data.
Referenced by geometry_create().
|
static |
Definition at line 738 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::corners, MultiresReshapeContext::face_start_grid_index, MultiresReshapeSmoothContext::geometry, MultiresReshapeSmoothContext::reshape_context, SubdivForeachContext::user_data, and MultiresReshapeSmoothContext::vertices.
Referenced by geometry_create().
|
static |
Definition at line 762 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::faces, MultiresReshapeSmoothContext::geometry, Face::num_corners, Face::start_corner_index, and SubdivForeachContext::user_data.
Referenced by geometry_create().
|
static |
Definition at line 596 of file multires_reshape_smooth.c.
References BKE_subdiv_crease_to_sharpness_f(), BLI_assert, MultiresReshapeContext::cd_vertex_crease, MultiresReshapeSmoothContext::geometry, get_effective_crease_float(), Vertex::grid_coords, MEM_reallocN, NULL, Vertex::num_grid_coords, MultiresReshapeSmoothContext::reshape_context, Vertex::sharpness, SubdivForeachContext::user_data, and MultiresReshapeSmoothContext::vertices.
Referenced by foreach_vertex().
|
static |
Definition at line 440 of file multires_reshape_smooth.c.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), callback, data, float(), foreach_toplevel_grid_coord_task(), MultiresReshapeSmoothContext::geometry, MultiresReshapeContext::level, TaskParallelSettings::min_iter_per_thread, MultiresReshapeSmoothContext::num_faces, MultiresReshapeContext::reshape, MultiresReshapeSmoothContext::reshape_context, and MultiresReshapeContext::top.
Referenced by evaluate_base_surface_grids(), evaluate_higher_grid_positions(), evaluate_higher_grid_positions_with_details(), and evaluate_linear_delta_grids().
|
static |
Definition at line 408 of file multires_reshape_smooth.c.
References data, MultiresReshapeSmoothContext::faces, float(), MultiresReshapeSmoothContext::geometry, grid_coords_from_face_vertices(), interpolate_grid_coord(), PTexCoord::ptex_face_index, PTexCoord::u, PTexCoord::v, x, and y.
Referenced by foreach_toplevel_grid_coord().
|
static |
Definition at line 564 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::corners, MultiresReshapeSmoothContext::edges, MultiresReshapeSmoothContext::faces, MultiresReshapeSmoothContext::geometry, MultiresReshapeSmoothContext::max_edges, MEM_calloc_arrayN, MEM_malloc_arrayN, MULTIRES_SUBDIVIDE_LINEAR, MultiresReshapeSmoothContext::num_corners, MultiresReshapeSmoothContext::num_faces, MultiresReshapeSmoothContext::num_vertices, MultiresReshapeSmoothContext::smoothing_type, SubdivForeachContext::user_data, and MultiresReshapeSmoothContext::vertices.
Referenced by geometry_create().
|
static |
Definition at line 634 of file multires_reshape_smooth.c.
References MultiresReshapeContext::base_mesh, MultiresReshapeContext::face_start_grid_index, foreach_single_vertex(), GridCoord::grid_index, Mesh::mpoly, multires_reshape_grid_to_face_index(), multires_reshape_ptex_coord_to_grid(), MultiresReshapeSmoothContext::reshape_context, MPoly::totloop, GridCoord::u, SubdivForeachContext::user_data, and GridCoord::v.
Referenced by foreach_vertex_every_corner(), foreach_vertex_every_edge(), and foreach_vertex_inner().
|
static |
Definition at line 702 of file multires_reshape_smooth.c.
References foreach_vertex(), and PTexCoord::ptex_face_index.
Referenced by geometry_create().
|
static |
Definition at line 720 of file multires_reshape_smooth.c.
References foreach_vertex(), and PTexCoord::ptex_face_index.
Referenced by geometry_create().
|
static |
Definition at line 685 of file multires_reshape_smooth.c.
References foreach_vertex(), and PTexCoord::ptex_face_index.
Referenced by geometry_create().
|
static |
Definition at line 778 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::geometry, Vertex::is_infinite_sharp, Vertex::num_grid_coords, SubdivForeachContext::user_data, and MultiresReshapeSmoothContext::vertices.
Referenced by geometry_create().
|
static |
Definition at line 879 of file multires_reshape_smooth.c.
References MultiresReshapeContext::base_mesh, BKE_subdiv_foreach_subdiv_geometry(), foreach_edge(), foreach_loop(), foreach_poly(), foreach_topology_info(), foreach_vertex_every_corner(), foreach_vertex_every_edge(), foreach_vertex_inner(), foreach_vertex_of_loose_edge(), geometry_init_loose_information(), get_reshape_level_resolution(), MultiresReshapeSmoothContext::reshape_context, SubdivToMeshSettings::resolution, MultiresReshapeContext::subdiv, SubdivForeachContext::topology_info, and SubdivToMeshSettings::use_optimal_display.
Referenced by multires_reshape_smooth_object_grids(), and multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 846 of file multires_reshape_smooth.c.
References MultiresReshapeContext::base_mesh, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST_BOOL, MLoop::e, MultiresReshapeSmoothContext::geometry, get_effective_crease_char(), get_reshape_level_resolution(), MPoly::loopstart, MultiresReshapeSmoothContext::max_edges, Mesh::medge, Mesh::mloop, Mesh::mpoly, MultiresReshapeSmoothContext::non_loose_base_edge_map, MultiresReshapeSmoothContext::reshape_context, Mesh::totedge, MPoly::totloop, and Mesh::totpoly.
Referenced by geometry_create().
|
static |
Definition at line 999 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::edges, MultiresReshapeSmoothContext::geometry, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 987 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::edges, MultiresReshapeSmoothContext::geometry, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 486 of file multires_reshape_smooth.c.
References MEdge::crease, and is_crease_supported().
Referenced by foreach_edge(), and geometry_init_loose_information().
|
static |
Definition at line 495 of file multires_reshape_smooth.c.
References is_crease_supported().
Referenced by foreach_single_vertex().
|
static |
Definition at line 328 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::corners, MultiresReshapeSmoothContext::geometry, Corner::grid_index, Face::num_corners, and Face::start_corner_index.
Referenced by grid_coords_from_face_vertices().
|
static |
Definition at line 965 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::corners, MultiresReshapeSmoothContext::faces, MultiresReshapeSmoothContext::geometry, Face::num_corners, Face::start_corner_index, OpenSubdiv_Converter::user_data, and MultiresReshapeSmoothContext::vertices.
Referenced by converter_init().
|
static |
Definition at line 927 of file multires_reshape_smooth.c.
References BKE_subdiv_converter_fvar_linear_from_settings(), MultiresReshapeSmoothContext::reshape_context, Subdiv::settings, MultiresReshapeContext::subdiv, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 981 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::geometry, MultiresReshapeSmoothContext::num_edges, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 956 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::faces, MultiresReshapeSmoothContext::geometry, Face::num_corners, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 942 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::geometry, MultiresReshapeSmoothContext::num_faces, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 949 of file multires_reshape_smooth.c.
References MultiresReshapeSmoothContext::geometry, MultiresReshapeSmoothContext::num_vertices, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 472 of file multires_reshape_smooth.c.
References MultiresReshapeContext::level, and MultiresReshapeContext::reshape.
Referenced by geometry_create(), and geometry_init_loose_information().
|
static |
Definition at line 912 of file multires_reshape_smooth.c.
References OSD_SCHEME_CATMARK.
Referenced by converter_init().
|
static |
Definition at line 1008 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::geometry, Vertex::sharpness, OpenSubdiv_Converter::user_data, and MultiresReshapeSmoothContext::vertices.
Referenced by converter_init().
|
static |
Definition at line 917 of file multires_reshape_smooth.c.
References BKE_subdiv_converter_vtx_boundary_interpolation_from_settings(), MultiresReshapeSmoothContext::reshape_context, Subdiv::settings, MultiresReshapeContext::subdiv, and OpenSubdiv_Converter::user_data.
Referenced by converter_init().
|
static |
Definition at line 357 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::corners, MultiresReshapeSmoothContext::geometry, get_face_grid_index(), NULL, Face::num_corners, Face::start_corner_index, and vertex_grid_coord_with_grid_index().
Referenced by foreach_toplevel_grid_coord_task().
|
static |
Definition at line 380 of file multires_reshape_smooth.c.
References GridCoord::grid_index, lerp(), result, and v.
Referenced by foreach_toplevel_grid_coord_task().
|
static |
Definition at line 477 of file multires_reshape_smooth.c.
References ELEM, MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE, and MultiresReshapeSmoothContext::smoothing_type.
Referenced by get_effective_crease_char(), and get_effective_crease_float().
|
static |
Definition at line 1017 of file multires_reshape_smooth.c.
References BLI_assert, MultiresReshapeSmoothContext::geometry, Vertex::is_infinite_sharp, OpenSubdiv_Converter::user_data, and MultiresReshapeSmoothContext::vertices.
Referenced by converter_init().
Definition at line 375 of file multires_reshape_smooth.c.
References Freestyle::a, usdtokens::b(), and t.
Referenced by btSoftBodyHelpers::CreatePatch(), btSoftBodyHelpers::CreatePatchUV(), btSoftBodyHelpers::CreateRope(), debugDrawPhase(), init_test_curve(), interpolate_grid_coord(), interpolate_hair_points(), LerpCurveSegmentMotionCV(), shutter_curve_eval(), BVHSpatialSplit::split_curve_primitive(), BVHSpatialSplit::split_triangle_primitive(), and work_balance_do_rebalance().
|
static |
Definition at line 1245 of file multires_reshape_smooth.c.
References BKE_subdiv_grid_size_from_level(), float(), GridCoord::grid_index, MultiresReshapeContext::level, linear_grid_element_final_get(), linear_grid_element_interpolate(), linear_grid_element_orig_get(), linear_grid_element_sub(), MultiresReshapeContext::reshape, MultiresReshapeSmoothContext::reshape_context, result, GridCoord::u, GridCoord::v, and v.
Referenced by evaluate_linear_delta_grids_callback().
|
static |
Definition at line 1223 of file multires_reshape_smooth.c.
References linear_grid_element_init(), ReshapeGridElement::mask, LinearGridElement::mask, multires_reshape_grid_element_for_grid_coord(), NULL, and MultiresReshapeSmoothContext::reshape_context.
Referenced by linear_grid_element_delta_interpolate().
|
static |
Definition at line 198 of file multires_reshape_smooth.c.
References BLI_assert, LinearGrid::elements, GridCoord::grid_index, LinearGrids::grid_size, LinearGrids::grids, LinearGrids::num_grids, GridCoord::u, and GridCoord::v.
Referenced by evaluate_linear_delta_grids_callback(), and propagate_linear_data_delta().
|
static |
Definition at line 220 of file multires_reshape_smooth.c.
References LinearGridElement::mask.
Referenced by linear_grid_element_final_get(), and linear_grid_element_orig_get().
|
static |
Definition at line 233 of file multires_reshape_smooth.c.
References LinearGridElement::mask, and result.
Referenced by linear_grid_element_delta_interpolate().
|
static |
Definition at line 1208 of file multires_reshape_smooth.c.
References linear_grid_element_init(), ReshapeConstGridElement::mask, LinearGridElement::mask, multires_reshape_orig_grid_element_for_grid_coord(), and MultiresReshapeSmoothContext::reshape_context.
Referenced by linear_grid_element_delta_interpolate().
|
static |
Definition at line 226 of file multires_reshape_smooth.c.
References Freestyle::a, usdtokens::b(), and result.
Referenced by linear_grid_element_delta_interpolate().
|
static |
Definition at line 178 of file multires_reshape_smooth.c.
References BKE_subdiv_grid_size_from_level(), LinearGrid::elements, LinearGrids::elements_storage, LinearGrids::grid_size, LinearGrids::grids, LinearGrids::level, MEM_calloc_arrayN, MEM_malloc_arrayN, and LinearGrids::num_grids.
Referenced by evaluate_linear_delta_grids().
|
static |
Definition at line 214 of file multires_reshape_smooth.c.
References LinearGrids::elements_storage, LinearGrids::grids, and MEM_SAFE_FREE.
Referenced by context_free_geometry().
|
static |
Definition at line 169 of file multires_reshape_smooth.c.
References LinearGrids::elements_storage, LinearGrids::grids, LinearGrids::level, NULL, and LinearGrids::num_grids.
Referenced by context_init().
void multires_reshape_smooth_object_grids | ( | const MultiresReshapeContext * | reshape_context, |
enum eMultiresSubdivideModeType | mode | ||
) |
Operates on a displacement grids (CD_MDISPS) which contains object space-coordinates stored for the reshape level.
Makes it so surface on top level looks smooth. Details are not preserved
Definition at line 1512 of file multires_reshape_smooth.c.
References context_free(), context_init(), evaluate_higher_grid_positions(), evaluate_linear_delta_grids(), geometry_create(), MultiresReshapeContext::level, MultiresReshapeContext::reshape, reshape_subdiv_create(), reshape_subdiv_refine_final(), and MultiresReshapeContext::top.
Referenced by multiresModifier_subdivide_to_level().
void multires_reshape_smooth_object_grids_with_details | ( | const MultiresReshapeContext * | reshape_context | ) |
Operates on a displacement grids (CD_MDISPS) which contains object space coordinates stored for the reshape level.
The result is grids which are defining mesh with a smooth surface and details starting from reshape level up to top level added back from original displacement grids.
Definition at line 1480 of file multires_reshape_smooth.c.
References base_surface_grids_allocate(), context_free(), context_init(), evaluate_base_surface_grids(), evaluate_higher_grid_positions_with_details(), evaluate_linear_delta_grids(), geometry_create(), SubdivSettings::is_simple, MultiresReshapeContext::level, MULTIRES_SUBDIVIDE_CATMULL_CLARK, MULTIRES_SUBDIVIDE_SIMPLE, MultiresReshapeContext::reshape, reshape_subdiv_create(), reshape_subdiv_refine_final(), reshape_subdiv_refine_orig(), Subdiv::settings, MultiresReshapeContext::subdiv, and MultiresReshapeContext::top.
Referenced by multiresModifier_reshapeFromCCG(), multiresModifier_reshapeFromVertcos(), and multiresModifier_subdivide_to_level().
|
static |
Definition at line 1311 of file multires_reshape_smooth.c.
References clamp_f(), MultiresReshapeSmoothContext::linear_delta_grids, linear_grid_element_get(), ReshapeGridElement::mask, ReshapeConstGridElement::mask, LinearGridElement::mask, multires_reshape_orig_grid_element_for_grid_coord(), NULL, and MultiresReshapeSmoothContext::reshape_context.
Referenced by evaluate_higher_grid_positions_callback(), and evaluate_higher_grid_positions_with_details_callback().
|
static |
Definition at line 1067 of file multires_reshape_smooth.c.
References BKE_subdiv_converter_free(), BKE_subdiv_eval_begin(), BKE_subdiv_new_from_converter(), converter_init(), NULL, MultiresReshapeSmoothContext::reshape_context, MultiresReshapeSmoothContext::reshape_subdiv, Subdiv::settings, MultiresReshapeContext::subdiv, and SUBDIV_EVALUATOR_TYPE_CPU.
Referenced by multires_reshape_smooth_object_grids(), and multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 1177 of file multires_reshape_smooth.c.
References BKE_subdiv_eval_limit_point_and_derivatives(), GridCoord::grid_index, multires_reshape_grid_to_corner(), multires_reshape_grid_to_face_index(), multires_reshape_tangent_matrix_for_corner(), PTexCoord::ptex_face_index, MultiresReshapeSmoothContext::reshape_context, MultiresReshapeSmoothContext::reshape_subdiv, PTexCoord::u, and PTexCoord::v.
Referenced by evaluate_base_surface_grids_callback(), and evaluate_higher_grid_positions_with_details_callback().
|
static |
Definition at line 1092 of file multires_reshape_smooth.c.
References Subdiv::evaluator, MultiresReshapeSmoothContext::geometry, MultiresReshapeSmoothContext::num_vertices, P(), OpenSubdiv_Evaluator::refine, MultiresReshapeSmoothContext::reshape_subdiv, OpenSubdiv_Evaluator::setCoarsePositions, and MultiresReshapeSmoothContext::vertices.
Referenced by reshape_subdiv_refine_final(), and reshape_subdiv_refine_orig().
|
static |
Definition at line 1172 of file multires_reshape_smooth.c.
References reshape_subdiv_refine(), and reshape_subdiv_refine_final_P().
Referenced by multires_reshape_smooth_object_grids(), and multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 1153 of file multires_reshape_smooth.c.
References copy_v3_v3(), ReshapeGridElement::displacement, multires_reshape_grid_element_for_grid_coord(), NULL, MultiresReshapeSmoothContext::reshape_context, reshape_subdiv_refine_vertex_grid_coord(), and zero_v3().
Referenced by reshape_subdiv_refine_final().
|
static |
Definition at line 1147 of file multires_reshape_smooth.c.
References reshape_subdiv_refine(), and reshape_subdiv_refine_orig_P().
Referenced by multires_reshape_smooth_object_grids_with_details().
|
static |
Definition at line 1123 of file multires_reshape_smooth.c.
References add_v3_v3v3(), D(), ReshapeConstGridElement::displacement, mul_v3_m3v3(), multires_reshape_evaluate_limit_at_grid(), multires_reshape_orig_grid_element_for_grid_coord(), NULL, MultiresReshapeSmoothContext::reshape_context, reshape_subdiv_refine_vertex_grid_coord(), and zero_v3().
Referenced by reshape_subdiv_refine_orig().
BLI_INLINE const GridCoord* reshape_subdiv_refine_vertex_grid_coord | ( | const Vertex * | vertex | ) |
Definition at line 1109 of file multires_reshape_smooth.c.
References Vertex::grid_coords, NULL, and Vertex::num_grid_coords.
Referenced by reshape_subdiv_refine_final_P(), and reshape_subdiv_refine_orig_P().
|
static |
Definition at line 937 of file multires_reshape_smooth.c.
Referenced by converter_init().
|
static |
Definition at line 792 of file multires_reshape_smooth.c.
References atomic_fetch_and_add_z(), BKE_subdiv_crease_to_sharpness_char(), BLI_assert, MultiresReshapeSmoothContext::edges, MultiresReshapeSmoothContext::geometry, and MultiresReshapeSmoothContext::num_edges.
Referenced by foreach_edge().
|
static |
Definition at line 345 of file multires_reshape_smooth.c.
References Vertex::grid_coords, GridCoord::grid_index, NULL, and Vertex::num_grid_coords.
Referenced by grid_coords_from_face_vertices().