case study: using qt to develop advanced guis & advanced visualization software

37
DAZ Studio Advanced 3D Graphics Empowered by Qt

Upload: qt-project

Post on 12-May-2015

2.805 views

Category:

Technology


0 download

DESCRIPTION

DAZ 3D strives to bring 3D art to the masses by delivering the highest quality 3D digital content and software at the most affordable prices. DAZ Studio is a free, feature rich 3D figure design and 3D animation tool that enables anyone to create stunning digital imagery. This is the perfect tool to design unique digital art and animation using virtual people, animals, props, vehicles, accessories, environments and more. In April of 2004, DAZ started the Public Beta release stage of development for DAZ Studio after two years of development. In June 2009, DAZ Studio v3.0 was released both as a free version and a monetized advanced version. This presentation will explain why Qt was originally selected, what benefits have been realized from it’s use in DAZ Studio, and what DAZ 3D’s experience has been in porting there app from Qt3.3 to Qt4.5. Specific topics will include scripting implementation, cross-platform compatibility, UI versatility, upgrade porting issues/experiences, benefits of the 4.5 opensource version, and styling benefits. Presentation by Tyson Ratliff and Jarom Schow held during Qt Developer Days 2009. http://qt.nokia.com/developer/learning/elearning

TRANSCRIPT

Page 1: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ StudioAdvanced 3D Graphics Empowered by Qt

Page 2: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ 3D

1

Page 3: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ 3D

• DAZ 3D – What we’re all about– “Unleash the Artist Within”

• Bring 3D art to the masses.

– High quality virtual 3D figures and content.– Innovative software which enables anyone to create

artistic images.– A synergistic community which learns, shares, and

grows together.

2

DAZ 3D

Page 4: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ 3D

• History of DAZ 3D– DAZ 3D began as a division of the Zygote Media

Group creating realistic virtual figures.– In December of 2000 it became an independent

corporation and shortly after opened an online store for 3D figures and content at www.daz3d.com.

– Since then it has grown to provide software applications which help users get the most out of their virtual content.

3

Page 5: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ Studio

4

Page 6: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ Studio

• In the beginning DAZ 3D had some great 3D figures and content, but relied on another company’s software to display this content.

• We needed a way to showcase our content and remove our reliance on 3rd party applications.

• DAZ Studio was born.

5

Page 7: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ Studio

• DAZ Studio is a feature rich 3D figure modeling, posing, and animation tool.

• It’s a vehicle for getting 3D content into the hands of users.– Get it into as many hands as possible.– It’s free!

• It pushes 3D content to new heights with new ideas and innovations.

6

Page 8: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ Studio

• Designing DAZ Studio– We needed an app with a unique and custom look.– We needed an application framework that would give

quick and flexible results.– We needed Windows and Mac versions.– We needed a scriptable application.

• Qt fit perfectly into our goals.

7

Page 9: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

DAZ Studio

• Why Qt?– Versatility of interface components– Cross platform support– Ease of development– Integrated scripting capability

• Since DAZ Studio’s inception in 2002 we’ve relied heavily on Qt, and it has been a huge benefit.

8

Page 10: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

9

Page 11: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

• Some applications need to look native to a specific platform – Qt does this well.

• With other applications, you often want a unique and eye-catching look. – Qt also does this well.

• We want anyone who sees DAZ Studio to be drawn in and have to try it.

• Here’s what we came up with:

10

Page 12: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

11

Page 13: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Just Kidding!

12

Page 14: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

13

Page 15: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

14

Page 16: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

15

Page 17: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

• Familiar widgets can still have unique style– Content pane using Model/View architecture

• Completely new widgets are also easy to create– Puppeteer – innovative user interface for posing and

shaping figures• OpenGL Widgets for real-time 3D displays

16

Page 18: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

17

Page 19: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

• Styles– We wanted a way to easily change the whole look of

the application through “skins” or styles.– This was before CSS styles were introduced in Qt4.– We created an XML based style system which

controls how widgets are drawn.– The style defines a set of drawing commands for how

each widget should be drawn depending on its current state.

– Supports images and basic drawing operations.

18

Page 20: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

• Styles– Savvy users are able to create their own styles.– We’re able to mimic the look of other applications in

our lineup, so users can have more familiar and consistent experiences.

– Most of this would have been very difficult without the powerful styling framework that Qt already had.

– We’re currently exploring Qt Style sheets and are excited for the possibilities they’ll provide.

19

Page 21: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

UI Versatility

• Layouts– Not all users have the same work flow.– Qt provides the flexibility to create completely

customizable window layouts.– Layouts can be arranged by the user and saved for

later use.– Users can quickly switch between multiple layouts

based on the tasks at hand.

20

Page 22: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Cross Platform Support

21

Page 23: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Cross Platform Support

• Whether Windows, Mac OS X, Linux, or any other supported system, Qt makes it easy to support multiple platforms.

• Design interface elements once, and they just work on other platforms.

• No need to deal with often complicated setup for native windows, widgets, file IO, etc.

• Spend less time worrying about details and more time getting stuff done.

22

Page 24: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Cross Platform Support

• Porting DAZ Studio to Mac was straightforward.– Initially DAZ Studio was developed on Windows.– Basic functionality was working in about 2 weeks.– It would not have been possible without Qt.– Most development is still done on Windows, without

having to worry that it won’t work on Mac OS X.

23

Page 25: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Scripting Support

24

Page 26: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Scripting Support

• Scripting support in an application is something that may not seem very useful at first, but it provides a lot of flexibility and power.– Gives the end user the ability to add the functionality

that they need.– Allows for features that may not be fully known at the

time of release.– Gives developers tools for prototyping and testing.

• Qt makes it really easy to have full scripting capabilities.

25

Page 27: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Scripting Support

• A Scripting interface was an important design goal for DAZ Studio.

• Originally we used the open-source SWIG toolkit to generate Python Bindings.

• When QSA (Qt Script for Applications) was introduced for Qt 3, we were early adopters.

• QSA made a scripting interface for DAZ Studio much easier to create and maintain.

• The same classes that provide the plug-in SDK also provide the scripting interface.

26

Page 28: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Scripting Support

• In Qt 4, QSA has been replaced by QtScript.• QtScript is now a part of the core Qt framework and is

more standards compliant.• Scripting provides many benefits to our users:

– Many tasks in DAZ Studio have been automated with scripts– Content presets are provided as scripts – figure poses, material

settings, animation data, etc.– Many 3rd party add-ons for DAZ Studio are available as scripts.– A Scripting language makes DAZ Studio very easy for the user

to extend – only basic programming knowledge is required.

27

Page 29: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Ease of Development

28

Page 30: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Ease of Development

• Qt provides a framework that makes new development for DAZ Studio relatively easy.

• New engineers, and even interns, have been able to make meaningful contributions in a relatively short time.

• The DAZ Studio plug-in SDK, which is rooted heavily in Qt, makes it easy to extend DAZ Studio with new functionality.

• A number of 3rd party plug-in developers have expressed that DAZ Studio is one of the easiest applications they’ve developed for – in part due to Qt.

29

Page 31: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Ease of Development

• Open Source benefits– In Qt 3, DAZ Studio plug-in developers were required

to license the Qt framework.– This was cost-prohibitive to many.– In Qt 4.5, the addition of LGPL licensing enabled us

to make the DAZ Studio SDK freely available, and has generated a lot of new interest.

– There is no barrier to entry except knowledge.– This creates a rich and productive add-on community.

30

Page 32: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Ease of Development

• Recently, we developed 64-bit versions of DAZ Studio and Carrara for Windows and Mac OS X.

• The move to 64-bit for DAZ Studio was very smooth, thanks in large part to Qt.

• The move to 64-bit for Carrara was more problematic.• On Mac OS X, the 64-bit move required us to change from using

Apple’s Carbon framework to the new Cocoa framework.• After researching the required changes, it was decided to move to

Qt instead, which can handle the Cocoa interface for us.• The application event loop and window system were moved onto Qt,

and a 64-bit version of Carrara for OS X was running in less time than if we had made the change to Cocoa ourselves.

31

Page 33: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Qt 3 to Qt 4

32

Page 34: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Qt 3 to Qt 4

• With all of our style customization and heavy use of scripting, porting from Qt 3 to Qt 4 was a worst-case-scenario.

• The qt3to4 utility gave us a good starting point• Problem areas

– Styles– Changes in widget and layout behavior– Scripting

33

Page 35: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Qt 3 to Qt 4

• QStyle changes were very problematic, and documentation was sometimes incomplete.– Access to the source code was very valuable.– We could examine exactly how different style aspects are

handled and adjust accordingly.• Qt3Support library is very useful, but some widgets and

layouts still don’t behave quite the same.– Switching to Qt 4 counterparts was mostly straightforward.

• Moving from QSA to QtScript was very challenging.– Again, having source code was invaluable.– We were able to write a syntax translation tool that can

automatically convert most of our QSA scripts to working QtScripts.

34

Page 36: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Qt 3 to Qt 4

• What did we get with Qt 4?– Improved UI behavior and stability– Qt Style Sheets– Model-View type item views– Mac Cocoa support – important for 64-bit version– Script debugger– Scripts are now fully ECMAScript compatible– WebKit and other networking improvements for

interactivity with our online store– LGPL licensing allowing us to distribute a free SDK

35

Page 37: Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software

Conclusions

• Qt is an invaluable tool in the development of DAZ Studio.

• Qt gives us the flexibility to create an application with a flair and style all its own.

• Qt enables us to ignore many technical details and focus on building a better app.

• Qt helps us reduce development costs and decrease time-to-market.

36