Hello,
I'm trying to load a daz product using the product name or product SKU number.
Any help would be appretiated.
Thanks.
Hello,
I'm trying to load a daz product using the product name or product SKU number.
Any help would be appretiated.
Thanks.
Hello, I would like to write a script to create a Light Group canvas for each light present in the scene.
Is it possible to do this from the scripting interface? I could not find any documentation related to this kind of objects.
Thanks in advance for any suggestion
I'm trying to let the user know when a file with a PNG extension is used, it gives a notice about transparent PNGs, how do I give a message box when it loads a PNG?
var sPath = FileDialog.doFileDialog(true, "Select an Image File", oImageMgr.getImageOpenPath(), "Image Files(*.png *.jpg *.tif)");
if(sPath){
oImage = new Image();
if(oImageMgr.loadImage(sPath, oImage)){
var oTexture = oImageMgr.getImage(sPath);
var oFileInfo = new DzFileInfo(sPath);
oImageMgr.setImageOpenPath(sPath);
var sNodeName = "%1".arg(oFileInfo.baseName());
if( DzFileInfo( String( "PNG" ))
{
MessageBox.information( "Your image is now PNG.", "Plane created!", "OK", "" );
}
Is it possible to parse the existing morph rules from DzFbxExporter or are they perhaps stored in a file somewhere that could be accessed?
Hi,
I'm creating a Genesis Assets converter. It's already working right now but I'm working on the best way to integrate it properly into DAZ GUI.
For now, I did the basic way : a script that prompts a new window when launched. That window displays each available asset. User has to choose one, then click "ok", then asset is converted and applied to the current scene primary node.
I was wondering : is it possible to add new custom action in DAZ default GUI so that when I right click on a material file (for example), a new option "Fit to current figure" become available?
Thanks for answers!
Hi,
I'm creating a simple script that would be an alternate "assets explorer", a sort of mix between the "Smart Content" tab and the "Content Library" panel.
Basing on the doc example (http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/metadata/list_product_files/start), I can retrieve each user owned product, and some of it's datas, but I can't find a simple way to locate the product preview image...
I tried several ways, but still no results, please help me! I need an img path, or a Pixmap, or anything that I can handle (path would be the best).
Each idea will be welcome, thanks!
TL;DR: I'm using Daz Studio to create 2D assets that make use of normal, diffuse and specular maps. In my current piepline, I have to perform seven different renders on every frame of animation. I think there may be a way to do pull this off with just 3 renders per frame, saving a considerable amount of time and effort. I could use some help from someone who is savvy with Daz Studio's scripting language, and knowledgeable about shaders, and maybe familiar with the inner-workings of LineRender9000.
The Long Version:
Using 3D artwork to generate pre-rendered game art has been my obsession this year. Currently, I'm using a program that generates a normal map based on how said object would appear when lit from the front, top, bottom, left and right sides. It was made for pixel artists, but it works remarkably well when you have five separate renders with light coming from a single direction in each. The one problem being, there are a lot of images to keep track of. A typical frame from an animated object might look something like: "SprName_Direction_FrameN_front.png" - with four more for the cardinal directions, one for diffuse, and one for specular. Basically, I have a handful of different "sets" that I load an object into and render from, and there's a lot of rigorous work involving material setting, and adhering to naming convention. I'd love to automate as much of this as I can.
Looking through the LineRender9000 documentation, I was saddened to see there were no scripted cameras that would produce a pure light-render (I'm not sure what you'd even call it. Illumination-render? Something where the texture does not appear, only how the light bounces off it). I did notice something interesting when reading up on the Fresnel Reflection v camera.
Ignores surface materials and renders the scene geometry using a Fresnel algorithm,
outputting the reflected vector as color information, converted to greyscale. That’s a
long-winded way of saying “the camera you should use for normal-like detail lines that
looks better than a straight output of normals would”.
Minus the greyscale part, that might be exactly what I'm trying to get! If there were a way to get a straight output of normals...well, that would be a normal map, no? If I could simply use a modified Fresnel Reflection v script to create a colored normal map, I wouldn't have to bother with the five directional lighting renders (nor creating seprate textureless material presets for different circumstances). I've attached a few images that sort of illustrate the process, and my desire to shorten it as much as possible.
I haven't done any scripting in Daz, but I've done enough in the past where I can have a pretty good idea of what's going on when looking through a script, provided the code is documented and clean. Unfortunately, none of the support scripts I found for LR9K address the shaders (or shader cameras) by name. I'm also pretty in the dark when it comes to shaders in general. A beginner's guide to scripting in Daz Studio probably wouldn't be helpful in a situation like this one; I can see how learning it could help streamline a lot of processes, but I kind of need to migrate from being stuck on the graphics to being stuck on the game coding. (I know, I'm doing this all in a very nonsensical order).
So my question is, is there a way I could figure out which part of the script applies the Fresnel Reflection algorithm, and more specifically, which part deals with greyscaling the output? I may not be able to write my own script, but I know how to comment things out! But...if it's clearly not that straightforward of a process, then I may have to outsource this part of the project to someone who knows what they're doing. There's another version of this thread, somewhere down the road, that involves: Clicking on a single script from Daz Studio -> Renders N times under every necessary circumstance, and saves each image name appropriately.
Hi everyone,
I started a little scripting project and ran into a problem. The endgoal is to loop over the frames of the timeline in a scene and save each frame as a posePresetFile in a defined folder.
For this goal the first step would be to save a file without user interaction. I know this is a pretty old hat and i looked at the given example and found an older thread with close to this code:
// DAZ Studio version 4.12.0.86 filetype DAZ Script
var oAssetIOMgr = App.getAssetIOMgr();
var nAssetIOFilter = oAssetIOMgr.findFilter( "DzPoseAssetFilter" );
var oAssetIOFilter = oAssetIOMgr.getFilter( nAssetIOFilter );
if( oAssetIOFilter ){
var oSettings = new DzFileIOSettings();
oAssetIOFilter.getDefaultOptions( oSettings );
//save only the current frame
oSettings.setBoolValue("SaveCurFrame",true);
oSettings.setBoolValue("CompressOutput",true);
oSettings.setBoolValue("RunSilent",true);
oAssetIOMgr.doSaveWithOptions(oAssetIOFilter,oSettings,true,"g:/frame000.duf");
}
The problem is that the file flat out isnt saved. The output only says "Running silent. No "NodeNames" defined. (in case this show an obvious error that i dont get).
Have i gotten the path wrong? or am i on the completly wrong track in the first place. Thanks for any pointers ^^
This is to help the diffeomorphic plugin.
I tried to look at the api reference in the documenation center but it seems it's mostly incomplete plus my programming days are far away now. We need to change the resoluition level of the objects in the scene before exporting, so to export the base mesh, then restore the resolution level after exporting. Any help please ?
var node = Scene.getPrimarySelection();
var obj = node.getObject();
var morph = obj.findModifier("PHMBrowWidth");
var deltas = morph.getDeltas();
print("Num deltas: "+deltas.getNumDeltas ());
If I run the previous lines of code (on G8F), I get 0 as result of number of deltas by default. But if I dial up the "Brow Width" morph on the character to any value, I get the correct number of deltas of the morph.
Then if I analyze the figure by script, create an array of morphs from it, and try to get the deltas from all of the morphs one by one, the number of deltas returned is always 0, even if the morphs are all dialed up on the figure.
Any idea? I'm trying to edit the geometry of all morphs on a figure by script in order to save tons of time...
Hello my dear Ladies and Gentlemen,
I need your help.
I have a ball, simulated to fall to ground using dforce.
When I play the simulation, the ball height position (Y translation property) never changes, it stays the same and yet, the ball is falling down to ground,
getting each frame closer to the ground.
I need a way to be able to get Y position for every frame the ball is falling to ground.
Thank you,
marius.
What code would I have to use in order to add a random texture to a surface on an object upon clicking the script's icon?
Hello,
I will ask a very simple question but I didn't find a way to get the answer in the documentation, in the old posts or in the samples.
I would like to get the full path of the current script.
I thank you a lot for your replies.
Gérald
Just started looking at one of my old PoserPython/DA Script thingies, because I now want to start writing to a datafile (previously I only ever read the datafile).
Assuming the user had both DAZ Studio and Poser installed the datafilewould be in oneof the Poser runtimes, which the user had as a mapped runtimein DAZ Studio. This wasn't aproblem when reading the file.However, if I want to write the file I start running into UAC/permissions problems.
So I've decided to try putting my datafile someplace like this (PoserPython code snippet, because I'm doing the Poser version first):
...
sTmp = os.environ['APPDATA']
fileaddr = os.path.join(sTmp,'Roaming','3DCheapskate-Poser-DAZ-SmartPlus','SmartPlusData.txt')
if os.path.exists(fileaddr):
...
This (should*) return a fileaddr something like...
C:\Users\[username]\AppData\Roaming\3DCheapskate-Poser-DAZ-SmartPlus\SmartPlusData.txt
(I decided not to put under \Roaming\Poser\ or \Roaming\DAZ 3D\ since it's not specific to either.And I like my folder names tobe self-exlanatory-ish)
I have two non-PoserPython related questions regarding this.
First Question (DAZ Script question):
How do I do this in DAZ Script ? (It's been a looonnnggg time...)
Second Question (MacOS question):
I assume that environment variable APPDATA doesn't exist in Mac-land. So what Mac-ish environment variable would be the equivalent/most appropriate ?
*I haven't actually tried it yet
When an exception is thrown I only see the last function in the stack trace. How do I get the full trace- see its caller, and its caller, etc...?
I successfully got the 2 proxy scripts to work with alternate UV Sets
by using this syntax.
var oSurfaceProperties = {
"Tape" : [
"UV Set/Default UVs/Tape Narrow"
]
};
but when I try to add more than one, like so
var oSurfaceProperties = {
"Tape" : [
"UV Set/Default UVs/Tape Narrow/Tape Small/Tape Square"
]
};
the script has no effect. No error, no new Surface channel.
I also tried
var oSurfaceProperties = {
"Tape" : [
"UV Set/Default UVs/Tape Narrow",
"UV Set/Tape Small"
]
};
and other variations with no success.
Is it possible to proxy link more than 1 alternate UV Set? If so, does anyone know what code line I need?
Never mind, found the answer in the wiki...
How do I assign a color to a material property? In this case I am looking to assign Emission Color.
I have gotten the property found.
var prop2 = mat.findPropertyByLabel( "Emission Color" );
I also can succesfully set the texture.
prop2.setMap( tex );
When I did this for the Bump Map I was able to set the numeric property.
prop2.setDoubleValue(1.0);
I still can't figure out how to read or write to the color of the property.
I have dug through forums, docs, and samples and still havent found the magic.
What is the getter/setter for the color values on the Emission Color property (or other color properties on a material)?
In my script, I render a lot of images. It stops when I hit CANCEL on render window, but a few seconds it starts rendererring another image. How can I terminate this running script completely ? Stop Renderering.
Hello, I'd like to receive some help as I'm not familiar with DAZ's scripting system and Documentation page is bit complicated to understand
I'm trying to make a script that creates Surface Group from every Face Group exists within an object.
However, I couldn't find proper API reference that refers to either of those group...
If anybody is able to help that'll be great.. Thanks!