PDJSON_Group:
The PDJSON_Group node is designed to facilitate the processing and modification of JSON files, specifically targeting groups within these files. This node is particularly useful for AI artists who need to manage and manipulate JSON data in bulk, allowing for efficient batch processing. By providing options to modify attributes such as color and size, the node enables users to customize their JSON data according to specific requirements. The primary goal of this node is to streamline the process of handling JSON files, making it easier to apply consistent changes across multiple files, thereby saving time and reducing manual effort.
PDJSON_Group Input Parameters:
directory_path
This parameter specifies the path to the directory containing the JSON files you wish to process. It is crucial for locating the files that the node will work on. The default value is set to A:\path\to\json_files, but you should change it to the directory where your JSON files are stored.
color_choice
This parameter allows you to select a color to apply to the groups within the JSON files. The available options are "Blue", "DeepGray", "Yellow", "Green", and "None", with "None" being the default. Choosing a color will modify the color attribute of the groups, which can be useful for categorization or visual differentiation.
modify_size
This parameter determines whether the size modification feature is enabled or disabled. The options are "enable" and "disable", with "disable" as the default. Enabling this option allows the node to adjust the size attributes within the JSON data, which can be useful for scaling purposes.
font_size
This parameter sets the font size for text elements within the JSON files. It accepts integer values ranging from 8 to 72, with a default value of 14. Adjusting the font size can impact the readability and presentation of text data in your JSON files.
target_title
This parameter allows you to specify a target title for the groups within the JSON files. By setting this parameter, you can filter or identify specific groups that match the given title, enabling targeted modifications.
output_folder
This parameter specifies the directory where the modified JSON files will be saved. It is important to set this to a location where you can easily access the processed files. The default value is an empty string, which means you need to provide a valid path.
new_filename
This parameter defines the suffix to be added to the filenames of the processed JSON files. The default value is _fix01, which helps in distinguishing the modified files from the original ones while retaining the original file extension.
PDJSON_Group Output Parameters:
Result
The output parameter Result returns a string that indicates the outcome of the JSON processing operation. This could include success messages or error information, providing feedback on the execution of the node's function.
PDJSON_Group Usage Tips:
- Ensure that the
directory_pathis correctly set to the location of your JSON files to avoid processing errors. - Use the
color_choiceparameter to visually categorize groups within your JSON files, which can be helpful for organization and analysis. - If you need to adjust the size attributes in your JSON data, remember to enable the
modify_sizeoption. - Set the
output_folderto a directory where you can easily manage and review the modified JSON files.
PDJSON_Group Common Errors and Solutions:
Error: [Errno 2] No such file or directory
- Explanation: This error occurs when the specified
directory_pathoroutput_folderdoes not exist. - Solution: Verify that the paths provided for
directory_pathandoutput_folderare correct and that the directories exist.
Error: JSONDecodeError
- Explanation: This error indicates that there is an issue with the format of one or more JSON files, preventing them from being read correctly.
- Solution: Check the JSON files for syntax errors or formatting issues and correct them before processing.
Error: [Errno 13] Permission denied
- Explanation: This error suggests that the node does not have the necessary permissions to read or write to the specified directories.
- Solution: Ensure that you have the appropriate permissions to access the directories and modify the files within them.
