Digital Art Zone

 
     
UI widget questions—hopefully now in correct forum
Posted: 19 December 2012 10:38 PM   [ Ignore ]
Member
Avatar
Rank
Total Posts:  47
Joined  2007-10-22

I’ll try to collect and collate what I’ve already got into this forum thread.

For starters:

What this thread is all about:


Here’s a PDF from a presentation from Jeremy Ernst given at the 2011 Game
Developer’s Conference, called “Fast and Efficient Facial RIgging.” He
describes the system he created for Gears of War 3, including using FACS for
the face.

http://jeremyernst.wordpress.com/2011/03/30/fast-and-efficient-facial-rigginggdc-2011-talk/

http://www.unrealengine.com/files/downloads/Jeremy_Ernst_FastAndEfficietFacialRigging2.pdf

I want it. 


Except I want it as a semi-transparent widget overlaying the 3D window.

Like this:

Image Attachments
Screen_Shot_2012-12-05_at_7.43_.17_AM_.png
Profile
 
 
Posted: 19 December 2012 10:48 PM   [ Ignore ]   [ # 1 ]
Member
Avatar
Rank
Total Posts:  47
Joined  2007-10-22

I made that widget ui in Qt Designer, an app included with DAZ Studio 4.5.

But now I have to hook up the sliders of this _non-standard_ interface to manipulate the morph values (not the deltas).

I have considered the SDK, but the simplest, most straightforward way seems to be to use Daz Script. 
In doing so, the widget will be customizable.  Just go into Qt Designer, move the sliders to where you want them, then hook up the code to the parameters you want to move.

What I know so far:

The code should probably be put into a .dsa file.

I don’t want to iterate through morph names.  I want a one-to-one correspondence, coded out in longhand.  In that way, idiots such as myself can simply go in and change the morphname in the .dsa when they put a different morphname in the .ui.  See Jeremy Ernst’s presentation for the reason why.

In the first line I want to tell the script to use the user interface FACS.ui, which will be located in the folder FACS, the same folder as the script file, FACS.dsa. The way to do that may or may not be:


//Declare and hook up the ui

var sUiPath =  String(“FACS/FACS.ui”);
var oUiFile = new DzFileInfo( sUiPath );

// Call the FACS widget into existence.

Then make sure it exists.

if( oUiFile.exists() )

Then make it appear in the pane, or nested inside the nested widgets.


// Call the sliders QSliders into existence.
// Connect morphvalue names such as CTRLMouthOpen to the corresponding QSlider with that name
// Use Signals/Slots concept to make the sliders do exactly what the Parameters controls would do

          } else {
          MessageBox.information( sUiPath, “The Cake is a Lie”, “&OK;” );
}

-=-=-

Hopefully this script will change and develop as I learn more.


Problems and issues:

I can’t find the syntax to call the .ui file.  Rob’s coding examples show how to call nested .ui’s. I successfully tested this theory by replacing “Select the property group from the list on the left” with “THE CAKE IS A LIE” in the “What do I do?” widget.

Also, the example code formats the widget to match the other panes/widgets in the user interface.  That formatting would make this widget useless.

 

Profile
 
 
Posted: 20 December 2012 12:41 PM   [ Ignore ]   [ # 2 ]
Member
Avatar
Rank
Total Posts:  47
Joined  2007-10-22

Tugpsx was kind enough to contribute a slider script.

// DAZ Studio version 3.1 filetype DAZ Script

var wDlg = new DzDialog;
var box = new DzVGroupBox(wDlg);
box.width=300
box.height=200
var w = new DzEnumSlider( box )
w.addItem( “oh” )
w.addItem( “my” )
w.addItem( “Bob” )
w.value = 2;

// setup button to update debug results
but = new DzPushButton( box );
but.text = “debug”;
connect( but, “clicked()”, butclicked )// click button to show update in debug
wDlg.width=300
wDlg.height=200
wDlg.exec()

function butclicked()
{
debug( “val = ” + w.value );


I put this into a .dsa file, put the .dsa file into the Sripts folder in the content directory ran it from Content Manager, and this popped up:
Very cool.

Image Attachments
Screen_Shot_2012-12-20_at_11.30_.21_AM_.pngScreen_Shot_2012-12-20_at_11.30_.48_AM_.pngScreen_Shot_2012-12-20_at_11.31_.05_AM_.png
Profile
 
 
Posted: 20 December 2012 01:22 PM   [ Ignore ]   [ # 3 ]
Member
Avatar
Rank
Total Posts:  47
Joined  2007-10-22

I have gone to Window/Tabs/Script IDE and pasted in the script as follows, and got the following results.

Note: As a former technical writer, a parent, and a current student of all that is DAZ, I know it’s important to start excruciatingly simple and to be visual.  So here goes:

Image Attachments
Screen_Shot_2012-12-20_at_12.18_.48_PM_.png
Profile
 
 
Posted: 20 December 2012 02:05 PM   [ Ignore ]   [ # 4 ]
Member
Avatar
Rank
Total Posts:  47
Joined  2007-10-22

Some screenshots playing around with the standard widget examples in the documentation:

Image Attachments
Screen_Shot_2012-12-20_at_12.39_.52_PM_.pngScreen_Shot_2012-12-20_at_12.40_.28_PM_.pngScreen_Shot_2012-12-20_at_12.41_.20_PM_.pngScreen_Shot_2012-12-20_at_1.01_.32_PM_.png
Profile
 
 
Posted: 20 December 2012 10:09 PM   [ Ignore ]   [ # 5 ]
Member
Avatar
Rank
Total Posts:  47
Joined  2007-10-22

http://forumarchive.daz3d.com/viewtopic.php?t=160742
This link might be helpful.

http://doc.qt.digia.com/qsa-1.2.2/language.html
And this one.

So does the DAZ Script IDE window equal the QSA Workbench, then?

http://doc.qt.digia.com/qsa-1.2.2/getting-started.html

Profile