Blender V4.5
blender::io Namespace Reference

Namespaces

namespace  alembic
namespace  csv
namespace  fbx
namespace  grease_pencil
namespace  hydra
namespace  obj
namespace  ply
namespace  serialize
namespace  stl
namespace  usd

Classes

class  AbstractHierarchyIterator
class  AbstractHierarchyIteratorInvisibleTest
class  AbstractHierarchyIteratorTest
class  AbstractHierarchyWriter
class  DupliParentFinder
class  EnsuredWriter
struct  ExportSubset
struct  HierarchyContext
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)
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)
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_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)
 TEST (io_common_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 (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 134 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 79 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]

◆ fixup_line_continuations()

void blender::io::fixup_line_continuations ( char * p,
char * end )

Fix up OBJ line continuations by replacing backslash () and the following newline with spaces.

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

References fixup_line_continuations(), and is_whitespace().

Referenced by fixup_line_continuations(), blender::io::obj::OBJParser::parse(), and TEST().

◆ is_whitespace()

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

◆ 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 142 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::ply::parse_row_ascii(), 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 165 of file io/common/intern/string_utils.cc.

References i, 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 178 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::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 15 of file path_util.cc.

References BLI_assert_msg, BLI_path_abs(), BLI_path_basename(), BLI_path_contains(), BLI_path_is_rel(), BLI_path_join, BLI_path_normalize(), BLI_path_rel(), blender::StringRefNull::c_str(), PATH_MAX, path_reference(), PATH_REFERENCE_ABSOLUTE, PATH_REFERENCE_AUTO, PATH_REFERENCE_COPY, PATH_REFERENCE_MATCH, PATH_REFERENCE_RELATIVE, PATH_REFERENCE_STRIP, and 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::StringRefBase::begin(), blender::StringRefBase::end(), len(), read_next_line(), and blender::StringRef::StringRef().

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

◆ remove_weak_subtrees()

◆ TEST() [1/7]

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

Definition at line 61 of file string_utils_tests.cc.

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

◆ TEST() [2/7]

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

Definition at line 26 of file string_utils_tests.cc.

References exp, EXPECT_STRREF_EQ, fixup_line_continuations(), str, and TEST().

◆ TEST() [3/7]

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

Definition at line 137 of file string_utils_tests.cc.

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

◆ TEST() [4/7]

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

◆ TEST() [5/7]

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

Definition at line 99 of file string_utils_tests.cc.

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

◆ TEST() [6/7]

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

Definition at line 79 of file string_utils_tests.cc.

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

◆ TEST() [7/7]

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

◆ TEST_F() [1/11]

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

Definition at line 321 of file abstract_hierarchy_iterator_test.cc.

References DAG_EVAL_RENDER, EXPECT_EQ(), SEP_STR, and TEST_F().

◆ 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]

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

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

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

Referenced by try_parse_int().