Elgato Stream Deck Plugin for Daz Studio [Alpha-ish]

WindamyreWindamyre Posts: 162
edited October 2021 in Freebies

Edited: Updated link for Stream Deck Plugin.  Expanded on plug-in install instructions.

Do you have an Elgato Stream Deck but are tired of finding unique keyboard shortcuts?  Do you wish you could quickly and easily assign a colorful, tactile key for all your Daz Studio and Custom Actions?

Now you can!

Introducing the Stream Deck Plug-in for Daz Studio.


The plug-in will allow you to:

  • Assign almost every Daz Studio action to a key. (limited by the Daz Studio SDK)
  • Assign every Custom Action you create in Daz Studio.
  • Use your own button title or have the plug-in supply a default one.
  • Use the icon associated with custom action or create your own.
  • Run actions in Daz Studio even when it's in the background.

All this for FREE! laugh

To install you'll need to get both parts:

  • Daz Studio Plugin by by esemwy.  This is the Daz Studio side of the system.  Without it, Daz Studio can't hear the actions sent by the Stream Deck.  The .dll file should be placed in your Daz Studio plugins folder.  For me this was C:\Program Files\DAZ 3D\DAZStudio4\plugins but YMMV. Quick note: as esemwy posted it as a .dll your browser/virus software might freak out a bit.  If you want (and know how) you can download the source code and compile it instead.  The plug-in should appear in Daz Studio under Help -> About Installed Plugins... as Stream Deck Plugin
  • Stream Deck Plugin by Windamyre.  This is the Stream Deck side of the system.  Without it, there's nothing for Daz Studio to listen to.  Download the Custom Acttions v0.3.1.zip (or whatever is current).  Inside will be a folder titled "com.windamyre.daztools.sdPlugin".  This folder should be placed in your Stream Deck Plugins folder.  For me this was C:\Users\[username]\AppData\Roaming\Elgato\StreamDeck\Plugins where [username] is replaced with yours.  Again, YMMV.  The Actions should appear in the Stream Deck under Daz Studio Tools.

Some technical info:

  • The system works by sending commands from the Stream Deck to Daz Studio via a websocket.  This is why Daz Studio doesn't need to be in the foreground to receive the command.
  • The list is compiled from Daz Studio directly and updated every 30 seconds or so.  If your new Custom action doesn't show up, give it a minute. 
  • Because the list is taken from Daz Studio, the actions are called what Daz Studio called them.  For example, "NVIDIA Iray" is the name for the Viewport Iray drawmode.
  • All the source code is available on github in case you want to review it or make suggestions.

Plans for future improvement:

  • 'Curated' lists of commands to cut down on the number of commands to sift through
  • Action to run custom script straight from the plug-in

Let me know what you think either here on Daz Forums or via GitHub.  If you want to fork the Elgato plugin feel free.  I'm a novice/hobbiest programmer, so you might be able to do better.  For the Daz Studio, plugin see esemwy.

Post edited by Windamyre on

Comments

  • HeleneHelene Posts: 85

    Thank you so much!  I will give this a try.  I love my Streamdeck.

     

  • WindamyreWindamyre Posts: 162
    Helene said:

    Thank you so much!  I will give this a try.  I love my Streamdeck.

     

    Great! Let me know if you have any issues. I'll do what I can to help and make improvements.
  • HeleneHelene Posts: 85

    DAZ Studio sees it's plugin.  I am having trouble with the Stream Deck plugin.
    When I unzipped it, I had DazStudioStreamDeckPlugins-3.3.0 / DazStudioStreamDeckPlugins-3.3.0 / Visual Menu / a bunch of folders and files
    The Stream Deck software didn't see it like this, so I moved DazStudioStreamDeckPlugins-3.3.0 / Visual Menu /    out of the top folder
    The Stream Deck software still didn't see it.
    So then I tried Visual Menu as the top folder, and The Stream Deck software still doesn't see it. 
    Each time I rebooted the Stream Deck Software and waited several minutes to see if it would work. 
    I can't reboot my computer at the moment, but I can try that later. 
    What else should I try?
    Thanks!

     

     

  • WindamyreWindamyre Posts: 162
    Helene said:

    DAZ Studio sees it's plugin.  I am having trouble with the Stream Deck plugin.
    When I unzipped it, I had DazStudioStreamDeckPlugins-3.3.0 / DazStudioStreamDeckPlugins-3.3.0 / Visual Menu / a bunch of folders and files
    The Stream Deck software didn't see it like this, so I moved DazStudioStreamDeckPlugins-3.3.0 / Visual Menu /    out of the top folder
    The Stream Deck software still didn't see it.
    So then I tried Visual Menu as the top folder, and The Stream Deck software still doesn't see it. 
    Each time I rebooted the Stream Deck Software and waited several minutes to see if it would work. 
    I can't reboot my computer at the moment, but I can try that later. 
    What else should I try?
    Thanks!

     

     

    Sounds like you've downloaded the source code. Here's a link that should go straight to the plugin's compiled folder. https://github.com/Windamyre/DazStudioStreamDeckPlugins/releases/download/v0.3.1/CustomAction.v0.3.1.zip Inside the zip will be a folder called "com.windamyre.daztools.sdPlugin". That's the one that goes in the streamdeck plugin's folder. I'll work on a better set of instructions.
  • WindamyreWindamyre Posts: 162
    You can delete the other folder unless you want to read the source code. :-)
  • WindamyreWindamyre Posts: 162

    Helene said:

    DAZ Studio sees it's plugin.  I am having trouble with the Stream Deck plugin.
    When I unzipped it, I had DazStudioStreamDeckPlugins-3.3.0 / DazStudioStreamDeckPlugins-3.3.0 / Visual Menu / a bunch of folders and files
    The Stream Deck software didn't see it like this, so I moved DazStudioStreamDeckPlugins-3.3.0 / Visual Menu /    out of the top folder
    The Stream Deck software still didn't see it.
    So then I tried Visual Menu as the top folder, and The Stream Deck software still doesn't see it. 
    Each time I rebooted the Stream Deck Software and waited several minutes to see if it would work. 
    I can't reboot my computer at the moment, but I can try that later. 
    What else should I try?
    Thanks!

     

    First off, thanks for trying this out!  Second, I figured out where I messed up.  I had uploaded a new version, but didn't update the link in the original post.  If there's anything else I can do to help out, or if there are any issues or improvements I can make, please let me know.

  • HeleneHelene Posts: 85

    That did it!  Now my Stream Deck has Daz Studio Tools. 
    The rest of my day will be a bit hectic, so I will try to do more tomorrow.
    Thank you!

     

  • WindamyreWindamyre Posts: 162

    No problem!  Glad it helped.  The hard part (for me) was figuring out what the heck Daz Studio called a particular action, and sometimes which one.  There are two "Select Children" to select, for example, the figure bones of the hand.  One is for bones, the other is for... materials?  Dunno.

    My next step is to try and create a curated / filtered list of actions with names that are more descriptive.

  • Hi Windamyre,

    First of all, thank you so much for getting something like this up and running, it has been a real help to getting things working for me. However, I've run into a crash recently and am wondering if you can help at all deciphering what the cause might be, or point me in the right direction.

    When I try to load a G8.1 Female model it just crashes after what appears to be it trying to load. A G8.1 Male has no issues, same thing with G8 as well.

    I have removed and re-added the Custom Actions in case something had broken there.

    Other actions that I have setup work, Emissive Shaders, Iray Uber Base, Mirror Posing, Riversoft's Look At Camera II all work, its just the G8/8.1 F which does make me think its just the amount of morphs installed.

    The only other thing I can consider, is its my network and the fact my data folder is on a NAS, but given other actions work, I am leaning towards just the amount of morphs I have for the females.
    Any chance you could take a look and see if a) my thought process is correct, and if so is there a fix for it somehow?

    log
    log
    pluginlog.log
    21K
  • WindamyreWindamyre Posts: 162
    edited September 28

    Professor Santiago said:

    Hi Windamyre,

    First of all, thank you so much for getting something like this up and running, it has been a real help to getting things working for me. However, I've run into a crash recently and am wondering if you can help at all deciphering what the cause might be, or point me in the right direction.

    When I try to load a G8.1 Female model it just crashes after what appears to be it trying to load. A G8.1 Male has no issues, same thing with G8 as well.

    I have removed and re-added the Custom Actions in case something had broken there.

    Other actions that I have setup work, Emissive Shaders, Iray Uber Base, Mirror Posing, Riversoft's Look At Camera II all work, its just the G8/8.1 F which does make me think its just the amount of morphs installed.

    The only other thing I can consider, is its my network and the fact my data folder is on a NAS, but given other actions work, I am leaning towards just the amount of morphs I have for the females.
    Any chance you could take a look and see if a) my thought process is correct, and if so is there a fix for it somehow?

    TL;DR: Because I ramble.  Yes.  It seems like anything that takes more than about 1.5 minutes crashes Daz Studio.  I'll work on a possible fix, but part of the issue is with the Daz Studio plug-in which I didn't write.  Details (and rambling) are below.

     

    Hey there!  First off, I'm glad it's (mostly) working for you and thanks for using it.  I've always wondered if anyone else found it useful.  As for the error, I've been looking through the log to try and backtrack what it dumps out.  I've got a couple of questions, just to make sure I know what's going on, but you might be barking up the right tree.  I'll explain in a second.

    1. What's crashing?  Daz Studio or the Plug-in/Elgato driver?  I'm guessing Studio
    2. Did you set it up by right-clicking on Genesis 8.1 Female and using Create Custom Action... and then assigning that as a Custom action?  I'm guessing Yes.

    I was distracted at first by a couple of really log error messages, one starting on line 16.  The word "Fatal" is what caught my eye, but I think that was a red herring because it kept running.  Still it means I should probably dust off the code and get back to work on it.

    What I think is the problem is on the last two lines of the log you sent:

    2022-09-28 16:54:20.2500|INFO|CustomShortcut|156|Cannot communicate with Daz Studio or plug-in
    2022-09-28 16:54:20.2505|DEBUG|CustomShortcut|156|The request was aborted: The operation has timed out.

    I found that I had a similar problem when I tried to use a Render shortcut (I'm too lazy to use Ctrl-R or just click the Render button).  It would render fine, but as soon as it was done, Daz Studio crashed.  When it does this, I get the same lines at the end.  I knew about this, but work had just picked up and I adapted, and to be honest: forgot.  I'm sorry about that.  I should have at least posted some feedback on the GitHub site.

    Here's what I think is happening, and you were on the right track:  When you press the button, the StreamDeck is sending a message to Daz Studio, or actually the totally awesome plugin that Stephen wrote telling it what Action to perform.  That plugin takes the Action and executes it inside Daz Studio.  When that Action is done it sends back a reply to the plug-in.

    Here's the problem: if the Action takes too long to complete (like a render or the torturously long morph loading process) the communication line between the StreamDeck and Daz closes out. On my set-up this happens after about 100 seconds.  When the Daz Studio plug-in tries to reply, it runs into a bunch of errors and crashes out.  Here's the last few lines of each of my logs:

    ----Streamdeck----

    2022-09-28 19:11:53.8383|INFO|CustomShortcut|57|Key Pressed
    2022-09-28 19:13:33.8556|INFO|CustomShortcut|57|Cannot communicate with Daz Studio or plug-in
    2022-09-28 19:13:33.8556|DEBUG|CustomShortcut|57|The operation has timed out

    ----Daz Studio----
    2022-09-28 19:14:32.754 [WARNING] :: QHttpResponse::setHeader() Cannot set headers after response has finished. 
    2022-09-28 19:14:32.755 [WARNING] :: QHttpResponse::setHeader() Cannot set headers after response has finished. 
    2022-09-28 19:14:32.755 [WARNING] :: QHttpResponse::writeHead() Cannot write headers after response has finished. 
    2022-09-28 19:14:32.755 [WARNING] :: QHttpResponse::end() Cannot write end after response has finished. 

    So at 13:33 the StreamDeck stops listening.  At 14:32 Daz tries to reply and can't.  The plug-in crashes and takes Daz Studio with it.

    So, Solutions:

    1. Don't use the StreamDeck plugin for anything that takes longer than about 1.5 minutes.
    2. That's about it.

    Stephen did the Daz side, in no small part because I suck at C++ and couldn't code my way out of a wet paper Hello World! application.  I don't know if there's anything I can do on his side.  I'm going to try and see if I can tighten up some of the code on my end.  Maybe I can extended the disconnect timer if I can find where that's hidden away.  That way even if it takes 2 or 3 minutes, the StreamDeck would still be on the line for the reply.

    Besides, I need to clean up some things and work out a better organization system.  Just a heads up:  If I do get a fix worked out, you'll probably have to reset the keys.  I don't know if I can work out an 'upgrade' from one version to the next.

    Please let me know if any of that made sense or was helpful.

    Thanks again for using it!

    Post edited by Windamyre on
  • Hi Windamyre,

    1. What's crashing?  Daz Studio or the Plug-in/Elgato driver?  I'm guessing Studio
    2. Did you set it up by right-clicking on Genesis 8.1 Female and using Create Custom Action... and then assigning that as a Custom action?  I'm guessing Yes

    Yes to both of those. A G8.1 Figure takes about 2min 45 seconds to load. I know its due to all the morphs I have installed, and the fact that if I remove the data directory it works fine, is what had me thinking it was simply the load time of it all. I am in the process of converting my models that I use on a frequent basis to a single slider, to reduce that load if I remove the main data folder, so hopefully I'll then be able to plug those into the Stream Deck and get it to work that one.

    Its certainly not a killer that I can't do the base models that way, if you can work out how to get it fixed that would be wonderful, but in all honesty I'm just overjoyed to be able to use the StreamDeck for some things to make it easier to work and deal with, so thats more than plenty in my view at the moment.

    And yes, everything made sense, and did lean on what was already in my mind anyway. Thank you for taking the time to put down an explanation of it all.

    I just want to say thank you to yourself and to esemwy for even getting something like this up and running at all. Its made things so much more accessable in my work flow, so thank the pair of you again.

     

  • WindamyreWindamyre Posts: 162

    Professor Santiago said:

    Hi Windamyre,

    Yes to both of those. A G8.1 Figure takes about 2min 45 seconds to load. I know its due to all the morphs I have installed, and the fact that if I remove the data directory it works fine, is what had me thinking it was simply the load time of it all. I am in the process of converting my models that I use on a frequent basis to a single slider, to reduce that load if I remove the main data folder, so hopefully I'll then be able to plug those into the Stream Deck and get it to work that one.

    And yes, everything made sense, and did lean on what was already in my mind anyway. Thank you for taking the time to put down an explanation of it all.

    I just want to say thank you to yourself and to esemwy for even getting something like this up and running at all. Its made things so much more accessable in my work flow, so thank the pair of you again.

    You're welcome!  I'm glad someone's getting some work out of it besides me.

    For your morph issue, I might recommend Turbo Loader.  It helps simplify the whole process and can really reduce your load times.  Best part is that if you've got a scene or subscene saved that uses a bunch of morphs you've turned off, it can turn them back on as it loads the scene.  IMHO, this product along with Super Save and Camera Magic (plus plugins) should be built into Daz 5.

  • Thank you for that. I had been looking at Turbo Loader but never really gotten around to looking properly into it and whether it would make a lot of difference. I might have to stump up and give it a go and see if it does make that difference for me which might bring it all back up and working. Camera Magic is on my wish list, but never heard of Super Save.. so some more investigations for me it seems smiley

  • WindamyreWindamyre Posts: 162

    Yup. Here's my take on 'em in a nutshell:

    Camera Magic:  One save per set of actors/props, regardless of how many poses.  I just wish I could run one script to save pose, shape, and visibility all at once without the dialog box.

    Turbo Loader: Decent user interface for bulk-disabling morphs by tweaking the file extension.  UI allows you to search for morphs by name, etc and disable individual morphs or whole packages.  Disabled morphs are not deleted, but the file extension keeps Daz from looking at them.  Scripts available to enable needed morphs on load.

    Super Save: Scripts for saving incremental files ("scene_001","sceen_002", etc.)  as well as saving larger tips (the images that show up when you mouse over) and even notes.  Not as useful with Camera Magic, but worth it if you get it on sale.

  • twitchewtwitchew Posts: 118
    edited November 19

    this is great and i can see all my custom actions, but none of the DazStudio Actions seems to show up in the Action to trigger pulldown.

    any advice?

     

    Post edited by twitchew on
  • WindamyreWindamyre Posts: 162
    edited November 19

    Glad it's (mostly) working for you.  Just to check a few things:

    • There are two different tools under Daz Studio Tools.  The first has the letters "DS" and should include all actions (custom and default).  The second has the green circle and person and only pulls in Custom Actions.  You'll want the first one.

    • The default actions are listed after the custom actions in the first tool.  You'll have to scroll down past your custom actions.  Also, there is no organization yet so sometimes it's a little try and error to figure out which "Select Children" command you want.

    • Lastly, and this was not part of you post but it's good to know, any action that takes more than a minute or two to finish - like a Render - will cause Daz to Crash. See the post above (September 28th) for details if interested.

    Let me know if any of that helped.  If it doesn't I'll try and help figure out why and post an update.

    Post edited by Windamyre on
  • twitchewtwitchew Posts: 118
    edited November 19

    thanks, 
    So the issue is that I am NOT seeing anything show up in the DAZ actions

    actions

    My  custom actions are showing up in the pulldown.

    custom actions pulldown

     

    Post edited by twitchew on
  • WindamyreWindamyre Posts: 162

    Hmmm... Well, so much for being an easy fix.

    Oddly enough as soon as I tried to figure out what was going on, my Stream Deck started acting up with some buttons working fine and others getting a blank pulldown.  There are some errors in the logs that might help figure it out.

    Give me a little time, and I'll see what's going on.  Not sure what changed.

  • WindamyreWindamyre Posts: 162

    Okay, so I think I pinned down the cause and fixed it.  If you want technical details, you can check out the code on GitHub or send me a DM and I'll expain where I was stupid.

    There is a new version (0.3.2) available on GitHub.  Here's a link to the site, and here is a link to the file.

    To update it, you'll have to quit the StreamDeck and copy the new files over the old ones.  This should not change any of your assigned keys, at least it didn't for me.  Still, I did make a screenshot of my layout first. 

    Now that I've got the project opened up, I'd really like to see about adding a filtered option on the Action Listing.  There are too many options and having them in one big stack can be a hassle.  If you have any suggestions on how to organize actions, please let me know.  I thought about doing it by Main Menu listings, or maybe Tab Menu Listings, but some show up in more than one place.  Let me know if you have any ideas.

Sign In or Register to comment.