Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Any way to detect (in memory) file modifications?

Any way to detect (in memory) file modifications?

PAMD76
Enthusiast Enthusiast
465 Views
1 Reply
Message 1 of 2

Any way to detect (in memory) file modifications?

PAMD76
Enthusiast
Enthusiast

Hi all,


Does anyone know if you can check to see if a file (in memory) has been modified?, for example, I load a scene and delete a node via the SDK, I now need to know if I need to save that file, I've looked at events but I can't find anything useful.

Thanks

Director / Technology Programmer.
Red Wasp Design & Plastic Ant Software
0 Likes
466 Views
1 Reply
Reply (1)
Message 2 of 2

regalir
Autodesk
Autodesk

There is no "direct" notification to achieve this but, while the Fbx scene is "alive" in memory, you can check the number of allocated objects (FbxScene::GetSrcObjectCount()) and if the number is different from when the scene has been "created", then you know that some objects have either been added or removed. Almost all the FbxClasses derive from the FbxObject so the above function will "catch" a lot of objects of the scene.

 

For properties changes, you may be able to use the FbxObject emitter functionality. It will emit the FbxObjectPropertyChanged event.

 

But for anything else (for example: vertices coordinates changes) I am afraid you will need to implement some sort of lookup tables that "collect" the initial values (right after the scene has been created/filled) and that you will use to compare with the current state of the scene at the time of saving. But it may quickly become an overkill process 🙂

0 Likes