ScriptSpot

Forum topic · Scripts Wanted

Group Name = Render Output name

By Gabriel Corazza · 2018-02-26

Description

Hi guys! Need some button/script that can fill render output box with the same name of my group selection (object/group.jpg). Is that possible? Thanx!!!

Comments (3)

.

miauu · 2018-02-26

Where is the image? - group.jpg

Generic name

Gabriel Corazza · 2018-02-27

Group.jpg is a generic name like "groupname".jpg,
my ideia:

1- Select any group in the scene. (grab groupname)
2- Press Magic button! Puff! :D
3- Render output now is "C:/groupname.jpg"

Srry my english is very rusty!

Ty Miauu
btw im still using Measure Pro every day XD

.

miauu · 2018-02-27

The script like this can be wrrtiten for 5 minutes or less. The problem is how the scrip to know this part: "C:/"
As you know Render Output must be a "path to folder" + "name of the file". The name of the file will be the name of the selected group. But how the script to know the path to the folder where the file to be saved?
If all images have to be saved to C:\ then use this:\


(
	function FindTopMostGroupHead obj = if isgroupMember obj do
	(
		while obj != undefined and (not isGroupHead obj or isGroupMember obj) do
			(obj = obj.parent)
		obj
	)
		
	selObjsArr = selection as array
	
	grpHead = FindTopMostGroupHead selObjsArr[1]
	
	rendSaveFile = true
	rendOutputFilename = "C:\\" + grpHead.name + ".jpg"
)