Box info Exporter

Would it be possible for someone to make a script that will export info for all the boxes in a scene to a textfile.

In the format of:
Name
Length
Width
Height
X(translation)
Y(translation)
Z(translation)
X(rotation)
Y(rotation)
Z(rotation)

Example:

Box01
48.713
22.97
-8.234
-7.262
-7.581
7.632
90.0
-0.0
-0.0

Box02
58.713
32.97
-3.234
-6.262
-9.581
7.632
90.0
-0.0
-0.0

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
othoap's picture

This may help

do a search for SOP : Spit Out Props+!

br0t's picture

there you go ( txtFile =

there you go

(
	txtFile = "C:\Users\YourName\Desktop\boxInfo.txt"
 
	if doesFileExist txtFile then
		theFile = openFile txtFile mode:"at"
	else 
		theFile = createFile txtFile
 
	fn print_data_to_file obj=
	(	 
		format "\n\n%\n%\n%\n%\n%\n%\n%\n%\n%\n%\n" obj.name obj.length obj.width obj.height obj.position.x obj.position.y obj.position.z \
		(obj.rotation as EulerAngles).x (obj.rotation as EulerAngles).y (obj.rotation as EulerAngles).z to:theFile
	)--end fn
 
	for theBox in $Box* do print_data_to_file theBox
	close theFile
)

If you run this multiple times without changing the file name, it will just add everything inside the file. If you want to delete the old info inside the file when running the script, change the mode from "at" to "wt"

Never get low & slow & out of ideas

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.