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

Assigning Volume shader at render time

$
0
0

I'm trying to modify the 'Standard Example' scripted 3Delight render script to tell 3delight to use the Volume shader from the camera.

When rendering with the standard (not scripted) 3Delight rendering, the volume shader takes effect. In the 'Standard Example' render script it does not. The camera is created via Shader mixer, its Root is a Volume brick.

I suspect the call that is required is Renderer.riAtmosphere(), but I'm unclear what to pass for the parameters. Confusingly, the Camera variable does not have a getShader() method either, which leads me to believe at runtime it is not a dzShaderCamera as I would expect.

Any hints?


Undocumented propertysettings_dz - is this the same as the old DzSettings? What's a key string?

$
0
0

(I've copied this post from here as a new thread, since it's not really related to the Iray renderer except by the context in which I was asking the question)

Using Rob's Render Settings - Find Property sample code I've got the properties I want. Now I look under DzProperty and reckon I need to do getAttributes / setAttributes, but the essential propertysettings_dz is as yet undocumented. I guess it's similar to the old DS3 DzSettings? So with a bit of educated guesswork I set up oProperty using Rob's sample code with "Environment Intensity" as the string and do this...

                var oPsettings = new DzPropertySettings;
                oProperty.getAttributes( oPsettings )
                print('>>> oP "Environment Intensity" = ',oPsettings.getFloatValue())

...(I know getFloatValue requires parameters - I'm getting to that) and I get this...

DEBUG: Found: Environment Map
WARNING: Script Error: Line 1839
WARNING: SyntaxError: too few arguments in call to getFloatValue(); candidates are
    getFloatValue(QString)
    getFloatValue(QString,float)

In the old DS3 DAZ Script 2 documentation it gives this

Number DzSettings::getFloatValue ( String key, Number def = 0.0 )
Parameters:
        key     The key string.

QUESTION 1: What is "the key string" ?

QUESTION 2: Am I heading in the right direction ?

How to get/set the collapsed-expanded state of a DzNode in the Content tab

$
0
0

The only related thing I can find is the isHidden()/setHidden() in the DS3 DzNode documentation.

But it's not them - they just remove the nodes completely from the Scene pane.

How to approach a grid of controls

$
0
0

I'm trying to create a dialog that has a grid of "records", each record having a set number of "columns" (other form controls, such as DzCheckBox, DzLineEdit, etc).

I have been able to more or less achieve basic functionality by creating a DzVGroupBox, setting DzVGroupBox.columns to the number of controls I want in the "grid", then manually adding a row of DzLabels, then a row of each set of controls, keeping track of them as an Array of Objects.

This works fine until I want to remove a "record", or all records.

How can you remove controls from a DzDialog (or any DzWidget for that matter)?
I'm open to other approaches to solving this problem as well. I have explored the DzListView, but that seems to not support various controls, nor editability, though to be fair, I've only figured out how to display text, so I may be missing something fundamental there as well.

Thanks for the help.

DzScrollView help

$
0
0

What's the trick to getting the DzScrollView to show a (in this case vertical) slider?

var oDialog = new DzDialog();
var oScrollView = new DzScrollView(oDialog);
var oGrp = new DzVGroupBox(oScrollView);
oGrp.columns = 1;

for (var i = 0 ; i < 20; i++) {	
	var oCheckBox = new DzCheckBox(oGrp);
}

oDialog.exec();

Produces the attached image (after manually resizing dialog).

I suspect it's something on oScrollView.getWidget(), but I'm coming up with nothing. Any hints?

 

Edit: To clarify what I'm trying to accomplish, I'm attempting to display a list of items in a dialog which may be larger (vertically) than the dialog will support I would like to put them in a vertical scroll pane so that the user may scroll to see them all.

Getting label of layered image

$
0
0

I can't seem to get the label of a layered image... .label returning undefined..

 

	oMap = oProperty.getMapValue();
	if( oMap ){
		if( oMap.className() == "DzLayeredTexture" ){
			NumOfLayers = oMap.getNumLayers();
			for( var i = 0; i < NumOfLayers; i++){
				cLayer = oMap.getLayer(i);
				LayerLabel = cLayer.label;
				debug( String( %1 ).arg( LayerLabel ) );
			}
		}
	}

 

Is It Possible To Access The Internal Name From A PP2 In DS4 Via DAZ Script? [How About The OBJ Name

$
0
0

I've recently updated the Poser version of my Smart+ Prop/PropGoto+ freebies - http://www.daz3d.com/forums/discussion/39376/
Part of the update was to use the internal name of the prop to identify Smart+ props like this:

Extract from file 'Smart+ Prop DS.pp2':

version
{
number 6
}
prop SmPlHaRoTestRod
{
geomCustom
...
}
prop SmPlHaRoTestRod
{
name TestRod
...

The "SmPlHaRo" prefix added to the internal name indicates it's a Smart+ prop targeted to the hand, requiring a rod-type grip.
This works fine in Poser 6, 8, and 9 (all the versions I can test with).

I'm working on the equivalent DAZ Studio update now (I'm using the old DAZ Script DSA format since I need to support DS3 still). So I'm using oProp.getLabel() to get the external name and oProp.name() to get the internal name.

DS3 works fine with the above (oProp.getLabel()="TestRod" and oProp.name="SmPlHaRoTestRod" as expected)

But DS4 seems to ignore the internal name and create its own, based on the CR2 name ((oProp.getLabel()="TestRod" but oProp.name="Smart+ Prop DS_18"), and the name looks like the subfolder names that DS creates in its C:\Users\\Documents\DAZ 3D\Studio\My Library\data\ folder which would make sense (I can't find the DS4 equivalent folder)

So the question is simple:
Is there any way to get the Poser prop internal name (as defined in the PP2)from DAZ Script in DS4?

Setting parameters of a figure in script

$
0
0

Hi, I am just starting with a little scripting and just needed some pointers please.

I would like to make a script that programmatically changes the values of the head bend and twist, but don't really know where to start.

See my image, I have V4.2 loaded and those are the dials I want to change,

How would I go about selecting the actor and then changing setting the value of those dials in my script ?

In the meantime I will keep hunting, I found some useful things but am a bit stuck on this bit. atm

Cheers :)


[Solved] Shader color decimal values

$
0
0

More data I'm trying to access by script... the color values displayed for Iray Uber Shader colors are expressed as between 0 and 1, and are what I need to use in my scripting; when passed to my external app, they give me a matching color. I can't seem to access them, though. The value is not the 0-255 value divided by 255; that's signficantly off. Does anyone know how this is computed or where it can be accessed?

EDIT: The correct values also show up in the diffuse values used by the OBJ exporter; they've got to be in there somewhere!

[Solved] Access to shader name

$
0
0

I'm trying to find a way to access the shader name as displayed on the Surfaces panel. I need to distinguish between different shaders that are all DzBrickMaterials. It looked like from another example I could do material.GetShader(), but that's coming back undefined. Help?

Ways to add a scene saved by script to the "Open Recent" Menu. [Solved]

$
0
0

Hello!

I've modified this sript provided by Rob: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/save_duf_scene/start for some of my scripts, and my scripts works as intended. BUT the last little touch I would like to add to them is the possiblity to reload the saved scene from the "Open Recent" menu of Daz Studio when scenes are saved by a script, which is presently not the case. For now, the scene saved by script do not appear in this menu.

I don't know at which level this addition to the "open recent" occurs. For now I have found nothing in the "App.getAssetIOMgr()", but maybe this is somewhere else.

I have another solution which would be to locate the AppData/Roaming of users and to "auto edit" via script the "RecentFiles.txt" but I really hesitate doing this... I don't like touching what's in the AppData, and I'm not even sure I'm allowed to do this. :(

Does any one know if it is possible to script the addition of a file to the recent list without scripting the modification of the "RecentFiles.txt", and in this case, can give me some clues to know in which direction I have to look for?

Thanks in advance!

Image manipulations via LIE from script

$
0
0

I have browsed through the online scripting documentation and did some forum searches via Google, but haven't found an answer to this.  Also, probably worth noting that while I have a pretty good knowledge of writing JavaScript, I haven't delved too far in to writing scripts for DS yet.

Before I begin making a deep dive, though, I wanted to see if anyone might know if it's possible to make adjustments to texture maps via LIE from a script?  For example, if I wanted to modify the gamma correction value for an image, could this be done from a script?  For that specific adjustment, I want to do it via LIE, and not the regular image editor, because I don't necessarily want the adjustment to apply to all instances of the image.  

Alternately, I'm trying to figure out if I could save the change as a LIE preset, but without the actual image?  (So the change could be applied to any image)

 

Basics

$
0
0

Hi all,

I'm an experienced developer, but I'm kinda lost with Daz. Documentation seems all over the place with no obvious way how to begin or where to find resources. Anyway, I'd like to do the following:

1. Add a figure on the scene. eg: Genesis 2

2. Add a cloth (from the content library) on the said figure 

3. Load a material for the cloth added in step 2

Finally I'd like to know if it is possible to run a script automatically when opening Daz or make it execute a script from command line or another way with no UI interaction.

 

If someone can provide a sample for the above actions or point me to the right direction would be much appreciated.

 

Thanks a lot!

How to access DzOpacityManip (How to change opacity on LIE Layers)

$
0
0

I have a shader preset that uses the Layered Image Editor. I am trying to make a script that will alter the opacity setting on one of the layers. I have been looking at the Daz Script 2 doc and at lots of script examples, but I feel like I'm missing the big picture. I just don't understand how I get to the layer so I can change the opacity. If anyone has any advice I would really appreciate it.

Display Custom Toolbar and/or Screen Refresh? [Solved]

$
0
0

I've written a script which creates and enables a custom toolbar, but for some reason it will not display immediately.  If I refresh the screen by going into and out of Full Screen mode (Shift+F11), the toolbar will then show, so I have tried reproducing this in script by using MainWindow.goFullScreen() and then MainWindow.exitFullScreen(), but it has no effect. 

Does anyone know a way of mimicking a screen refresh in script?  I know it can be done because maclean has done it in his Room Creator, but the script is encrypted so I can't nab his trick. 


How do I get the width and height of an existing image file?

$
0
0

I've tried a few things, but can't seem to figure out how I can get the width and height of an existing image file.

Relative Paths

$
0
0

I feel like I'm missing something really obvious here, but I've got a script that works as long as I use absolute paths. It's pretty simple. I just call 2 different files to apply them both. Is there a way to use relative paths? I can't find any documentation on the relative paths or sample code using them. 

 var oContentMgr = App.getContentMgr();
 oContentMgr.openFile("C:/Users/CC/Documents/Secondary Runtimes/Ciara/People/test1.duf", true);
 oContentMgr.openFile("C:/Users/CC/Documents/Secondary Runtimes/Ciara/People/test2.duf", true);

 

Script Question

$
0
0

Hello!

So I have to render scenes named set00 through set19. For every scene I need the character in that scene to change to 5 different poses and render for each pose on every scene. The 5 poses are the same for every scene and the base character is the same as well. So that amounts to about 100 renders. Each render takes about two hours, so that's 200 hours or about 8 days of rendering. I don't know anything about Daz scripting, but I was thinking it would be a lot easier if there was some way to automate this process. Is this possible and if so how?
Thanks for taking the time to read my post!

Copying/Modifying Surface Color Values

$
0
0

Hi,

I wonder if anyone can help me. I'm working on a script based of Casual's mcjSpreadTex - https://sites.google.com/site/mcasualsdazscripts5/mcjspreadtex

I've modified it so it copies color values, which then can be applied to other channels. However, I want to some operations to it ie. clamp color to a minimal value of 32 rather than 0 and retarget colors above values (say, 255,192,128 to 160,120,80). I'm thinking retargeting is done by converting the values from RGB to HSV and then changes/clamps the colors to a value of 67. Is that possible? Or do I have to work with the original RGB values.

Thanks.

Does DAZ Script have any way of detecting the user's screen dimensions

$
0
0

Thread seconded from the original (foolish) question "Make Text Wrap In A DzWidget/Dialog/BasicDialog ?" to a new question "does DAZ Script have any way of detecting the user's screen dimensions"

Original (foolish) question "Make Text Wrap In A DzWidget/Dialog/BasicDialog ?"

What the title says, preceded by "How do I..."

Hopefully the answer's really obvious and it's another case of not being able to see the tree for the woods...

    var wDlg = new DzBasicDialog;       
    var wWbLbl = new DzLabel( wDlg );
    wWbLbl.text = "Blah, blah, blah, blah, ...ad infinitum..."

If 'text' is long with no <br> then the dialog stretches over the left/right edges of the screen. Anything I try to do with width, minwidth, setWidth, etc affects the dialog but the text doesn't wrap.

Viewing all 1036 articles
Browse latest View live


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