Blender V5.3
blender::io Namespace Reference

Namespaces

namespace  alembic
namespace  csv
namespace  fbx
namespace  grease_pencil
namespace  gsplat
namespace  hydra
namespace  obj
namespace  otio
namespace  ply
namespace  serialize
namespace  spz
namespace  stl
namespace  usd
namespace  validate

Classes

class  AbstractHierarchyIterator
class  AbstractHierarchyIteratorInvisibleTest
class  AbstractHierarchyIteratorTest
class  AbstractHierarchyWriter
class  DupliParentFinder
class  EnsuredWriter
struct  ExportSubset
struct  HierarchyContext
struct  MeshCoerceForExport
class  ObjectIdentifier
class  ObjectIdentifierOrderTest
class  PersistentID
class  PersistentIDTest
class  SubdivModifierDisabler
class  TestingHierarchyIterator

Functions

static bool remove_weak_subtrees (const HierarchyContext *context, AbstractHierarchyIterator::ExportGraph &clean_graph, const AbstractHierarchyIterator::ExportGraph &input_graph)
 TEST_F (AbstractHierarchyIteratorTest, ExportHierarchyTest)
 TEST_F (AbstractHierarchyIteratorTest, ExportSubsetTest)
 TEST_F (AbstractHierarchyIteratorInvisibleTest, ExportInvisibleTest)
bool operator== (const PersistentID &persistent_id_a, const PersistentID &persistent_id_b)
const Mesh * mesh_coerce_for_export_setup (MeshCoerceForExport &coerce, Depsgraph *depsgraph, Object *obj_eval, const bool apply_modifiers)
bool operator== (const ObjectIdentifier &obj_ident_a, const ObjectIdentifier &obj_ident_b)
 TEST_F (ObjectIdentifierOrderTest, graph_root)
 TEST_F (ObjectIdentifierOrderTest, real_objects)
 TEST_F (ObjectIdentifierOrderTest, duplicated_objects)
 TEST_F (ObjectIdentifierOrderTest, behavior_as_map_keys)
 TEST_F (ObjectIdentifierOrderTest, map_copy_and_update)
 TEST_F (PersistentIDTest, is_from_same_instancer)
 TEST_F (PersistentIDTest, instancer_id)
 TEST_F (PersistentIDTest, as_object_name_suffix)
std::string path_reference (StringRefNull filepath, StringRefNull base_src, StringRefNull base_dst, ePathReferenceMode mode, Set< std::pair< std::string, std::string > > *copy_set)
void path_reference_copy (const Set< std::pair< std::string, std::string > > &copy_set)
StringRef read_next_line (StringRef &buffer)
static bool is_whitespace (char c)
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_sign (const char *p, const char *end, int &sign)
const char * try_parse_float (const char *p, const char *end, int fallback, bool &success, float &dst, bool skip_space)
const char * try_parse_int (const char *p, const char *end, int fallback, bool &success, int &dst, bool skip_space)
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)
 TEST (io_common_string_utils, read_next_line)
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 (io_common_string_utils, drop_whitespace)
 TEST (io_common_string_utils, parse_int_valid)
 TEST (io_common_string_utils, parse_int_invalid)
 TEST (io_common_string_utils, parse_float_valid)
 TEST (io_common_string_utils, parse_float_invalid)

Function Documentation

◆ drop_non_whitespace()

const char * blender::io::drop_non_whitespace ( const char * p,
const char * end )

◆ drop_plus()

const char * blender::io::drop_plus ( const char * p,
const char * end )
static

Definition at line 112 of file io/common/intern/string_utils.cc.

References drop_plus().

Referenced by drop_plus(), parse_float(), and parse_int().

◆ drop_sign()

const char * blender::io::drop_sign ( const char * p,
const char * end,
int & sign )
static

Definition at line 57 of file io/common/intern/string_utils.cc.

References drop_sign(), and sign().

Referenced by drop_sign(), try_parse_float(), and try_parse_int().

◆ drop_whitespace() [1/2]

◆ drop_whitespace() [2/2]

◆ is_whitespace()

bool blender::io::is_whitespace ( char c)
static

◆ mesh_coerce_for_export_setup()

const Mesh * blender::io::mesh_coerce_for_export_setup ( MeshCoerceForExport & coerce,
Depsgraph * depsgraph,
Object * obj_eval,
bool apply_modifiers )

◆ operator==() [1/2]

bool blender::io::operator== ( const ObjectIdentifier & obj_ident_a,
const ObjectIdentifier & obj_ident_b )

◆ operator==() [2/2]

bool blender::io::operator== ( const PersistentID & persistent_id_a,
const PersistentID & persistent_id_b )

Definition at line 106 of file dupli_persistent_id.cc.

Referenced by operator==().

◆ parse_float() [1/2]

const char * blender::io::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 120 of file io/common/intern/string_utils.cc.

References drop_plus(), drop_whitespace(), ELEM, is_whitespace(), and parse_float().

Referenced by blender::io::obj::geom_add_curve_parameters(), blender::io::obj::MTLParser::parse_and_store(), parse_float(), parse_float(), parse_floats(), blender::io::obj::parse_texture_option(), TEST(), and TEST().

◆ parse_float() [2/2]

StringRef blender::io::parse_float ( StringRef s,
float fallback,
float & dst,
bool skip_space = true,
bool require_trailing_space = false )
static

◆ parse_floats()

const char * blender::io::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 143 of file io/common/intern/string_utils.cc.

References parse_float(), and parse_floats().

Referenced by blender::io::obj::geom_add_curve_vertex_indices(), blender::io::obj::geom_add_uv_vertex(), blender::io::obj::geom_add_vertex(), blender::io::obj::geom_add_vertex_normal(), blender::io::obj::MTLParser::parse_and_store(), parse_floats(), and blender::io::obj::parse_texture_option().

◆ parse_int() [1/2]

const char * blender::io::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 156 of file io/common/intern/string_utils.cc.

References drop_plus(), drop_whitespace(), ELEM, and parse_int().

Referenced by blender::io::obj::geom_add_curve_vertex_indices(), blender::io::obj::geom_add_polygon(), blender::io::obj::geom_set_curve_degree(), blender::io::obj::geom_update_smooth_group(), blender::io::ply::load_face_element(), blender::io::ply::load_tristrips_element(), parse_int(), parse_int(), blender::io::ply::parse_row_ascii(), blender::io::obj::parse_vertex_index(), TEST(), and TEST().

◆ parse_int() [2/2]

StringRef blender::io::parse_int ( StringRef s,
int fallback,
int & dst,
bool skip_space = true )
static

◆ path_reference()

std::string blender::io::path_reference ( StringRefNull filepath,
StringRefNull base_src,
StringRefNull base_dst,
ePathReferenceMode mode,
Set< std::pair< std::string, std::string > > * copy_set = nullptr )

Return a filepath relative to a destination directory, for use with exporters.

When PATH_REFERENCE_COPY mode is used, the file path pair (source path, destination path) is added to the copy_set.

Equivalent of bpy_extras.io_utils.path_reference.

Definition at line 18 of file path_util.cc.

References BLI_assert_msg, blender::BLI_path_abs(), blender::BLI_path_basename(), blender::BLI_path_contains(), blender::BLI_path_is_rel(), BLI_path_join, blender::BLI_path_normalize(), blender::BLI_path_relative_to(), blender::StringRefNull::c_str(), FILE_MAX, path_reference(), blender::PATH_REFERENCE_ABSOLUTE, blender::PATH_REFERENCE_AUTO, blender::PATH_REFERENCE_COPY, blender::PATH_REFERENCE_MATCH, blender::PATH_REFERENCE_RELATIVE, blender::PATH_REFERENCE_STRIP, and blender::STRNCPY().

Referenced by path_reference().

◆ path_reference_copy()

void blender::io::path_reference_copy ( const Set< std::pair< std::string, std::string > > & copy_set)

◆ read_next_line()

StringRef blender::io::read_next_line ( StringRef & buffer)

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 18 of file io/common/intern/string_utils.cc.

References blender::blender::StringRefBase::begin(), blender::blender::StringRefBase::end(), len(), read_next_line(), and blender::StringRef::StringRef().

Referenced by blender::io::obj::MTLParser::parse_and_store(), read_next_line(), and TEST().

◆ remove_weak_subtrees()

◆ TEST() [1/6]

blender::io::TEST ( io_common_string_utils ,
drop_whitespace  )

Definition at line 44 of file string_utils_tests.cc.

References drop_whitespace(), EXPECT_STRREF_EQ, and TEST().

◆ TEST() [2/6]

blender::io::TEST ( io_common_string_utils ,
parse_float_invalid  )

Definition at line 120 of file string_utils_tests.cc.

References blender::EXPECT_EQ(), EXPECT_STRREF_EQ, parse_float(), and TEST().

◆ TEST() [3/6]

blender::io::TEST ( io_common_string_utils ,
parse_float_valid  )

◆ TEST() [4/6]

blender::io::TEST ( io_common_string_utils ,
parse_int_invalid  )

Definition at line 82 of file string_utils_tests.cc.

References blender::EXPECT_EQ(), EXPECT_STRREF_EQ, parse_int(), and TEST().

◆ TEST() [5/6]

blender::io::TEST ( io_common_string_utils ,
parse_int_valid  )

Definition at line 62 of file string_utils_tests.cc.

References blender::EXPECT_EQ(), EXPECT_STRREF_EQ, parse_int(), str, and TEST().

◆ TEST() [6/6]

blender::io::TEST ( io_common_string_utils ,
read_next_line  )

◆ TEST_F() [1/11]

blender::io::TEST_F ( AbstractHierarchyIteratorInvisibleTest ,
ExportInvisibleTest  )

◆ TEST_F() [2/11]

blender::io::TEST_F ( AbstractHierarchyIteratorTest ,
ExportHierarchyTest  )

◆ TEST_F() [3/11]

◆ TEST_F() [4/11]

◆ TEST_F() [5/11]

blender::io::TEST_F ( ObjectIdentifierOrderTest ,
duplicated_objects  )

◆ TEST_F() [6/11]

◆ TEST_F() [7/11]

◆ TEST_F() [8/11]

◆ TEST_F() [9/11]

blender::io::TEST_F ( PersistentIDTest ,
as_object_name_suffix  )

◆ TEST_F() [10/11]

◆ TEST_F() [11/11]

blender::io::TEST_F ( PersistentIDTest ,
is_from_same_instancer  )

◆ try_parse_float()

const char * blender::io::try_parse_float ( const char * p,
const char * end,
int fallback,
bool & success,
float & dst,
bool skip_space = true )

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), success value is false.

Returns the start of remainder of the input string after parsing.

Definition at line 72 of file io/common/intern/string_utils.cc.

References drop_sign(), drop_whitespace(), ELEM, sign(), and try_parse_float().

Referenced by try_parse_float().

◆ try_parse_int()

const char * blender::io::try_parse_int ( const char * p,
const char * end,
int fallback,
bool & success,
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), success value is false.

Returns the start of remainder of the input string after parsing.

Definition at line 92 of file io/common/intern/string_utils.cc.

References drop_sign(), drop_whitespace(), ELEM, sign(), and try_parse_int().

Referenced by try_parse_int().