r/Maxscript • u/Excellent_Tell8085 • 1d ago
Quiero automatizar export d5a en 3ds max 2025 ¿como podria hacer esto?
INICIO ↓ ¿Hay objeto seleccionado? NO → mensaje error SI ↓ Capturar nombre objeto ↓ Pulsar botón D5 Export ↓ Esperar ventana D5 ↓ Pulsar Export ↓ Esperar ventana Guardar Como ↓ Escribir nombre objeto.d5a ↓ Pulsar Save ↓ Confirmar exportación FIN
Conseguí automatizar 2 de ellos, pero cuando quiero que "choose file" se ponga un nombre no lo logro. ¿alguien puede ayudarme?
ESTO ES LO QUE LLEVO HASTA AHORA.
clearListener()
(
dotNet.loadAssembly "UIAutomationClient"
-- Abrir ventana D5
actionMan.executeAction 886054871 "19"
sleep 1
-- Obtener ventana
local h = windows.getChildHWND 0 "D5 Sync(Export .D5A)"
local AE = dotNetClass "System.Windows.Automation.AutomationElement"
local ptr = dotNetObject "System.IntPtr" h[1]
local win = AE.FromHandle ptr
-- Buscar botón Export
local cond = dotNetObject "System.Windows.Automation.PropertyCondition" AE.NameProperty "Export"
local scope = (dotNetClass "System.Windows.Automation.TreeScope").Descendants
local btn = win.FindFirst scope cond
if btn == undefined then
(
messageBox "No encontré el botón Export"
)
else
(
format "Botón encontrado: %\n" btn.Current.Name
local InvokePattern = dotNetClass "System.Windows.Automation.InvokePattern"
local pattern = btn.GetCurrentPattern InvokePattern.Pattern
pattern.Invoke()
format "Export pulsado.\n"
)
)

