Quantcast
Channel: Daz SDK Developer Discussion - Daz 3D Forums
Viewing all 229 articles
Browse latest View live

Got a Sample Plugin Built, But Can't Call from Daz Script [SOLVED]

$
0
0

Hello all,

thanks to answers in prior posts and reading others here on the site I have made baby steps towards making a plugin. Please note, I haven't coded anything but javascript in a long long time and while I have coded java a decade ago, it's been even longer since I last touched c++. I haven't used any IDE other than Eclipse in that time. So please forgive me up front if I get terminology wrong in regards to Windows and Visual Studio.

My steps so far over the past several days:

  • Downloaded the Daz SDK and looked through both the SDK and Qt docs to get a good idea of what's there. Confirmed I should be able to do what I need to for my project.
  • Downloaded Visual Studio 2010 Express and many extra updates and installers per some posts here.
  • Spent a day or two not getting any of it to work or get the plugins built, mostly due to not being to set the Configuration Manager to have an x64 option.
  • Uninstalled Visual Studio 2010 Express, the SP1, and any Microsoft SDK I had installed as part of that effort.
  • Installed Visual Studio 2019 Community and picked every c++ option available during the install
  • Loaded the SDK samples.sln where it prompted me to change two items related to Visual Studio 2010; I selected the Windows 10 SDK and another option (sorry I forget what it was, but the value had something like v142 in it)
  • Opened the Configuration Manager and saw there were x64 options so changed the values for Release to x64 in all the sample projects
  • Right clicked AFirstPlugin project, hit build and saw that it looked to have worked.
  • Located the sdk_afirstplugin.dll in the <daz install dir>\exec\Release\x64\plugins
  • Copied the dll into <daz install dir>\DAZ 3D\DAZStudio4\plugins directory and started Daz Studio
  • Dropped down the Edit menu and confirmed the 'Hello' option. Selected it and got the "Helo, World" dialog and additional dialogs when hitting Accept and Reject buttons

For my project I wanted to confirm that I could call code in a plugin from my Daz Script project. I see that the class DzAFirstPluginAction is public, so from the Script IDE I entered:

var afpa = new DzAFirstPluginAction();

afpa.executeAction();

and hit the Execute button. I was very happy to see the dialog open and work just as it had from the Edit menu. This confirms to me I can do what I was hoping in regards to making a plugin to handle low level QImage pixel by pixel manipulations and be able to call that from my Daz Scripting project.

I started by trying to copy the solution and project names into a new solution, then manually renaming the .cpp files, .h files, etc. I honestly can't recall what all I did other than royally screw everything up. I thought I had a whole different solution, but after renaming everything I could find in all the files there were still references to AFirstPlugin and nothinig would build. I decided to delete everything as it looked like not only had I messed up my new solution but also the original Samples.sln. So I deleted everything and re-installed the full SDK, samples, and Docs from scratch.

Right now as I put this post out I'm back to the the point where I verified the AFirstPluginAction dll builds and runs correctly in Daz.

In order to not repeat my Visual Studio Solution/project debacle I hope someone here can help guide or point me to the best and/or easiest way to make a new Solution and/or Project so that all the references, configurations, etc. are all there without stomping all over the initial sample code? Do I make a new project in the samples.sln itself? Or do I somehow copy or Save As the solution into something new and remove all the sample projects but one - and then somehow rename or refactor that?

Also, this may or may not be a seperate question, but I didn't see any obvious way to rename/refactor across the project. I saw a reference in googling to ctrl-r, ctrl-r but that does nothing in Visual Studio for me.

As always, any help and guidance is greatly appreciated!

 

 


G2, G3, G8, Determining the figure type

$
0
0

Hello, I am finalizing an animation exporter plugin, but it won't work very well with Genesis 8 because it requires a T-pose and G8 presents an A-pose. So, I'd like to check the figure type to at least warn the user about it.

I can check the bones names but my understanding is that Genesis 3 shares the same bones names with G8 and I have no issues exporting animations with G3. An alternative would be to check the skeleton name, but that would require maintaining a list of "viable" skeletons and would that be reliable? The most conservative solution would be to check the bones names (and then exclude or warn about G3) but I prefer ask first if there is a better solution smiley

TIA

PostgreSQL question

$
0
0

Hi all, this is probably the closest place for me to ask this question-

I understand that PostgreSQL is the DB being used in DAZ. I write SQL/DML queries in products like Oracle and MySQL relational databases but have never touched PostgreSQL in any of my job sites at my day gig. Is there a way for me to get to the actual tables in DAZ's postgresql database so that I can edit data across thousands of products that exist in my catalog without using the metadata editor?  I imagine if I can find the relational database manager for postgresql and connect it to DAZ's DB tables it will be possible to do with UPDATE queries and the like. As far as I know, we as users can only Update/Create/Delete one product set of records at a time in DAZ Studios metadata editor in the Content Library. For editing data across multiple products, this is very tedious and cumbersome...

If there IS a way to do this via some sort of external RDBMS for PostgreSQL that would be AWESOMEEEE

Thanks for any suggestions!

Getting started.

$
0
0

I've got the SDK and I'm wondering two things:  (1) I have VS 2019, not 2010.  I've switched out the platform toolset and the .dll builds OK but I'm wondering if there's anything I need be wary of related to this (presumably it won't work unless I build against the 2010 platform toolset?).  Secondly, with respect to getting started debugging, what do people generally do?  Is there a way to get Daz to load a plugin from a directory other than Plugins, or should I make a copy of Daz somewhere I can set the solution output to without having to elevate to admin?  Otherwise, how do I go about debugging my code in this respect?

Any advice you can give would be great, thanks.

Connecting to PostgreSQL

$
0
0

So my earlier discussion got moved back to the script developer forum so I will pose my question to the SDK users in this way-

How are you using the SDK to call API functions for the PostgreSQL object? Is ODBC being used as well?

There is an RDBMS installed with studio's installation of PostgreSQL so I'm guessing that Studio/SDK has an interface to reach inside the database directly or a way to interface with the RDBMS externally....

Access to raw rendered image data?

$
0
0

Hello all,

I might be biting off more c++ than I can chew trying to wrap my brain around this topic... but -

In the documentation for the SDK I found a DzRenderData() class and DzRenderDataEvent() which reference a 'passData' function. Looking a bit further I believe they are used in the DzRenderHandler() class but don't seem to be documented fully and I can't find any reference or examples to look at.

I assume this is the mechanism where the renderer is passing back a bucket's worth of render data and then once all the buckets are received writes the image out to the file?

If i'm on the right track can these classes and functions be used to manually assemble an image, or have direct access to the fully rendered image, but BEFORE it writes out to a file? And then also, could something be called, like DzRenderer.killRender() to prevent the writing of the file to disk?

thanks for any pointers/tips/help

 

 

Multi-threading renderers?

$
0
0

Hello all,

3rd in my series of questions around the details of the SDK regarding rendering. This topic goes in hand with my other two, namely if you can prevent the rendering progress popup, and can you get a rendered image from a handler before writing to disk.

This topic might be more about my lack of c++ coding skills and knowledge and less about the SDK. But is it possible to call multiple renderers, each on it's own thread? At the moment in my proof of concept project I am doing a loop calling DzRenderer->render(...) for each increment of the loop. I'm hoping there's a way to multi-thread this so I could run say, 4 renders at the same time.

Any thoughts, tips, help, etc is greatly appreciated.

Render without the Progress Popup?

$
0
0

Hello all,

does anyone know if there is a way to call the DzRenderer->render(...) and NOT have the 'Rendering Image' progress popup at all? I'm looping over a series of renders saving off the images to combine at the end and the constant popups make it hard to cancel as well as I assume slow down the overall process.

thanks in advance on any hints on how this might be done.


How can I move an object in its local object space?

$
0
0

Hi.

How can I move an Object that has no parent forward in facing direction?
When I try to use setLocalPos(x, y, z+1) it moves in global space, but not in the direction it is facing to. When my object is a child of a node, then it works just fine.

Inhibit DzPane resizing

$
0
0

I can trap the event but it's only triggered "after" the actual resizing of the window. I have complete control over any other window I create (QWidget, Dialog..etc), I can set all the "->set" size parameters there is but still resizing is allowed. It's probably something obvious, but today, it eludes me. Any ideas?

 

Exposing a custom SDK class to the scripting environment

$
0
0

Is it possible to expose a class to the scripting environment?

Strand Based Hair Vertex Info?

$
0
0

Hi all,

I just exporter a character with the new Elven Lord as OBJ, and the hair is exported as polylines, which is to be expected.

I am trying to access this polyline information, but the new SDK has no additional geometry classes for polylines; all the geometry is still represented by DzFacetMesh. But I notice that nodes that are hair strands have many vertices and 0 faces.

But the question remains: Given an array of vertices, how does one interpret it as one or more polylines? There's a suspicious new function

unsigned char *DzVertexMesh::getVertexFlagsPtr();

That I suspect holds the key, but there's no meaningful documentation as to what the bits mean.

Can anyone shed some light on how to output the vertices that make up the hair strands?

Thanks!

 

Particle FX and SDK...

$
0
0

I have been getting this error every since I updated to win 10 and now the documents folder is in Users instead of documents...Do I have to recompile the plugin to point to Users...Before in win7/8 the my documents were on c:/...now its users/name/ectera..and the old documents was where I compiled the last time to change the experiration Date..Before I re-compile I am installing DS and the sdk on a new computer that has only had win10 and never DS or DS-SDK and going to install the old plugin...Is there any reason why I cant just have the plug-in in one folder in the plug-in folder...?

 

Plugin and using one folder in plugin folder for all content...?

$
0
0

The structure of folders with-in daz and outside..3rd party screw-ups put stuff all over the place...Can I consolidate a plugin and all of its geometries/textures in one folder with-in the Daz plugin folder...?

 

as it is right now the only things that are not in the same folder are textures and pre-sets those are in mylibrary...

 

Arguments to pass to DzAssetMgr::searchDB

$
0
0

I have been trying to figure out the form of the arguments to pass to DzAssetMgr::searchDB, but I have yet to find any combination that gives me any assets in the search container that is returned.  Time to ask for help!

I am interested in this signature of the method:

DzAssetMgr::searchDB (const QString & str,

                      const QStringList & categories,

                      const QStringList & compatibilityBases,

                      const QStringList & contentTypes,

                      DzSearchDBThread * thread = NULL,

                      QObject * finishObj = NULL,

                      QObject * progress = NULL)

I realize that I am asking a lot of questions, but I have tried to write them so they break down into a few simple questions about each argument that hopefully just need something close to a "yes" or "no" answer.

1. Is the string argument for the first parameter the same form as the text typed into the search field on the Content Library or Smart Content pane?  If not, what is it?  

2. If I don't want to filter the results, should I pass an empty string or a wildcard as the first argument?

3. I assume that each category in the QStringList passed as the second argument is the full path of the category (eg "/Default/Hair/Long").  Is this correct? Is it case sensitive, is '/' the correct delimiter, do I need a leading '/', etc?

4. If I pass more than one category, will the method return all assets in either category or all assets in both (union or intersection)?  Can I force it to be the intersection if union is the default?

5. What should I pass if I want the search to return assets in any category?  Empty list, null, a wildcard, a list every known category, something else?

6. For compatibilityBases, I assume I should pass a list of strings of the form that appear in the Content DB Editor, eg "/Genesis 8/Female".  Is this correct?  Again, is it case sensitive, is '/' the correct delimiter, do I need a leading '/', etc?

7. What should I pass if I want the search to return assets with any compatibility base?  Empty list, null, a wildcard, a list every known compatibility base, something else?

8. For contentTypes, I assume I pass a list of strings like "/Follower/Hair".  Again,Is this correct, is it case sensitive, is '/' the correct delimiter, do I need a leading '/', etc?

9. What should I pass if I want the search to return assets of any content type?  Empty list, null, a wildcard, a list every known compatibility base, something else?  (I'm not sure that I would need to do this, but it would be good to know)

10.  Does the method return the union of the intersection of the assets that "match" each string in the list of strings pssed as each argument?  For example, do I get the union or intersection of assets in each of the categories in the list passed to the categories parameter?  Similarly, do I get the union or intersection of assets in the lists of categories, compatibility bases and content types?

Thanks in advance


Calling the Filament Renderer in plugin code?

$
0
0

Hello everyone,

I'm hoping someone has started playing with the Filament renderer from a plugin, or just know the ins and outs of the rendering classes and might spot the obvious for me...

I have a plugin which starts a render with this code:

    DzRenderer* myRenderer = myRenderMgr->getActiveRenderer();
    DzProgress renderProgressPopup("Rendering with " + myRenderer->getName() + " Renderer...");
    bool success = myRenderer->render(myHandler, myCamera, dzApp->getRenderMgr()->getRenderOptions());

 

The attached picture shows my Rendering Tab, where the Engine selected is '3Delight'. When my plugin runs it correctly says myRenderer's name is 3Delight and the image my plugin outputs in a 3Delight image.

But when I select the Engine as 'Viewport' in order to get it to render with Filament, it gives the name back as 'NVidia Iray' and renders in Iray.

Is the Engine choice in this drop down not what you are selecting with 'getActiveRenderer()'? Or, if yes, is there something else I need to set in order to get Filament to be selected? Also, all my Main Window viewports have 'Filament (PBR)' selected as the user draw style.

thanks in advance for any insight/guidance/help!

#include "dz3dviewport.h"; causes compile errors

$
0
0

Hello,

after getting info from Richard Haseltineine in the scripting forum regarding Filament rendering I am trying to use the Dz3DViewport objects in my plugin. However, just adding the header include statements:

#include "dz3dviewport.h";

 

to my .h and .cpp files, and then building, causes 6 syntax errors to show up in my .cpp file. When I remove them I can once again compile my plugin. 

Is there any known issues with these objects? 

thanks in advance

Reading Compressed duf Files

$
0
0

I'm working on a plugin that needs to read the DSON within my asset files. I've found that some files are compressed & appear as binary, so I can't parse them the way I do with the normal text files.

I found this post about the same topic in the Scripting forum that suggests using DzGzFile: https://www.daz3d.com/forums/discussion/412911/why-some-duf-file-is-ascii-and-other-is-binary

Is there anything similar in the Daz SDK or in QT that could be used the same way? Or has anyone else found a good way to decompress these files into text for parsing?

I've tried using QByteArray's qUncompress function, but that didn't seem to work.

Anyone had a QtSlider to display correctly?

$
0
0

No matter how I lay it out (in a vertical or horizontal layout, with or without ticks) all I see in the display is two small vertical bars, one black, one grey.

I don't see anything remotely resembling a slider. I can move the 'slider' and see the value change, but a user will never figure it out. There is no slider track and no clider button.

Does anyone have an example of how to create a proper horizontal slider?

Thanks,
David

SDK Qt libraries incompatible with Daz Studio QT libraries?

$
0
0

We are currently porting one of our plugins to the newest SDK version with cmake build. We noticed some problems with the ported plugin that did not exist with the old one. The plug-in was not recognized as a valid plug-in by Daz Studio on some computers. It ran on other computers, but caused protection violations in previously problem-free program areas.

While searching for the reasons, we found that our Daz SDK is using a QT version 0x40807. Daz Studio 4.15 uses version 0x40801.

If we copy the QT dlls of the SDK to Daz Studio 4.15, Daz Studio no longer starts.

We assume, that some of our problems are caused beecause we  link agains the newer QT libs but use the older Daz Studio dlls.

Any suggestions?

Viewing all 229 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>