hey guys, i'm trying to import a batch of obj files from a directory without having the script show any dialogs but for some reason it always shows the import dialog on the first import i want to do.
The following objs import without showing any dialog. Here is the code
(
theFiles = getFiles "C:\\path\\*.*"
for i = 1 to theFiles.count do
importFile theFiles[i] #noprompt using:Wavefront_Object
)
Does anyone know a workaround or a fix to this problem?
Replies
You'll need to get the name of the window (basically the title bar) and the name of the button (the text on the button itself). Note that both of those are case sensitive!
second problem is that the import dialog has a loadingbar, so i thought i'd add a timer that would set a bool to true after 2 seconds but this doesn't seem to work and yet again i can't really see why not
edit: crap it seems like the dialog box halts the script , so if i don't set a delay it will be fast enough to import but won't have enough time to load the loadbar resulting in a "Nothing found to import" message. And with the delay my function to press the button will not be called when the dialog is active
guess what, this holds the Import Dialog from loading the mesh so yet again it results in a "Nothing found to import" message. -_-'
I really need this to work since it would be running on a server
So what i'm doing now is running a vbs script that focuses my screen and sends a space command.
Maxscript
PressSpace.vbs