Blender
V3.3
|
Classes | |
struct | IndexOffsets |
class | OBJWriter |
class | MTLWriter |
struct | FileTypeTraits |
struct | FileTypeTraits< eFileType::OBJ > |
struct | FileTypeTraits< eFileType::MTL > |
struct | FormattingSyntax |
struct | always_false |
class | FormatHandler |
struct | CustomBMeshDeleter |
class | OBJMesh |
struct | tex_map_XX |
struct | MTLMaterial |
class | OBJCurve |
class | OBJDepsgraph |
class | OBJParser |
class | MTLParser |
class | MeshFromGeometry |
struct | UniqueNodetreeDeleter |
class | ShaderNodetreeWrap |
class | CurveFromGeometry |
struct | GlobalVertices |
struct | PolyCorner |
struct | PolyElem |
struct | NurbsElement |
struct | Geometry |
class | obj_exporter_test |
class | ObjExporterWriterTest |
class | obj_exporter_regression_test |
struct | OBJExportParamsDefault |
struct | Expectation |
class | obj_importer_test |
class | obj_mtl_parser_test |
Typedefs | |
using | unique_bmesh_ptr = std::unique_ptr< BMesh, CustomBMeshDeleter > |
using | unique_nodetree_ptr = std::unique_ptr< bNodeTree, UniqueNodetreeDeleter > |
Enumerations | |
enum class | eFileType { OBJ , MTL } |
enum class | eOBJSyntaxElement { vertex_coords , vertex_coords_color , uv_vertex_coords , normal , poly_element_begin , vertex_uv_normal_indices , vertex_normal_indices , vertex_uv_indices , vertex_indices , poly_element_end , poly_usemtl , edge , cstype , nurbs_degree , curve_element_begin , curve_element_end , nurbs_parameter_begin , nurbs_parameters , nurbs_parameter_end , nurbs_group_end , new_line , mtllib , smooth_group , object_group , object_name , string } |
enum class | eMTLSyntaxElement { newmtl , Ni , d , Ns , illum , Ka , Kd , Ks , Ke , map_Kd , map_Ks , map_Ns , map_d , map_refl , map_Ke , map_Bump , string } |
enum | eGeometryType { GEOM_MESH = OB_MESH , GEOM_CURVE = OB_CURVES_LEGACY } |
Functions | |
static void | spaces_to_underscores (std::string &r_name) |
static int | calc_chunk_count (int count) |
template<typename Function > | |
void | obj_parallel_chunked_output (FormatHandler< eFileType::OBJ > &fh, int tot_count, const Function &function) |
static int | get_smooth_group (const OBJMesh &mesh, const OBJExportParams ¶ms, int poly_idx) |
template<typename... T> | |
constexpr FormattingSyntax | syntax_elem_to_formatting (const eOBJSyntaxElement key) |
template<typename... T> | |
constexpr FormattingSyntax | syntax_elem_to_formatting (const eMTLSyntaxElement key) |
static float | round_float_to_n_digits (const float f, int round_digits) |
static float3 | round_float3_to_n_digits (const float3 &v, int round_digits) |
static void | copy_property_from_node (const eNodeSocketDatatype property_type, const bNode *node, const char *identifier, MutableSpan< float > r_property) |
static void | linked_sockets_to_dest_id (const bNode *dest_node, const nodes::NodeTreeRef &node_tree, StringRefNull dest_socket_id, Vector< const nodes::OutputSocketRef * > &r_linked_sockets) |
static const bNode * | get_node_of_type (Span< const nodes::OutputSocketRef * > sockets_list, const int node_type) |
static std::string | get_image_filepath (const bNode *tex_node) |
static const nodes::NodeRef * | find_bsdf_node (const nodes::NodeTreeRef *nodetree) |
static void | store_bsdf_properties (const nodes::NodeRef *bsdf_node, const Material *material, MTLMaterial &r_mtl_mat) |
static void | store_image_textures (const nodes::NodeRef *bsdf_node, const nodes::NodeTreeRef *node_tree, const Material *material, MTLMaterial &r_mtl_mat) |
MTLMaterial | mtlmaterial_for_material (const Material *material) |
static void | print_exception_error (const std::system_error &ex) |
static bool | is_curve_nurbs_compatible (const Nurb *nurb) |
std::pair< Vector< std::unique_ptr< OBJMesh > >, Vector< std::unique_ptr< OBJCurve > > > | filter_supported_objects (Depsgraph *depsgraph, const OBJExportParams &export_params) |
static void | write_mesh_objects (Vector< std::unique_ptr< OBJMesh >> exportable_as_mesh, OBJWriter &obj_writer, MTLWriter *mtl_writer, const OBJExportParams &export_params) |
static void | write_nurbs_curve_objects (const Vector< std::unique_ptr< OBJCurve >> &exportable_as_nurbs, const OBJWriter &obj_writer) |
void | export_frame (Depsgraph *depsgraph, const OBJExportParams &export_params, const char *filepath) |
bool | append_frame_to_filename (const char *filepath, const int frame, char *r_filepath_with_frames) |
void | exporter_main (bContext *C, const OBJExportParams &export_params) |
Vector< Vector< int > > | fixup_invalid_polygon (Span< float3 > vertex_coords, Span< int > face_vertex_indices) |
void | transform_object (Object *object, const OBJImportParams &import_params) |
static Geometry * | create_geometry (Geometry *const prev_geometry, const eGeometryType new_type, StringRef name, Vector< std::unique_ptr< Geometry >> &r_all_geometries) |
static void | geom_add_vertex (const char *p, const char *end, GlobalVertices &r_global_vertices) |
static void | geom_add_mrgb_colors (const char *p, const char *end, GlobalVertices &r_global_vertices) |
static void | geom_add_vertex_normal (const char *p, const char *end, GlobalVertices &r_global_vertices) |
static void | geom_add_uv_vertex (const char *p, const char *end, GlobalVertices &r_global_vertices) |
static void | geom_add_edge (Geometry *geom, const char *p, const char *end, GlobalVertices &r_global_vertices) |
static void | geom_add_polygon (Geometry *geom, const char *p, const char *end, const GlobalVertices &global_vertices, const int material_index, const int group_index, const bool shaded_smooth) |
static Geometry * | geom_set_curve_type (Geometry *geom, const char *p, const char *end, const StringRef group_name, Vector< std::unique_ptr< Geometry >> &r_all_geometries) |
static void | geom_set_curve_degree (Geometry *geom, const char *p, const char *end) |
static void | geom_add_curve_vertex_indices (Geometry *geom, const char *p, const char *end, const GlobalVertices &global_vertices) |
static void | geom_add_curve_parameters (Geometry *geom, const char *p, const char *end) |
static void | geom_update_group (const StringRef rest_line, std::string &r_group_name) |
static void | geom_update_smooth_group (const char *p, const char *end, bool &r_state_shaded_smooth) |
static bool | parse_keyword (const char *&p, const char *end, StringRef keyword) |
static void | use_all_vertices_if_no_faces (Geometry *geom, const Vector< std::unique_ptr< Geometry >> &all_geometries, const GlobalVertices &global_vertices) |
static eMTLSyntaxElement | mtl_line_start_to_enum (const char *&p, const char *end) |
static bool | parse_texture_option (const char *&p, const char *end, MTLMaterial *material, tex_map_XX &tex_map) |
static void | parse_texture_map (const char *p, const char *end, MTLMaterial *material, const char *mtl_dir_path) |
static Material * | get_or_create_material (Main *bmain, const std::string &name, Map< std::string, std::unique_ptr< MTLMaterial >> &materials, Map< std::string, Material * > &created_materials, bool relative_paths) |
static void | set_property_of_socket (eNodeSocketDatatype property_type, StringRef socket_id, Span< float > value, bNode *r_node) |
static Image * | load_image_at_path (Main *bmain, const std::string &path, bool relative_paths) |
static Image * | create_placeholder_image (Main *bmain, const std::string &path) |
static Image * | load_texture_image (Main *bmain, const tex_map_XX &tex_map, bool relative_paths) |
StringRef | read_next_line (StringRef &buffer) |
static bool | is_whitespace (char c) |
void | fixup_line_continuations (char *p, char *end) |
const char * | drop_whitespace (const char *p, const char *end) |
const char * | drop_non_whitespace (const char *p, const char *end) |
static const char * | drop_plus (const char *p, const char *end) |
const char * | parse_float (const char *p, const char *end, float fallback, float &dst, bool skip_space, bool require_trailing_space) |
const char * | parse_floats (const char *p, const char *end, float fallback, float *dst, int count, bool require_trailing_space) |
const char * | parse_int (const char *p, const char *end, int fallback, int &dst, bool skip_space) |
static void | geometry_to_blender_objects (Main *bmain, Scene *scene, ViewLayer *view_layer, const OBJImportParams &import_params, Vector< std::unique_ptr< Geometry >> &all_geometries, const GlobalVertices &global_vertices, Map< std::string, std::unique_ptr< MTLMaterial >> &materials, Map< std::string, Material * > &created_materials) |
void | importer_main (bContext *C, const OBJImportParams &import_params) |
void | importer_main (Main *bmain, Scene *scene, ViewLayer *view_layer, const OBJImportParams &import_params, size_t read_buffer_size) |
TEST_F (obj_exporter_test, filter_objects_curves_as_mesh) | |
TEST_F (obj_exporter_test, filter_objects_curves_as_nurbs) | |
TEST_F (obj_exporter_test, filter_objects_selected) | |
TEST (obj_exporter_utils, append_negative_frame_to_filename) | |
TEST (obj_exporter_utils, append_positive_frame_to_filename) | |
static std::string | read_temp_file_in_string (const std::string &file_path) |
TEST_F (ObjExporterWriterTest, header) | |
TEST_F (ObjExporterWriterTest, mtllib) | |
TEST (obj_exporter_writer, format_handler_buffer_chunking) | |
static bool | strings_equal_after_first_lines (const std::string &a, const std::string &b) |
TEST_F (obj_exporter_regression_test, all_tris) | |
TEST_F (obj_exporter_regression_test, all_quads) | |
TEST_F (obj_exporter_regression_test, fgons) | |
TEST_F (obj_exporter_regression_test, edges) | |
TEST_F (obj_exporter_regression_test, vertices) | |
TEST_F (obj_exporter_regression_test, non_uniform_scale) | |
TEST_F (obj_exporter_regression_test, nurbs_as_nurbs) | |
TEST_F (obj_exporter_regression_test, nurbs_curves_as_nurbs) | |
TEST_F (obj_exporter_regression_test, nurbs_as_mesh) | |
TEST_F (obj_exporter_regression_test, cube_all_data_triangulated) | |
TEST_F (obj_exporter_regression_test, cube_normal_edit) | |
TEST_F (obj_exporter_regression_test, cube_vertex_groups) | |
TEST_F (obj_exporter_regression_test, cubes_positioned) | |
TEST_F (obj_exporter_regression_test, cubes_vertex_colors) | |
TEST_F (obj_exporter_regression_test, cubes_with_textures_strip) | |
TEST_F (obj_exporter_regression_test, cubes_with_textures_relative) | |
TEST_F (obj_exporter_regression_test, suzanne_all_data) | |
TEST_F (obj_exporter_regression_test, all_curves) | |
TEST_F (obj_exporter_regression_test, all_curves_as_nurbs) | |
TEST_F (obj_exporter_regression_test, all_objects) | |
TEST_F (obj_exporter_regression_test, all_objects_mat_groups) | |
TEST (obj_import_string_utils, read_next_line) | |
TEST (obj_import_string_utils, fixup_line_continuations) | |
static StringRef | drop_whitespace (StringRef s) |
static StringRef | parse_int (StringRef s, int fallback, int &dst, bool skip_space=true) |
static StringRef | parse_float (StringRef s, float fallback, float &dst, bool skip_space=true, bool require_trailing_space=false) |
TEST (obj_import_string_utils, drop_whitespace) | |
TEST (obj_import_string_utils, parse_int_valid) | |
TEST (obj_import_string_utils, parse_int_invalid) | |
TEST (obj_import_string_utils, parse_float_valid) | |
TEST (obj_import_string_utils, parse_float_invalid) | |
TEST_F (obj_importer_test, import_cube) | |
TEST_F (obj_importer_test, import_cube_o_after_verts) | |
TEST_F (obj_importer_test, import_suzanne_all_data) | |
TEST_F (obj_importer_test, import_nurbs) | |
TEST_F (obj_importer_test, import_nurbs_curves) | |
TEST_F (obj_importer_test, import_nurbs_cyclic) | |
TEST_F (obj_importer_test, import_nurbs_manual) | |
TEST_F (obj_importer_test, import_nurbs_mesh) | |
TEST_F (obj_importer_test, import_materials) | |
TEST_F (obj_importer_test, import_cubes_with_textures_rel) | |
TEST_F (obj_importer_test, import_faces_invalid_or_with_holes) | |
TEST_F (obj_importer_test, import_invalid_indices) | |
TEST_F (obj_importer_test, import_invalid_syntax) | |
TEST_F (obj_importer_test, import_all_objects) | |
TEST_F (obj_importer_test, import_cubes_vertex_colors) | |
TEST_F (obj_importer_test, import_cubes_vertex_colors_mrgb) | |
TEST_F (obj_importer_test, import_vertices) | |
TEST_F (obj_mtl_parser_test, string_newlines_whitespace) | |
TEST_F (obj_mtl_parser_test, cube) | |
TEST_F (obj_mtl_parser_test, all_objects) | |
TEST_F (obj_mtl_parser_test, materials) | |
.MTL writers. | |
static std::string | float3_to_string (const float3 &numbers) |
Variables | |
const int | SMOOTH_GROUP_DISABLED = 0 |
const int | SMOOTH_GROUP_DEFAULT = 1 |
static const char * | DEFORM_GROUP_DISABLED = "off" |
static const char * | MATERIAL_GROUP_DISABLED = "" |
static const int | chunk_size = 32768 |
template<typename... T> | |
constexpr bool | is_type_float = (... && std::is_floating_point_v<std::decay_t<T>>) |
template<typename... T> | |
constexpr bool | is_type_integral = (... && std::is_integral_v<std::decay_t<T>>) |
template<typename... T> | |
constexpr bool | is_type_string_related = (... && std::is_constructible_v<std::string, T>) |
const int | NOT_FOUND = -1 |
const int | NEGATIVE_INIT = -10 |
static const std::pair< StringRef, int > | unsupported_texture_options [] |
constexpr bool | save_failing_test_output = false |
const std::string | all_objects_file = "io_tests/blend_scene/all_objects.blend" |
using blender::io::obj::unique_bmesh_ptr = typedef std::unique_ptr<BMesh, CustomBMeshDeleter> |
Definition at line 43 of file obj_export_mesh.hh.
using blender::io::obj::unique_nodetree_ptr = typedef std::unique_ptr<bNodeTree, UniqueNodetreeDeleter> |
Definition at line 28 of file obj_import_mtl.hh.
|
strong |
Enumerator | |
---|---|
OBJ | |
MTL |
Definition at line 26 of file obj_export_io.hh.
Enumerator | |
---|---|
GEOM_MESH | |
GEOM_CURVE |
Definition at line 81 of file obj_import_objects.hh.
|
strong |
Enumerator | |
---|---|
newmtl | |
Ni | |
d | |
Ns | |
illum | |
Ka | |
Kd | |
Ks | |
Ke | |
map_Kd | |
map_Ks | |
map_Ns | |
map_d | |
map_refl | |
map_Ke | |
map_Bump | |
string |
Definition at line 61 of file obj_export_io.hh.
|
strong |
Definition at line 31 of file obj_export_io.hh.
bool blender::io::obj::append_frame_to_filename | ( | const char * | filepath, |
int | frame, | ||
char * | r_filepath_with_frames | ||
) |
Makes r_filepath_with_frames
(which should point at a character array of size FILE_MAX
) be filepath
with its "#" characters replaced by the number representing frame
, and with a .obj extension. Append the current frame number in the .OBJ file name.
Definition at line 301 of file obj_exporter.cc.
References blender::math::abs(), BLI_path_extension_replace(), BLI_path_frame(), BLI_strncpy(), FILE_MAX, and integer_digits_i().
Referenced by exporter_main(), and TEST().
|
static |
Definition at line 204 of file obj_export_file_writer.cc.
References chunk_size, and count.
Referenced by obj_parallel_chunked_output().
|
static |
Copy a float property of the given type from the bNode to given buffer.
Definition at line 28 of file obj_export_mtl.cc.
References BLI_assert, copy_v3_v3(), blender::MutableSpan< T >::data(), node, nodeFindSocket(), blender::MutableSpan< T >::size(), SOCK_FLOAT, SOCK_IN, SOCK_RGBA, SOCK_VECTOR, bNodeSocketValueFloat::value, bNodeSocketValueVector::value, and bNodeSocketValueRGBA::value.
Referenced by store_bsdf_properties(), and store_image_textures().
|
static |
Based on the properties of the given Geometry instance, create a new Geometry instance or return the previous one.
Definition at line 27 of file obj_import_file_reader.cc.
References blender::io::obj::Geometry::edges_, blender::io::obj::Geometry::face_elements_, usdtokens::g(), GEOM_CURVE, GEOM_MESH, blender::io::obj::Geometry::geom_type_, blender::io::obj::Geometry::geometry_name_, blender::StringRefBase::is_empty(), and blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty().
Referenced by geom_set_curve_type(), and blender::io::obj::OBJParser::parse().
|
static |
Definition at line 79 of file obj_import_mtl.cc.
References BKE_image_add_generated(), BLI_path_basename(), color, IMA_GENTYPE_BLANK, IMA_SRC_FILE, image(), and STRNCPY.
Referenced by load_texture_image().
const char * blender::io::obj::drop_non_whitespace | ( | const char * | p, |
const char * | end | ||
) |
Drop leading non-white-space from a string part.
Definition at line 67 of file obj_import_string_utils.cc.
References is_whitespace().
Referenced by parse_texture_option().
|
static |
Definition at line 75 of file obj_import_string_utils.cc.
Referenced by parse_float(), and parse_int().
const char * blender::io::obj::drop_whitespace | ( | const char * | p, |
const char * | end | ||
) |
Drop leading white-space from a string part.
Definition at line 59 of file obj_import_string_utils.cc.
References is_whitespace().
Referenced by drop_whitespace(), geom_add_curve_parameters(), geom_add_mrgb_colors(), geom_add_polygon(), geom_set_curve_type(), geom_update_smooth_group(), blender::io::obj::OBJParser::parse(), blender::io::obj::MTLParser::parse_and_store(), parse_float(), parse_int(), parse_texture_option(), and TEST().
Definition at line 41 of file obj_import_string_utils_tests.cc.
References blender::StringRefBase::begin(), drop_whitespace(), and blender::StringRefBase::end().
void blender::io::obj::export_frame | ( | Depsgraph * | depsgraph, |
const OBJExportParams & | export_params, | ||
const char * | filepath | ||
) |
Export a single frame of a .obj file, according to the given export_parameters
. The frame state is given in depsgraph
. The output file name is given by filepath
. This function is normally called from exporter_main
, but is exposed here for testing purposes. Export a single frame to a .OBJ file.
Conditionally write a .MTL file also.
Definition at line 254 of file obj_exporter.cc.
References OBJExportParams::blen_filepath, BLI_assert, BLI_path_normalize(), BLI_path_slash_native(), BLI_split_dir_part(), BLI_strncpy(), depsgraph, OBJExportParams::export_materials, OBJExportParams::file_base_for_tests, OBJExportParams::filepath, filter_supported_objects(), PATH_MAX, OBJExportParams::path_mode, print_exception_error(), write_mesh_objects(), and write_nurbs_curve_objects().
Referenced by blender::io::obj::obj_exporter_regression_test::compare_obj_export_to_golden(), and exporter_main().
void blender::io::obj::exporter_main | ( | bContext * | C, |
const OBJExportParams & | export_params | ||
) |
The main function for exporting a .obj file according to the given export_parameters
. It uses the context C
to get the dependency graph, and from that, the Scene
. Depending on whether or not export_params.export_animation
is set, it writes either one file per animation frame, or just one file. Central internal function to call Scene update & writer functions.
Definition at line 310 of file obj_exporter.cc.
References append_frame_to_filename(), C, RenderData::cfra, DEG_get_input_scene(), ED_object_mode_set(), OBJExportParams::end_frame, OBJExportParams::export_animation, OBJExportParams::export_eval_mode, export_frame(), FILE_MAX, OBJExportParams::filepath, blender::io::obj::OBJDepsgraph::get(), OB_MODE_OBJECT, Scene::r, scene, OBJExportParams::start_frame, and blender::io::obj::OBJDepsgraph::update_for_newframe().
Referenced by OBJ_export().
std::pair< Vector< std::unique_ptr< OBJMesh > >, Vector< std::unique_ptr< OBJCurve > > > blender::io::obj::filter_supported_objects | ( | Depsgraph * | depsgraph, |
const OBJExportParams & | export_params | ||
) |
Filter supported objects from the Scene.
Find the objects to be exported in the view_layer
of the dependency graphdepsgraph
, and return them in vectors unique_ptr
s of OBJMesh
and OBJCurve
. If export_params.export_selected_objects
is set, then only selected objects are to be exported, else all objects are to be exported. But only objects of type OB_MESH
, OB_CURVES_LEGACY
, and OB_SURF
are supported; the rest will be ignored. If export_params.export_curves_as_nurbs
is set, then curves of type CU_NURBS
are exported in curve form in the .obj file, otherwise they are converted to mesh and returned in the OBJMesh
vector. All other exportable types are always converted to mesh and returned in the OBJMesh
vector.
Definition at line 88 of file obj_exporter.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BASE_SELECTED, curve, DEG_ITER_OBJECT_FLAG_DUPLI, DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY, DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET, DEG_ITER_OBJECT_FLAG_VISIBLE, DEG_OBJECT_ITER_BEGIN, DEG_OBJECT_ITER_END, depsgraph, OBJExportParams::export_curves_as_nurbs, OBJExportParams::export_selected_objects, ListBase::first, is_curve_nurbs_compatible(), Curve::nurb, OB_CURVES_LEGACY, OB_MESH, and OB_SURF.
Referenced by export_frame(), and TEST_F().
|
static |
Find the Principled-BSDF Node in nodetree. We only want one that feeds directly into a Material Output node (that is the behavior of the legacy Python exporter).
Definition at line 157 of file obj_export_mtl.cc.
References blender::nodes::InputSocketRef::directly_linked_sockets(), node, blender::nodes::NodeTreeRef::nodes_by_type(), SH_NODE_BSDF_PRINCIPLED, bNodeType::type, and blender::nodes::NodeRef::typeinfo().
Referenced by mtlmaterial_for_material().
Vector< Vector< int > > blender::io::obj::fixup_invalid_polygon | ( | Span< float3 > | vertex_coords, |
Span< int > | face_vertex_indices | ||
) |
Given an invalid polygon (with holes or duplicated vertex indices), turn it into possibly multiple polygons that are valid.
vertex_coords | Polygon's vertex coordinate list. |
face_vertex_indices | A polygon's indices that index into the given vertex coordinate list. |
Definition at line 22 of file importer_mesh_utils.cc.
References add_newell_cross_v3_v3v3(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), axis_dominant_v3_to_m3(), BLI_assert, CDT_CONSTRAINTS_VALID_BMESH_WITH_HOLES, delaunay_2d_calc(), faces, input, blender::Span< T >::last(), mul_v2_m3v3(), normal, normalize_v3(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::Span< T >::size(), UNLIKELY, and vertex_coords.
void blender::io::obj::fixup_line_continuations | ( | char * | p, |
char * | end | ||
) |
Fix up OBJ line continuations by replacing backslash () and the following newline with spaces.
Definition at line 39 of file obj_import_string_utils.cc.
References is_whitespace().
Referenced by blender::io::obj::OBJParser::parse(), and TEST().
|
static |
Convert float3 to string of space-separated numbers, with no leading or trailing space. Only to be used in NON-performance-critical code.
Definition at line 504 of file obj_export_file_writer.cc.
|
static |
Definition at line 310 of file obj_import_file_reader.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), drop_whitespace(), blender::io::obj::Geometry::nurbs_element_, blender::io::obj::NurbsElement::parm, and parse_float().
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 289 of file obj_import_file_reader.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::io::obj::NurbsElement::curv_indices, INT32_MAX, blender::io::obj::Geometry::nurbs_element_, parse_floats(), parse_int(), and blender::io::obj::GlobalVertices::vertices.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 154 of file obj_import_file_reader.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, blender::io::obj::Geometry::edges_, parse_int(), blender::io::obj::Geometry::track_vertex_index(), and blender::io::obj::GlobalVertices::vertices.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 95 of file obj_import_file_reader.cc.
References drop_whitespace(), srgb_to_linearrgb_uchar4(), blender::io::obj::GlobalVertices::VertexColorsBlock::start_vertex_index, blender::io::obj::GlobalVertices::vertex_colors, and blender::io::obj::GlobalVertices::vertices.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 171 of file obj_import_file_reader.cc.
References blender::io::obj::PolyElem::corner_count_, drop_whitespace(), blender::io::obj::Geometry::face_corners_, blender::io::obj::Geometry::face_elements_, blender::io::obj::Geometry::has_invalid_polys_, blender::io::obj::Geometry::has_vertex_groups_, INT32_MAX, blender::io::obj::PolyElem::material_index, parse_int(), blender::io::obj::PolyElem::shaded_smooth, blender::io::obj::PolyElem::start_index_, blender::io::obj::Geometry::total_loops_, blender::io::obj::Geometry::track_vertex_index(), blender::io::obj::GlobalVertices::uv_vertices, blender::io::obj::PolyElem::vertex_group_index, blender::io::obj::GlobalVertices::vertex_normals, and blender::io::obj::GlobalVertices::vertices.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 147 of file obj_import_file_reader.cc.
References parse_floats(), and blender::io::obj::GlobalVertices::uv_vertices.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 66 of file obj_import_file_reader.cc.
References parse_floats(), srgb_to_linearrgb_v3_v3(), blender::io::obj::GlobalVertices::VertexColorsBlock::start_vertex_index, blender::io::obj::GlobalVertices::vertex_colors, and blender::io::obj::GlobalVertices::vertices.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 134 of file obj_import_file_reader.cc.
References normal, normalize_v3(), parse_floats(), and blender::io::obj::GlobalVertices::vertex_normals.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 284 of file obj_import_file_reader.cc.
References blender::io::obj::NurbsElement::degree, blender::io::obj::Geometry::nurbs_element_, and parse_int().
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 268 of file obj_import_file_reader.cc.
References create_geometry(), drop_whitespace(), GEOM_CURVE, blender::io::obj::NurbsElement::group_, and blender::io::obj::Geometry::nurbs_element_.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 336 of file obj_import_file_reader.cc.
References blender::StringRefBase::find().
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 347 of file obj_import_file_reader.cc.
References drop_whitespace(), parse_int(), smooth(), and blender::StringRefBase::startswith().
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Make Blender Mesh, Curve etc from Geometry and add them to the import collection.
Definition at line 33 of file obj_importer.cc.
References Freestyle::a, blender::Vector< T, InlineBufferCapacity, Allocator >::append(), usdtokens::b(), BKE_collection_object_add(), BKE_layer_collection_get_active(), BKE_layer_collection_resync_allow(), BKE_layer_collection_resync_forbid(), BKE_main_collection_sync(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), LayerCollection::collection, blender::io::obj::CurveFromGeometry::create_curve(), DEG_id_tag_update(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), GEOM_CURVE, GEOM_MESH, Collection::id, Scene::id, ID_RECALC_ANIMATION, ID_RECALC_BASE_FLAGS, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, materials, blender::parallel_sort(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), and scene.
Referenced by importer_main().
|
static |
Definition at line 118 of file obj_export_mtl.cc.
References BKE_image_has_filepath(), BKE_image_has_packedfile(), BLI_path_sequence_decode(), BLI_path_sequence_encode(), BLI_path_slash_rfind(), BLI_strncpy(), FILE_MAX, Image::filepath, bNode::id, IMA_SRC_SEQUENCE, Image::source, and bNode::storage.
Referenced by store_image_textures().
|
static |
From a list of sockets, get the parent node which is of the given node type.
Definition at line 102 of file obj_export_mtl.cc.
References bNodeType::type, and bNode::typeinfo.
Referenced by store_image_textures().
|
static |
Definition at line 282 of file obj_import_mesh.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BKE_material_add(), BKE_ntree_update_main_tree(), Material::id, id_us_min(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), materials, Material::nodetree, and Material::use_nodes.
|
static |
Definition at line 325 of file obj_export_file_writer.cc.
References mesh, NEGATIVE_INIT, params, SMOOTH_GROUP_DEFAULT, and SMOOTH_GROUP_DISABLED.
Referenced by blender::io::obj::OBJWriter::write_poly_elements().
void blender::io::obj::importer_main | ( | bContext * | C, |
const OBJImportParams & | import_params | ||
) |
Definition at line 94 of file obj_importer.cc.
References C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), and scene.
Referenced by blender::io::obj::obj_importer_test::import_and_check(), and OBJ_import().
void blender::io::obj::importer_main | ( | Main * | bmain, |
Scene * | scene, | ||
ViewLayer * | view_layer, | ||
const OBJImportParams & | import_params, | ||
size_t | read_buffer_size | ||
) |
Definition at line 102 of file obj_importer.cc.
References BKE_view_layer_base_deselect_all(), OBJImportParams::clear_selection, OBJImportParams::filepath, geometry_to_blender_objects(), materials, and scene.
Definition at line 71 of file obj_exporter.cc.
References CU_BEZIER, Nurb::next, Nurb::pntsv, and Nurb::type.
Referenced by filter_supported_objects().
|
static |
Definition at line 34 of file obj_import_string_utils.cc.
References Freestyle::c.
Referenced by drop_non_whitespace(), drop_whitespace(), fixup_line_continuations(), and parse_float().
|
static |
Collect all the source sockets linked to the destination socket in a destination node.
Definition at line 74 of file obj_export_mtl.cc.
References blender::StringRefNull::c_str(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), blender::nodes::InputSocketRef::directly_linked_sockets(), blender::Span< T >::first(), bNode::idname, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::Span< T >::size(), and STREQ.
Referenced by store_image_textures().
|
static |
Definition at line 65 of file obj_import_mtl.cc.
References BKE_image_load_exists(), BKE_main_blendfile_path(), BLI_path_rel(), and image().
Referenced by load_texture_image().
|
static |
Definition at line 98 of file obj_import_mtl.cc.
References BLI_path_basename(), create_placeholder_image(), image(), blender::io::obj::tex_map_XX::image_path, load_image_at_path(), blender::io::obj::tex_map_XX::mtl_dir_path, and blender::bke::attribute_accessor_functions::remove().
|
static |
Definition at line 607 of file obj_import_file_reader.cc.
References map_Bump, map_d, map_Kd, map_Ke, map_Ks, map_Ns, map_refl, parse_keyword(), and string.
Referenced by parse_texture_map().
MTLMaterial blender::io::obj::mtlmaterial_for_material | ( | const Material * | material | ) |
Definition at line 340 of file obj_export_mtl.cc.
References BLI_assert, find_bsdf_node(), Material::id, material, blender::io::obj::MTLMaterial::name, ID::name, Material::nodetree, store_bsdf_properties(), and store_image_textures().
Referenced by blender::io::obj::MTLWriter::add_materials().
void blender::io::obj::obj_parallel_chunked_output | ( | FormatHandler< eFileType::OBJ > & | fh, |
int | tot_count, | ||
const Function & | function | ||
) |
Definition at line 216 of file obj_export_file_writer.cc.
References blender::io::obj::FormatHandler< filetype, buffer_chunk_size >::append_from(), calc_chunk_count(), chunk_size, min, blender::threading::parallel_for(), and r.
Referenced by blender::io::obj::OBJWriter::write_poly_elements(), blender::io::obj::OBJWriter::write_poly_normals(), blender::io::obj::OBJWriter::write_uv_coords(), and blender::io::obj::OBJWriter::write_vertex_coords().
const char * blender::io::obj::parse_float | ( | const char * | p, |
const char * | end, | ||
float | fallback, | ||
float & | dst, | ||
bool | skip_space = true , |
||
bool | require_trailing_space = false |
||
) |
Parse a float from an input string. The parsed result is stored in dst
. The function skips leading white-space unless skip_space=false
. If the number can't be parsed (invalid syntax, out of range), fallback
value is stored instead. If require_trailing_space
is true, the character after the number has to be whitespace.
Returns the start of remainder of the input string after parsing.
Definition at line 83 of file obj_import_string_utils.cc.
References drop_plus(), drop_whitespace(), and is_whitespace().
Referenced by geom_add_curve_parameters(), blender::io::obj::MTLParser::parse_and_store(), parse_float(), parse_floats(), parse_texture_option(), and TEST().
|
static |
Definition at line 49 of file obj_import_string_utils_tests.cc.
References blender::StringRefBase::begin(), blender::StringRefBase::end(), and parse_float().
const char * blender::io::obj::parse_floats | ( | const char * | p, |
const char * | end, | ||
float | fallback, | ||
float * | dst, | ||
int | count, | ||
bool | require_trailing_space = false |
||
) |
Parse a number of white-space separated floats from an input string. The parsed count
numbers are stored in dst
. If a number can't be parsed (invalid syntax, out of range), fallback
value is stored instead.
Returns the start of remainder of the input string after parsing.
Definition at line 106 of file obj_import_string_utils.cc.
References count, and parse_float().
Referenced by geom_add_curve_vertex_indices(), geom_add_uv_vertex(), geom_add_vertex(), geom_add_vertex_normal(), blender::io::obj::MTLParser::parse_and_store(), and parse_texture_option().
const char * blender::io::obj::parse_int | ( | const char * | p, |
const char * | end, | ||
int | fallback, | ||
int & | dst, | ||
bool | skip_space = true |
||
) |
Parse an integer from an input string. The parsed result is stored in dst
. The function skips leading white-space unless skip_space=false
. If the number can't be parsed (invalid syntax, out of range), fallback
value is stored instead.
Returns the start of remainder of the input string after parsing.
Definition at line 119 of file obj_import_string_utils.cc.
References drop_plus(), and drop_whitespace().
Referenced by geom_add_curve_vertex_indices(), geom_add_edge(), geom_add_polygon(), geom_set_curve_degree(), geom_update_smooth_group(), parse_int(), and TEST().
|
static |
Definition at line 45 of file obj_import_string_utils_tests.cc.
References blender::StringRefBase::begin(), blender::StringRefBase::end(), and parse_int().
|
static |
Definition at line 380 of file obj_import_file_reader.cc.
References blender::StringRefBase::data(), and blender::StringRefBase::size().
Referenced by mtl_line_start_to_enum(), blender::io::obj::OBJParser::parse(), blender::io::obj::MTLParser::parse_and_store(), and parse_texture_option().
|
static |
Definition at line 696 of file obj_import_file_reader.cc.
References blender::io::obj::tex_map_XX::image_path, material, blender::io::obj::tex_map_XX::mtl_dir_path, mtl_line_start_to_enum(), parse_texture_option(), blender::StringRefBase::startswith(), string, and blender::StringRefBase::trim().
Referenced by blender::io::obj::MTLParser::parse_and_store().
|
static |
Definition at line 651 of file obj_import_file_reader.cc.
References drop_non_whitespace(), drop_whitespace(), material, parse_float(), parse_floats(), parse_keyword(), blender::io::obj::tex_map_XX::projection_type, blender::io::obj::tex_map_XX::scale, SHD_PROJ_SPHERE, blender::StringRefBase::startswith(), blender::io::obj::tex_map_XX::translation, and unsupported_texture_options.
Referenced by parse_texture_map().
|
static |
Definition at line 65 of file obj_exporter.cc.
Referenced by export_frame().
Fetches next line from an input string buffer.
The returned line will not have '
' characters at the end; the buffer
is modified to contain remaining text without the input line.
Definition at line 16 of file obj_import_string_utils.cc.
References buffer, Freestyle::c, len, and ptr.
Referenced by blender::io::obj::OBJParser::parse(), blender::io::obj::MTLParser::parse_and_store(), and TEST().
|
static |
Definition at line 116 of file obj_exporter_tests.cc.
References BLI_file_read_text_as_mem(), buffer, and MEM_freeN.
Referenced by blender::io::obj::obj_exporter_regression_test::compare_obj_export_to_golden(), and TEST_F().
|
static |
Definition at line 359 of file obj_export_mesh.cc.
References round_float_to_n_digits(), and v.
Referenced by blender::io::obj::OBJMesh::store_normal_coords_and_indices().
Round f to round_digits decimal digits.
Definition at line 353 of file obj_export_mesh.cc.
Referenced by round_float3_to_n_digits().
|
static |
Set the socket's (of given ID) value to the given number(s). Only float value(s) can be set using this method.
Definition at line 31 of file obj_import_mtl.cc.
References BLI_assert, copy_v3_v3(), copy_v4_v4(), blender::Span< T >::data(), blender::StringRefBase::data(), nodeFindSocket(), blender::Span< T >::size(), SOCK_FLOAT, SOCK_IN, SOCK_RGBA, SOCK_VECTOR, bNodeSocketValueVector::value, and bNodeSocketValueRGBA::value.
|
static |
Definition at line 182 of file obj_export_file_writer.cc.
Referenced by blender::io::obj::OBJWriter::write_object_name(), and blender::io::obj::OBJWriter::write_poly_elements().
|
static |
Store properties found either in bNode or material into r_mtl_mat.
Definition at line 177 of file obj_export_mtl.cc.
References Material::a, Material::b, blender::nodes::NodeRef::bnode(), copy_property_from_node(), blender::io::obj::MTLMaterial::d, Material::g, illum, blender::io::obj::MTLMaterial::illum, blender::io::obj::MTLMaterial::Ka, blender::io::obj::MTLMaterial::Kd, blender::io::obj::MTLMaterial::Ke, blender::io::obj::MTLMaterial::Ks, material, Material::metallic, metallic, mul_v3_fl(), blender::io::obj::MTLMaterial::Ni, blender::io::obj::MTLMaterial::Ns, Material::r, usdtokens::roughness(), Material::roughness, SOCK_FLOAT, SOCK_RGBA, Material::spec, and usdtokens::specular().
Referenced by mtlmaterial_for_material().
|
static |
Store image texture options and file-paths in r_mtl_mat
.
Definition at line 269 of file obj_export_mtl.cc.
References blender::nodes::NodeRef::bnode(), copy_property_from_node(), get_image_filepath(), get_node_of_type(), linked_sockets_to_dest_id(), map_Bump, blender::io::obj::MTLMaterial::map_Bump_strength, map_Ke, material, SH_NODE_MAPPING, SH_NODE_NORMAL_MAP, SH_NODE_TEX_IMAGE, SOCK_FLOAT, SOCK_VECTOR, and blender::io::obj::MTLMaterial::texture_maps.
Referenced by mtlmaterial_for_material().
|
static |
Definition at line 233 of file obj_exporter_tests.cc.
References Freestyle::a, and usdtokens::b().
Referenced by blender::io::obj::obj_exporter_regression_test::compare_obj_export_to_golden().
|
constexpr |
|
constexpr |
Definition at line 128 of file obj_export_io.hh.
References ATTR_FALLTHROUGH, cstype, curve_element_begin, curve_element_end, edge, is_type_float, is_type_integral, is_type_string_related, mtllib, new_line, normal, nurbs_degree, nurbs_group_end, nurbs_parameter_begin, nurbs_parameter_end, nurbs_parameters, object_group, object_name, poly_element_begin, poly_element_end, poly_usemtl, smooth_group, string, T, uv_vertex_coords, vertex_coords, vertex_coords_color, vertex_indices, vertex_normal_indices, vertex_uv_indices, and vertex_uv_normal_indices.
Referenced by blender::io::obj::FormatHandler< filetype, buffer_chunk_size >::write().
blender::io::obj::TEST | ( | obj_exporter_utils | , |
append_negative_frame_to_filename | |||
) |
Definition at line 94 of file obj_exporter_tests.cc.
References append_frame_to_filename(), BLI_strlen_utf8(), and FILE_MAX.
blender::io::obj::TEST | ( | obj_exporter_utils | , |
append_positive_frame_to_filename | |||
) |
Definition at line 105 of file obj_exporter_tests.cc.
References append_frame_to_filename(), BLI_strlen_utf8(), and FILE_MAX.
blender::io::obj::TEST | ( | obj_exporter_writer | , |
format_handler_buffer_chunking | |||
) |
Definition at line 200 of file obj_exporter_tests.cc.
References curve_element_begin, blender::io::obj::FormatHandler< filetype, buffer_chunk_size >::get_as_string(), blender::io::obj::FormatHandler< filetype, buffer_chunk_size >::get_block_count(), new_line, nurbs_parameter_begin, object_name, and blender::io::obj::FormatHandler< filetype, buffer_chunk_size >::write().
blender::io::obj::TEST | ( | obj_import_string_utils | , |
drop_whitespace | |||
) |
Definition at line 59 of file obj_import_string_utils_tests.cc.
References drop_whitespace(), and EXPECT_STRREF_EQ.
blender::io::obj::TEST | ( | obj_import_string_utils | , |
fixup_line_continuations | |||
) |
Definition at line 24 of file obj_import_string_utils_tests.cc.
References exp(), EXPECT_STRREF_EQ, fixup_line_continuations(), and str.
blender::io::obj::TEST | ( | obj_import_string_utils | , |
parse_float_invalid | |||
) |
Definition at line 135 of file obj_import_string_utils_tests.cc.
References EXPECT_EQ(), EXPECT_STRREF_EQ, and parse_float().
blender::io::obj::TEST | ( | obj_import_string_utils | , |
parse_float_valid | |||
) |
Definition at line 113 of file obj_import_string_utils_tests.cc.
References EXPECT_EQ(), blender::StringRefBase::is_empty(), parse_float(), and str.
blender::io::obj::TEST | ( | obj_import_string_utils | , |
parse_int_invalid | |||
) |
Definition at line 97 of file obj_import_string_utils_tests.cc.
References EXPECT_EQ(), EXPECT_STRREF_EQ, and parse_int().
blender::io::obj::TEST | ( | obj_import_string_utils | , |
parse_int_valid | |||
) |
Definition at line 77 of file obj_import_string_utils_tests.cc.
References EXPECT_EQ(), EXPECT_STRREF_EQ, parse_int(), and str.
blender::io::obj::TEST | ( | obj_import_string_utils | , |
read_next_line | |||
) |
Definition at line 11 of file obj_import_string_utils_tests.cc.
References EXPECT_STRREF_EQ, blender::StringRefBase::is_empty(), read_next_line(), and str.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
all_curves | |||
) |
Definition at line 500 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
all_curves_as_nurbs | |||
) |
Definition at line 508 of file obj_exporter_tests.cc.
References OBJExportParams::export_curves_as_nurbs, OBJExportParams::export_materials, and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
all_objects | |||
) |
Definition at line 519 of file obj_exporter_tests.cc.
References OBJExportParams::export_colors, OBJExportParams::export_smooth_groups, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
all_objects_mat_groups | |||
) |
Definition at line 532 of file obj_exporter_tests.cc.
References OBJExportParams::export_material_groups, OBJExportParams::export_smooth_groups, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
all_quads | |||
) |
Definition at line 321 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::scaling_factor.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
all_tris | |||
) |
Definition at line 312 of file obj_exporter_tests.cc.
References blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
cube_all_data_triangulated | |||
) |
Definition at line 405 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, OBJExportParams::export_triangulated_mesh, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
cube_normal_edit | |||
) |
Definition at line 418 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
cube_vertex_groups | |||
) |
Definition at line 430 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, OBJExportParams::export_normals, OBJExportParams::export_uv, OBJExportParams::export_vertex_groups, and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
cubes_positioned | |||
) |
Definition at line 443 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::scaling_factor.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
cubes_vertex_colors | |||
) |
Definition at line 454 of file obj_exporter_tests.cc.
References OBJExportParams::export_colors, OBJExportParams::export_materials, OBJExportParams::export_normals, OBJExportParams::export_uv, and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
cubes_with_textures_relative | |||
) |
Definition at line 477 of file obj_exporter_tests.cc.
References blender::io::obj::OBJExportParamsDefault::params, OBJExportParams::path_mode, and PATH_REFERENCE_RELATIVE.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
cubes_with_textures_strip | |||
) |
Definition at line 467 of file obj_exporter_tests.cc.
References blender::io::obj::OBJExportParamsDefault::params, OBJExportParams::path_mode, and PATH_REFERENCE_STRIP.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
edges | |||
) |
Definition at line 340 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
fgons | |||
) |
Definition at line 330 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
non_uniform_scale | |||
) |
Definition at line 360 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
nurbs_as_mesh | |||
) |
Definition at line 394 of file obj_exporter_tests.cc.
References OBJExportParams::export_curves_as_nurbs, OBJExportParams::export_materials, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
nurbs_as_nurbs | |||
) |
Definition at line 370 of file obj_exporter_tests.cc.
References OBJExportParams::export_curves_as_nurbs, OBJExportParams::export_materials, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
nurbs_curves_as_nurbs | |||
) |
Definition at line 381 of file obj_exporter_tests.cc.
References OBJExportParams::export_curves_as_nurbs, OBJExportParams::export_materials, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
suzanne_all_data | |||
) |
Definition at line 487 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, OBJExportParams::export_smooth_groups, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_regression_test | , |
vertices | |||
) |
Definition at line 350 of file obj_exporter_tests.cc.
References OBJExportParams::export_materials, OBJExportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, blender::io::obj::OBJExportParamsDefault::params, and OBJExportParams::up_axis.
blender::io::obj::TEST_F | ( | obj_exporter_test | , |
filter_objects_curves_as_mesh | |||
) |
Definition at line 55 of file obj_exporter_tests.cc.
References all_objects_file, depsgraph, EXPECT_EQ(), filter_supported_objects(), and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_test | , |
filter_objects_curves_as_nurbs | |||
) |
Definition at line 67 of file obj_exporter_tests.cc.
References all_objects_file, depsgraph, EXPECT_EQ(), OBJExportParams::export_curves_as_nurbs, filter_supported_objects(), and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_exporter_test | , |
filter_objects_selected | |||
) |
Definition at line 80 of file obj_exporter_tests.cc.
References all_objects_file, depsgraph, EXPECT_EQ(), OBJExportParams::export_curves_as_nurbs, OBJExportParams::export_selected_objects, filter_supported_objects(), and blender::io::obj::OBJExportParamsDefault::params.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_all_objects | |||
) |
Definition at line 441 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_cube | |||
) |
Definition at line 147 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_cube_o_after_verts | |||
) |
Definition at line 164 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_cubes_vertex_colors | |||
) |
Definition at line 596 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_cubes_vertex_colors_mrgb | |||
) |
Definition at line 667 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_cubes_with_textures_rel | |||
) |
Definition at line 315 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_faces_invalid_or_with_holes | |||
) |
Definition at line 363 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_invalid_indices | |||
) |
Definition at line 405 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_invalid_syntax | |||
) |
Definition at line 423 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_materials | |||
) |
Definition at line 306 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_nurbs | |||
) |
Definition at line 212 of file obj_importer_tests.cc.
References OB_CURVES_LEGACY, OB_MESH, and size().
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_nurbs_curves | |||
) |
Definition at line 228 of file obj_importer_tests.cc.
References OB_CURVES_LEGACY, OB_MESH, and size().
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_nurbs_cyclic | |||
) |
Definition at line 255 of file obj_importer_tests.cc.
References OB_CURVES_LEGACY, OB_MESH, and size().
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_nurbs_manual | |||
) |
Definition at line 271 of file obj_importer_tests.cc.
References OB_CURVES_LEGACY, OB_MESH, and size().
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_nurbs_mesh | |||
) |
Definition at line 290 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_suzanne_all_data | |||
) |
Definition at line 194 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_importer_test | , |
import_vertices | |||
) |
Definition at line 718 of file obj_importer_tests.cc.
blender::io::obj::TEST_F | ( | obj_mtl_parser_test | , |
all_objects | |||
) |
Definition at line 130 of file obj_mtl_parser_tests.cc.
References ARRAY_SIZE, blender::io::obj::MTLMaterial::Ka, blender::io::obj::MTLMaterial::Kd, and blender::io::obj::MTLMaterial::name.
blender::io::obj::TEST_F | ( | obj_mtl_parser_test | , |
cube | |||
) |
Definition at line 121 of file obj_mtl_parser_tests.cc.
References blender::io::obj::MTLMaterial::Ka, blender::io::obj::MTLMaterial::Kd, and blender::io::obj::MTLMaterial::name.
blender::io::obj::TEST_F | ( | obj_mtl_parser_test | , |
materials | |||
) |
Definition at line 159 of file obj_mtl_parser_tests.cc.
References ARRAY_SIZE, blender::io::obj::MTLMaterial::d, blender::io::obj::MTLMaterial::illum, blender::io::obj::tex_map_XX::image_path, blender::io::obj::MTLMaterial::Ka, blender::io::obj::MTLMaterial::Kd, blender::io::obj::MTLMaterial::Ke, blender::io::obj::MTLMaterial::Ks, map_Bump, blender::io::obj::MTLMaterial::map_Bump_strength, map_Kd, map_Ks, map_Ns, map_refl, blender::io::obj::MTLMaterial::name, blender::io::obj::MTLMaterial::Ni, blender::io::obj::MTLMaterial::Ns, blender::io::obj::tex_map_XX::projection_type, blender::io::obj::tex_map_XX::scale, SHD_PROJ_SPHERE, blender::io::obj::MTLMaterial::tex_map_of_type(), and blender::io::obj::tex_map_XX::translation.
blender::io::obj::TEST_F | ( | obj_mtl_parser_test | , |
string_newlines_whitespace | |||
) |
Definition at line 74 of file obj_mtl_parser_tests.cc.
References ARRAY_SIZE, blender::io::obj::MTLMaterial::illum, blender::io::obj::tex_map_XX::image_path, blender::io::obj::MTLMaterial::Ka, blender::io::obj::MTLMaterial::Kd, blender::io::obj::MTLMaterial::Ks, map_Kd, map_Ks, blender::io::obj::MTLMaterial::name, blender::io::obj::MTLMaterial::Ns, and blender::io::obj::MTLMaterial::tex_map_of_type().
blender::io::obj::TEST_F | ( | ObjExporterWriterTest | , |
header | |||
) |
Definition at line 164 of file obj_exporter_tests.cc.
References BKE_blender_version_string(), BKE_tempdir_init(), blender::io::obj::OBJExportParamsDefault::params, read_temp_file_in_string(), and result.
blender::io::obj::TEST_F | ( | ObjExporterWriterTest | , |
mtllib | |||
) |
Definition at line 183 of file obj_exporter_tests.cc.
References blender::io::obj::OBJExportParamsDefault::params, read_temp_file_in_string(), and result.
void blender::io::obj::transform_object | ( | Object * | object, |
const OBJImportParams & | import_params | ||
) |
Apply axes transform to the Object, and clamp object dimensions to the specified value.
Definition at line 95 of file importer_mesh_utils.cc.
References BKE_mesh_boundbox_get(), BKE_object_apply_mat4(), OBJImportParams::clamp_size, copy_m4_m3(), copy_v3_fl(), OBJImportParams::forward_axis, IO_AXIS_Y, IO_AXIS_Z, mat3_from_axis_conversion(), max_ff(), max_fff(), min_ff(), Object::scale, unit_m3(), unit_m4(), OBJImportParams::up_axis, and BoundBox::vec.
Referenced by blender::io::obj::CurveFromGeometry::create_curve(), and blender::io::obj::MeshFromGeometry::create_mesh().
|
static |
Definition at line 400 of file obj_import_file_reader.cc.
References usdtokens::g(), GEOM_MESH, blender::io::obj::Geometry::geom_type_, blender::io::obj::Geometry::track_all_vertices(), and blender::io::obj::GlobalVertices::vertices.
Referenced by blender::io::obj::OBJParser::parse().
|
static |
Definition at line 137 of file obj_exporter.cc.
References blender::io::obj::MTLWriter::add_materials(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), count, blender::io::obj::OBJMesh::ensure_mesh_edges(), blender::io::obj::OBJMesh::ensure_mesh_normals(), OBJExportParams::export_colors, OBJExportParams::export_materials, OBJExportParams::export_normals, OBJExportParams::export_uv, if(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::io::obj::MTLWriter::mtl_file_path(), blender::io::obj::MTLWriter::mtlmaterial_name(), blender::threading::parallel_for(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::io::obj::OBJMesh::tot_normal_indices(), blender::io::obj::OBJMesh::tot_polygons(), blender::io::obj::OBJMesh::tot_uv_vertices(), blender::io::obj::OBJMesh::tot_vertices(), blender::io::obj::OBJWriter::write_edges_indices(), blender::io::obj::OBJWriter::write_mtllib_name(), blender::io::obj::OBJWriter::write_object_name(), blender::io::obj::OBJWriter::write_poly_elements(), and blender::io::obj::OBJWriter::write_vertex_coords().
Referenced by export_frame().
|
static |
Export NURBS Curves in parameter form, not as vertices and edges.
Definition at line 242 of file obj_exporter.cc.
References blender::io::obj::OBJWriter::get_outfile(), blender::io::obj::OBJWriter::write_nurbs_curve(), and blender::io::obj::FormatHandler< filetype, buffer_chunk_size >::write_to_file().
Referenced by export_frame().
const std::string blender::io::obj::all_objects_file = "io_tests/blend_scene/all_objects.blend" |
Definition at line 53 of file obj_exporter_tests.cc.
Referenced by TEST_F().
|
static |
Definition at line 203 of file obj_export_file_writer.cc.
Referenced by blender::gpu::GLQueryPool::begin_query(), BLI_array_store_at_size_ensure(), BLI_memblock_create_ex(), BLI_memiter_alloc(), BLI_stack_new_ex(), calc_chunk_count(), drw_sparse_uniform_buffer_init(), DRW_sparse_uniform_buffer_new(), ShaderEval::eval_gpu(), blender::fn::materialize_detail::execute_materialized(), blender::compositor::init_execution_groups_for_execution(), memiter_empty_test(), memiter_string_test(), memiter_words10k_test(), obj_parallel_chunked_output(), queue_chunk_elem_max_calc(), blender::io::stl::read_stl_binary(), stack_chunk_elem_max_calc(), task_parallel_calc_chunk_size(), and task_parallel_iterator_do().
|
static |
Definition at line 37 of file obj_export_file_writer.cc.
Referenced by blender::io::obj::OBJWriter::write_poly_elements().
|
constexpr |
Definition at line 111 of file obj_export_io.hh.
Referenced by syntax_elem_to_formatting().
|
constexpr |
Definition at line 114 of file obj_export_io.hh.
Referenced by syntax_elem_to_formatting().
|
constexpr |
Definition at line 117 of file obj_export_io.hh.
Referenced by syntax_elem_to_formatting().
|
static |
Per reference http://www.martinreddy.net/gfx/3d/OBJ.spec: Once a material is assigned, it cannot be turned off; it can only be changed. If a material name is not specified, a white material is used. So an empty material name is written.
Definition at line 45 of file obj_export_file_writer.cc.
Referenced by blender::io::obj::OBJWriter::write_poly_elements().
const int blender::io::obj::NEGATIVE_INIT = -10 |
Any negative number other than NOT_FOUND
to initialize usually non-negative numbers.
Definition at line 29 of file obj_export_mesh.hh.
Referenced by get_smooth_group(), blender::io::obj::OBJMesh::ith_smooth_group(), and blender::io::obj::OBJWriter::write_poly_elements().
const int blender::io::obj::NOT_FOUND = -1 |
Denote absence for usually non-negative numbers.
Definition at line 27 of file obj_export_mesh.hh.
Referenced by blender::io::obj::OBJWriter::write_poly_elements().
|
constexpr |
Definition at line 34 of file obj_exporter_tests.cc.
Referenced by blender::io::obj::obj_exporter_regression_test::compare_obj_export_to_golden().
const int blender::io::obj::SMOOTH_GROUP_DEFAULT = 1 |
Definition at line 35 of file obj_export_file_writer.cc.
Referenced by get_smooth_group().
const int blender::io::obj::SMOOTH_GROUP_DISABLED = 0 |
Per reference http://www.martinreddy.net/gfx/3d/OBJ.spec: To turn off smoothing groups, use a value of 0 or off. Polygonal elements use group numbers to put elements in different smoothing groups. For free-form surfaces, smoothing groups are either turned on or off; there is no difference between values greater than 0.
Definition at line 34 of file obj_export_file_writer.cc.
Referenced by get_smooth_group().
|
static |
Definition at line 639 of file obj_import_file_reader.cc.
Referenced by parse_texture_option().