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

Still trying to set a 2nd Poser Dir as a Favorite

$
0
0

A year later, and I'm back to this topic. Rob's script is great, but incomprehensible to me.I have 2 poser installs on the same SSD - P6 and P9. P6 Favorites are no problem, but the P9 script only ever finds the P6.folders.

http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/specific_ui/set_content_library_container/start

The relevant section comments are kind of vague

// Set the base to the first mapped Poser formats directory
// Set the first value to the id of the top-level container,
			// set the second value to the base path within that container

The trouble is I don't know what line any of these refer to. And how would it change for a 2nd Poser install?

It's not anything life-threatening, but surely someone knows how it works?

 

		// Set the base to the first mapped Poser formats directory
			var sBase = String("%1/%2")
						.arg( oContentMgr.getPoserDirectoryPath( 0 ) )
						.arg( sIntermediate );
 
			// Set the first value to the id of the top-level container,
			// set the second value to the base path within that container
			var aIdPath = [ oAssetMgr.getPoserDirID(), sBase ];
			// Split the relative path into its individual parts
			var aRelativeParts = sPath.split( "/" );
			// Iterate over each part in the relative path,
			for( var i = 0; i < aRelativeParts.length; i += 1 ){
				// Push the full path of the 'current' part onto the id path array
				aIdPath.push( String("%1/%2")
					.arg( sBase )
					.arg( aRelativeParts.slice(0, i + 1).join( "/" ) ) );
			}

TIA


Is automatically saving the opened file as scene if the rendered image gets saved possible?

$
0
0

Hi, I'm currently fixing my biggest issue that I constantly have:
"rendering a few dozens different poses of a character only to then want to go back and edit a few things in one of them and because I forgot to save the final version with that pose I have to recreate it again"
It literally happens twice daily, so now I am looking to create a script for DAZ that runs in the background and notices if I save a rendered image and then saves that open file under the same name that gave the just saved image. 
Is this even possible and if yes can you point me in the right direction? Or do I have to find another way of doing things? 
I have prior knowdledge of C# btw so you don't have to overly simplify explanations :)

Thanks in advance <3

why duf file center_point infor dn't matched the paramater in joint editor

$
0
0

for my piple, export the character to maya , and do animation in maya, and data back to daz for render. the problem is the character exported in maya , the joint orientate and position is't straight line that will make ik slover in maya happen error that value is strange and is not fix limition inside daz. so i dicide to fix the joint position and oritentate. when i modify the duf file, for the document know center_point and end_point  and oritenation item is value for  position and oritentation of joint. the problem is joint editor value and the valude in the duf is't the same. the value will less a little, very small, can some body tell the relation of value in duf and the value in joint editor ?

thank you.

Help: Assigning a "normal map" to a Material from a script doesn't work.

$
0
0

Hi there,

I have a script that takes a simple json and populate a material with texture maps. It's working perfectly for Diffuse, bump and Glossiness but doens't work on normal map.

The error I'm getting is  TypeError: Result of expression 'prop.setMap' [undefined] is not a function.

EDIT:::::  Nevermind I figured it out.  it seems like for Normal Map I need to use prop.setValue() instead of prop.setMap()..

Anyone knows why some properties requires setValue() instead of setMap() ?

Documenation for weightmaps/bone/skinbinding architecture and data-structures

$
0
0

The DAZ Studio Architecture Overview that comes with the SDK is very light on information about how vetercies are connected to bones and how it all works together.  Is it documented with examples somewhere else?

Giving Credit where credit is due...

$
0
0

I've been relying heavily on the forums here to solve many of my scripting issues (as most of us do). So, I was wondering if we are are supposed to give credit / acknowledgement for using snippets of the code that is provided by the actual Daz Site. Example : http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/properties/erc_freeze/start

Or are they free to use / modify? This is for a product for sale.

If we are supposed to give credit, where should we do that, since my script files will be encrypted in the final product.

ERCFreeze naming difficulties

$
0
0

I've been working on a script to automatically align the bones of Antenna to the head of whatever model they are attached to, then ERC freeze them, and Save the morph.

I've modified two of the Sample Scripts:

http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/properties/erc_freeze/start

http://docs.daz3d.com/doku.php/artzone/wiki/user/rbtwhiz/technotes/daz_script/node_properties/start

I use the Node Properties script to find and isolate and FHM head morphs, then pass them onto the ERCFreeze function.

			for( var i = 0; i &lt; aPROPERTIES.length; i++ ){
				oProperty = aPROPERTIES[ i ];
				oOwner = oProperty.getOwner();
								
				if( oOwner.className() == "DzMorph" &amp;&amp; (oProperty.getValue() != 0) ){
					sMorphName = oOwner.getName();
					sMorphName = sMorphName.toUpperCase();
					
					if ( (sMorphName.slice(0, 3)) == "FHM") {
					      oHeadMorph[nHeadMorphNum] = oProperty;

==================================================================================================

			// Define a controller;
 			oControllerNode = (oTrgtNode);
	 
			// Create and setup a controller property
			oControllerProperty = ( oHeadMorph[i] );
 			oControllerNode.addProperty( oControllerProperty );

While this technically works, it changes the NAME of the Controlling Property to VALUE, which is the actual name of the property. The real name is found by using oProperty.getOwner(). I don't want to create a NEW property, because then I'll have duplicate properties.

Using the oHeadMorph[i].getOwner() throws a null error, so I assume the FHM property is not compatible as an addProperty, while the child IS, but it's name is VALUE.

I still don't have an innate grasp of classes yet, so hard to wrap my head around. =/

Does anyone know how to attach an ERC Freeze to an Existing Controller? or how to REMOVE the current Morph controller, so I can just make a new one?

How to get joint orientation by daz script

$
0
0

I want get joint orientation by daz script, but fail.

Some joint result is true like Left Shoulder Bend,but some joint result is error.

I need help.

image

(function () {

function radialAngle() {

var pi = Math.PI;

return 180 / pi;

};

var bone = Scene.getPrimarySelection();

var nAngle = radialAngle();

var rot = bone.getLocalRot();

var rotOrder = bone.getRotationOrder();

 

var o = bone.getOrientation()

oEuler = o.getValue(rotOrder.firstAxis, rotOrder.secondAxis, rotOrder.thirdAxis);

oEulerD = oEuler.multiply(DzVec3(nAngle, nAngle, nAngle));

print(oEulerD)

})();


Help: Can't trigger action

Zero Pose of Node and all children Script

$
0
0

Hi All,

I quite often have to select a node and all its children and zero out their poses when I get in a mess. This could be a finger, a hand, a whole limb or the whole figure for that matter.

I found several scripts to hide a node and all it's children but nothing to zero poses. Can anybody give me an example script to do this?

Cheers

How to Save a rendered image & Add Canvases

$
0
0

Hello, I have just started with Daz scripting. I'm trying to load a file, add a canvas and save the rendered image as a png. I have been able to load a file, start the render and activate the canvases but I can't find out how to add an Emission or Glossy canvases. I have been able to render an image but I can't activate the render to file. Here is the current code:
 

var TempFile = "Z:/01Test.duf";
	
var oContentMgr = App.getContentMgr();
oContentMgr.openFile(TempFile, false);

print("scene Loaded");

var TempRenderer = App.getRenderMgr();
var TempRenderOptions = TempRenderer.getRenderOptions();

TempRenderOptions.renderImgFilename = "Z:/01TestSave.png";
TempRenderOptions.renderImgTarget = 2; // Direct to file (doesn't work)
TempRenderOptions.applyChanges();
//TempRenderOptions.renderImgTold = 2; // Tried this but also doesn't seem to work

print(TempRenderOptions.renderImgFilename);

if (!TempRenderer.doRender(TempRenderOptions))
	{
		MessageBox.critical("Render Canceled. ","Render","&amp;OK","");
	}
else
	{
		//TempRenderer.saveLastRender(); // Manual save
	}

var TempData = App.getRenderMgr().getRenderElementObjects();

if(TempData[1].name == "NVIDIA Iray Render Options")
	{
	if(TempData[1].getProperty(3).name == "Max Time")
		{

		var TempProperty = TempData[1].getProperty(3); // Max Time
		TempProperty.setValue(200);
		print("Max Time:"+TempProperty.getValue());

		TempData[1].renderToCanvases = true;

        // I have manually added a canvas for testing how to add one and this gives me it's name but I can't add one by script
		print("Canvas:"+TempData[1].getCanvasDefinition(0).name);

		//TempData[1].clearCanvasDefitions();
		}
	else
		{
			MessageBox.critical("Property 'Max Time' not found.","Render","&amp;OK","");
		}
	}
else
	{
		MessageBox.critical("Could not find 'NVIDIA Iray Render Options'.","Render","&amp;OK","");
	}

print("Script Ended.");

This thread has helped a lot but I'm missing information on how to add a canvas: https://www.daz3d.com/forums/discussion/196346/how-to-access-advanced-section-in-iray-render-settings

Thanks.

Rendering a large amount of images. Help me please!

$
0
0

Hi everyone!

I must render a large number of images by configuring a scene in a script and calling the render() method from DzRenderer. I'm rendering them with iray.
I faced with two problems and couldn't find a solution on my own.
1. Sometimes the scene is too complex so the rendering of single image can take a long time. It is necessary to somehow automatically cancel rendering if it lasts a very long time. Is it possible to track the rate of change of iterations when calling render() method? The MaxTime parameter from the render settings is not my solution :(
2. I noticed that with sequential rendering, sometimes there are problems with clearing memory in the GPU. It looks like the memory accumulates with each new picture, but sometimes it clears normally. Is there some way to control this?

DAZ TO BLENDER HD does not appear.

$
0
0

I can't find this option DAZ TO BLENDER HD.
How do I install and use?

 

DzCustomMDLBrick creation

$
0
0

In 4.8.0.3, the shader mixer got support for auto creating a custom MDL brick. Is this functionality accesible via scripting?

getAutoAddParameter() works great to connect parameters between bricks, but I've got to get the parameters in the first brick first. I can use loadMDLModule() to read a module in and get a DzIrayMDLModule containing the DzMDLDefinition(s), but I cannot find a way to autopopulate DzCustomMDLBrick.

Do I have to manually create the parameters at this point?

Accessing object's surface mats

$
0
0

How do I access an object's (or figure) surface materials?


Script that changes the library folder in the content Manager

$
0
0

Please tell me how to use the script to change the location of the library folder. So that I can add or remove libraries without going to the content Manager.

Adding support files to a product

$
0
0

Can anyone point me to how to add support files to a DzProductAssetContainer?

Open an text file on Mac

$
0
0

Hi there,

my beloved Content Wizard can easily call a texteditor to edit some values. Problem: That only works on windows. On Mac it won't. Does anybody know how to send a file to the Mac native Textedit.app or call the app to do some edits?

Thanks!

X rotate not working

$
0
0

Ok so, I'm trying to write a script that will change the values or set the values in the whole timeline. The script is as below-

 

var g8 = Scene.getPrimarySelection();

var skeleton = Scene.getSelectedSkeletonList ();

for (var fig_idx = 0; fig_idx != skeleton.length; ++ fig_idx) {

var bone = skeleton[fig_idx].findBoneByLabel ("Right Shoulder Bend");

c = bone.getXRotControl ();

c1 = bone.getYRotControl ();

c2 = bone.getZRotControl ();

//c.setValue (c.getValue () + 15 );

//c1.setValue (c1.getValue () - 15 );

}

 

var msg = c.getValue();

MessageBox.information( msg, " is the value.", "&OK" );

//return;

Now, the issue here is that when I use the function getXRotControl(), it's returning zero, while the value on the dial is -5.59, while both the Y and Z rotation values are showing properly, its only the x values I'm unable to get. While everything is working for all the other bones. This means that the function getXRotControl() is not working properly for the bones "Right Shoulder Bend" and "Right Shoulder Twist" and also for left shoulders too. I need to add +15 twist to each frame, since twist dial is red, it corresponds to x rotate.

Multi-pass rendering script freebie for DAZ Studio

$
0
0

Update:

New version for Iray:

https://www.daz3d.com/forums/discussion/451996/free-script-simple-multi-pass-render-iray#latest

 

-------------------------
Update log:
2015-05-17
* add Esemwy's work of github as latest version
* re-upload dhtapp's work since they're gone from the bad dropbox
--------------------------


Here is why you need Multi-pass rendering:
https://www.youtube.com/watch?v=F79cgGPEU_k


Latest version from Github by Esemwy:
----------------------------------------------------------
Post:
http://www.daz3d.com/forums/viewreply/775570/

Github project:
https://github.com/esemwy/SimpleMultiPassRender


Version from dhtapp to make it work with AoA:
--------------------------------------------------------------------
Post:
http://www.daz3d.com/forums/viewreply/676252/

re-uploaded file:
http://www.mediafire.com/download/ndo4xg2o5bu80vn/SimpleMPRLightsPreserved.zip


Verion from me:
-------------------------------------
Since I can't find a free script to do a multi-pass rendering, I just write one for everyone.

SimpleMultiPassRender:
http://www.mediafire.com/download/8aoqwmowppjr7xo/SimpleMultiPassRender.zip

How to use:
Unzip, then put this script under your Content->Script folder.

When using, it will automatically render each light into different images, nothing more.

Just made a little change from mCasual/Jacques's mcjListRender.dsa, thanks for his amazing work, really helps much.

Viewing all 1025 articles
Browse latest View live


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