ability to write in text file selected objects name list
Closed this issue · 1 comments
Vinc3r commented
check example code from Cstfan
# import the necessary modules we need
# in our case, blender's python API and python's os module
import bpy, os
# get the current selection
selection = bpy.context.selected_objects
# initialize a blank result variable
result = ""
# iterate through the selected objects
for sel in selection:
# get the current object's dimensions
dims = sel.dimensions
# write the selected object's name and dimensions to a string
result += "%s," % (sel.name)
# get path to render output (usually /tmp\)
# tempFolder = os.path.abspath (bpy.context.scene.render.filepath)
tempFolder = "c:\Temp"
# make a filename
filename = os.path.join (tempFolder, "List_Objects_LM.txt")
# open a file to write to
file = open(filename, "w")
# write the data to file
file.write(result)
# close the file
file.close()
Vinc3r commented
copy to clipboard is more convenient