ScriptSpot

Forum topic · Scripts Wanted

Sort Batch Render Cameras sequence by camera name

By compuhms · 2018-08-25

Description
Comments (13)

appius · 2020-10-15

same here, i can't get it work

.

miauu · 2018-09-25

I suppose that the cameras are displayed in the order they are selected. So, select the cameras in proper order and you will see them with correct order.
Also you have to be able to click the header of the comuns with cameras and the list to be sorted.

.

miauu · 2018-10-05

Try this:


(
	function SortByNames obj01 obj02 = stricmp obj01.name obj02.name
		
	camArr = for c in cameras where classOf c != targetObject collect  c	
	
	qsort camArr SortByNames
		
	select camArr
	
	actionMan.executeAction -43434444 "4096"  -- Render: Batch Render Dialog Toggle
)

Load the scene and run the script. It will open the Batch Render dialog
The last line works in 3ds Max 2019. I don't know what version of 3ds Max do you have, so if there are error in the last line, just delete it, load the scene, run the script and then opem the Batch Render dialog manually.

compuhms · 2018-10-05

I'm using 3ds Max 2016, the script gives no errors but after running the script it JUST select all cameras and open the Batch Render dialog ONLY. Still cameras are not sorted. what do you think?

.

jahman · 2018-10-05

0. collect views
1. sort
2. duplicate
3. delete old
4. set original view names back

compuhms · 2018-10-05

is it a script? please elaborate

.

jahman · 2018-10-05

nope, it's just a maxscript demo of the proposed algorithm

compuhms · 2018-10-06

Thanks for your collaboration anyway. It would be great if there’s a tool like this.

.

miauu · 2018-10-05

Try this one:


(	
	function SortByXMember arr1 arr2 x:1 =
	(
		stricmp arr1[x] arr2[x]
	)	
	
	brmNumViews = batchRenderMgr.numViews 
	
	if brmNumViews != 0 do
	(
		viewsArr = for v = 1 to brmNumViews collect ( #(v, (batchRenderMgr.GetView v).camera.name) )
		qsort viewsArr SortByXMember x:2		
		sortedViewsArr = for arr in viewsArr collect ( batchRenderMgr.DuplicateView arr[1] )

		for v = 1 to brmNumViews do (batchRenderMgr.DeleteView 1 )	
	)
	actionMan.executeAction -43434444 "4096"  -- Render: Batch Render Dialog Toggle	
)

works perfect

compuhms · 2018-10-05

thank you so much :) brilliant

unhighlight or "deselect all cameras" batch render dialogue

compuhms · 2021-06-08

greetings.. incase if there is a scene with 20 render batch cameras added in batch render dialogue..is there a script to deselect all cameras from batch render dialogue so that i can manually select only certain jobs that i need to render?

.

jahman · 2021-06-08


for i=1 to batchRenderMgr.numViews do (batchRenderMgr.GetView i).enabled = false

but you'll have to reopen batch render dialog to see the changes