a blender plugin for collaborative work on the articiel platform

8

Upload: uqam

Post on 29-Mar-2023

1 views

Category:

Documents


0 download

TRANSCRIPT

A Blender Plugin for Collaborative Work on the Articiel Platform

Martin Lesage, Omar Cherkaoui, Faysal

Abouzaid, Martin Poirier Laboratoire de Recherche de Téléinformatique

Université du Québec à Montréal PO BOX 8888, Downtown Branch

Montreal(Quebec) H3C 3P8 – Canada

Gilles Raîche Centre sur les applications des modèles de réponse

aux items (CAMRI) Université du Québec à Montréal

PO BOX 8888, Downtown Branch Montreal(Quebec) H3C 3P8 – Canada

Abstract - Applications of collaborative work and platforms allowing workgroups to exchange projects and files over the Internet is a rapidly expanding field. The Laboratoire de Téléinformatique in collaboration with CANARIE and Hexagram launched the Articiel project studying collaborative work by the creation of wiremesh 3D characters and animations. Artist collaboration is expanded over the Internet by the Articiel platform based on Web services SOA architecture. A plugin for the MAYA 3D authoring software was realized previously. Considering that Maya is private domain software not accessible to anyone, actual work converted the MAYA plugin code for the BLENDER public domain software whose functionalities are similar to MAYA. The Blender and Maya software both works on personal computer. The aim of the collaborative work to enable with these applications is to create a Web session on the Articiel platform Web server and share project or contribution file on its disk space.

Keywords: Blender, collaborative work, contribution, graphic animation, plugin, Web services.

1 Introduction 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[16] plugin who was calling the platform functionalities through its web services. 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. We will propose a way to express contribution in Blender by a Python[18] algorithm capturing in a text file the wiremesh differences of 3D coordinates. We also had to do the conversion of the code of the Maya plugin to a Blender plugin. To do so, we accessed the Articiel Web services with a Python/C++ wrapper that permitted us to reuse 90% of the Maya plugin code.

This paper is organized as follows: we will place the subject in the background section in section 2, explain the Articiel collaborative platform in section 3, and define the collaborative creation of 3D objects in section 4. Once the subject entry completed, we will develop our solution in section 5, the contribution generation in Blender. The programmed plugin software will be shown in section 6. The results of the use of the Blender plugin for the Articiel platform are shown in section 7. Suggested future work is shown in section 8. The work and results described in this paper have been submitted for a master degree thesis.

2 Background Collaborative platforms have for general tasks to provide file exchange and messaging capabilities to workgroups (Jabber[2]). Our work led us to study collaborative platforms specialized in the conception of 3D objects and graphic animations (Virtus[19], AlienBrain[1], MUG[9], Unigraphics NX[21], UNI-VERSE[22]). The platforms are frequently based on Java virtual machine and technology (Virtus[19], Jabber[2], C/Webtop[3], MUG[9]). The UNI-VERSE[22] collaborative platform is very similar to the Articiel platform and is widely used by the Blender community of user. One of its limitations is that platform can’t be installed on the CANARIE CA*NET4 grid network[8]. This point will be discussed further in the summary and future work section of this paper.

3 The Articiel collaborative platform The Articiel platform provides a collaborative environment for communities of artists (workgroups)

distantly located. This environment is based on a Service Oriented Architecture (SOA) making it open to add additional functionalities and adaptable for a wide variety of clients as shown in figure 1. This platform is specifically designed for the collaborative creation of 3D objects (virtual human characters), graphic animations and movie clips[7].

The main goal of the platform is to provide a repository to store, modify, merge and retrieve artists’ contributions and projects as shown in figure 1. It also describes artists contributions by XML formatted annotations based on Web semantics and ontology theory. The workflow managing capability of the platform allows many artists (grouped in studios or communities) to work on the same graphic character by contributions or project files exchange[7]. The Articiel platform provides the following Web services functionalities to client applications[5, 14]: - session management (login and logout), - user management (username, password and

community), - workflow management (electronic agenda and

messaging), - dataflow management (storage, modification,

retrieving and also the merging of contributions and projects); and

- annotation description based on Web semantic and ontology theory.

Figure 1. Articiel access modes and web services[14]

The Articiel platform can be accessed by two client modes, either by a plugin embedded in a software

application or simply by a Web browser. The platform Web services are divided in two categories: common services and high level services as illustrated in figure 1. The common services are assigned to the workflow management of the user interface. Specialized services are dedicated to artists’ work management and assigned to the dataflow of the contribution, projects and studios[14].

4 Collaborative design of 3D objects The purpose of collaborative work is to allow distantly located communities of artists to work on the same 3D character by the exchange of contributions[13,14]. In this paper, the nature of the 3D objects is wiremesh structure composing the graphics characters processed by the applications studied (Blender[4] and Maya[16]).

Figure 2. The decomposition of a 3D character in contributions[15]

The Articiel platform dataflow smallest component is the contribution. A contribution is a numeric or text file containing work done by a graphic artist on a 3D character or a part of this character (arm, leg, head, body, etc.) as shown in figure 2. The dataflow is associated with artists’ contributions and projects. The artist work contributions are described by XML formatted annotations based on the Annotea standard giving informations on the contribution author, date of creation, date of modification and context type[6].

The subtasks can be the creation or the modification of a part of the global project task. In the case of a graphic character project, a subtask could be a limb modification of this character assigned to a specific graphic artist member of a studio. The work done by an artist in a studio results in

contributions that could be stored, merged and retrieved[14] by other artists on the platform[5]. The Articiel platform can also store whole scenes, animations and videos in directories so that artists and projects managers could archive, store and retrieve electronic files or directories containing scenes or video animations of a project[6, 14].

The Articiel platform could be accessed directly over the Internet by a Web browser. It can also be accessed within a graphic design application by the extension of the application functionalities with a software plugin (previous work done on a Maya plugin[5, 6, 14] and actual work done on Blender plugin). The platform functionalities of workflow and dataflow management described in this section will be further discussed in section 6, the Blender plugin for the Articiel platform.

5 Blender contribution implementation As stated previously, the Articiel platform can be accessed over the Internet directly by a Web browser or a plugin embedded in the graphic design software. The scope of this paper will study the automatic use of the Articiel platform accessing his Web services by a plugin instead of a manual use by a Web browser.

Figure 3. Contribution capture in Blender

The plugin added to the software make the Articiel platform session, contribution, annotation and project management functionalities available within a pop-up window (Maya) or new buttons added to the initial menu functionalities of the graphic software (Blender) as shown in figure 3. The graphic artist is now able to do collaborative work inside a working session with his graphic software by saving, merging and retrieving contribution and project files.

The plugin enable the artist to exchange files with other graphic artists without Internet browser manipulation or FTP sessions. The artist no longer needs switching

applications from his graphic software back and forth to the Internet browser. A large amount of work in this project was to transpose the Maya plugin contribution algorithms to other algorithms that could enable a similar contribution saving and retrieving management for Blender.

5.1 Previous study of the Maya contribution The Maya contribution is made of Maya Embedded Language (MEL)[16] graphics operations instructions stored in a text file as in shown figure 4. The name of the contribution file is composed by the date and the hour the contribution was made.

select -r Setup.vtx[24:168] Setup.vtx[1321:1324] Setup.vtx[1466:1851] Setup.vtx[1858] Setup.vtx[5214:5232] Setup.vtx[5243:5247] Setup.vtx[5265:5266] ;

Figure 4. Maya contribution text file « 2004.11.24-15.26.24.log»

All the operations applied on a Maya wiremesh object are converted in MEL language by the Maya application programming interface (API). Therefore the Maya API is a MEL language interpreter. Unfortunately, the Blender software doesn’t have a graphic instruction programming language as MEL that keeps an explicit trace of the events or the operations applied to the wiremesh object by the artist. The wiremesh modifications are applied internally within the Blender software in binary format and couldn’t be specifically saved in a text file format.

5.2 Research results for the Blender contribution algorithms

Our research found that the Blender software have a Python[18] API and that it was possible to modify wiremesh 3D objects and to record modifications by Python programming algorithms.

Figure 5. Wiremesh contribution definition in Blender

We solved the lack of explicit event tracking and the textual operations instructions problems by programming a

Python algorithm. Our algorithm is recording all the modified vertex coordinates differences of a determined 3D graphic object for any operation or modification made by the graphic artist.

Our approach to the implantation of the contribution in Blender will be a text file generated by a Python[18] algorithm recording the list of the modified vertex coordinates differences as shown in figure 5.

95 [0.0000, 0.0000, 0.0000] 295 [0.0027, 0.0013, 0.0000] 309 [0.2123, 0.1001, 0.0000] 311 [0.3029, 0.1429, 0.0000] 313 [0.4056, 0.1913, 0.0000] 315 [0.0539, 0.0254, 0.0000] 317 [0.0677, 0.0319, 0.0000] 319 [0.0516, 0.0244, 0.0000]

Figure 6. Blender contribution text file « 2004.11.24-15.26.24.log»

The Blender contribution file will contain a list of the modified vertex of the 3D character. Figure 6 shows an example of a contribution file. The first number of a file’s line is the number of a modified vertex of the 3D character. The three numbers inside the brackets specify the vertex changes according to the three dimensional X, Y and Z coordinates.

def startContribution(self): BLENDER.Window.EditMode(0) self.OldMesh = GetMesh(self.getPerson()) if not self.OldMesh: 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 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

Figure 7. Pyton script algorithm for the creation of the contribution file

The text file list of the modified vertex can be applied again to the same object or to another object having the

same number of vertex. The file naming convention is the same as the Maya contribution files to keep a certain similarity in both projects.

The Blender contribution is defined by a list of the modified vertex coordinates differences. According to figures 5 and 6, one line of the contribution file is defined by the following mathematical formulas:

let vi a vertex in three dimensions and vi’ the same vertex after a modification or a contribution application by an artist. We can affirm that the vertex difference is:

∆i = vi’ - vi

that we can expand over the X, Y and Z coordinates :

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

Our contribution generation algorithm shown in figure 7

is based on the previous mathematical formulas.

def applyContribution(self): BLENDER.Window.EditMode(0) mesh = GetMesh(self.getPerson()) if not mesh: return False try: file = open(Wrapper.getLogPath(), "r") except IOError: print "Filename error loading contribution:" print "No file corresponding to filename as described

in annotation." print Wrapper.getLogPath() + " not found!" Error("Applying Contribution") return False if BLENDER.Debug: print "apres ouverture fichier" for ligne in file.readlines(): i = ligne.find(" ") index = int(ligne[:i]) delta = [] j = ligne.find(",") delta.append(float(ligne[i+2:j])) i = ligne.rfind(",") delta.append(float(ligne[j+2:i])) j = ligne.find("]") delta.append(float(ligne[i+2:j])) try: mesh.verts[index].loc[0] += delta[0] mesh.verts[index].loc[1] += delta[1] mesh.verts[index].loc[2] += delta[2] except IndexError: print "Vertex index does not exist in this mesh." if BLENDER.Debug: print "apres delta update" mesh.update(True) if BLENDER.Debug: print "apres update" return True

Figure 8. Pyton script algorithm for the application of the contribution file

The application of the contribution is the inverse process of the contribution generation. The algorithm of a contribution file’s application on a 3D wiremesh object in Blender is shown by figure 8. The variable ∆i contains a vertex contribution and its application is defined by:

vi’ = vi + ∆i

this also can be expanded over the X, Y and Z coordinates :

vix’ = vix + ∆ixviy’ = viy + ∆iyviz’ = viz + ∆iz

The contribution application algorithm shown in figure 8

is based on the previous mathematical formulas and the geometric representation of figure 9.

Figure 9. Wiremesh application definition in Blender 6 Blender plugin for Articiel platform The Blender[4] application user interface is slightly different that Maya’s[16] but both applications have the same functionalities.

Figure 10.The Blender plugin interface

The Blender user interface is composed of graphic design windows and applications buttons windows as shown in figures 3 and 10. The Maya plugin interface is a pop-up window that is superposing itself to the Maya user interface window. The menus in Maya are contained in menu bars. The Blender plugin interface is a window containing buttons and text entry fields generated in Python[18] script by the «Articiel.py» file. Figure 3 shows the Articiel plugin buttons window in the upper right. The Blender plugin buttons shown in figure 10 are interacting with the Articiel platform Web services to enable collaborative work tasks[5, 13, 14]: - user management by text entry fields «Username»,

«Community» and «Studio». - session management by text entry field

«Password» and buttons «Start Articiel», «Logout » and « Exit Articiel».

- project 3D files management with text entry fields «3D Person» , «Project Options» and buttons « Save Project» and «Get Project».

- annotation management with text entry fields «Task Name» and «Description».

- contribution management with text entry field «Description» and buttons «New Capture», «Continue to Capture», «Get Author Contribution», «Get Studio Contribution» and « Stop and Submit».

The Articiel platform is based on a SOA architecture.

The platform Web services are supporting collaborative work applications and development. Their main goal is to provide work session management and to store graphic artists’ project and contributions as illustrated in figure 11.

Figure 11. The Blender plugin collaborative mode of operation

The architecture shown in figure 12 is a Python/C++ wrapper that allowed the programming team to reuse 90% of the Maya plugin Microsoft Visual C++ .NET code. This is a three layered architecture enabling the Blender API Python text entry field and button generation file «Articiel.py» to communicate and exchange data with the «artwscpp.cpp» plugin code calling the Articiel platform

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

Artist #1 computer

BLENDER 2.36 Application

Plugin

Contribution (vertex coordinates

differences)

Web services and generating the session, project and contribution management.

Figure 12. The Blender plugin with wrapper architecture mode

The plugin software layers are described as follows: - «articiel.py»: Blender API Python script generating

the contribution, plugin window, buttons and entry text fields of figure 10.

- «wrapycpp.cpp»: This file is a Microsoft .NET Visual C++ file that is the C++/Python wrapper. The wrapper contains the Python function prototypes associated with their equal function prototype in C++. The wrapper is a software function allowing data exchange between the «articiel.py» Pyhton plugin interface and the Articiel platform web services access module «artwscpp.cpp».

- «artwscpp.cpp»: Articiel platform web services access module generating the session, project and contribution management.

7 Results

The Blender plugin was tested in a collaborative work project where high school level students had to use the Blender 3D graphic authoring software to produce basic wiremesh 3D legendary shaped characters. The students had no previous knowledge of Blender nor the Articiel platform and collaborative work.

Two high school institutions distantly located in the city of Montreal beta-tested the plugin with a legendary shaped 3D character collaborative work project divided in two design team composed of nine student studios. The first artist studio was located at the Collège Mont-Royal High School. The second studio was located at the Cardinal High School. The theme of the project was to design 3D rendered wiremesh characters with a legendary aspect inspired by two well known celebrities of the Quebec province, the Great Antonio[12] and the Beaupré Giant[10]. The workflow was organized between the design teams with the head and the bust of the character to be realized by the Cardinal High School team and the limbs (legs and

School. All the graphic artists and studios had done their work in a collaborative manner by exchanging contributions and project files with the Articiel platform.

arms) to be realized by the College Mont-Royal High

Figure 13. Legendary shaped character[13]

his project was held in a Ministère de l’Éducation du

Summary and future work on enabling

distribut

he Blender application Python API scripting language

The Python/C++ wrapper could equally be extended to ac

TQuébec’s school reform where the students had to participate in a creative skills development and professional studio work experience. The students had to design 3D wiremesh rendered characters. The results are shown in figure 13 and are described at full extent in the Articiel project final report[13]. 8

The Artgrid project is focused ed software and to create collaborative work on the

CANARIE CA*NET4 fiber optical network[8] and the GLOBUS[11] Grid manager. An extension of this project will be to do the conversion of the Blender and Maya plugins to access Grid Web services on LINUX workstations with the GLOBUS grid manager[13].

T can access Web services by the extension module

SOAPPy[20]. It can also access Grid Web services (GWSDL) with the extension module pyGLOBUS[17]. An extension of the C++/Python wrapper with GWSDL could equally enable the Blender plugin to do collaborative work on the Grid. The time allowed realizing the project hasn’t permitted the programming team to implement the ArtGRID GWSDL software module. This issue is an essential condition to the extension of this project.

Figure 14. The Blender plugin with wrapper architecture mode

cess Grid Web services. The wrapper code modules «wrapycpp.cpp» and «artwscpp.cpp» must be rewrited to

BLENDER Software

Python

Python/C++ Wrapper

ARTGrid Platform

ArtG ServicesRID Grid Web (GWSDL)

Requests ponses Res

C++ Code

GLOBUS Grid manage

BLENDER Software

r

Python Script («Articiel.py»)

Wrapper Python/C++(«wrapycpp.cpp»)

Articiel Platform Articiel Platform Web Services (WSDL)

Requests Responses

C++ Code(«artwscpp.cpp»)

the future ArtGRID Globus Grid Web services specifications as shown in figure 14.

9 Conclusion As shown in our results, the plugin conversion

was a success and the Blender plugin have exactly the same functionalities than the Maya plugin. The plugin was used at his full capabilities by the two teams of students of the Cardinal and Collège Mont-Royal high schools. The only problems encountered were installations and computer compatibility problems. Once the Blender and the plugin software installed, a short demonstration to the users by the programming team on how to save and retrieve projects and contributions enable the students to start their work sessions.

The time constraints didn’t allow the conversion of the Blender and Maya plugins to grid applications with the GLOBUS grid manager on the CANARIE CA*NET4 network[8]. This proposed grid extension of our work should be interesting for collaborative graphics animations projects using very large projects and contribution files and to use the CA*NET4 network bandwidth to its full extent.

This project has just scratched the surface of the large capabilities of the Articiel platform enabling it to accommodate almost any communities of users doing collaborative work and its future extensions on the Grid. Future work in 3D wiremesh authoring API compatibility and an open access of the Articiel platform to users could bring the advantages of collaborative work to any kind of software applications and workgroups.

10 References [1] Alienbrain. 2005. http://www.alienbrain.com.

[2] Bergal, D.. 2002. “Advantages of Jabber as a Platform for Developping Collaborative Applications”. Available at http://www.jabber.com/media/Jabber_Advantages.pdf

[3] Bergenti, F., A. Poggi and M. Somacher. “A collaborative platform for fixed and mobile networks”. Communications of the ACM, Vol. 45, No. 1, p.39-44, Nov 2002.

[4] Blender. 2004. Available at http://www.blender.org

[5] Boutemedjet, S. “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, 150p., 2003.

[6] Boutemedjet, S. “ARTICIEL: Document de spécification des nouveaux besoins de la plateforme Articiel”. Laboratoire de recherche de téléinformatique de l'UQAM, 17p., 2003.

[7] Boutemedjet, S. 2002. ARTICIEL: “Overall requirements and design descriptions”. Laboratoire de recherche de téléinformatique de l'UQAM, 12p., 2002.

[8] Canarie. 2005. Available at http://www.canarie.ca

[9] Cera, C. D., 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, 16p., 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] Kabbaj, A. 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, 62p., 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] Martin, J., S. Boutemedjet, O. Cherkaoui, L.Poissant & M. Fleury. “The Coordination and Collaborative Process in New Media Projects Using ARTICIEL”. New Media Research Networks Conference, 4p., March 2004.

[16] Maya. http://www.aliaswavefront.com

[17] pyGlobus. http://dsd.lbl.gov/gtg/projects/pyGlobus/

[18] Python. 2005. Available at http://www.python.org

[19] Saar, K. “VIRTUS: A Collaborative Multi-User Platform”. Virtual Reality Modeling Language Symposium, p.141-152., Feb 1999

[20] SOAPy. http://sourceforge.net/projects/soapy

[21] Unigraphics(UGS). http://www.ugs.com/

[22] Uni-Verse . http://www.uni-verse.org/

[23] Verse. http://www.blender.org/modules/verse