Sort Batch Render Cameras sequence by camera name

i have so many max files that contains batch render cameras and i need to sort the render sequence alphabetically by camera name. for elaboration check this link: http://www.hm-studios.com/downloads/batchsort.jpg

Comments

Comment viewing options

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

same here, i can't get it

same here, i can't get it work

miauu's picture

.

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.

compuhms's picture

still no solution | batch render window sort cameras by name

Thank you for the reply, but clicking on the header of the columns "Camera" doesn't sort them. It needs a script to sort by name.

check this empty max file with just added batchrender cameras added for test

http://www.hm-studios.com/downloads/batch-render-sort-cameras-by-name.max

arch. Hazem Mamdouh
www.hm-studios.com

miauu's picture

.

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's picture

I'm using 3ds Max 2016, the

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?

arch. Hazem Mamdouh
www.hm-studios.com

miauu's picture

.

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	
)
compuhms's picture

works perfect

thank you so much :) brilliant

arch. Hazem Mamdouh
www.hm-studios.com

jahman's picture

.

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

compuhms's picture

is it a script? please

is it a script? please elaborate

arch. Hazem Mamdouh
www.hm-studios.com

jahman's picture

.

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

Comment viewing options

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