This script generates a JSON file containing entries for furniture items based on SWF or Nitro files in the specified directory. The generated JSON file follows a specific structure and can be used for various purposes in a project.
- Place your SWF or Nitro files in the "furni" directory.
- To execute the script, navigate to the directory where the "furnidata_generator.py" file is located and run the command: python furnidata_generator.py
- Follow the prompts to specify the starting point for ID values and select the desired MIME type.
- The script will process the files and generate a JSON file with the furniture item entries.
- The generated JSON file will be saved in the "generated" folder as "furnidata.json".
json_folder
: The folder where the generated JSON file will be saved. By default, it is set to "generated".json_file
: The name of the generated JSON file. By default, it is set to "furnidata.json".
- The script retrieves the file list from the specified directory based on the MIME type.
- It prompts the user to enter the desired starting point for the ID values.
- The user selects the MIME type for filtering the files.
- The script processes the files, extracts the classname from each file, and creates a JSON entry for each unique classname.
- The generated JSON entries contain various properties such as ID, classname, revision, category, dimensions, name, description, etc.
- The script saves the generated entries in a JSON file with proper indentation.
- If no files are found or processed, appropriate error messages are displayed.
Note: Ensure that the necessary files are present in the "furni" directory and the desired MIME type is selected correctly.
This script lacks the ability to differentiate between furniture placed on the floor and furniture placed on walls. Consequently, when generating the furnidata entries, it will assume that all furniture belongs to the floor category due to its prevalence. As a result, the generated furnidata.json file will not include the section for wall furniture. It is recommended to either copy these entries to a separate furnidata file that follows the appropriate furnidata structure with a wall section, or manually incorporate the wall section into the generated furnidata.
This script was created by Gizmo.
Gizmo_1813 on Discord.