Skip to content

Commit

Permalink
ability to force fbx nodes to update
Browse files Browse the repository at this point in the history
  • Loading branch information
NickHardeman committed Aug 30, 2023
1 parent 3eda8be commit f032fd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ofxFBX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void ofxFBX::update(float aElapsedSeconds) {
void ofxFBX::lateUpdate() {

if( !areAnimationsEnabled() || !hasAnimations() ) {
if( bFirstRun ) {
if( bFirstRun || bNodesNeedLateUpdate ) {
FbxTime ttime(FBXSDK_TIME_INFINITE);
for( auto& node : mAllNodes ) {
if( node->getType() == ofxFBXSource::Node::OFX_FBX_SKELETON || node->getType() == ofxFBXSource::Node::OFX_FBX_BONE) {
Expand Down
3 changes: 3 additions & 0 deletions src/ofxFBX.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class ofxFBX : public ofNode {
// NULL NODES ////////////////////////
vector< shared_ptr<ofxFBXNode> >& getNullNodes();
int getNumNullNodes();

void setNodesNeedUpdate( bool ab ) {bNodesNeedLateUpdate=ab;}

// MESHES ////////////////////////////
vector< shared_ptr<ofxFBXMesh> >& getMeshes();
Expand Down Expand Up @@ -226,6 +228,7 @@ class ofxFBX : public ofNode {

bool bFirstRun = true;
bool bUpdateMeshVbo = true;
bool bNodesNeedLateUpdate = false;

// only one for now //
AnimationTransition mAnimTrans;
Expand Down

0 comments on commit f032fd4

Please sign in to comment.