Pro Optimize on Multiple Selected Objects

Hi,

I have problems displaying "calclulate=on" on multiple objects simultaneously.
I know it will be heavy on multiple objects at the same time, but is it possible to show it on multiple objects when adjusting the threshold?

Any help would be appreciated :)

My Script Snippet:

try (destroyDialog ::rol_ProOptimize) catch()
 
rollout rol_ProOptimize "Pro Optimize"
(
	group "Pro Optimize:"
	(
		button btn_ADD "ADD Pro Optimize" width:100 height:16 align:#left across:2
		spinner spn_tresh "Threshold:" width:110 height:20 range:[0,100,100] type:#integer --type:#float enabled:true
		button btn_Collapse "..:: Colapse Selection To Editable Poly ::.." width:225 height:20 
	)
 
	on spn_tresh changed val do
	(
		for obj in selection do
		(
			obj.modifiers[#ProOptimizer].VertexPercent = spn_tresh.value
		)
	)
 
	on btn_Collapse pressed do
	(
		for obj in selection do
		(
			macros.run "Modifier Stack" "Convert_to_Poly"
		)
	)
 
	on btn_ADD pressed do
	(
		for obj in selection do
		(
			addModifier obj (ProOptimizer()) ui:on
			obj.modifiers[#ProOptimizer].OptimizationMode = 1
			obj.modifiers[#ProOptimizer].SymmetryMode = 0
			obj.modifiers[#ProOptimizer].Calculate = on
			obj.modifiers[#ProOptimizer].VertexPercent = spn_tresh.value
		)
		/*
		for obj in selection do
		(
			modPanel.addModToSelection (ProOptimizer ()) ui:on
			obj.modifiers[#ProOptimizer].OptimizationMode = 1
			obj.modifiers[#ProOptimizer].SymmetryMode = 0
			obj.modifiers[#ProOptimizer].Calculate = on
			obj.modifiers[#ProOptimizer].VertexPercent = tresh.value
		)
	*/
	)
)
 
createDialog rol_ProOptimize width:250 height:80 pos:[260,155]

Comments

Comment viewing options

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

I suggest you to rethink and optimize...

I guess the best way is to find the optimal setting BEFORE apply this modifier on all your scene. Are you sure you need to see the result in realtime on all your selection to find your optimal setting?
Maxscript is not a best for realtime actions, it's more powerfull to automate actions.

I have some advices for optimize you code :
-prevent to call 3 times the "selection". create a variable and call 1 time : mySelection = selection. After, you ll use your mySelection variable to do what you need.
-why dont find the best settings before batching? By exemple, you can add a presets interface. when you find some good settings on one object, it will allow you to save settings and apply it by batch. It's not really necessary to see all the process in realtime (I mean, me, I think it's not necessary :) ), it's just an Optimizer modifier. (by exemple : save setting under SUPERSETTINGS name and apply SUPERSETTINGS on any objects you want)
-prevent to use macros.run "Modifier Stack" it's heavy to calculate on multi objects. Use the direct command : convertTo $ TriMeshGeometry or convertTo $ PolyMeshObject

Mon avis est qu'il est préférable de trouver les bon paramettre d'optimisation avant de les appliquer en masse. Maxscript est un outils formidable d'automatisation mais ce n'est pas l'idéal pour les actions en temps réel.

Je conseil plutot de réviser le processus et d'optimiser le code :
-Eviter de rappeler 3 fois la variable "Selection". Créer plutôt une variable : maSelection = Selection et faire appelle autant de fois que l'on veut a cette variable maVariable.
-Pourquoi ne pas faire une interface qui permet de trouver des réglages optimales pour les sauvegarder dans une interface de gestion des préréglages. Cela permettrait de sauvegarder ces réglages et de les appliquers en masse sur tout plein d'obgets. (par exemple enregistrer des réglages sous le nom de SUPERREGLAGE et par la suite appliquer SUPERREGLAGE sur tous les objets)
-Eviter les commandes use macros.run "Modifier Stack" plus lourde a calculer qu'un simple : convertTo $ TriMeshGeometry ou convertTo $ PolyMeshObject

Jul

tassel's picture

Hi, Thank you for you

Hi,

Thank you for you comment. I know the script itself is not optimal and I will take your tips and comments and make the changes later on. I did an version without realtime view, but our heavy offshore models require realtime view, because of the complex and messed-up geometry (My solution at the moment is only to use this on one geometrical object at the time).

Best regards,
Raymond H.Ingebretsen

/ Raymond

Comment viewing options

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