Member Bay Posted May 30, 2020 Member Report Share Posted May 30, 2020 I'm trying to automate Decimate to retopo but if the user selects a polycount larger than 50k, a dialogue appears that I can't seem to skip without skipping the decimation slider dialog. is there a way to get the SetModalDialogCallback to effect this dialog? This is the modal dialog I want to keep: this is the one I want to skip if it comes up: these are the commands I'd using. The scripting documentation doesn't mention this sub modal dialog. any pointers on how to skip it would be appreciated. // SetModalDialogCallback("ModalDialogCallbackOverDecimation"); cmd("$DecimateToRetopo"); // RemoveModalDialogCallbacks(); fyi: Honestly I'd rather skip both of these dialogs and use a custom window with a numeric entry field to specify a target polycount, but when I did this, it only works on low poly vox layers. when the incoming mesh count is too high, the ReductionPercent slider float precision is too low and it fails out. void ModalDialogCallbackDecimateToTargetPolyCount(){ if(TargetReductionPercent<99.999) { SetSliderValue("$DecimationParams::ReductionPercent",TargetReductionPercent); }else { SetSliderValue("$DecimationParams::ReductionPercent",99.9); } cmd("$DialogButton#1");/*press Ok*/ } void ModalDialogCallbackSaveSession(){ cmd("$DialogButton#1");/*press Ok*/ } Quote Link to comment Share on other sites More sharing options...
Contributor ajz3d Posted May 30, 2020 Contributor Report Share Posted May 30, 2020 This post was recognized by Carlosan! ajz3d was awarded the badge 'Helpful' and 1 points. Try this: / This function should be called before you call any of modal dialogs // function if you want to press button number ButtonIndex // (first button is 1, second is 2). void PressInNextModalDialogs(int ButtonIndex); // For example, if you have Yes and No buttons and you call // PressInNextDialogs(1) before showing dialog then Yes will be // pressed automatically. // You should call PressInNextDialogs(-1) to stop automatical // pressing of buttons. Source: https://pilgway.com/files/scriptdocs/ABuildDialogs.html You would probably have to insert this at the end of your decimation dialog callback function. Otherwise it would press buttons in the decimation dialog. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.