Options
Go to last post Go to first unread
Michse22  
#1 Posted : Tuesday, March 26, 2024 12:14:48 PM(UTC)
Michse22

Rank: Member

Joined: 12/24/2021(UTC)
Posts: 15

Thanks: 10 times
Was thanked: 3 time(s) in 3 post(s)

Hi,


I hope you can help me with a little problem I'm running into:


Whenever other products (eg meipes golden palace / strix nipples & navel ...) use that little info dialog "hey! whatever I did it's done now, so please press OK" the AutoLoad Script pauses until you press that annoying button. Is there a way to suppress such popups while the script is running? I tried running DAZ with -noPrompts - that works - but that way I loose too many desired infos. If suppressing popups is not possible - maybe some sort of "auto-OK" or simulating a hit on the "enter/return" key?


I really love your script. Makes fitting the basics to any character a lot faster :)


lightBLUE  
#2 Posted : Tuesday, March 26, 2024 1:35:11 PM(UTC)
lightBLUE

Rank: Advanced Member

Joined: 3/13/2018(UTC)
Posts: 51

Thanks: 7 times
Was thanked: 20 time(s) in 17 post(s)
Hi,

Thanks.

I know what you mean, automatic acceptance would be good for many dialog popups.
But I don't really have a solution for that.
AutoLoad is just loading the desired assets, and if they contain some dialog popup, it doesn't have the instructions to hit the predefined button.
I did think about the possibility of adding the automatic dialog acceptance, but I wasn't sure it would be good for every scenario, so I didn't.

Sorry I can't be of more help here.
thanks 2 users thanked lightBLUE for this useful post.
ZenMaster3D on 3/26/2024(UTC), Michse22 on 3/27/2024(UTC)
Michse22  
#3 Posted : Wednesday, March 27, 2024 12:50:53 PM(UTC)
Michse22

Rank: Member

Joined: 12/24/2021(UTC)
Posts: 15

Thanks: 10 times
Was thanked: 3 time(s) in 3 post(s)

Thanks for trying :)


Maybe I'll stumble upon something useful on the daz site...


Michse22  
#4 Posted : Sunday, April 7, 2024 2:29:30 AM(UTC)
Michse22

Rank: Member

Joined: 12/24/2021(UTC)
Posts: 15

Thanks: 10 times
Was thanked: 3 time(s) in 3 post(s)

I've found a way :D


There is a third party open source app called Autohotkey ( https://www.autohotkey.com ).
I modified an example from their forum (Example 2 - SetTimer  https://www.autohotkey.c...s/viewtopic.php?t=120588 )
I have very limited programming knowledge - so don't ask me what all that array stuff at the end is - it just works for me ;)


This is the code for the Autohotkey script:


#Requires AutoHotkey v2


SetTimer(WinOpenClose, 2000) ; Calls the function WinOpenClose every 2000 milliseconds
Persistent() ; We have no hotkeys, so Persistent is required to keep the script going


WinOpenClose() {
    static lastOpenWindows := ListOpenWindows()
    currentOpenWindows := ListOpenWindows()
    for hwnd in SortedArrayDiff([currentOpenWindows*], [lastOpenWindows*]) {
        if !lastOpenWindows.Has(hwnd) {
            info := currentOpenWindows[hwnd]
            if (info.title = "Finished" || info.title = "DAZStudio") {
                ToolTip(info.title "popup closed")
                SetTimer(ToolTip, -3000)
                WinClose(info.title)
            }
        } else {
            info := lastOpenWindows[hwnd]
            if (info.title = "DAZStudio") {
                ToolTip(info.title " exiting script")
                SetTimer(ToolTip, -3000)
                SetTimer(WinOpenClose, 0)
                ExitApp
            }
        }
    }
    lastOpenWindows := currentOpenWindows


    ListOpenWindows() { ; Returns Map where key=window handle and value={title, class, processName}
        openWindows := Map()
        for hwnd in WinGetList()
            try openWindows[hwnd] := {title: WinGetTitle(hwnd), class:WinGetClass(hwnd), processName: WinGetProcessName(hwnd)}
        return openWindows
    }
    SortedArrayDiff(arr1, arr2) { ; also accounting for array length difference
        i := 1, j := 1, n := arr1.Length, m := arr2.Length, diff := []
        while (i <= n && j <= m) {
            if arr1[i] < arr2[j] {
                diff.Push(arr1[i]), i++
            } else if arr2[j] < arr1[i] {
                diff.Push(arr2[j]), j++
            } else {
                i++, j++
            }
        }
        while i <= n
            diff.Push(arr1[i]), i++
        while j <= m
            diff.Push(arr2[j]), j++
        return diff
    }
}


line 13 contains every "OK-Popup Window title" seperated by || , for my purpose "Finished" and "DAZStudio" if you have other popups you have to change / add them:
            if (info.title = "Finished" || info.title = "second popup title" || info.title = "third popup title" || info.title = "DAZStudio") {


line 20 defines my Endpoint - after closing "DAZStudio" Popup the script will end itself:
           if (info.title = "DAZStudio") {


You can find the Popup titles either by reading their title or by using "window spy" from the autohotkey dash (start it and hover your mouse over the desired popup)


@lightBLUE:


  1. If I had a way to start the script or an ".exe" with your Autoload script automatically that would be quite handy - is it possible?
  2. Also I'm loading way more than 4 files on a node. With your script I have to select the node, select 4 files, accept, confirm adding another node and repeating the process again. Is there a way to increase the number of files added to one node in one window? Maybe configurable to adjust to your own screen size...
  3. I'm adding .duf and .dsa - the script can handle both. The standard selection in the file dialog is only .duf and I have to manually switch to .dsa quite often. Would it be possible to add a third filter option including .duf, .dsa and .dse as default option? Or a way to let me define that as default?

I don't think there will ever be a solution for an auto OK from DAZ itself. Since they can't even add a basic function like "cancel whatever is happening right now?"... (eg. dforce explosion or loading big assets ;)


lightBLUE  
#5 Posted : Sunday, April 7, 2024 2:17:06 PM(UTC)
lightBLUE

Rank: Advanced Member

Joined: 3/13/2018(UTC)
Posts: 51

Thanks: 7 times
Was thanked: 20 time(s) in 17 post(s)
That's an interesting solution. I never tried to create something with Autohotkey, but as I understand, it can automatically perform different repetitive tasks, such as closing popups in this case.

Unfortunately, AutoLoad Creator can open only the file types that are supported inside Daz Studio, if you add an exe file to the script Daz Studio will respond with an error message I assume.
So out of the box, it will not be able to run the Autohotkey script.

AutoLoad Creator is literally creating Daz scripts, so it needed some kind of a template number of added files, some users suggested that four files are enough. The main script would have to be corrected in order to accept a larger number.

The script is set to filter the files to duf., dsa., and dse. Duf is the first option as it is the most common, and for that reason, it appears as default when you open the window. Different file types always appear as separate options, and therefore you'll need to select the file type manually.
Michse22  
#6 Posted : Tuesday, April 9, 2024 11:02:00 PM(UTC)
Michse22

Rank: Member

Joined: 12/24/2021(UTC)
Posts: 15

Thanks: 10 times
Was thanked: 3 time(s) in 3 post(s)

While I'm a little sad on the filetype topic, I'm glad I've found a site from Jay Versluis on how to load files in DAZ: ( https://www.versluis.com...umentation-daz-products/ )


With his example code I was able to load .exe files :) The code requires the file to be located in the same directory as the script:


var sPath = MainWindow.getPaneMgr().findPane("DzContentLibraryPane").getSelectedContainer().getFullPath();
App.showURL("file:///" + sPath + "/DazPopupClose_Timer.exe");


I created a script with that code and load it first in autoload - working great so far :D


lightBLUE  
#7 Posted : Wednesday, April 10, 2024 7:14:05 AM(UTC)
lightBLUE

Rank: Advanced Member

Joined: 3/13/2018(UTC)
Posts: 51

Thanks: 7 times
Was thanked: 20 time(s) in 17 post(s)
That's a good solution :)
I'm glad you found a way to make it work for you.

It's not easy to find documentation on Daz scripting, I really love coding but when it comes to Daz script I often get frustrated with the lack of documentation that you can find online.
I have a lot of ideas for new scripts, but the resources on the subject are limited and for that reason, it takes so much more time to implement them.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.496 seconds.

Notification

Icon
Error