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

List of available head morphs

$
0
0

Just  a quick question.

I don't want to delve too deep into scripting - just want to know enough to do what I want to do.

Random characters. I don't have too many base models and so, for a project I'm doing where I need "lots" of people, I want to get bang for my buck. As such, I've created a little script to randomize various sliders. Works fine and dandy by explicitly stating which morphs to change. I'm not 100% happy however in how the faces are coming out. So I've come up with a better idea which seems to work and look better when I've done it by hand .. 

And that's by blending a number of the head morphs of my current characters to form a brand new character. So I want to do this via script to randomly pick 4 heads and then apply a 15% to 50% modifier to each so they blend into one.

What I want therefore and can't see much in the way of documentation to help me out - is to collect a list of the head morphs under Genesis 8 Female (ie, Victoria 8 Head, Charlotte 8 Head, Stephanie 8 Head), for instance, that I currently have within Daz and stick them in an array and then do my stuff. I just can't work out HOW to automatically pull in the Head Morph list (filtering what I want is fine it's just the basic "put the head morphs you've got into an array" bit that I can't seem to find an answer for). 

It's probably easy - but programming wise, I've never messed around with the likes of java or other scripting languages and whatnot so not too up to speed on how it all works and fits together. Generally code in other stuff ... 

Cheers in advance for any help

 

 

 

 


[problem gone..] QScriptValue::call() failed

$
0
0

QScriptValue::call() failed: cannot call function with thisObject created in a different engine

I'm getting this error (everything works though), and only when not running in the debugger.

Any pointers to anything that could get rid of this?
 

 


 

Surface Selection Script

$
0
0

Before I ask my question I would like to state that I have no idea how to make script or where to even start.

Can a script be made to select all surfaces with a particular named texture map or via material ID colour. This could be for surfaces that cannot be selected via the normal methods easily, say a light bulb in a shade, multiples of. Yes there is a reason I would like to know how or if it is even possible.

 

If it is possible would anyone like to help me achieve this.

How To Access Element Data?

$
0
0

Hi,

I've just noticed that I can add user-defined data to an object or figure when it's loaded (via the menu command Edit > Object > Element Data ...)

Just as an experiment for a shoe my G2F figure is wearing, I created an empty script file and added 2 key - value pairs (see screen grab below).

I then re-saved the shoe.  So now the script executes when I re-load the shoe.  If I now select the shoe in the Scene Pane, how do I access (in a script) the

the 2 key - value pairs that I created for the shoe?

 

(Also, in the script that executes when the shoe is loaded, how can that script access the shoe's scene data such as it's node or skeleton?)

Question about DB_List_Products_Used and save in DS

$
0
0

I have an interesting observation that I cannot figure out if it is a bug somewhere, or that this is "how it should work".

I've been looking and playing with Robs Sample Script DB_List_Products_Used

// Source: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/metadata/list_products_used/start

And it took me a while to realize that if you add products to a scene, the script nicely generate useful information, like:

{
    "node": "Box2",
    "products": {
        "f70ac07a-1fd3-4ffc-aca9-ff5a1297b1a4": {
            "title": "New Colony",
            "files": [
                "/Environments/Architecture/New colony/Materials/Iray/NC Box2.duf"
            ]
        }
    }
}
{
    "node": "Michael 8",
    "products": {
        "784cd38f-9da6-40e2-bd5f-2b0bef8a2208": {
            "title": "Michael 8",
            "files": [
                "/People/Genesis 8 Male/Characters/Michael 8.duf"
            ]
        },
        "5a680fc4-3284-4ba0-918e-d2f541e5827b": {
            "title": "Michael 8 Pre-Release PA Build",
            "files": [
                "/People/Genesis 8 Male/Characters/Michael 8.duf"
            ]
        }
    }
}

But as soon as I hit save in DS, it comes out like this, or runs on an opened saved file:

{
	"node": "Box2",
	"products": {}
}
{
	"node": "Michael 8",
	"products": {}
}

Is there something I can do ( I really want to expand this script, I have some very good ideas where to take it) to get that information "back", or is it lost as soon as the scene is saved?
 

A script to create a polylines dForce Add-On Modifier for a bouncing ball

$
0
0

In RGincy's excellent dForce thread, I posted an example of a dForce bouncing ball whose polylines Add-On was created in Cinema4D and imported into DAZ Studio via an .obj file.

The attached Add_Structure.dsa script creates and adds the same polylines Add-On, using only DAZ Script - I've posted it here so others can see and use the techniques.  NB: Requires DAZ Studio v4.11.0.236 or later

For this it uses code from the following DAZ Samples (thank you Rob!):

To use this script:

  1. In DAZ Studio v4.11.0.236 or later, open the attached Bouncing_Ball_01b.duf (or create your own equivalent per the instructions in my post in RGincy's thread).
  2. In the Scene Pane, ensure that the "Ball" Node is Selected.
  3. Load the attached Add_Structure.dsa into the Script IDE Pane, and Execute it.

The results should be:

  • An AddOn_Structure.obj file is created (or overwritten!) in the same directory as the .dsa script, and is Imported into DAZ Studio.
  • The new Node "AddOn_Structure" made of polylines is added to the Scene and parented to the "Ball" Node.
  • The new Node has a "dForce Add-On Modifier" added to it.

If you now run the dForce Simulation, you should get the effect shown in the .gif above.

(If you execute the script while holding down the Alt key, then instead of creating and importing an.obj file, the script uses DzFacetMesh::addPolyline() to create the Add-On - but I cannot get this to work correctly, so I have started a separate thread to ask for help with that).

P.

 

Having trouble with DzFacetMesh.addPolyline()

$
0
0

I posted a thread with an attached Add_Structure.dsa script showing how to add a Polyline dForce Add-On Modifier using just DAZ Script. It works, but uses an intermediate .obj file - which should not be necessary.

If you execute that script while holding down the Alt key, then instead of creating and importing an.obj file, the script uses DzFacetMesh::addPolyline() to create the Add-On - but I cannot get this to work correctly, so I've started this separate thread to ask for help:

It all works OK, except that  when DzAddDForceModifierDynamicSurfaceAddOnAction is done on the resulting structure, it adds the "Simulation" section to the Add-On Node's "General" section in the Parameters Pane, but it does not add the "Simulation" section for the Add-On Node in the Surfaces Pane, so Simulation does not work with it.
And doing this manually makes no difference: Edit > Object > Geometry > Add dForce Modifier: Dynamic Surface Add-On.

It seems that there is something in the way the Add-On is being generated in function local_BuildStructureDirectly() that prevents DzAddDForceModifierDynamicSurfaceAddOnAction from working correctly with its output.  Perhaps some things need to be done in a different order?  I've tried changing things around, with no success.

The function local_BuildStructureDirectly() uses code from these DAZ Samples (Thanks again Rob!) (of course, they work correctly):

For convenience, I've attached to this post the same files as the other thread:  Add_Structure.dsa and Bouncing_Ball_01b.duf

Any help or suggestions will be much appeciated.

P.

[Showstopper issue] DzZipFile.locateFile() on Windows broken?

$
0
0
do {

filename = oZipFile.getCurrentFileName();

debug("filename="+filename);

var found = oZipFile.locateFile(filename);

if (!found) {

debug("### NOT FOUND ###");

}

} while(oZipFile.goToNextFile());

Om Mac OS X, this nicely shows all files in the zip, on Windows, I get ### NOT FOUND ### for all files.
Any special trick on Windows for finding the same path you just got from the zipFile?  

This is just a cut down of the actual code that collect files in one place and the locate the in the zip later on for extraction.

 


Is there a way to record a script from actions? Want to change max/min values on rotation...

$
0
0

The default max/min values V4's hip rotations are insane, +/- 360,000.  As a result, when I try to rotate, she spins out of control.  So I always find myself manually adjusting these max and min values on new characters.

Is there a way to "record" a script based on manual actions? 

Note - I've tried saving a pose with max/min values set on rotations, but the saved pose just seems to contain the dial value, not the max/min.

Fun with files named test

$
0
0

This is just a heads-up in case you encounter this behaviour and wonder if you are going mad...

Copy these attached files to a directory (or create your own equivalents):
  test_obj.txt   Rename it to test.obj (cannot attach .obj files here) - it just defines 2 Vertices and a Line between them
  test.duf        A Cube primitive
  test.dsa        A 1-line script that shows a message

Run DAZ Studio, and:
    Import test.obj - Actually, test.dsa is excuted.
  Rename test.dsa to test1.dsa (or anything different)
    Import test.obj - Actually, test.duf is loaded.
  Rename test.duf to test1.duf (or anything different)
    Import test.obj - At last - test.obj is imported.

This happens only with files named test - any other names work normally.

DAZ Studio v4.10.0.123 and v4.11.0.236 both behave this way.

 

How to shutdown daz3d with script

$
0
0

What is the script for shutting down daz3d? I wrote a java script to call daz script to render an animation and do something else, but I cannot continue my code unless I close daz3d first. I think there is a fairly easy command for that, but I cannot find it.

For DzAsset​.addCompatibilities: How do I get a complete list of bases?

$
0
0

For DzAsset​.addCompatibilities ( Array bases, Boolean create=false ):

How do I get a complete list of bases that I can add to an asset?


I'm looking for something that will return these in a list.
.......
Generation4
Generation4/Michael 4
Generation4/Michael 4#David
Generation4/Michael 4#Hiro
Generation4/Michael 4#The Freak
Generation4/The Kids 4
Generation4/Victoria 4
Generation4/Victoria 4#Aiko
Generation4/Victoria 4#Stephanie
Generation4/Victoria 4#The Girl
......

 

Thanks

copy and paste a figure multiple times.

$
0
0

My gosh I'm drawing a blank, watching the tutorials am unable to see what Val is doing. So how do I duplicate models?

Thanks

DAZScript wrapper for QTreeView? [Solved]

$
0
0

Hi there,

i'm starting scripting and found a lot of information in the scripting reference guide and the qt documentation archive for qt 4.8.6. What i'm looking for (and did not found yet) is a DazScriptWrapper for QTreeView. The DzNodeSelectionComboBox shows a tree for selection of nodes so i think it seem to possible to create a tree, but how?

Any idea, link or example is very welcome.

[SOLVED] How to findPropertyByLabel for hidden properties?

$
0
0

I'm trying to set certain parameters on the selected figure using script, using the line below

   var property = targetFigure.findPropertyByLabel(j);

This works fine and dandy for some figures + properties, but unfortunately when the property is hidden the result is empty, even when I have Show Hidden Properties enabled in the UI. There is no findPropertyByLabel overloaded method with a boolean flag to search hidden properties, and there also doesn't appear to be another DzElement method to find a hidden properties. Even findPrivatePropertyByLabel doesn't seem to be for hidden properties (I was hoping private == hidden).

Anyone know how to find a hidden property on a node?

Thanks

 


DzDial Focus Highlighting Removal

$
0
0

Quick question and purely cosmetic: with the DzDial control, whenever I click on it to select a dial value, there is this garish yellow 'focus highlighting box' that appears to show the control has been selected -- is there any way / property inherited to switch off the focus highlighting?

(it's the first time I've used the control on a UI, and perhaps everyone's used to the focus highlighting, it just took me by surprise)

Thanks,

weight maps

$
0
0

Is there a way to get hold of the weightmap information attached to a vertice / mesh or bone?

I can get the node, the vertex, the Skeleton and the bone. I hear that boneBinding links the two together, but how do you get that information? 

Create Script to Copy materials in sequence

$
0
0

Hi everyone, I need to create a script to copy materials in sequence. As shown in the image below.

Can anybody help me?

Thanks.

item changing script needs to work on all characters in a scene

$
0
0

my script is to show and hide items that G8F is wearing, it only works on the original g8 in the scene when the script was created-i need it to be able to show and hide items on any g8 in the scene, for example, there could be 4 g8F in the scene-the best scenario would be it can work from one script but if that is not doable to have a separate script for each g8F would also be great, 

 

can someone give me a starting point how either one of these options can be achieved

thank you

DzMorphLoader Script help

$
0
0

I'm working on a scirpt to create a morph via script.  I came accross this http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/morphloader_dz and the sample of this http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/import_obj_morph_loader_silent/start I wanted to make a morph without saving the obj, and thought the 

String createMorph ( vertexmesh_dz mesh, DzNode node, Boolean onlyErrorsOrWarnings=true, Boolean plainText=true )

function would work, but it seems to be calling the file overload of the function

String createMorph ( DzFileIOSettings settings, DzNode node, Boolean onlyErrorsOrWarnings=true, Boolean plainText=true )

as it says it cannot load the file (.) (null) because I didn't pass a filename.  I tried to force the overloaded version for DzVertexMeshPtr with oMorphLoader['createMorph(DzVertexMeshPtr, DzNode*, bool, bool)'] but it still seems to want a file, but I want to create a morph from a given vertex mesh.

Am I missunderstanding this overload of the createMorph function?

Thanks.

Viewing all 1036 articles
Browse latest View live


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