Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Copyright (c) [2/25/24] [Dieton]
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- """
- import bpy
- def write_shape_key_names(file_path):
- # Get the active object
- active_object = bpy.context.active_object
- # Check if an object is selected
- if active_object:
- # Open the file in write mode
- with open(file_path, 'w') as file:
- # Write shape key names to the file
- for shape_key in active_object.data.shape_keys.key_blocks:
- file.write(shape_key.name + '\n')
- print(f"Shape key names written to: {file_path}")
- else:
- print("Error: No object selected.")
- # Set the file path where the shape key names will be written
- file_path = "C:/File_Location/shape_key_names.txt"
- # Call the function to write shape key names to the file
- write_shape_key_names(file_path)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement