Rumba C++ SDK
IO.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2018
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include <functional>
18 
19 #include "Export.h"
20 #include "Value.h"
21 
22  namespace maquina
23  {
24  class Plug;
25  class Node;
26  class Dict;
27 
29 
33  const std::vector<Plug>& plugs,
34  const std::wstring& filepath,
35  const std::string_view& comments="",
36  const std::string_view& tags=""
37  );
38 
40 
44  const std::vector<Plug>& plugs,
45  const std::wstring& filepath,
46  bool single_layer=false,
47  const std::function<bool(float, const char*)>& progress=nullptr,
48  const std::string_view& comments="",
49  const std::string_view& tags="",
50  float first_frame_clip=0,
51  float last_frame_clip=0
52  );
53 
55 
57  const std::wstring& filepath
58  );
59 
61 
63  const std::wstring& filename
64  );
65 
68  const Dict& pose,
69  float frame
70  );
72 
74  const std::wstring& filename
75  );
76 
78 
87  const std::vector<Plug>& plugs,
88  const std::wstring& filename,
89  const std::vector<std::string>& layers_to_import
90  );
91 
93 
95  const std::wstring& filepath
96  );
97 
99  MAQUINA_EXPORT std::string serialize_nodes(
100  const std::vector<Node>& nodes,
101  bool serialize_external_input_connections = false
102  );
103 
105 
106  MAQUINA_EXPORT std::vector<Node> deserialize_nodes(
107  std::string buffer,
108  Node* parent=nullptr,
109  const std::string& valid_types=""
110  );
111 
113 
115  const std::wstring& file, //< Path to the input file.
116  const Dict& options //< The reader options
117  );
118 
120  MAQUINA_EXPORT std::string serialize_pose(
121  const Dict& pose
122  );
123 
126  std::string buffer
127  );
128 
130  const std::wstring& file //< Path to the input file.
131  );
132  }
MAQUINA_EXPORT void import_settings(const std::wstring &filepath)
Import workspace settings from a file.
TagsIteration tags(const std::string_view &tags_list)
Return a tag iteration from a string with comma, semi-column or space separated tokens.
MAQUINA_EXPORT void apply_pose(const Dict &pose, float frame)
Apply a pose.
MAQUINA_EXPORT std::string serialize_pose(const Dict &pose)
Serialize the pose in a string.
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
MAQUINA_EXPORT Dict load_pose(const std::wstring &filename)
Import the plugs values from a file.
#define MAQUINA_EXPORT
Definition: Export.h:31
MAQUINA_EXPORT Dict document_info(const std::wstring &file)
MAQUINA_EXPORT void export_plug_animation(const std::vector< Plug > &plugs, const std::wstring &filepath, bool single_layer=false, const std::function< bool(float, const char *)> &progress=nullptr, const std::string_view &comments="", const std::string_view &tags="", float first_frame_clip=0, float last_frame_clip=0)
Save the layer setup and plugs animation in a file.
MAQUINA_EXPORT bool import_plug_animation(const std::vector< Plug > &plugs, const std::wstring &filename, const std::vector< std::string > &layers_to_import)
Import an animation from a file.
MAQUINA_EXPORT Dict deserialize_pose(std::string buffer)
Deserialize the pose from a string.
MAQUINA_EXPORT std::vector< Node > deserialize_nodes(std::string buffer, Node *parent=nullptr, const std::string &valid_types="")
Deserialize the nodes from a string.
MAQUINA_EXPORT std::string serialize_nodes(const std::vector< Node > &nodes, bool serialize_external_input_connections=false)
Serialize the nodes in a string.
MAQUINA_EXPORT void export_settings(const std::wstring &filepath)
Save workspace settings to a file.
MAQUINA_EXPORT Dict load_animation_pose(const std::wstring &filename)
Import the animation pose from a file, in this case the value of the pose is not relevant.
MAQUINA_EXPORT void export_plug_values(const std::vector< Plug > &plugs, const std::wstring &filepath, const std::string_view &comments="", const std::string_view &tags="")
Save the plugs values in a file.
MAQUINA_EXPORT Value read_value(const std::wstring &file, const Dict &options)
Load an object value from a file.