Blender V5.0
cycles_xml.cpp File Reference
#include <cstdio>
#include <algorithm>
#include "graph/node_xml.h"
#include "scene/background.h"
#include "scene/camera.h"
#include "scene/film.h"
#include "scene/integrator.h"
#include "scene/light.h"
#include "scene/mesh.h"
#include "scene/object.h"
#include "scene/osl.h"
#include "scene/scene.h"
#include "scene/shader.h"
#include "scene/shader_graph.h"
#include "scene/shader_nodes.h"
#include "util/log.h"
#include "util/path.h"
#include "util/projection.h"
#include "util/string.h"
#include "util/transform.h"
#include "util/xml.h"
#include "app/cycles_xml.h"

Go to the source code of this file.

Classes

struct  XMLReadState

Functions

static bool xml_read_int (int *value, const xml_node node, const char *name)
static bool xml_read_int_array (vector< int > &value, const xml_node node, const char *name)
static bool xml_read_float (float *value, const xml_node node, const char *name)
static bool xml_read_float_array (vector< float > &value, const xml_node node, const char *name)
static bool xml_read_float3 (float3 *value, const xml_node node, const char *name)
static bool xml_read_float3_array (vector< float3 > &value, const xml_node node, const char *name)
static bool xml_read_float4 (float4 *value, const xml_node node, const char *name)
static bool xml_read_string (string *str, const xml_node node, const char *name)
static bool xml_equal_string (const xml_node node, const char *name, const char *value)
static void xml_read_camera (XMLReadState &state, const xml_node node)
static void xml_read_shader_graph (XMLReadState &state, Shader *shader, const xml_node graph_node)
static void xml_read_shader (XMLReadState &state, const xml_node node)
static void xml_read_background (XMLReadState &state, const xml_node node)
static Meshxml_add_mesh (Scene *scene, const Transform &tfm, Object *object)
static void xml_read_mesh (const XMLReadState &state, const xml_node node)
static void xml_read_light (XMLReadState &state, const xml_node node)
static void xml_read_transform (const xml_node node, Transform &tfm)
static void xml_read_state (XMLReadState &state, const xml_node node)
static void xml_read_object (XMLReadState &state, const xml_node node)
static void xml_read_include (XMLReadState &state, const string &src)
static void xml_read_scene (XMLReadState &state, const xml_node scene_node)
void xml_read_file (Scene *scene, const char *filepath)

Function Documentation

◆ xml_add_mesh()

Mesh * xml_add_mesh ( Scene * scene,
const Transform & tfm,
Object * object )
static

Definition at line 375 of file cycles_xml.cpp.

References Scene::create_node().

Referenced by xml_read_mesh().

◆ xml_equal_string()

bool xml_equal_string ( const xml_node node,
const char * name,
const char * value )
static

Definition at line 165 of file cycles_xml.cpp.

References name, and string_iequals().

Referenced by xml_read_mesh(), and xml_read_state().

◆ xml_read_background()

void xml_read_background ( XMLReadState & state,
const xml_node node )
static

Definition at line 363 of file cycles_xml.cpp.

References state, and xml_read_shader_graph().

Referenced by xml_read_scene().

◆ xml_read_camera()

void xml_read_camera ( XMLReadState & state,
const xml_node node )
static

Definition at line 178 of file cycles_xml.cpp.

References Camera::need_flags_update, state, Camera::update(), and xml_read_int().

Referenced by xml_read_scene().

◆ xml_read_file()

void xml_read_file ( Scene * scene,
const char * filepath )

◆ xml_read_float()

bool xml_read_float ( float * value,
const xml_node node,
const char * name )
static

Definition at line 84 of file cycles_xml.cpp.

References float, and name.

Referenced by xml_read_mesh(), and xml_read_state().

◆ xml_read_float3()

bool xml_read_float3 ( float3 * value,
const xml_node node,
const char * name )
static

Definition at line 114 of file cycles_xml.cpp.

References make_float3(), name, array< T, alignment >::size(), and xml_read_float_array().

Referenced by xml_read_transform().

◆ xml_read_float3_array()

bool xml_read_float3_array ( vector< float3 > & value,
const xml_node node,
const char * name )
static

Definition at line 126 of file cycles_xml.cpp.

References i, make_float3(), name, array< T, alignment >::size(), and xml_read_float_array().

Referenced by xml_read_mesh().

◆ xml_read_float4()

bool xml_read_float4 ( float4 * value,
const xml_node node,
const char * name )
static

Definition at line 141 of file cycles_xml.cpp.

References make_float4, name, array< T, alignment >::size(), and xml_read_float_array().

Referenced by xml_read_transform().

◆ xml_read_float_array()

bool xml_read_float_array ( vector< float > & value,
const xml_node node,
const char * name )
static

◆ xml_read_include()

void xml_read_include ( XMLReadState & state,
const string & src )
static

◆ xml_read_int()

bool xml_read_int ( int * value,
const xml_node node,
const char * name )
static

Definition at line 54 of file cycles_xml.cpp.

References name.

Referenced by xml_read_camera().

◆ xml_read_int_array()

bool xml_read_int_array ( vector< int > & value,
const xml_node node,
const char * name )
static

Definition at line 66 of file cycles_xml.cpp.

References name, and string_split().

Referenced by xml_read_mesh().

◆ xml_read_light()

void xml_read_light ( XMLReadState & state,
const xml_node node )
static

◆ xml_read_mesh()

◆ xml_read_object()

void xml_read_object ( XMLReadState & state,
const xml_node node )
static

Definition at line 711 of file cycles_xml.cpp.

References Scene::create_node(), and state.

Referenced by xml_read_scene().

◆ xml_read_scene()

◆ xml_read_shader()

void xml_read_shader ( XMLReadState & state,
const xml_node node )
static

Definition at line 355 of file cycles_xml.cpp.

References state, and xml_read_shader_graph().

Referenced by xml_read_scene().

◆ xml_read_shader_graph()

◆ xml_read_state()

void xml_read_state ( XMLReadState & state,
const xml_node node )
static

Definition at line 658 of file cycles_xml.cpp.

References LOG_ERROR, Node::name, state, xml_equal_string(), xml_read_float(), and xml_read_string().

Referenced by xml_read_scene().

◆ xml_read_string()

bool xml_read_string ( string * str,
const xml_node node,
const char * name )
static

Definition at line 153 of file cycles_xml.cpp.

References name, and str.

Referenced by xml_read_scene(), xml_read_shader_graph(), and xml_read_state().

◆ xml_read_transform()