Blender Plugin Implementations for 3D Collaborative ...

4 downloads 310 Views 2MB Size Report
Extensive tests and experimentation by graphics artists' communities had proved ... transpose the contribution problem in the Blender Python API programming ...
Blender Plugin Implementations for 3D Collaborative Work Martin Lesage, Omar Cherkaoui, Faysal Abouzaid, Martin Poirier, Gilles Raîche, and Martin Riopel

Abstract— The development of networking and client/server systems over the Internet had led to many collaborative work software applications. To extend the graphic design collaborative platforms focused on 3D artistic characters, the Articiel project is based on the Articiel collaborative platform that is a client-server application on the World Wide Web(WWW) based on a SOA architecture. This platform is including the essential functionalities needed by communities of distantly located artists to create and modify 3D characters or graphic animations. The Articiel platform collaborative functionalities are: messaging, agenda, storing and retrieving artists’ projects and contributions. Previous work has proved the usability of the Articiel platform by the programming of a Maya plugin who was calling the platform functionalities through its web services. The aim of this paper is to show a new contribution algorithm and the technical innovations resulting of the plugin conversion from Maya to Blender.

I. INTRODUCTION

T

HE aim of the realization of the Blender plugin was the fulfillment of the Canarie[8] organism request by the Networking Research Laboratory for increasing the use of his CA*NET4 network by allowing more graphic artist communities to exchange contribution and project files. The Maya[17] graphic software was proprietary domain and its use was restricted to the organizations that could afford the licence fees. A request was made to build SOA architecture based plugin for the Blender Software that is similar to Maya but in the public domain software using a GPL license free of utilisation. The wide Blender community of users and the support given by the Blender organization was an asset to this project that allowed many students of different schools to participate in a collaborative creation of 3D characters in Blender. The Blender application is free of utilization and has a rapid execution. It is used by a wide community of artists doing 3D drawing and graphic animations. It doesn’t have an explicit graphic scripting language like Maya making Blender Manuscript received March 15, 2007. Omar Cherkaoui and Martin Poirier are with the Université du Québec à Montréal’s Networking Research Laboratory of the Computer science Department, PO BOX 8888, Downtown Branch, Montreal (Quebec) H3C 3P8 – CANADA. Phone (514) 987-3000 Ext.: 6189 Fax: (514) 987-8477 (e-mail: [email protected]; [email protected]) Martin Lesage, Gilles Raîche and Martin Riopel are with the Université du Québec à Montréal’s Education Department, PO BOX 8888, Downtown Branch, Montreal (Quebec) H3C 3P8 – CANADA. Phone (514) 987-3000 Ext.: 8982 Fax: (514) 987-4608 (e-mail: [email protected]; [email protected]; [email protected]) Faysal Abouzaid is a Ph.D. student in computer science at the École Polytechnique de Montréal, PO BOX 6079, Downtown Branch, Montreal (Quebec) H3C 3A7 – CANADA. Phone (514) 340-4711 (e-mail: [email protected])

files smaller than Maya files for a same graphic scene. The Blender application has advanced embedded data structures offering frontward and backward compatibility. This application can also interface itself with Web services by its Python[19] scripting API and the SOAPPy[21] module. This approach had been studied in the present paper, buy rejected at the advantage of a wrapper Python/C++. The wrapper approach was selected for his higher level of reuse of the Maya plugin C++ code. The code kept was the Web services access routines and the project management routines. The contribution management had to be rebuilt form scratch. The contribution management programming is one of the major parts of this project and discussed in section 5. This paper is organized as follows: we will place the subject in the background section in section 2, explain the collaborative work platforms in section 3, and define the contribution in section 4. The subject entry completed, we will develop our solution of the Blender plugin implementation in section 5. The results will be shown in section 6 by the use of the plugin for 3D legendary shaped characters by Montréal city high school students. In section 7 are presented the limitations of this project. Future work is proposed in section 8. The work and results described in this paper have been accepted for a master degree thesis[15]. II. BACKGROUND Extensive tests and experimentation by graphics artists’ communities had proved the reliability of the Articiel Platform and the user friendliness of the Maya plugin. One of the major limitations of this approach was that the Maya application is a proprietary software and its buying costs are expensive. That limitation was denying some users to use the Articiel platform for 3D characters creation and animation collaborative work project. The aim of this project was to develop a Blender plugin that have exactly the same functionalities than the Maya plugin and could do collaborative work by calling the Articiel Platform Web services. The Blender artistic 3D character and graphics animation public domain software is free of utilization. In that context a conversion of the Maya Articiel Plugin to a Blender Articiel plugin was done. The challenge was that the APIs of Maya and Blender were different. We couldn’t recompile the Maya C++ code in the Blender API and continue further studies of the problem. The MAYA API is based on the MEL(Maya Embedded Language) scripting language that is describing the operations applied on the graphic objects. Collaborative functionalities could be added to Maya by plugins made in the Microsoft .NET Visual C++

Lesage, M., Charkaoui, O., Faysal, A., Poirier, M., Raîche, G., and Riopel, M. (2007, accepté). Blender plugin implementations for 3D collaborative work. Communication présentée au 2007 Institute of Electrical and Electronics Engineers (IEEE) International Conference on Systems, Mans, and Cybernetics qui se tiendra à Montréal, QUÉBEC.

programming environment. The Blender API is different and based on the Python[19] language. It doesn’t have a specific dedicated graphic operation scripting language. The Blender plugins are only applicable for texture and sequence and are developed in the LCC/GCC environment. They don’t support that kind of architecture. We had to study the Python API to transpose the contribution problem in the Blender Python API programming environment III.

COLLABORATIVE WORK PLATFORMS

The Articiel platform is a Web server application regrouping many Web services programmed in the Microsoft C++ .NET software development package. The Articiel platforms allows allow groups of users assigned in communities and studios to work and exchange contributions simultaneously in real time situation. An artist session uses the Articiel platform collaborative application to exchange files and contributions with other artists. The platform collaborative application enable the user to perform a work session (login and logout), to exchange files and contributions with other users (dataflow management), to add comments to his work (annotation) and to communicate with other artists by an electronic agenda and mailboxes (workflow management). The platform can be accessed by a Web browser or by a plugin as shown in figure 1. Due to its trivial operation mode, the Web browser access will not be considered in this paper. Collaborative application 1 (web browser access)

Collaborative application 2 (plugin access)

Collaborative application n (plugin or web browser access)

Fig. 2. Articiel layered web services architecture[5][13][14] IV. CONTRIBUTION DEFINITION The Articiel platform provides a distributed collaborative work platform over the Internet for 3D wiremesh graphics projects and animations as shown in figure 3. The Articiel platform manages artist’s projects and contributions. An artist project is a graphic scene or an animation that usually includes 3D characters evolving in a background. The Maya project files have the “.MB” extension while the Blender project files have the “.BLEND” extensions.

Articiel platform Fig. 1. Articiel platform collaborative model[14] The Articiel collaborative platform has layered software architecture. All of its Web server applications are implemented in Web services. The plugin software developed for the Articiel platform is entirely base on calls to its Web services. Figure 2 illustrates the platform project, session and file management through software layers. The functionality layer enables the user’s registration functionalities (login and logout) and the files annotation (comments describing the contributions). The service composition layer manages the Web services with the UDDI repository. The High-level services layer manages the artist’s contribution and project files. This level also identifies the artist studio and community. The common services layers implements the chat and mailbox services. The low level files storage on the Web server is managed by the Data level.

Fig. 3. An user contribution modifying the nose[16] In the Articiel collaborative platform context, an artist contribution is the smallest component of work that the artist could do to a 3D character. The contribution is generally a slight modification of a 3D character body part (head, limb, arm, head, nose, etc.). Figure 3 illustrates an artist contribution that is a 3D character nose enlargement. For computer processing, the contribution will be a small text file containing software application script or numerical data. The Maya 3D software application contributions files contains MEL (Mata Embedded Language) script describing the modification (Ex.: select –r Setup.vtx[24:168]

Setup.vtx[1321:1324], …, etc.). The Blender 3D software application contribution files contains a list of data representations of the 3D characters’modified vertex (Ex.: 295 [0.0027, 0.0013, 0.000], 309 [0.2123, 0.1001, 0.000], …, etc.). In both case, the contribution file is recording in the text file the displaced wiremesh vertex resulting of a 3D character body part modification.

return False self.sendUserData() val = Wrapper.NewLog() self.File = open(Wrapper.getLogPath(), "w") return val def stopContribution(self): if not self.OldMesh: return Contribution = "" BLENDER.Window.EditMode(0) mesh = GetMesh(self.getPerson()) if not mesh: return False file = self.File

Fig. 4. Articiel contribution reentrancy[14] An Articiel project contribution has reentrancy properties: the same contribution can be applied several number of times to the same character resulting a repetition of the modification that increase or decreases in magnitude the targeted part of the 3D character as shown in figure 4. A contribution applied at a 3D character can also be applied to a different character as long as both characters have the same number of vertex.

if len(mesh.verts) != len(self.OldMesh.verts): print "Vertex added or remove from mesh:" print "Cannot calculate and send contribution" Error("Calculating Contribution") return False for i in range(len(mesh.verts)): v2 = mesh.verts[i].loc v1 = self.OldMesh.verts[i].loc if v1[0] != v2[0] or v1[1] != v2[1] or v1[2] != v2[2]: Contribution += str(i) + " " + str(v2 - v1) + "\n" file.write(Contribution) file.close() self.OldMesh = None return True

V. BLENDER PLUGIN IMPLEMENTATION The Blender plugin implementation started with the study of the Maya plugin code and the Blender programming API. Some preliminary tests were done with the SOAPPy module but this option would have led the programming team to rewrite all of the Maya plugin code accessing the Web services. An other option was studied which was a Python/C++ wrapper that is the adopted solution and led us to reuse all the Web C++ code implementing the Web services access. A. UserInterface

Fig. 5. Geometrical 3D model of the Blender contribution[15] The first number of a line of the text file is the number of the modified vertex. The numbers in brackets are the vertex changes for the three dimensional X, Y and Z coordinates. The resulting vertex difference is: ∆i = vi’ - vi as demonstrated in figure 5. The following difference can be expanded over the x, y and z coordinates :

∆ix = vix’ - vix ∆iy = viy’ - viy ∆iz = viz’ - viz

The following Python code function describes the generation of the contribution in Blender. This code records the list of the modified vertex of the 3D character in a text file: def startContribution(self): BLENDER.Window.EditMode(0) self.OldMesh = GetMesh(self.getPerson()) if not self.OldMesh:

Fig. 6. Articiel platform user interface[13] The Blender plugin user interface is a window of the Blender user interface. The interface enable the artist to start a session on the Articiel Platform with a login process and also to quit the session. The Articiel session enable the artist to do collaborative work in real time simultaneously with the other logged users. The plugin also enable the Artist to exchange projects and contributions while they are working in a session

as illustrated in figure 6. B. Functionalities The Blender plugin is an extension of the Blender software enabling it to assess the functionalities of the Articiel platform within a work session (buttons “Start Articiel and “Exity Articiel”). The functionalities of the plugin enable the Blender application to do collaborative work by the exchange over the Internet of contribution(buttons “Get Studio Contribution”, “Get Author Contribution”, “Continue to Capture” and “Stop and Submit”) and project files(buttons “Save Project” and “Get Project” asd shown in figure 7.

must have been obliged to rewrite the 10 000 lines of the Maya plugin C++ code in Python. BLENDER Software Python script SOAPPy Web services client Requests

Responses

Articiel platform Web services Articiel platform

Fig. 9. SOAPPy Architecture

Fig. 7. Articiel platform functionalities buttons[13][15] C. General model of the plugin The Blender plugin is an extension of the Blender software. Figure 8 shows that the plugin enable the graphic artist to access the Articiel platform functionalities to save and retrieve contribution («.LOG» extension files) and project files («.BLEND» extension files) on the Articiel server shared disk space.

E. The realized wrapper C++/Python The architecture shown in figure 10 is a Python/C++ wrapper. This is the realized architecture implementing the actual plugin with a 90% reuse of the Maya C++ plugin code that was accessing the Articiel Web services. BLENDER Software Python Script («Articiel.py») Wrapper Python/C++(«wrapycpp.cpp») C++ Code(«artwscpp.cpp») Requests

Responses

Articiel Platform Web Services (WSDL)

Plugin

Plugin

Articiel Platform

Fig. 10. Wrapper C++/Python Architecture Blender 2.36

Blender 2.36

Workstation Artiste #1

Workstation Artiste #2

Contribution files (.LOG)

Contribution files (.LOG)

Projet files .BLEND)

Projet files .BLEND)

VI. RESULTS

Articiel Platform http://www.teleinfo.uqam.ca/articiel_05/

Fig. 8. Plugin interaction with Articiel Platform[13][15] D. The studied SOAPPy solution The architecture shown in figure 9 was studied but rejected even though the SOAPPy[21] module could enable the Python API of Blender to access directly the Articiel platform Web services. This approach was tested but the programmers

The overall project and the technical aspects were leaded by Professor Omar Cherkaoui of the Laboratoire de Téléinformatique de l’université du Québec à Montréal providing the plugin programming team and Articiel platform hosting. The collaborative design of 3D legendary shaped characters by students teams was supervised by Professor Louise Poissant of the Groupe de Recherches en Arts Médiatiques (GRAM) of UQAM[13]. The graphics characters had to represent two strong men of the Quebec province, the “Grand Antonio”[12] and the “Géant Beaupré”[10] as shown in figure 11. Professor Louise Poissant was assisted by Yves Amyot who was in charge of the realization of 3D character design by a high school student with the Articiel platform. He was helped by Gisèle Trudel who was in charge of supervising the design teams developing 3D characters within collaborative sessions with the Articiel plugin for Blender. Technical assistance, Blender software installation and plugin installation was provided by the programming team of the Laboratoire de Téléinformatique[13].

The Artgrid server is implemented on the Canarie CA*NET4 network with Lightpath fiber optical nodes[8]. A. Proposed architecture to access grid Web services with pyGlobus Our experimentation of the SOAPPy module proved that the Blender Python API can access the Globus Grid Web services by the pyGlobus module as described in figure 12. The time allowed to realize the project will have to include the conversion on the 10 000 C++ lines of the Maya plugin code in Python. BLENDER Software Python Script SOAPPy Web services client

Fig. 11. Plugin utilization for 3D characters generation[13]

pyGlobus Module Requests

VII. LIMITATIONS The Blender plugin described in this paper despite its flexible SOA architecture is only interacting with the Articiel collaborative platform belonging to the Laboratoire de Téléinformatique de l’Université du Québec à Montréal (UQAM). The number of users that could use the application is restricted because the user must be registered in the platform. The graphic artists are currently using 3D graphic authoring software applications like Maya[17] and Blender[4]. The project leaders should consider the change management considering traditional to collaborative work and also collaborative platforms and the use of a specific plugin. Our experimentation of this plugin with graphic artists has led us to give formation sessions to the communities of artists to improve the understanding of the plugin. The Blender plugin have exactly the same functionalities than the Maya plugin. The experimenters made no improvements or modifications to the Articiel platform and collaborative work techniques.The Blender plugin have been developed in the Windows XP environment. During our experimentation with graphics artists, we encounter some installation problems with DLL files when the software was installed on a Windows 98 environment. The contribution nature is different and specific to an application. The Blender and Maya contribution files are different and a Maya contribution could not be retrieved in Blender nor the inverse. Further work in the standardization of API and scripting language of 3D graphics authoring software(Blender, Maya, Softimage, OpenFX, Unigraphics NX, …) could enable greater compatibility, file exchange and collaborative work between these applications.The plugin must be completely recompiled to work on Linux, MacOS and other platforms or operating systems. VIII. SUMMARY AND FUTURE WORK The Artgrid project is a Grid extension of the Articiel project. The Articiel server can be accessed over the Internet.

Responses

ArtGRID Grid Web Services(GWSDL) ARTGrid Platform GLOBUS Grid manager

Fig. 12. SOAPPy architecture for Grid applications B. Proposed architecture to access grid Web services with a wrapper The Python/C++ wrapper can access the Artgrid Web services by C++ functions enabling the execution of Grid Web servicesas shown in figure 13. BLENDER Software Python Script Python/C++ Wrapper C++ Code Requests

Responses

ArtGRID Grid Web Services(GWSDL) Plateforme ARTGrid GLOBUS Grid manager

Fig. 13. C++/Python architecture for Grid applications C. ArtGRID supporting network Figure 14 shows the Canarie CA*NET4 network with Lightpath fiber optical nodes. This network has linked the UQAM, Ryerson and Emily Carr Institute of Arts and Design (ECIAD) universities in the Artgrid project. Future applications and conversion of the Blender and Maya plugin for the Grid using the GLOBUS grid manager will use this network at its full extent[18].

Fig. 14. The Canarie CA*NET4 network[13] IX. CONCLUSION This paper described our work is the conversion of a Maya plugin Microsoft Visual C++ code to a Blender wrapper C++/Python software application. The main part of our work was that the code could not be directly transposed and recompiled in a plugin for Blender because Blender does not directly support that kind of plugin architecture. The programming team had to learn the Python API of Blender and do scientific research to implement the contribution in Blender’s Python scripting API. We found two ways to access Web services with the Python API, the first approach was with the module SOAPPy that was rejected by the obligation to rewrite all the plugin C++ code in Python. The second and adopted approach was to write a Python/C++ wrapper that allowed the team to reuse 90% of the Maya plugin web services C++ code access routines. REFERENCES [1] [2]

Alienbrain. (2005). Available: http://www.alienbrain.com. D. Bergal. (2002). “Advantages of Jabber as a Platform for Developping Collaborative Applications”. Available at http://www.jabber.com/media/Jabber_Advantages.pdf [3] F. Bergenti, A. Poggi, and M. Somacher, “A collaborative platform for fixed and mobile networks”. Communications of the ACM, Vol. 45, No. 1, pp.39-44, Nov 2002. [4] Blender. (2004). Available at http://www.blender.org [5] S. Boutemedjet, “Conception d’une plateforme collaborative de création de personnages 3D à travers le Web”. Master’s Degree thesis. Montréal : Université du Québec à Montréal, M8167, 150pp., 2003. [6] S. Boutemedjet, “ARTICIEL: Document de spécification des nouveaux besoins de la plateforme Articiel”. Laboratoire de recherche de téléinformatique de l'UQAM, 17pp., 2003. [7] S. Boutemedjet, ARTICIEL: “Overall requirements and design descriptions”. Laboratoire de recherche de téléinformatique de l'UQAM, 12pp., 2002. [8] Canarie. (2005). Available at http://www.canarie.ca [9] C. D. Cera, W. C. Regli, I. Braude, Y.Shapirstein & C.V. Foster, “A Collaborative 3D Environment for Authoring of Design Semantics”. Drexel University Technical report, DU-MCS-01-06, 16pp., 2001 [10] Géant Beaupré. (2005). Available at http://collections.ic.gc.ca/beaupre/prommf41.htm [11] Globus. (2005). Available at http://www.globus.org/ [12] Grand Antonio. (2005). Available at http://www34.brinkster.com/noxfr/pages_blog/articles/t-29.html

[13] A. Kabbaj, and J. Martin, “Articiel rapport final: Programme du contenu électronique de Canarie”. Laboratoire de recherche de téléinformatique de l'UQAM, project CP-60, 62pp., 2005. [14] Laboratoire de Recherche de téléinformatique, “ARTICIEL :Rapport final”. Montréal(Qué.): Laboratoire de recherche de téléinformatique de l'UQAM, 62p., 2004 [15] M. Lesage, “Le développement d’un plugiciel de travail collaboratif pour la plateforme Articiel”. Master’s Degree thesis. Montréal : Université du Québec à Montréal, U5564, 90pp., 2006. [16] J. Martin, S. Boutemedjet, O. Cherkaoui, L.Poissant & M. Fleury, “The Coordination and Collaborative Process in New Media Projects Using ARTICIEL”. New Media Research Networks Conference, 4pp., March 2004. [17] Maya.(2005). Available at: http://www.aliaswavefront.com [18] pyGlobus. (2005). Available at: http://dsd.lbl.gov/gtg/projects/pyGlobus/ [19] Python. (2005). Available at http://www.python.org [20] K. Saar, “VIRTUS: A Collaborative Multi-User Platform”. Virtual Reality Modeling Language Symposium, p.141-152., Feb 1999 [21] SOAPy. (2005) Available at: http://sourceforge.net/projects/soapy [22] Unigraphics(UGS). (2005). Available at : http://www.ugs.com/ [23] Uni-Verse . (2005) Available at : http://www.uni-verse.org/ [24] Verse. (2005). Available at : http://www.blender.org/modules/verse

Fig. 2. Articiel layered web services architecture[5][13][14]

Fig. 3. An user contribution modifying the nose[15]

Fig. 4. Articiel contribution reentrancy

Fig. 5. Geometrical 3D model of the Blender contribution[15]

Fig. 6. Articiel platform user interface[13]

Fig. 7. Articiel platform functionalities buttons

Plugin

Plugin

BLENDER 2.36 Application

BLENDER 2.36 Application

Artist #1 computer

Artist #2 computer

Contribution (vertex coordinates differences) Project (.BLEND files)

Contribution (vertex coordinates differences) Project (.BLEND files)

Articiel platform web services http://www.teleinfo.uqam.ca/articiel_05/

Fig. 8. Blender plugin interaction with the Articiel Platform

BLENDER Software Python script SOAPPy Web services client Requests

Articiel platform Web services Articiel platform Fig. 9. SOAPPy Architecture

Responses

BLENDER Software Python Script («Articiel.py») Wrapper Python/C++(«wrapycpp.cpp») C++ Code(«artwscpp.cpp») Requests

Articiel Platform Web Services (WSDL) Articiel Platform Fig. 10. Wrapper C++/Python Architecture

Fig. 11. Plugin utilization for 3D characters generation[13]

Responses

BLENDER Software Python Script SOAPPy Web services client pyGlobus Module Requests

Responses

ArtGRID Grid Web Services(GWSDL) ARTGrid Platform GLOBUS Grid manager Fig. 12. SOAPPy architecture for Grid applications

BLENDER Software Python Script Python/C++ Wrapper C++ Code Requests

ArtGRID Grid Web Services(GWSDL) Plateforme ARTGrid GLOBUS Grid manager Fig. 13. C++/Python architecture for Grid applications

Responses

Fig. 14. The Canarie CA*NET4 network[13]