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

Align buttons to the right

$
0
0

I want to add a button to the bottom right. 

What I've done is add a group box

Then inside it added another group box, (aligned to the right) as well as the buttons. 

This works, but unfortunately, even if you make the group box flat, it still draws a line along the top, so this setup looks like a hack. 


exporting all vertices using a function

$
0
0

Hello,

I am writing a script which needs to get all the vertices of a geometry.

This action can be done by writing a loop using a myGeometry.getVertex(i).

This loop takes 5 seconds when the mesh has 350,000 vertices.

Is there a function like myGeometry.getVertices() which would be able to transfer all the vertices in only one function and which would make this action faster.

I thank you for your replies.

Is it possible to get the directory of a script.

$
0
0

Hello,

I need to get the directory of a script I wrote because I need to use a file which is in the same directory.

The script can be installed in any folder and I have no solution to find how to reach the corresponding file.

I thank you for replies.

way to encrypt a script for an older DS version than the encrypting one

$
0
0

I have several (commercial) scripts encrypted with Daz Studio 4.8.0.59. Today I need to upgrade it to the latest version of Daz Studio, but I'd also like to be able to update my script projects - or eventually create new ones - with the same compatibility version. Which will not be possible any more as soon as the update will be made.

I think I understood there was a way to do this, meaning encrypting for an older Daz Studio version than the version which encrypts, but I have no idea how to do this. This is why I come here to ask the question, in order to know if it is really possible, and how I could do that? 

How to Keep Breakpoints?

$
0
0

I've just started playing around with DAZ Scripting, thanks to all the excellent tips out here and samples on the DAZ website.  But one thing is really annoying me.... I have to keep re-setting the breakpoints in the debugger.  Isn't there anyway to keep them around?  Even if it's just in the current session?

DzFloatSlider How to Make Text Box Bigger

$
0
0

I'm using a DzFloatSlider in a dialog box but my max value needs to go to 100,000 and it's being truncated in the text value box.  Since it's editable, it would be nice to be able to see the whole value that's entered.  It works as it is, but it's sloppy.  I can't find anyway to resize the text box so it fits my data.  It seems like there are applicable functions in the parent, DzWidget, but I don't know if those apply to the whole slider bar or not, e.g. setFixedWidth.  Is there a way to do this?

How to test for NaN? [SOLVED]

$
0
0

In DS v4.10.0.123, a test for Number.NaN always seems to return false.  Am I missing something?:

// Script to test Number.NaN

// Define an anonymous function;
// serves as our main loop,
// limits the scope of variables
(function(){

  print( ' ' );
  print( App.longVersionString );             // 4.10.0.123
  print( ' ' );

  var X;

  X = 1 / 0;
  print( 'X=1/0', X );                        // Infinity
  print( X == Number.NaN               );     // false
  print( X == Number.POSITIVE_INFINITY );     // true       <---OK
  print( X == Number.MAX_VALUE         );     // false
  print( X == Number.NEGATIVE_INFINITY );     // false
  print( X == Number.MIN_VALUE         );     // false
  print( ' ' );

  X = Math.sqrt( -1 );
  print( 'X=sqrt(-1)', X );                   // NaN
  print( X == Number.NaN               );     // false      <---!!! Should be true
  print( X == Number.POSITIVE_INFINITY );     // false
  print( X == Number.MAX_VALUE         );     // false
  print( X == Number.NEGATIVE_INFINITY );     // false
  print( X == Number.MIN_VALUE         );     // false
  print( ' ' );

  X = Number.NaN;
  print( 'X=NaN', X );                        // NaN
  print( X == Number.NaN               );     // false      <---!!! Should be true
  print( X == Number.POSITIVE_INFINITY );     // false
  print( X == Number.MAX_VALUE         );     // false
  print( X == Number.NEGATIVE_INFINITY );     // false
  print( X == Number.MIN_VALUE         );     // false
  print( ' ' );

// Finalize the function and invoke
})();

 

detecting collisions

$
0
0

Hi , i have two questions.

i'm planning to write a script that can help avoid poking through something when posing a character  (a kind of basic physics engine) 

is there a method to detect collision on and between characters ,  how the smoothing modifier knows what part of the body it should morph ?  

is there a callback (signal?)  that fires while or after you change the position of an object or a character on the scene?

if you have some advices and some examples , it will be helpful , thanks


Brackets and curly brackets on non US (Scandinavian) keyboards?

$
0
0

I'm getting my feet wet using the Script IDE and to my surprice it's impossible to type both brackets and curlly brackets Script IDE editor on my Swedish keyboard?!?

It is possible to copy the characters from a text editor into the Script IDE editor.

Is it a bug that should be reported?

Textfield with autocomplete, area with scrolling

$
0
0

Hello. Is it possible to create textfield with autocomplete in BasicDialog? I have an array with predefined values for textfield... and... Where can I find example of code, please.

And second question. I have three columns of (too many) checkboxes in BasicDialog. How to put every column to some container with scrolling. Example of code, please.

Thanks.

to select node in the needed figure

$
0
0

I have  2 figures in a scene to example - Genesis(1) and Genesis (2).

I need to select Hip in Genesis (2).   

var roots = Scene.getNodeList();
var itemLd=Scene.findNodeByLabel( "Genesis (2)" )
itemLd.select(true );
var itemLH=Scene.findNodeByLabel( "Hip" )
itemLH.select(true );

But this code selects Hip in Genesis(1)

 

Rename objects and objects parented to other objects

$
0
0

Im looking for either a script that will rename items parented to a selected object, or pointers on creating one.

Many thanks

Anybody fancy doing a (freebie) DAZ Script version of Easypose ?

$
0
0

Several months ago I wrote a freebie PoserPython script to add Ajax-type Easypose to a figure - released as Freazypose (prototype 0.10) at ShareCG.

Inevitably I've had a query as to whether it'll work in DAZ Studio, which of course it won't.

However, the PoserPython script is only 359 lines in total. Half of those are probably comments and blank lines for layout, and half of what's left is probably dialogues and information pop-ups. So I reckon maybe 100 lines of actual PoserPython.

The two key PoserPyton API calls to add Easypose were...:

  • actor.CreateValueParameter() ... to add new master dials
  • parameter.AddValueOperation() ... to slave the required parameters on other actors to the master dial

...and the section of the PoserPython script that does this is lines 288-361 (in case anybody downloads the thing from ShareCG to have a look)

* * * * * * * * * * * * * * * * * *

I'm very rusty on DAZ Script, but I think a 'DzNode' corresponds to an 'actor' and a'DzNodeProperty' to a 'parameter'. 

However, when I look at the method lists in the documentation ( http://docs.daz3d.com/doku.php/public/software/dazstudio/3/start - downloaded years ago) my brain jumps into neutral...

So the questions are:

  1. Does DAZScript have the necessary API callsto do this ?
  2. If so,then does anybody fancy giving it a go ? I don't.
  3. (or perhaps mCasual already done this ?)

Mesh smoothing disabled in scene opened by script - help?

$
0
0

I'm having problems with a script to batch render scenes in Iray.

TL;DR
The script will open a scene (or scenes) from files and render each camera in the scene to a file, but clothing items are showing poke-through which does not show when the same scene is opened manually and then rendered manually.  The same poke-through is evident if I disable mesh smoothing on the clothing items after manually opening the scene file.

More info.
The script uses the openFile method of App.getContentMgr() to open the scene file.  Then, for each camera in the scene, it renders to a named file.  It has no effect on the poke-through issue whether it renders using a Dz3DViewRenderHandler object or a DzImageRenderHandler - have tried both, same problem.

I have added code after the scene file has been opened and before the rendering begins to identify all the nodes in the scene with an 'Enable Smoothing' property, and to display its value.  It's a boolean property, and the values for all items showing poke-through are 'true'.  I expect this to represent 'enabled', but then why the poke-through.  Even aside from the poke-through, it's obvious the items are not smoothed in the rendered image.

Once the scene has been opened by the script and the scripted render has finished, there is no poke-through in the viewport (unless I disable mesh smoothing) and it doesn't show if I start a render manually.  It only seems to be a problem when the render is done by the script.

Has anyone else come across this issue before?  Any ideas on how to diagnose/work around/ fix this much appreciated, as it is pretty much a show stopper and I am stuck!

Classes and Separating Script Files

$
0
0

Just wondering if it is possible to seperate a script into separate files?

I know a function expression is used to declare a constructor functions; can and if so, how, can these be separated between script files?

Would make files much easier to write and debug.


Need help with ( Save a Material(s) Preset Script )

$
0
0

The Save a Material(s) Preset script running in Silent mode isn't saving the same as it does with the same user input information.

With run silent set to true I get this.

 

I change the run silent to false.

 

I use the same options that run silent would use in the options and I get this witch is what I want.

So the question is how do I get it to run silent and save the file out like it does with user input?

How can I delete an asset from a product?

$
0
0

I'm trying to delete an asset from a product. I tried the code below but product.removeAsset("Product name")); always returns false and the asset doesn't get deleted.

 var products = oAssetMgr.findProductsByName( "My Product");
        var product = products[0];
        var assets = product.getAssets();
        
        for(var i = 0; i < assets.length; i++)
        {
        	if(assets[i].assetName == "Product name")
        	{
               var removed = product.removeAsset("Product name"));
               print("Removed asset = " + removed);
           }
        }

 

Using a Palette to change DzWidget colours

$
0
0

Using a Palette to change DzWidet colours has anyone made this work and have some code examples to show.


var oMyNewGB = new DzGroupBox();

oMyNewGB.paletteBackgroundColor.setRgb( 0,0,0 ); // does nothing
oMyNewGB.paletteBackgroundPixmap = new Pixmap( pathToImage ); // does nothing
oMyNewGB.palette.window = new Color( 0,0,0 ); // does nothing
oMyNewGB.palette.active.window = new Color( 0,0,0 ); // also does nothing
oMyNewGB.palette.active.window.setRgb( 0,0,0 ); // alas also does nothing

oMyNewGB.palette.window.value // returns the number 95
oMyNewGB.palette.window.value = 100; // does nothing - value is still 95 

So my question is - what is the magic sauce for actually changing the colour of interface widgets in script?

Script to install content to the menu

$
0
0

I've seen it from products from V3Digitaltimes like the Pose Mixer.

It comes with a script that when you click on it, it will create a folder to a menu next to "scripts" and puts the product there in the layout.
How can I make such a script?

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? 

Viewing all 1031 articles
Browse latest View live


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