Author Topic: How to read animation data from proxy file .cgeo through maxscript?  (Read 830 times)

2023-01-03, 15:52:22

GSystem

  • Active Users
  • **
  • Posts: 12
    • View Profile
Hello.
I'm looking for a way to read data from a proxy file .cgeo via maxscript without having to load it into 3ds Max. Rather, I need to get information about the number of frames from the file in order to find out whether this proxy is animated or not. I have a large library of proxy files and I want to sort it so that animated proxies are separated from static ones.
Is there some way to get this information from a property "Animation snapshot count" in the proxy file? Maybe using C# or .NET?
I will be grateful for any help.
« Last Edit: 2023-01-03, 21:45:44 by GSystem »

2023-01-05, 10:31:16
Reply #1

Aram Avetisyan

  • Corona Team
  • Active Users
  • ****
  • Posts: 928
    • View Profile
Hi,

Each .cgeo file has a readable header. If you simply open it with Notepad, you will see e.g.:

CV 
Corona Renderer Proxy file.
This file contains an animated Mesh object.
This file is BINARY.
Version: 7
Date created: 2019-03-19 14:15:00
Number of faces: 44998
Number of vertices: 38496
Number of mapping channels: 2
Number of normals: 53710
Number of hair: 0
Bounding box size (original units) : 0.166863 0.145909 0.382361
Bounding box size (millimeters) : 166.863 145.909 382.361
Original material name: Material #2126367930
Original object name: GrowFX06
Animation snapshot count: 1
Time per animation snapshot [microseconds]: 40000
Animation time start: 4000000
Scale: 0.001
Compressed: True

and the binary code.

Animation snapshot count: higher than 1 means that the proxy is animated.

Hope this helps.
Aram Avetisyan | chaos-corona.com
Chaos Corona QA Specialist | contact us

2023-01-05, 12:15:18
Reply #2

GSystem

  • Active Users
  • **
  • Posts: 12
    • View Profile
Hi,

Each .cgeo file has a readable header. If you simply open it with Notepad, you will see e.g.:

CV 
Corona Renderer Proxy file.
This file contains an animated Mesh object.
This file is BINARY.
Version: 7
Date created: 2019-03-19 14:15:00
Number of faces: 44998
Number of vertices: 38496
Number of mapping channels: 2
Number of normals: 53710
Number of hair: 0
Bounding box size (original units) : 0.166863 0.145909 0.382361
Bounding box size (millimeters) : 166.863 145.909 382.361
Original material name: Material #2126367930
Original object name: GrowFX06
Animation snapshot count: 1
Time per animation snapshot [microseconds]: 40000
Animation time start: 4000000
Scale: 0.001
Compressed: True

and the binary code.

Animation snapshot count: higher than 1 means that the proxy is animated.

Hope this helps.

Hello, Aram.

Thanks for the answer.
Yes, I know that the proxy file has a plain text header, but in order to read it, you need to open each file in a text editor, which is not very convenient. Therefore, I want to write a script that would get data from each proxy file in the specified folder (there are more than 500 of them in this folder) from the "Animation snapshot count" line and, depending on the number of frames, move the file to a specific folder. I don't know how to read plain text (stringstream) from a binary file. Is there some maxscript function to do this?

2023-02-21, 14:52:34
Reply #3

Aram Avetisyan

  • Corona Team
  • Active Users
  • ****
  • Posts: 928
    • View Profile
Hi,

I have managed to write a python script on my free time, which should work just fine in your case.
You need to place it in a root directory, where all Corona Proxies, and sub-directories with Corona Proxies are placed.
It will go through each folder, and if there are Proxies, it will create "Animated proxies" and "Static Proxies" folders in that directory, and copy corresponding proxies (just to be safe) to these folders, effectively grouping them, for each directory and subdirectory.

You can then quickly pick the ones needed and place them in a separate folder, if needed.
Make sure you have Python 3 installed, place the script at root directory and just run it.

Let me know if this helps.
Aram Avetisyan | chaos-corona.com
Chaos Corona QA Specialist | contact us