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

Dynamically scaling a light based on its orientation to another light?

$
0
0

Hey guys,

I am new to programming in Daz, so bear with me if this can be better achieved another way without using scripts. This is what I would like to do;

I want to scale LIGHT#1 dynaically based on its orientation to LIGHT#2.
So if LIGHT#1 and LIGHT#2 are pointing directly at each other, then scale should be X%.
As the two lights rotate away from each other, then the scale should transition to Y%.

Is this something that can be handled with controllers perhaps, or scripts? 
Sorry for the basic question. Let me know if this makes sense.

Thank you,

-P


Know what I want to do...

$
0
0

So I've made a lighting product which I would like to step a user through choosing options and then pressing a final button to apply the setup. In my head it seems pretty straight forward - about 5 steps, but I'm completely new to Daz Scripting and don't know where to start. So I've got a dialogue popup sorted (yay) but would need to get arrays for choices and any pointers for how to start would be really appreciated. :)

 

AJ

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.

Setting a DzImageProperty value to a new DzTexture

$
0
0

Well, I'm stumped.

My script is attempting to change the image used by a DzImageProperty (it's a DzBrickMaterial, I iterate through the property list and find the matching property name.)

So I've got a reference to DzApp::DzImageMgr, and I'm calling getImage(newtexturefilename) to get the new DzTexture.  That seems to work....then I call setValue() on the DzImageProperty.

No errors, but it doesn't change in the scene.  The image list doesn't show the new image in it either.  The property doesn't change.  I've tried debugging it, but with the debugger stepping through, the new DzTexture from the DzImageMgr gets deleted before I can do anything.

 

Here are the two significant parts of the script:  First, the main part where I then call a second part....

					// newfn now has the name of the texture to switch to
					// and filename has the current filename
					var newfninfo = new DzFileInfo(newfn);
					if(newfninfo.exists)
					{
						var ImgMgr = App.getImageMgr();
						var checkImage = ImgMgr.findImage(newfn);
						if(checkImage)
						{
							// the image is already loaded.  Set the current Material
							SetMaterialTextureByType(mat,type,checkImage);
						}
						else
						{
							// the image isn't loaded.
							var newTex = ImgMgr.getImage(newfn);
							SetMaterialTextureByType(mat,type,newTex);
						}
						print("Set " + mat.name + " " + GetTextureTypeStr(type) + " to " + newfn);
					}

 

And here is the pertinent part of SetMaterialTextureByType(m, type, tex)

		case textype.brick:
			for(var i = 0; i < m.getNumProperties(); i++)
			{
				var bp = m.getProperty(i);
				if(bp.inherits("DzImageProperty"))
				{
					var bpv = bp.getValue();
					if(bpv.inherits("DzTexture"))
					{
						var tn = tex.name;  print("Texture name: " + tn);
						if(tex.isNull) { print("Texture deleted before it could be set!"); break; }

						if(bpv.name == tex.name)
						{
							bp.setValue(tex);
							break; //i = m.getNumProperties();
						}
					}
				}
			}
			break;

 

I should add that for when it's not a brick, SetMaterialTextureByType() goes through the types it has from DzDefaultMaterial, and calls the various 'set' members.....but that doesn't appear to work EITHER.  (i.e., the image was a "base color" image map, so it is set using materialObj.setColorMap(newTex);

So what am I either missing, or getting wrong?

 

New to the scripting IDE...

$
0
0

Hi all,

I am new to the DAZ Scripting IDE, just opened it for the first time a couple days ago but I am a software developer by trade so not new to the scripting aspect of it. The coding constructs of DAZScript seem very intuitive and easy enough to pick up. However, I see that documentation of the object methods and members is a bit, um, sparse -

So is there a way to have the IDE turn on auto-fill of an object so when I start typing in object names it gives me a flyout menu of all the possible members/methods to use for that specific object? If I had that working I can figure out the methods by trial and error without a manual. Otherwise this is going to be a really painful exercise in futility.

How do people new to the IDE write scripts here with only part of a manual and part of the classes/objects fleshed out in documentation? Do we just come here for all of our questions to be answered or do we flood support with trouble tickets? Sorry for the frustrated tone, finding definiteive answers has been frustrating...

Show-hide floor in viewport

$
0
0

Hi!

I can't understand how to do - show or hide floor in viewport.

Is it really in Daz script?

Selection in Surface Pane using script

$
0
0

I know how to select node by label (findNodeByLabel( "..." )).

But how to make this in Surface Pane - to example choose "Opacity" or other item here? Thanks wink

to create a conform cloth with script?

$
0
0

Interesting, is it  possible to create conform garment using a script?

I understand 

1) to load character  

App.getContentMgr().openNativeFile( DUFname, true );     

2) to  open ready clothing as OBJ

App.getContentMgr().openFile( OBJname, true );     

4) Is there now  any way ( function or  script code) to create conform clothing?

????   :)

I forgot - to do OBJ as figure before this. I don't know how too. :(


add brick to shader

$
0
0

It is possible with a script to add a shader brick to the shader and connect this with different shader bricks?

I have added a new property (DzFloatProperty) to the surface pane. It is shown in a pane. But the shader ignores that.

And i don't kown how to connect that.

If yes, is sample available?

 

How to control the service button in the header?

$
0
0

Sorry how I can control these buttons( now default in dialog) or remove them?

I do not need in  Help button  because I have a normal HELP with images in script and I want delete this button. 

I don't know how to control  Exit  button .  I have to keep track of button click by user to return the 3D window in the the right state.

Documentation Update for Save Duf Hierarchical Materials preset

Getting a list of Scripted renderers

$
0
0

Is there a "good" way to determine what Scripted 3Delight Render Scripts are available for use from within the DAZ Studio client?

 

My current implementation is iterating the subdirectories of

String("%1/Scripted Renderer/").arg(App.getResourcesPath());

and assuming each folder contains a registered script of the same name, which seems to make a lot of assumptions that the folders and names match. So, is there a "right" way to know what scripts are available?

var sScriptedRendererBasePath = String("%1/Scripted Renderer/").arg(App.getResourcesPath());
var oDir = new DzDir(sScriptedRendererBasePath);
var aEntryList = oDir.entryList("");
var aScriptedRendererScriptNames = new Array();

for (var i = 0; i < aEntryList.length; i++) {
        if (aEntryList[i] === "." || aEntryList[i] === "..")
            continue;
        aScriptedRendererScriptNames[aScriptedRendererScriptNames.length] = aEntryList[i];
    }

 

Image file caching

$
0
0

It seems that DAZ Studio will cache image file information at some point (for sure during rendering), and "source" Image file updates that happen "behind the scenes" do not take effect until DAZ Studio is restarted. Seemingly this caching is by filename. Changing the property filename will cause the Image file to be re-evaluated.

Is there a way to tell DAZ Studio to re-assess the Image files so the changes take effect?

In my specific example, there are images which are referenced by DzColorProperty objects, and the underlying image file, when changed, does not take effect. A change to the file name does take effect.

I am ok with commands that would either "re-assess all images" or "re-assess these specific images".

Thus far, I have tried:

App.getImageMgr().autoRefreshChanged(true);
App.getImageMgr().prepareAllImages(App.getRenderMgr().getActiveRenderer());

to no avail.

Any ideas?

DzShaderCamera

$
0
0

Hello

I've used the 'setOption' method inside a render time script and it works within a scripted render but not with a standard 3delight render nor with an IPR session

Is there a way to make it work ?

DzGroupBox borders

$
0
0

Is there a way to disable the borders around a DzGroupBox?

I am able to achieve a control layout on a DzDialog that looks fairly good, but the nested groups add a lot of borders, which I'd like to hide if possible.

Alternately, if there's a better way to lay out controls without nesting DzGroupBox widgets, I'm open to alternatives.


How to get the Point At target [Solved]

$
0
0

I know how to set a point at target, but I can't find how to get what a point at target is.

var pAt = bone.getPointAtControl();

pAt.getValue() will get me the strength value. I've tried pAt.getLabel() and pAT.getName() but both are returning blank.

How can I display images in a dialog box?

$
0
0

Hello everyone.
I'm new to daz script.

I have spent a few days searching on the forum, reading the docs and examples.
The only useful class I found is DzListViewItem,which can be used to display pixmap in dialog box.
If this class is just what I need, then how should I convert an image to a pixmap?
Thanks.

ActionMgr DzUndoAction is it possible to get the list of undo(s)

$
0
0

After doing different things in Daz Studio there is a list of actions that can be undone from Edit->Undo. This only shows the most recent action. Is there a way to get what other actions are in that current list.

Display Property Group in the Parameters tab?

$
0
0

I cannot find a way of selecting and displaying a Property Group in the Parameters tab.  I can change the values of the properties themselves, and I can get the Parameters tab to display using "togglePane", but I cannot get a group (say, Actor/People/Real World) to display in the interface.  Does anyone know if there is a way of doing this?

I want to do this to give the user the option of going directly to my custom dials rather than having to tediously search around in the Property trees.

Instances creation via DzScript. How?

$
0
0

Pls, help :) How to get access for instances creation?

Viewing all 1027 articles
Browse latest View live


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