12 #ifndef __FBX_SCENEPROXY_H_INCLUDED__
13 #define __FBX_SCENEPROXY_H_INCLUDED__
51 using FBX_PropertyID::FBX_PropertyID;
72 myNodeToName[node] =
name;
73 myNameToNode[
name] = node;
80 auto item = myNameToNode.
find(name);
81 return item != myNameToNode.
end() ? item->second : fallback;
88 auto item = myNodeToName.find(node);
89 return (item != myNodeToName.end()) ? item->second : fallback;
95 return myNodeToName.contains(node);
114 bool myConvertUnits =
true;
115 bool myConvertAxisSystem =
true;
116 bool myConvertAxisSystemForceYUp =
true;
117 bool myImportTemplates =
true;
118 bool myImportPivots =
true;
119 bool myImportGlobalSettings =
true;
120 bool myImportCharacters =
true;
121 bool myImportConstraints =
true;
122 bool myImportGobos =
true;
123 bool myImportShapes =
true;
124 bool myImportLinks =
true;
125 bool myImportTextures =
true;
126 bool myImportModels =
true;
127 bool myImportAnimations =
true;
128 bool myImportMaterials =
false;
131 bool myExtractEmbeddedData =
false;
136 bool myBinary =
true;
137 bool myAnimationOnly =
false;
138 bool myEmbedData =
false;
154 bool load(
const char*
path,
163 return load(path, options, errors);
170 bool save(
const char*
path,
172 const SaveOptions& options)
const;
176 bool animation_only =
false)
const
181 return save(path, errors, options);
187 void stampDocumentInfo(
const char* orig_fbx_filename =
nullptr);
189 fpreal globalFrameRate()
const;
190 void setGlobalFrameRate(
fpreal fps);
214 bool convertAxisSystem(AxisSystemPreset preset);
222 bool setGlobalSystemUnit(SystemUnitPreset preset);
226 bool convertToHoudiniAxisSystem();
229 const char* nodeName(FBX_NodeID node)
const;
236 void importCustomProperties(
237 const FBX_NodeID node,
239 bool is_animated =
false,
240 const fpreal time_seconds = 0)
const;
245 FBX_AnimCurveID outputCustomProperties(
246 const FBX_NodeID node,
247 FBX_AnimLayerID
layer,
250 bool is_animated =
false);
252 FBX_AnimCurveID outputCustomEnumProperties(
253 const FBX_NodeID node,
254 FBX_AnimLayerID
layer,
262 FBX_AnimCurveNodeID outputCustomCompoundProperties(
263 const FBX_NodeID node,
264 FBX_AnimLayerID
layer,
270 FBX_AnimCurveID createCurveOnNode(
271 FBX_AnimCurveNodeID curve_node,
277 int getChannelsCount(FBX_AnimCurveNodeID curve_node);
280 FBX_NodeID findNode(
const char*
name)
const;
288 FBX_NodeID findNodeByPath(
const char*
path)
const;
293 int nodeCount()
const;
294 FBX_NodeID node(
int i)
const;
296 FBX_NodeID rootNode()
const;
297 FBX_NodeID parentNode(FBX_NodeID node)
const;
298 int childNodeCount(FBX_NodeID node)
const;
299 FBX_NodeID childNode(FBX_NodeID node,
int i)
const;
326 NodeType nodeType(FBX_NodeID node)
const;
329 FBX_NodeID createJointNode(
const char*
name,
bool is_root);
332 FBX_NodeID createLODGroupNode(
const char*
name);
335 FBX_NodeID createNullNode(
const char*
name);
338 static bool isLODGroupNullNodeName(
const char *node_name);
342 void nodeAddChild(FBX_NodeID parent, FBX_NodeID child);
344 bool visibility(FBX_NodeID node)
const;
346 FBX_GeometryID geometry(FBX_NodeID node)
const;
347 FBX_NodeID geometryNode(FBX_GeometryID geometry)
const;
348 int geometrySkinDeformerCount(FBX_GeometryID geometry)
const;
351 int skinDeformerCount()
const;
355 FBX_GeometryID skinDeformerGeometry(
int i)
const;
357 FBX_MeshID geometryMesh(FBX_NodeID node)
const;
360 bool computeSmoothingGroupInfo(FBX_MeshID mesh)
const;
370 bool convertGeometry(
372 FBX_GeometryID geometry,
374 bool add_unused_joints,
377 bool convertGeometry(
379 FBX_GeometryID geometry,
381 bool add_unused_joints,
394 SkinningType geometrySkinDeformerType(FBX_GeometryID geometry,
int i)
const;
397 int blendshapeCount(FBX_GeometryID geometry)
const;
399 int blendshapeChannelCount(
400 FBX_GeometryID geometry,
int blendshape_idx)
const;
403 int blendshape_idx,
int channel_idx)
const;
408 bool convertBlendShapeBaseGeometry(
410 FBX_GeometryID geometry,
420 void blendShapeChannelTargets(
421 FBX_GeometryID geometry,
431 void blendShapeChannelTargets(
432 FBX_GeometryID geometry,
445 FBX_AnimCurveID blendshapeChannelCurve(
446 FBX_GeometryID geometry,
448 int channel_idx)
const;
449 FBX_AnimCurveID blendshapeChannelCurve(
450 FBX_GeometryID geometry,
453 bool create_if_needed);
458 FBX_AnimCurveID curve,
fpreal time_seconds)
const;
461 int animCurveKeyCount(FBX_AnimCurveID curve)
const;
464 void getAnimCurveTimeInterval(
465 FBX_AnimCurveID curve,
484 bool nodeIsRotationActive(FBX_NodeID node)
const;
494 UT_Vector3D nodeRotationPivot(FBX_NodeID node)
const;
496 int animLayerCount(FBX_ClipID
clip)
const;
497 FBX_AnimLayerID animLayer(FBX_ClipID
clip,
int i)
const;
500 FBX_AnimLayerID createAnimLayer(
const char*
name,
501 FBX_ClipID
clip = FBX_ClipID{});
505 void destroyAnimLayer(FBX_AnimLayerID
layer,
506 bool recurse_unused =
false);
510 void addAnimLayer(FBX_ClipID
clip, FBX_AnimLayerID
layer);
511 void removeAnimLayer(FBX_ClipID
clip, FBX_AnimLayerID
layer);
515 int animLayerSrcCount(FBX_AnimLayerID
layer)
const;
518 FBX_AnimCurveID propertyAnimCurve(
519 FBX_PropertyID property,
520 FBX_AnimLayerID
layer,
522 bool create =
false);
527 FBX_PropertyID property,
536 void propertySetFloat(
537 FBX_PropertyID property,
539 void propertySetVector(
540 FBX_PropertyID property,
546 double sceneScale()
const;
553 FBX_NodeID node,
fpreal time_seconds)
const;
558 FBX_NodeID node,
fpreal time_seconds)
const;
561 UT_Matrix4D nodeGlobalRestTransform(FBX_NodeID node)
const;
566 UT_Matrix4D nodeLocalRestTransform(FBX_NodeID node)
const;
569 void setNodeLocalRestTransform(
578 bool nodeGeometricTransform(
582 void removeNodeAnimation(FBX_NodeID node);
587 double computeConversionFactor()
const;
590 nodeScaleInheritanceMode(FBX_NodeID node)
const;
597 bool setNodeScaleInheritanceMode(
600 int clipCount()
const;
601 FBX_ClipID
clip(
int i)
const;
603 FBX_ClipID findClip(
const char* name)
const;
604 const char* clipName(FBX_ClipID
clip)
const;
606 void setActiveClip(FBX_ClipID
clip);
607 FBX_ClipID activeClip()
const;
609 FBX_ClipID createClip(
const char* name);
613 void getClipTimeRange(
615 void setClipTimeRange(
706 template <
typename FBX_T,
typename ID_T>
707 static inline FBX_T * castID(ID_T
id);
730 void reset(FBX_AnimCurveID curve);
731 void markForDeletion();
734 int addKey(
fpreal time_seconds);
741 fpreal keyValue(
int key_i)
const;
743 FBX_AnimCurveID
curve()
const {
return myCurve; }
747 template <
typename FBX_T,
typename ID_T>
748 static inline FBX_T * castID(ID_T
id)
749 {
return FBX_SceneProxy::castID<FBX_T,ID_T>(
id); }
752 FBX_AnimCurveID myCurve = FBX_AnimCurveID{};
753 int myLastKeyIndex = 0;
754 bool myDestroyCurveOnCleanup =
false;
788 return !(*
this ==
x);
804 D1::clearConstruct(&(p->
myNode));
806 D2::clearConstruct(&(p->
mySkins));
808 static const bool clearNeedsDestruction =
false;
812 #endif // __FBX_SCENEPROXY_H_INCLUDED__
FrontVector myFrontVector
SYS_FORCE_INLINE bool exists(FBX_NodeID node) const
CoordSystem myCoordSystem
bool contains(const Key &key) const
SYS_FORCE_INLINE void add(FBX_NodeID node, const UT_StringHolder &name)
const GLuint GLenum const void * binary
GLsizei const GLchar *const * path
static bool isClear(const T &v)
iterator end()
Returns a non-const end iterator for the set.
bool save(const char *path, FBX_ErrorManager &errors, bool binary=true, bool animation_only=false) const
iterator find(const Key &key)
GLenum GLuint GLint GLint layer
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
bool operator!=(const FBX_AxisSystem &x) const
GA_API const UT_StringHolder scale
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
static void clearConstruct(T *p)
SYS_FORCE_INLINE bool exists(const UT_StringRef &name) const
bool load(const char *path, bool convert_units, FBX_ErrorManager &errors)
GLuint const GLchar * name
GA_API const UT_StringHolder transform
A map of string to various well defined value types.
bool operator==(const FBX_AxisSystem &x) const
FBX_AnimCurveID curve() const
Iterates over a node's user properties.
SYS_FORCE_INLINE UT_StringRef getName(FBX_NodeID node, const UT_StringRef &fallback) const
SYS_FORCE_INLINE FBX_NodeID getNode(const UT_StringRef &name, FBX_NodeID fallback) const
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
FBX_SCENEPROXY_DECLARE_ID(FBX_NodeID)
JointInfoMap myCapturePose