SDK build environment

I just realized dazstudio SDK is outdated.
i finally found and installed visualstudio 2010.(Service Pack 1)
installed Qt 4.8.7 (32 Bit) I can't find 64 bit!
but still I should find old version of the Cmake that supports VS 2010
I installed all, but windows 7 sdk! I can't!
everything supre outdated (14 years!)
did I missed something? any solution?
someone can tell me structure to build a correct pipeline?
My target Daz version is 4.23 (64 bit) , Can we make 64 bit plugins at all?

Post edited by MehdiZangenehBar on
«1

Comments

  • Yea, but links are broken, and I still don't get my questions...

  • MehdiZangenehBar said:

    I just realized dazstudio SDK is outdated.
    i finally found and installed visualstudio 2010.(Service Pack 1)
    installed Qt 4.8.7 (32 Bit) I can't find 64 bit!
    but still I should find old version of the Cmake that supports VS 2010
    I installed all, but windows 7 sdk! I can't!
    everything supre outdated (14 years!)
    did I missed something? any solution?
    someone can tell me structure to build a correct pipeline?
    My target Daz version is 4.23 (64 bit) , Can we make 64 bit plugins at all?

    Of course you can. If your bin and lib directories don't have x64 subdirectories, then there's something wrong with your SDK install.

    The SDK is outdated, but the header files are such that you can compile and link against the latest DS libs.

    There is no 32/64 bit version of Qt; it will be whatever you compile it for, which makes me think you might simply not have selected x64 as the architecture.

    And I would just skip cmake altogether and just build up your project from the ground up as a Windows DLL project. It's kind of a pain adding the build tool rules for uic and moc, but if you know how to build a Qt app in general, you'll know what to do.

    This is becoming strange... I am not an experienced Win32 developer and don't know what I'm doing, but did get VS2022 working, while others have expressed having difficulty. I think I probably made mistakes that somehow offset each other.

    In any case, the SDK being old is not an issue as it would appear to be, and you can do what you are trying to do.

     

  • OK, my new update:
    SDK have 64 bit for sure.
    Daz Studio is 64 Bit.
    Visual Studio 2010 express installed SP1 (Toolset 100)
    ​Windows 7 SDK already exist in VS 2010 folders.
    Cmake 3.24 installed, instead of the latest version : cmake_minimum_required(VERSION 3.4...3.24) and it works perfectly.
    The ONLY problem is Qt 4.8.7 64 bit is not exist, we have to build it from the source... (I wish someone have the builded and send me the link)
    I just tried 32 bit for test and plugin is created , but not loaded in DazStudio, (Help > About installed plugins, shows Plugin failed to load!)

  • surrealsurreal Posts: 175
    edited February 19

    MehdiZangenehBar said:

    installed Qt 4.8.7 (32 Bit) I can't find 64 bit!

    Are you saying that you only have the DAZStudio4.5+ SDK/bin/Win32 folder and do not have the DAZStudio4.5+ SDK/bin/x64 folder?

    Did you follow all the steps in the "Compiling DAZ Studio Plugins on Windows" section of the SDK documentation?

    It describes how to setup for building 64 bit.

    If you have built a 32bit plugin then I can understand you getting a "Plugin Failed to load" error. I think the 32bit is a carry over from when there was a 32bit version of DAZStudio.

    You will need to build x64 plugins for the current DazStudio.

    If you still get an error after building a 64bit plugin, have a look in your Daz Studio log file(Help > Troubleshooting > View Log File).

    It is always a good starting point for debugging errors. The alternative is to use VS debugging and connect to DazStudio after it starts and before it tries to load your plugin.

    I can understand TheMysteryIsThePoint appreciation of VS2022 and dislike of cmake. Myself I much prefer using cmake(when adding a new project) and VS2017. I find that VS2022 will occationally break a project and the simplest solution is to open and build the project in VS2107, most probably because I know VS2017 better than VS2022.

    Post edited by surreal on
  • To compile for 64 bit DS you need to select that option in Cmake.

    DS 32 still exists.

     

  • MehdiZangenehBar said:

    OK, my new update:
    SDK have 64 bit for sure.
    Daz Studio is 64 Bit.
    Visual Studio 2010 express installed SP1 (Toolset 100)
    ​Windows 7 SDK already exist in VS 2010 folders.
    Cmake 3.24 installed, instead of the latest version : cmake_minimum_required(VERSION 3.4...3.24) and it works perfectly.
    The ONLY problem is Qt 4.8.7 64 bit is not exist, we have to build it from the source... (I wish someone have the builded and send me the link)
    I just tried 32 bit for test and plugin is created , but not loaded in DazStudio, (Help > About installed plugins, shows Plugin failed to load!)

    You don't need to compile it. You've got the DLLs and LIBs already. You just need the headers.

    Again, there is no separate 32 or 64 bit release of Qt 4.8.7; it will be for the architecture for which it was compiled.

    You want this one.

    If you are getting 32 bit build artifacts, it is because that's what you asked for. Set it to x64/Release.

     

  • Aha, thanks guys, Yes my target is 64bit. (I don't want 32 bit at all)
    Thanks for the Qt, it seems I though wrong, I should reference that from SDK, no need to install separate Qt.
    I am struggling with the windows 7 SDK (both online and iso installer), I got error that SDK needs dotnet framework in order to install correctly, I just installed and re installed .Net several times, but still got error.
    I guess if I find VisualStudio 2010 professional, I don't have to install windows 7 SDK right?

  • OmnifluxOmniflux Posts: 389

    MehdiZangenehBar said:

    I am struggling with the windows 7 SDK (both online and iso installer), I got error that SDK needs dotnet framework in order to install correctly, I just installed and re installed .Net several times, but still got error.

    I recall having some difficulty the last time I installed this SDK.

    I have these two links bookmarked, one of which I think helped me resolve the issue.

    Also, there are some instances in which you should NOT install "Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1" after installing the SDK, but I cannot remember what they are...

  • Thank you for your helps, I tried several times, but decided to installed Visual Studio 2010 Ultimate, so no need to install windows SDK anymore.

  • I am still confused about the qt, as we don't have 64 bit version of the qt, i used a command to autocreate moc file.
    now project will be builded, plugin is loaded in daz, but i can't find the action: where is my problem?
    how i can find the action?
    can I check it using dazscript?
    https://drive.google.com/file/d/1TB1lTF0RTI6MLwNaVxpO_qTe2erNNeKK/view?usp=drive_link
     

  • You need to crate the 64 bit plug-in, using the commands as explained above. Qt 64 already exists and doesn't need creating separately.

  • MehdiZangenehBar said:

    I am still confused about the qt, as we don't have 64 bit version of the qt, i used a command to autocreate moc file.
    now project will be builded, plugin is loaded in daz, but i can't find the action: where is my problem?
    how i can find the action?
    can I check it using dazscript?
    https://drive.google.com/file/d/1TB1lTF0RTI6MLwNaVxpO_qTe2erNNeKK/view?usp=drive_link

    This seems like it may be the same phenomenon that I encountered with Sagan. Read the first post in the Sagan topic

  • MehdiZangenehBarMehdiZangenehBar Posts: 64
    edited February 22

    Richard Haseltine said:

    You need to crate the 64 bit plug-in, using the commands as explained above. Qt 64 already exists and doesn't need creating separately.

    I did! did you check the file?
    I successfully builded 64 bit version without errors, my question was, did i implemented cmake correctly?
    and plugin is loaded successfully, I can see it in plugin window as green
    but where is my registered action? why I am not able to find it inside menu or workspace customize window

    Post edited by MehdiZangenehBar on
  • TheMysteryIsThePoint said:
    This seems like it may be the same phenomenon that I encountered with Sagan. Read the first post in the Sagan topic

    would you please give me a favor and explain briefly here? instead of link to the thousonds pages that I should read? 

  • surrealsurreal Posts: 175

    Did you define a group(getActionGroup()) for your action? If not then the default is the"Miscellaneous" group. Look in DzStudio > Window > Workspace > Customize > Miscellaneous.

    Did you define a default menu(getDefaultMenuPath() for your action? If you did not then the default is for it to not be automatically added to any menu. You will need to go into  DzStudio > Window > Workspace > Customize and manually add it to one or more menus.

    The SDK documentation has a good example and explanation in the DzAction Class Reference regarding creating actions and what groups and menus they will appear in by default.

     

                Step 1.Create a unique GUID for your action. VS > Tools > Greate GUID
                            Your GUID should be unique, well as unique as windows will make it. This will identify your action from any other action.
               
                Step 2. In pluginMain.cpp add a line for your action and its GUID example "DZ_PLUGIN_CLASS_GUID(MyAction, 12345678-90AB-CDEF-GHJK-LMNOPQUVXY12".
                            The GUID should not have any spaces in it.
                             If you want to be able to call your action from scripts then add the line to export the action.see example in DzAction documentation.
                
                Step 3. In a header and source file define your action based on DzAction. example

    MYACTIONS.H

                /**********************************************************************                This file is an adaption of the DAZ Studio SDK examples.                This file may be used only in accordance with the DAZ Studio SDK                license provided with the DAZ Studio SDK.                The contents of this file may not be disclosed to third parties,                copied or duplicated in any form, in whole or in part, without the                prior written permission of DAZ 3D, Inc, except as explicitly                allowed in the DAZ Studio SDK license.                See http://www.daz3d.com to contact DAZ 3D or for more                information about the DAZ Studio SDK.            **********************************************************************/            #pragma once                        #include "dzaction.h"                        /// <summary>            /// Example MyAction class header            ///  minimum action class that will show by default in the edit menu            ///  Will display a warning messagebox when clicked.            /// </summary>            class MyAction : public DzAction {                Q_OBJECT            public:                MyAction() ;                            // If you want the action to appear in a different menu                 //  replace &Edit with the name of the menu                QString    getDefaultMenuPath() const override { return "&Edit"; }                                   // If you want the action to appear in your own group                 //  replace edit with the name of your group.                 // Groups are in Window > Workspace > Customize                  // After it has been created use Customize                 //  to manually put you action in any menu or group you want.                QString    getActionGroup() const override { return "Edit"; }               protected slots:                void    executeAction() override;                        };

    MYACTIONS.CPP

                #include <QtGui/qmessagebox.h>            #include "MYACTIONS.H"                        MyAction::MyAction() : DzAction("My simple action",                "This action does nothing")            {                QMessageBox::warning(0, "Nothing", "Boo"), QMessageBox::Ok);            }

     

  • and there is no "Miscellaneous"

  • I tried several things, but it seems I am not able to register an action

  • MehdiZangenehBar said:

    did you checked my file? I did all
    https://drive.google.com/file/d/1TB1lTF0RTI6MLwNaVxpO_qTe2erNNeKK/view?usp=drive_link

    You are asking people to take donate time to help you, it is reasonable to actually answer their questions rather than present them with a file and expect them to study it for all the details.

  • Richard Haseltine said:

     

    You need to crate the 64 bit plug-in, using the commands as explained above. Qt 64 already exists and doesn't need creating separately.

    g people to take donate time to help you, it is reasonable to actually answer their questions rather than present them with a file and expect them to study it for all the details.

    did you ask a question? anyone asked a question?
    I questioned about the my cmake in the link
    I don't get why you tell that?!
    ​please be professional

  • MehdiZangenehBar said:

    Richard Haseltine said:

     

    You need to crate the 64 bit plug-in, using the commands as explained above. Qt 64 already exists and doesn't need creating separately.

    g people to take donate time to help you, it is reasonable to actually answer their questions rather than present them with a file and expect them to study it for all the details.

    did you ask a question? anyone asked a question?
    I questioned about the my cmake in the link
    I don't get why you tell that?!
    ​please be professional

    You hae twice asked if people checked your file in response to suggestions.

  • I created a simple project based on data that gathered here,
    my goal is to step by step develop and correct it to make a starter project.
    best way is to share the project, and ask experienced people check it in each step.

  • so my main challange now is , plugin is builded / loaded, but action is not registered.

  • MehdiZangenehBar said:

    TheMysteryIsThePoint said:
    This seems like it may be the same phenomenon that I encountered with Sagan. Read the first post in the Sagan topic

    would you please give me a favor and explain briefly here? instead of link to the thousonds pages that I should read? 

    Read the first post in the Sagan topic

     

  • surreal said:

    Did you define a group(getActionGroup()) for your action? If not then the default is the"Miscellaneous" group. Look in DzStudio > Window > Workspace > Customize > Miscellaneous.

    Did you define a default menu(getDefaultMenuPath() for your action? If you did not then the default is for it to not be automatically added to any menu. You will need to go into  DzStudio > Window > Workspace > Customize and manually add it to one or more menus.

    The SDK documentation has a good example and explanation in the DzAction Class Reference regarding creating actions and what groups and menus they will appear in by default.

     

                Step 1.Create a unique GUID for your action. VS > Tools > Greate GUID
                            Your GUID should be unique, well as unique as windows will make it. This will identify your action from any other action.
               
                Step 2. In pluginMain.cpp add a line for your action and its GUID example "DZ_PLUGIN_CLASS_GUID(MyAction, 12345678-90AB-CDEF-GHJK-LMNOPQUVXY12".
                            The GUID should not have any spaces in it.
                             If you want to be able to call your action from scripts then add the line to export the action.see example in DzAction documentation.
                
                Step 3. In a header and source file define your action based on DzAction. example

    MYACTIONS.H

                /**********************************************************************                This file is an adaption of the DAZ Studio SDK examples.                This file may be used only in accordance with the DAZ Studio SDK                license provided with the DAZ Studio SDK.                The contents of this file may not be disclosed to third parties,                copied or duplicated in any form, in whole or in part, without the                prior written permission of DAZ 3D, Inc, except as explicitly                allowed in the DAZ Studio SDK license.                See http://www.daz3d.com to contact DAZ 3D or for more                information about the DAZ Studio SDK.            **********************************************************************/            #pragma once                        #include "dzaction.h"                        /// <summary>            /// Example MyAction class header            ///  minimum action class that will show by default in the edit menu            ///  Will display a warning messagebox when clicked.            /// </summary>            class MyAction : public DzAction {                Q_OBJECT            public:                MyAction() ;                            // If you want the action to appear in a different menu                 //  replace &Edit with the name of the menu                QString    getDefaultMenuPath() const override { return "&Edit"; }                                   // If you want the action to appear in your own group                 //  replace edit with the name of your group.                 // Groups are in Window > Workspace > Customize                  // After it has been created use Customize                 //  to manually put you action in any menu or group you want.                QString    getActionGroup() const override { return "Edit"; }               protected slots:                void    executeAction() override;                        };

    MYACTIONS.CPP

                #include <QtGui/qmessagebox.h>            #include "MYACTIONS.H"                        MyAction::MyAction() : DzAction("My simple action",                "This action does nothing")            {                QMessageBox::warning(0, "Nothing", "Boo"), QMessageBox::Ok);            }

    Thank you, @surreal

    You probably just solved the problem for me in Sagan.

     

  • MehdiZangenehBarMehdiZangenehBar Posts: 64
    edited February 24

    @TheMysteryIsThePoint 
    I undrstand, in order to register an action in menu we should override getActionGroup and getDefaultMenuPath. thanks @surreal
    But my problem was, the action was not accicable even with the daz script:

    var actionMgr = MainWindow.getActionMgr();
    var action = actionMgr.findAction("Kodak");
    
    if (action)
    {
        action.trigger();
    }
    else
    {
        print("Kodak action not found!");
    }
    

     

    So, where was the problem?! I finally figure it out. my problem was I was trying to use qt 32 headers, instead of 64 headers. I just build 64 bit version of the Qt and everything works just fine,

    action is perfectly registered now and it is accicable from menu and also dazscript.

    So conclusion from me:

    Visual Studio 2010 express needs Windows 7 SDK, Windows 7 SDK needs dotnet framework 4 to install. and tried several times to reinstall everything with different methods, but I failed. so only versions that works this days is Professional or Ultimate versions.

    Important part was Qt, Qt 4.8.x 64 bit is not exist, we should build 64 bit version of it. The trick to use Qt sources from DAZStudio4.5+ SDK\bin\x64 and mix it with headers from installed Qt 32 bit is a huge mistake that I did. it will fail to register the actions!

    I just use Visual Studio Code and cmake always, so Visual Studio version was not important I think, as we should build using 2010 Toolset v100.

    if someone interested to see the final test project, I can share it here.

    And thanks everyone who helped me here.

     

    Post edited by MehdiZangenehBar on
  • Richard HaseltineRichard Haseltine Posts: 102,768
    edited February 24

    MehdiZangenehBar said:

    @TheMysteryIsThePoint 
    I undrstand, in order to register an action in menu we should override getActionGroup and getDefaultMenuPath. thanks @surreal
    But my problem was, the action was not accicable even with the daz script:

    var actionMgr = MainWindow.getActionMgr();
    var action = actionMgr.findAction("Kodak");
    
    if (action)
    {
        action.trigger();
    }
    else
    {
        print("Kodak action not found!");
    }
    

     

    So, where was the problem?! I finally figure it out. my problem was I was trying to use qt 32 headers, instead of 64 headers. I just build 64 bit version of the Qt and everything works just fine,

    action is perfectly registered now and it is accicable from menu and also dazscript.

    So conclusion from me:

    Visual Studio 2010 express needs Windows 7 SDK, Windows 7 SDK needs dotnet framework 4 to install. and tried several times to reinstall everything with different methods, but I failed. so only versions that works this days is Professional or Ultimate versions.

    Important part was Qt, Qt 4.8.x 64 bit is not exist, we should build 64 bit version of it. The trick to use Qt sources from DAZStudio4.5+ SDK\bin\x64 and mix it with headers from installed Qt 32 bit is a huge mistake that I did. it will fail to register the actions!

    I just use Visual Studio Code and cmake always, so Visual Studio version was not important I think, as we should build using 2010 Toolset v100.

    if someone interested to see the final test project, I can share it here.

    And thanks everyone who helped me here.

    This is getting way out of my comfort zone, so I am just going to pass their through:

    You DO NOT need to build Qt. The Qt libraries/binaries are included already. Your issue is with configuration of CMake - i.e., not discretely choosing the correct bit architecture (in the configuration dialog) and/or paths to the provided Qt libraries (automatically populated based on said configuration). Do not try to use a 32-bit configuration for a 64-bit project, use a different build folder for each architecture, delete the CMake cache (for the build folder) if there is one (otherwise the configuration dialog will not present no matter how many times you click the button), and configure the project for building each bit architecture independently.

    Post edited by Richard Haseltine on
  • MehdiZangenehBarMehdiZangenehBar Posts: 64
    edited February 24

    Richard Haseltine said:

    This is getting way out of my comfort zone, so I am just going to pass their through:

    Thas't exactly why I questioned: did you checked my cmake file? because it is perfectly targeted 64 bit version of the SDK libraries/binaries, but about the headers, there is no Qt header or cpp files in SDK at all, so we should do? I downloaded qt-opensource-windows-x86-vs2010-4.8.7.exe from https://download.qt.io/archive/qt/4.8/4.8.7/ and updated cmake to address header files ONLY from there. so errors gone and I successfully build the plugin.BUT after thousond try to register a simple action, I failed and action was not registered.
    so I downloaded 
    qt-everywhere-opensource-src-4.8.7.zip and builded 64 bit version of it, and just updated the folder path, and this time action was successfully registered.

    EDIT:
    OK, I should admit that I was wrong, I don't know the cmake version or c_cpp_properties configuration made me confuse about this, however, it seems we don't need to install Qt, and every Qt stuff in SDK works without error. note that I installed cmake 2.24 which is highest version of the cmake that supports VS 2010.
    so, you right, we don't need to install qt.
    this is my cmakelist:
     

    cmake_minimum_required(VERSION 3.10)
    project(Kodak)
    
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    # Paths
    set(DAZ_SDK_PATH "D:/Software/DazStudio/DAZStudio4.5+ SDK")
    set(DAZ_PLUGIN_PATH "C:/Daz 3D/Applications/64-bit/DAZ 3D/DAZStudio4/plugins")
    
    # DAZ SDK Paths
    set(DAZ_SDK_INCLUDE "${DAZ_SDK_PATH}/include")
    set(DAZ_SDK_LIB "${DAZ_SDK_PATH}/lib/x64")
    set(DAZ_SDK_BIN "${DAZ_SDK_PATH}/bin/x64")
    
    # Include Directories
    include_directories(
        "${DAZ_SDK_INCLUDE}"
        "${DAZ_SDK_INCLUDE}"
        "${DAZ_SDK_INCLUDE}/QtCore"
        "${DAZ_SDK_INCLUDE}/QtGui"
        "${DAZ_SDK_INCLUDE}/QtScript"
    )
    
    # Library Directories
    link_directories(
        "${DAZ_SDK_LIB}"
        "${DAZ_SDK_BIN}"
    )
    
    # Headers for MOC processing
    set(KODAK_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/Kodak.h")
    
    add_custom_command(
        OUTPUT moc_Kodak.cpp
        COMMAND "${DAZ_SDK_BIN}/moc.exe" "${KODAK_HEADER}" -o moc_Kodak.cpp
        DEPENDS "${KODAK_HEADER}"
    )
    
    # Plugin Library
    add_library(Kodak SHARED
        Kodak_Plugin.cpp
        Kodak.cpp
        moc_Kodak.cpp
        Kodak.def
    )
    
    set_target_properties(Kodak PROPERTIES LINK_FLAGS "/DEF:Kodak.def")
    
    # Linking Libraries
    target_link_libraries(Kodak
        dzcore.lib
        QtCore4.lib
        QtGui4.lib
        QtScript4.lib
    )
    
    # Copy Plugin to DAZ Studio Plugins Folder
    add_custom_command(
        TARGET Kodak
        POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
        "$"
        "${DAZ_PLUGIN_PATH}/$"
    )
    
    
    Post edited by MehdiZangenehBar on
  • and my c_cpp_properties.json
    {
        "configurations": [
            {
                "name": "Win64",
                "includePath": [
                    "D:/Software/DazStudio/DAZStudio4.5+ SDK/include",
                    "D:/Software/DazStudio/DAZStudio4.5+ SDK/include/QtCore",
                    "D:/Software/DazStudio/DAZStudio4.5+ SDK/include/QtGui",
                    "D:/Software/DazStudio/DAZStudio4.5+ SDK/include/QtScript",
                    "D:/Software/DazStudio/DAZStudio4.5+ SDK/lib/x64",
                    "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include",
                    "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Include"
                ],
                "defines": [
                    "WIN64",
                    "_WINDOWS",
                    "UNICODE",
                    "_UNICODE",
                    "_CRT_SECURE_NO_WARNINGS",
                    "_AMD64_",
                    "NOMINMAX"
                ],
                "intelliSenseMode": "msvc-x64",
                "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe",
                "cStandard": "c99",
                "cppStandard": "c++17"
            }
        ],
        "version": 4
    }
    
    
Sign In or Register to comment.