Author Topic: Ignore pop up dialogs when scripting Meshmixer  (Read 4738 times)

smagnetize

  • Newbie
  • *
  • Posts: 8
    • View Profile
Ignore pop up dialogs when scripting Meshmixer
« on: March 04, 2016, 04:18:00 AM »
Is there any way to prevent or auto continue when a dialog popup when executing a script.

For example this dialog pops up when exporting:
Complex object in scene
One or more objects being exported is complex (non-manifold).
The resulting mesh file may have errors. Do you wish to continue or cancel exporting?

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #1 on: March 11, 2016, 11:13:39 AM »
Sorry, this is an oversight, there is no way to dismiss this dialog right now. I put a fix into the next beta, should be out soon.

Are there other places you are having this problem? Please let me know so I can fix them.

If you really need to fix this, then at least on windows it should be possible to inject an 'enter' keypress into the event stream for the process. This would be through Win32 APIs. I can't really help you to do this but I know it is possible, you will have to google around for it.
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

smagnetize

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #2 on: March 14, 2016, 05:05:10 AM »
Thanks, I've only come across this particular dialog.

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #3 on: March 14, 2016, 01:28:43 PM »
ok, this fix is in the current beta
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

smagnetize

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #4 on: March 29, 2016, 06:16:05 AM »
The dialog is still appearing for me.

I'm using meshmixer 3.1.83 and https://github.com/meshmixer/mm-api/tree/current_beta.

MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #5 on: March 29, 2016, 12:38:35 PM »
Besides dismissing a dialog:

Does it make sense to ignore that message? A Complex is a MM thing and non manifolds are hard to repair...
Maybe you consider to run
GetSceneCommandResult_GetObjectType to check if there's a Complex
and if yes: SplitComplex
and export after splitting...
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.

smagnetize

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #6 on: March 31, 2016, 07:13:37 AM »
Thanks MagWeb, I've had a look into Complex objects. I think the dialog is perhaps using the word "complex" for a different thing here. I've just imported a .obj file and haven't gone through the process of creating the Complex objects. I don't want to fix the non-manifolds in meshmixer (one day hopefully we'll have that issue fixed before importing into meshmixer.)
« Last Edit: March 31, 2016, 07:17:14 AM by smagnetize »

MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #7 on: March 31, 2016, 10:11:24 AM »
Sorry, got you wrong for that dialog also happens if you try to export a MM-made-Complex. But you are right: happens also on exporting non-manifold meshes.

BTW: ATM running the stored command "SplitComplex" (using Current_Beta branch) seems not to split but trying to generate a Complex instead. Same at "FilterComplex"
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #8 on: April 13, 2016, 05:34:33 PM »
does it still appear in the 3.1.88 beta?

Magweb, I just fixed the SplitComplex problem, will be in next beta (which might be a week or so as I in the middle of some major changes...)
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

smagnetize

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #9 on: April 15, 2016, 11:50:00 AM »
I've installed 3.1.88 and the same dialog still shows.

Let me know if there's any more info I can provide.

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #10 on: April 21, 2016, 01:44:16 PM »
can you send me an example? eg a saved .mix and the command you are using to write the file.
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

bathsheba

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Bathsheba Sculpture
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #11 on: June 06, 2016, 06:55:02 PM »
I too would like to be able to dismiss pop-ups from the Windows/Python API.  The specific problem I have is that I want to completely automate a Meshmixer operation from another script: open it, have it open a file, do stuff, and then quit.
 
I don't see any way to quit from the API, which if that actually doesn't exists, I'd like to raise as a separate feature request please?

What I did was let my Python script finish and then have my calling script kill the MeshMixer process.  Unfortunately it sees that as a crash, and on the next launch you get an unscriptable, unsuppressable dialog asking whether to restore the previous file.  I never will want this, and now my script can't run without being babysat.

Help?

Thanks,
Bathsheba
http://bathsheba.com

tkmorrison

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #12 on: April 20, 2017, 03:15:13 PM »
My number 1 requests would also be that popups be suppressed. It makes automation quite difficult. I resorted to using scripted key-presses, and it's pretty messy. (On windows + python I'm using win32com.client )

Three popups have been a problem with version 3.2:
1. The complex object / nonmanifold popup when exporting a mesh.
2. The 'meshmixer crashed' popup when starting meshmixer after a crash
3. And then crashes themselves, but I think the popup here is a windows popup.

@bathsheba - In python you can at least close MeshMixer without inducing a 'crashed' response using this:
meshmixerProcess = subprocess.Popen( ["C:/Program Files/Autodesk/Meshmixer/meshmixer.exe"] )
meshmixerProcess.terminate()

esean

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Ignore pop up dialogs when scripting Meshmixer
« Reply #13 on: May 01, 2017, 01:22:22 PM »
Hi,

I would also like to add my request for this feature. Has there been any progress or workarounds? I'm running MM v3.2.27 on Mac.

I am also writing a python automated workflow and want to select "Yes/continue" to this dialog specifically,

>> 1. The complex object / nonmanifold popup when exporting a mesh.

This is the specific dialog I would like to dismiss (click Yes), but as others point out, a more general APi is preferred as I may hit other dialogs later...

Thanks!

Sean