how do i fix model beak while i using script morphing
how do i fix model break while i using script morphing like eye is missing , alien face
// DAZ Studio version 4.22.0.1 filetype DAZ Script
// Initialize empty arrays and retrieve a list of nodes from the scene
Names = [];
Nodes = Scene.getNodeList();
// Loop through each node obtained from the scene
for (i = 0; i < Nodes.length; i++) {
obj = Nodes[i].getObject();
// Check if the node object exists
if (obj !== null) {
NM = obj.getNumModifiers();
// Iterate through the modifiers of the current node
for (j = 0; j < NM; j++) {
Modifier = obj.getModifier(j);
// Check if the modifier is of type 'DzMorph'
if (Modifier.inherits("DzMorph")) {
Name = Modifier.name;
// Check if the modifier name contains 'Head', excluding 'Proportion' and 'ForeHead'
if (Name.indexOf("Head") !== -1 &&
Name.indexOf("Proportion") === -1 &&
Name.indexOf("ForeHead") === -1) {
// Wait until a specific file "1.txt" exists in the specified directory
while (true) {
isFile = DzFileInfo("C:\\Users\\hunte\\Music\\RTBP\\DzPyWorkplace\\1.txt").isFile();
if (isFile) {
break;
}
}
// Retrieve the control for adjusting the modifier value
ValueControl = Modifier.getValueControl();
Max = ValueControl.getMax();
Min = ValueControl.getMin();
numRanges = 20;
interval = (Max - Min) / numRanges;
// Capture images at different modifier values and save them in a directory
Dv = ValueControl.getValue();
for (n = 0; n <= numRanges; n++) {
value = (Min + interval * n).toFixed(1);
ValueControl.setValue(value);
viewportMgr = MainWindow.getViewportMgr();
activeViewport = viewportMgr.getActiveViewport();
threeDViewport = activeViewport.get3DViewport();
Image = threeDViewport.captureImage();
Image.save("C:\\Users\\hunte\\Music\\RTBP\\DzPyWorkplace\\_" + value + ".png");
}
// Reset the modifier value to its original value
ValueControl.setValue(Dv);
// Rename "1.txt" to "0.txt" and read the content of "1.txt" to retrieve a float value
DzFile("C:\\Users\\hunte\\Music\\RTBP\\DzPyWorkplace\\1.txt")
.rename("C:\\Users\\hunte\\Music\\RTBP\\DzPyWorkplace\\0.txt");
// Wait for the file "1.txt" to be available again and set the modifier value to the retrieved float value
while (true) {
isFile = DzFileInfo("C:\\Users\\hunte\\Music\\RTBP\\DzPyWorkplace\\1.txt").isFile();
if (isFile) {
Line = DzFile("C:\\Users\\hunte\\Music\\RTBP\\DzPyWorkplace\\1.txt").read();
floatValue = parseFloat(Line);
if (!isNaN(floatValue)) {
ValueControl.setValue(floatValue);
}
break;
}
}
}
}
}
}
}