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

Face Transfer Automation - Referencing Existing Widgets - Help

$
0
0

I am trying to automate the process of face transfer.

 

The idea is to pass the file path and gender type to a function. The function will then use the image and generate the model.

My initial approach was to use the DzFaceTransferSelectImageAction. But this prompts the browse to locate image dialogue, which beats the whole purpose of automation.

In order to bypass, I need to either get the function that is invoked by the Action (which I don't know due to the lack of documentation). The second option is to reference the combo box widget, and populate it with the file path without ever interacting with the locate image dialogue. The rest of the steps are easy.

Here is the code:

oPaneMgr = MainWindow.getPaneMgr()
actionMgr = MainWindow.getActoinMgr()

// Reference the pane
oFTPane = oPaneMgr.findPane("DzFaceTransferPane")

// Reference the options menu
options = oFTPane.getOptionsMenu().getItemList()

// Trigger the select image
// This is the part I want to change since it prompts the select image dialogue
actionMgr.findAction("DzFaceTransferSelectImageAction").trigger()

// Generate model (I will add a conditional whether the passed parameter for gender is male or female)
actionMgr.findAction("DzFaceTransferGenerateMaleAction").trigger()

I have tried to get the reference to the combo box using this method

var CMB = oFTPane.findChild("FaceTransferSourceImageCmb")

However, this doesn't work. It results in the following error:

TypeError: Result of expression oFTPane.findChild [undefined] is not a function

I am not sure why. It seems that the findChild() method is not included in the DzPane, even though it inherits from the QObject class which does have this method.

http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object_q

I have looked up Rob's examples for making a silenced importer/exporter and they will come very handy at a later stage. But, I can't apply them here. To change the image dialogue settings, I need to call the function directly, not the action itself.


So, to summaerize:

- Is there a way for me to locate an existing widget on a pane?

- Is there a way to get the function names the are executed by an Action? CallBack methods?

- Is there a different way to achieve the desired effect (silencing the image dialogue and passing a file path)?

Any help is much appreciated. Thanks in advance.
 


Viewing all articles
Browse latest Browse all 1036

Trending Articles



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