Daz Need help with daz eyes issue .

GNVE

Active Member
Jul 20, 2018
724
1,185
If you are far out from the zero point (where the perspective view focusses when you load up a scene) that might cause issues. Group the whole scene and move it closer to the zero point if you are far out.
If you are close to the zero point you could also try another eye material to see if that resolves it (or even reloading the one you are using now).
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,566
7,382
GNVE has identified the usual cause. Note that if you go over to the Daz forums, in the Daz Studio / Scripting forum, someone posted a "recenter in world" script. Select your character, run the script, and it shifts everything in the scene so that the selected item is at 0,0,0. Saves a lot of fiddling.
 

tk99

Active Member
Jun 3, 2019
507
583
GNVE has identified the usual cause. Note that if you go over to the Daz forums, in the Daz Studio / Scripting forum, someone posted a "recenter in world" script. Select your character, run the script, and it shifts everything in the scene so that the selected item is at 0,0,0. Saves a lot of fiddling.

And I thought I had all important scripts installed!

TY
 

Falcon6

Active Member
Mar 15, 2018
650
4,228
Here's the DAZ forum thread with the scripting...
Just found this thread and looked at the linked daz3d forum post. Two questions (request also if applicable):

1. Towards the bottom of the daz forum post there is a second "script" in a long single line format that supposedly moves everything including any locked items. Is this still applicable? And if so...

2. I have no idea how to copy/paste that script into a working Notepad format to make it work. I tried comparing it to the first post in the thread as guidance, but obviously there are differences that non-script writing people (me) wouldn't comprehend. If the second script would still be applicable to the current version of Daz Studio, can someone convert it to a Notepad file and upload it for a quick download here?

Thanks for any clarification/assistance.
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,380
8,648
Just found this thread and looked at the linked daz3d forum post. Two questions (request also if applicable):

1. Towards the bottom of the daz forum post there is a second "script" in a long single line format that supposedly moves everything including any locked items. Is this still applicable? And if so...

2. I have no idea how to copy/paste that script into a working Notepad format to make it work. I tried comparing it to the first post in the thread as guidance, but obviously there are differences that non-script writing people (me) wouldn't comprehend. If the second script would still be applicable to the current version of Daz Studio, can someone convert it to a Notepad file and upload it for a quick download here?

Thanks for any clarification/assistance.
In reference to the above issue with the ring around the eyes? Scripts are completely unnecessary for it. Just change the Instancing Optimization from Auto to Speed or Memory in Render Settings.

eyes.png
 

function2020

Newbie
May 20, 2020
30
13
Just found this thread and looked at the linked daz3d forum post. Two questions (request also if applicable):

1. Towards the bottom of the daz forum post there is a second "script" in a long single line format that supposedly moves everything including any locked items. Is this still applicable? And if so...

2. I have no idea how to copy/paste that script into a working Notepad format to make it work. I tried comparing it to the first post in the thread as guidance, but obviously there are differences that non-script writing people (me) wouldn't comprehend. If the second script would still be applicable to the current version of Daz Studio, can someone convert it to a Notepad file and upload it for a quick download here?

Thanks for any clarification/assistance.
same, just saw this thread, the one longer sentence can be used (so I didn't try the first one), but it need to be cut to few sentences, you can simply cut(enter) from every long space .
However, it has a problem, I'm trying to fix it, so is studying JS now. :D almost done
Its problem is, if you have a Group of camera, after running this script, all cameras in the group can not orbit and rotate with any object you focused, the orbit trail is weird and difficult to use.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,566
7,382
In reference to the above issue with the ring around the eyes? Scripts are completely unnecessary for it. Just change the Instancing Optimization from Auto to Speed or Memory in Render Settings.
Yes, this does address this problem, however there are other problems that will also occur when you're too far from the (0,0) point as well, so understanding the cause of the problem is important. Another artifact that you'll sometimes see when too far away are funny black lines on the forehead due to the interaction between the forehead and hair cap.

All of this has to do with the fact that iRay optimizes memory in the GPU by using floating point numbers that have limited numbers of digits, and so when you're far away from (0,0) it has trouble keeping "nearly intersecting" surfaces from actually intersecting. By example, when you're near zero, you can have digits like this 1.0001, so things separated by 0.01 are kepty separate, but when you're far away you get fewer to the right of the decimal - like 1000.1, so things separated by 0.01 can't be.
 

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,308
All of this has to do with the fact that iRay optimizes memory in the GPU by using floating point numbers that have limited numbers of digits, and so when you're far away from (0,0) it has trouble keeping "nearly intersecting" surfaces from actually intersecting. By example, when you're near zero, you can have digits like this 1.0001, so things separated by 0.01 are kepty separate, but when you're far away you get fewer to the right of the decimal - like 1000.1, so things separated by 0.01 can't be.
The thing I don't understand is why swapping instance optimization actually works. I remember reading about it on Daz forum, but can't find that particular post. Fair bet is that is recalculate the floating point but I'm not sure why it's happening at all (nor it is on Nvidia or Daz side). It's like software mystery lol.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,566
7,382
The thing I don't understand is why swapping instance optimization actually works. I remember reading about it on Daz forum, but can't find that particular post. Fair bet is that is recalculate the floating point but I'm not sure why it's happening at all (nor it is on Nvidia or Daz side). It's like software mystery lol.
Actually, that I know, because I read a long and ridiculously technical article about it. When you set the instance optimization setting the way you suggested, there's a side effect where iRay actually "recenters" the world around the current camera. Which, effectively, puts the camera at (0,0), which eliminates the floating point problem in most cases, because by the time you're far enough away for it to show up, the artifacts are usually too small to see.

When I read that, I asked myself, "Self, why the hell don't they do that always?" The reason is that, by doing this, you aren't necessarily always centered within things like HDRI's, which remain centered at the real (0,0). Ditto with "skydomes" and distant lights and things like that. So, by artificially altering the origin, iRay could potentially introduce artifacts or distortions into the render, so, by default, they don't do it. But, apparently, the iRay engineers thought to themselves, "Self, if they're telling us to do something other than the default with instances, then they're apparently willing to accept tradeoffs in the result of the render. Caveat Renderer." It doesn't make a lot of sense to me, but the fact that recentering is a side effect of that setting change does explain why it "fixes" the artifact. (Possibly at the cost of others...)
 

function2020

Newbie
May 20, 2020
30
13
Ok, as mentioned above, I found a problem for that script (actually I think it is a bug for DAZ3D), now I fixed it by adding some actions to set camera groups' coordinate to 000. Here is the whole script:
JavaScript:
// DAZ Studio version 4.12.1.118 filetype DAZ Script
// Origin by OMNI at https://www.daz3d.com/forums/discussion/284301/world-recenter-script-feedback-sought
// modified by function to fix camera group problem
/* Use it: select the object that want to put as world center, run this script, done, and can undo.*/
(function(){
    function repositionNode (oNode)
    {
        if (oNode.isRootNode())
        {
            // Unlock locked controls before repositioning
            var aFunctions = [oNode.getXPosControl, oNode.getYPosControl, oNode.getZPosControl];
            var bLockTracker = [false, false, false]
            aFunctions.forEach (function (control, i) { if (control().isLocked()) control().lock (bLockTracker[i]++) });

            // Reposition node
            oNode.setWSPos (oNode.getWSPos().subtract (vecOffset));

            // Restore locked controls
            aFunctions.forEach (function (control, i) { if (bLockTracker[i]) control().lock (true) });
        }
    }

    if (Scene.getNumSelectedNodes() != 1)
        MessageBox.warning ("Please select a single item in the scene before invoking this script", "Selection Error", qsTr ("&OK"), "");
    else
    {
        // Get selected nodes offset from world origin
        var vecOffset = Scene.getSelectedNode (0).getWSPos();

        beginUndo();
        Scene.getNodeList().forEach (repositionNode);

/**********below script is for CameraGroup_to_WorldCenter*************/       
// DAZ Studio version 4.16.0.3 filetype DAZ Script
/* This script is to reset all Camera Groups' coordinate to
 world center 0,0,0 in a scene, to avoid camera orbit problem. */

// get all scene nodes list
var aAllNodes = Scene.getNodeList();
var nAllNodes = aAllNodes.length;
// Iterate over all scene nodes
for (var i1 = 0; i1 < nAllNodes; i1 += 1) {
    // Get the 'current' node
    var oNode = aAllNodes[i1];
    // set its parent node
    var oParent = oNode.getNodeParent();
    // check if current node is a Camera
    if (oNode.isViewCamera) {
        // check if node has parent
        if (oParent) {
            // Get all of the child nodes of the camera parent
            var aNodes = oParent.getNodeChildren(true);
            // Get the number of nodes
            var nNodes = aNodes.length;
            // Iterate over all cameras
            for (var i = 0; i < nNodes; i += 1) {
                // Get the 'current' camera
                var oCamera = aNodes[i];
    /* get each Camera's World position & rotation, clear its Local position & rotation,
    delete all its keyframes, and set its Local p & r to its World p & r. */
                var p = oCamera.getWSPos();
                var r = oCamera.getWSRot();
                oCamera.getXRotControl().deleteAllKeys();
                oCamera.getYRotControl().deleteAllKeys();
                oCamera.getZRotControl().deleteAllKeys();
                oCamera.getXPosControl().deleteAllKeys();
                oCamera.getYPosControl().deleteAllKeys();
                oCamera.getZPosControl().deleteAllKeys();
                oCamera.setLocalPos(p);
                oCamera.setLocalRot(r);
            }
     // finally clear Camera Group's world position and rotation and delete keyframes.
            oParent.getXRotControl().deleteAllKeys();
            oParent.getYRotControl().deleteAllKeys();
            oParent.getZRotControl().deleteAllKeys();
            oParent.getXPosControl().deleteAllKeys();
            oParent.getYPosControl().deleteAllKeys();
            oParent.getZPosControl().deleteAllKeys();
        }
    }
}
/**********end of script for CameraGroup_to_WorldCenter**************/       
        acceptUndo("Reposition to world center");
    }
})();
To use it, simply copy it to notepad, save as worldReCenter.dsa, put it to a folder that you can find in your DAZ Content Library, and run it.
 

Impious Monk

Active Member
Game Developer
Oct 14, 2021
626
2,808
Ok, as mentioned above, I found a problem for that script (actually I think it is a bug for DAZ3D), now I fixed it by adding some actions to set camera groups' coordinate to 000. Here is the whole script:
JavaScript:
// DAZ Studio version 4.12.1.118 filetype DAZ Script
// Origin by OMNI at https://www.daz3d.com/forums/discussion/284301/world-recenter-script-feedback-sought
// modified by function to fix camera group problem
/* Use it: select the object that want to put as world center, run this script, done, and can undo.*/
(function(){
    function repositionNode (oNode)
    {
        if (oNode.isRootNode())
        {
            // Unlock locked controls before repositioning
            var aFunctions = [oNode.getXPosControl, oNode.getYPosControl, oNode.getZPosControl];
            var bLockTracker = [false, false, false]
            aFunctions.forEach (function (control, i) { if (control().isLocked()) control().lock (bLockTracker[i]++) });

            // Reposition node
            oNode.setWSPos (oNode.getWSPos().subtract (vecOffset));

            // Restore locked controls
            aFunctions.forEach (function (control, i) { if (bLockTracker[i]) control().lock (true) });
        }
    }

    if (Scene.getNumSelectedNodes() != 1)
        MessageBox.warning ("Please select a single item in the scene before invoking this script", "Selection Error", qsTr ("&OK"), "");
    else
    {
        // Get selected nodes offset from world origin
        var vecOffset = Scene.getSelectedNode (0).getWSPos();

        beginUndo();
        Scene.getNodeList().forEach (repositionNode);

/**********below script is for CameraGroup_to_WorldCenter*************/      
// DAZ Studio version 4.16.0.3 filetype DAZ Script
/* This script is to reset all Camera Groups' coordinate to
world center 0,0,0 in a scene, to avoid camera orbit problem. */

// get all scene nodes list
var aAllNodes = Scene.getNodeList();
var nAllNodes = aAllNodes.length;
// Iterate over all scene nodes
for (var i1 = 0; i1 < nAllNodes; i1 += 1) {
    // Get the 'current' node
    var oNode = aAllNodes[i1];
    // set its parent node
    var oParent = oNode.getNodeParent();
    // check if current node is a Camera
    if (oNode.isViewCamera) {
        // check if node has parent
        if (oParent) {
            // Get all of the child nodes of the camera parent
            var aNodes = oParent.getNodeChildren(true);
            // Get the number of nodes
            var nNodes = aNodes.length;
            // Iterate over all cameras
            for (var i = 0; i < nNodes; i += 1) {
                // Get the 'current' camera
                var oCamera = aNodes[i];
    /* get each Camera's World position & rotation, clear its Local position & rotation,
    delete all its keyframes, and set its Local p & r to its World p & r. */
                var p = oCamera.getWSPos();
                var r = oCamera.getWSRot();
                oCamera.getXRotControl().deleteAllKeys();
                oCamera.getYRotControl().deleteAllKeys();
                oCamera.getZRotControl().deleteAllKeys();
                oCamera.getXPosControl().deleteAllKeys();
                oCamera.getYPosControl().deleteAllKeys();
                oCamera.getZPosControl().deleteAllKeys();
                oCamera.setLocalPos(p);
                oCamera.setLocalRot(r);
            }
     // finally clear Camera Group's world position and rotation and delete keyframes.
            oParent.getXRotControl().deleteAllKeys();
            oParent.getYRotControl().deleteAllKeys();
            oParent.getZRotControl().deleteAllKeys();
            oParent.getXPosControl().deleteAllKeys();
            oParent.getYPosControl().deleteAllKeys();
            oParent.getZPosControl().deleteAllKeys();
        }
    }
}
/**********end of script for CameraGroup_to_WorldCenter**************/      
        acceptUndo("Reposition to world center");
    }
})();
To use it, simply copy it to notepad, save as worldReCenter.dsa, put it to a folder that you can find in your DAZ Content Library, and run it.
Thank you for sharing!
 
  • Like
Reactions: function2020

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,308


3.6.2 Increasing computational precision and accuracy

When instancing mode is set to “on”, “auto” or “user”, the scene is automatically shifted in space. This increases the precision and accuracy of rendering computations and reduces precision artifacts that originate from self-intersection. To disable this behavior, set bool instancing_shift_camera to “false”.

It is also possible to force an update of the scene shifting by calling the API method IScene::set_dirty at the beginning of a frame with a flag value that marks the instance transforms as dirty. This is recommended if the camera was moved a long distance (like when rendering new frames of an animation, or the user interactively changing it over time), as there is no automatic update of the shifting in order to avoid unexpected stutter through scene updates when moving the camera.

\o/