From 6577496fc2eeb4ef565074722ca771d5f9be0829 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 18 Aug 2010 18:31:05 +0200 Subject: [PATCH 01/56] Fixed: #1073 Replace deprecated functions gethostbyname and gethostbyaddr --- code/nel/include/nel/net/inet_address.h | 3 + code/nel/src/net/inet_address.cpp | 165 ++++++++++++++++-------- 2 files changed, 117 insertions(+), 51 deletions(-) diff --git a/code/nel/include/nel/net/inet_address.h b/code/nel/include/nel/net/inet_address.h index 50b591fb6..a526b303f 100644 --- a/code/nel/include/nel/net/inet_address.h +++ b/code/nel/include/nel/net/inet_address.h @@ -143,6 +143,9 @@ protected: /// Constructor with ip address, port=0 CInetAddress( const in_addr *ip, const char *hostname = 0); + /// Update _HostName from _SockAddr + void updateHostName(); + private: // Called in all constructors. Calls CBaseSocket::init(). diff --git a/code/nel/src/net/inet_address.cpp b/code/nel/src/net/inet_address.cpp index ea0f69656..41684079e 100644 --- a/code/nel/src/net/inet_address.cpp +++ b/code/nel/src/net/inet_address.cpp @@ -27,6 +27,8 @@ #ifdef NL_OS_WINDOWS # include # include +// for Windows 2000 compatibility +# include #elif defined NL_OS_UNIX # include # include @@ -40,6 +42,9 @@ using namespace std; using namespace NLMISC; +#ifndef NI_MAXHOST +# define NI_MAXHOST 1025 +#endif namespace NLNET { @@ -74,20 +79,32 @@ CInetAddress::CInetAddress( const in_addr *ip, const char *hostname ) } else { - hostent *phostent = gethostbyaddr( (char*)&ip->s_addr, 4, AF_INET ); - if ( phostent == NULL ) - { - _HostName = ipAddress(); - } - else - { - _HostName = string( phostent->h_name ); - } + updateHostName(); } _Valid = true; } +/* + * Update _HostName from _SockAddr current value + */ +void CInetAddress::updateHostName() +{ + char host[NI_MAXHOST]; + + sint status = getnameinfo((struct sockaddr *) _SockAddr, sizeof (struct sockaddr), host, NI_MAXHOST, NULL, 0, NI_NUMERICSERV); + + if ( status ) + { + _HostName = ipAddress(); + } + else + { + _HostName = string( host ); + } +} + + /* * Alternate constructor (calls setByName()) */ @@ -148,16 +165,6 @@ bool operator==( const CInetAddress& a1, const CInetAddress& a2 ) */ bool operator<( const CInetAddress& a1, const CInetAddress& a2 ) { -#ifdef NL_OS_WINDOWS - if ( a1._SockAddr->sin_addr.S_un.S_addr == a2._SockAddr->sin_addr.S_un.S_addr ) - { - return ( a1.port() < a2.port() ); - } - else - { - return ( a1._SockAddr->sin_addr.S_un.S_addr < a2._SockAddr->sin_addr.S_un.S_addr ); - } -#elif defined NL_OS_UNIX if ( a1._SockAddr->sin_addr.s_addr == a2._SockAddr->sin_addr.s_addr ) { return ( a1.port() < a2.port() ); @@ -166,7 +173,6 @@ bool operator<( const CInetAddress& a1, const CInetAddress& a2 ) { return ( a1._SockAddr->sin_addr.s_addr < a2._SockAddr->sin_addr.s_addr ); } -#endif } @@ -223,26 +229,59 @@ CInetAddress& CInetAddress::setByName( const std::string& hostName ) { // Try to convert directly for addresses such as a.b.c.d in_addr iaddr; -#ifdef NL_OS_WINDOWS - iaddr.S_un.S_addr = inet_addr( hostName.c_str() ); - if ( iaddr.S_un.S_addr == INADDR_NONE ) -#elif defined NL_OS_UNIX iaddr.s_addr = inet_addr( hostName.c_str() ); if ( iaddr.s_addr == INADDR_NONE ) -#endif { - // Otherwise use the traditional DNS look-up - hostent *phostent = gethostbyname( hostName.c_str() ); - if ( phostent == NULL ) + struct addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version + hints.ai_socktype = SOCK_STREAM; + + struct addrinfo *res = NULL; + sint status = getaddrinfo(hostName.c_str(), NULL, &hints, &res); + + if (status) { _Valid = false; - LNETL0_DEBUG( "LNETL0: Network error: resolution of hostname '%s' failed", hostName.c_str() ); + LNETL0_DEBUG( "LNETL0: Network error: resolution of hostname '%s' failed: %s", hostName.c_str(), gai_strerror(status) ); // return *this; throw ESocket( (string("Hostname resolution failed for ")+hostName).c_str() ); } - _HostName = string( phostent->h_name ); - memcpy( &_SockAddr->sin_addr, phostent->h_addr, sizeof(in_addr) ); + + struct addrinfo *p = res; + + // process all addresses + while (p != NULL) + { + // check address family + if (p->ai_family == AF_INET) + { + // ipv4 + struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; + + // convert the IP to a string + _HostName = string(inet_ntoa(ipv4->sin_addr)); + memcpy( &_SockAddr->sin_addr, &ipv4->sin_addr, sizeof(in_addr) ); + } + else if (p->ai_family == AF_INET6) + { + // ipv6 + // TODO: modify class to be able to handle IPv6 + + // struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; + + // convert the IP to a string + // inet_ntop(p->ai_family, addr, ipstr, sizeof(ipstr)); + // memcpy( &_SockAddr->sin_addr, &ipv6->sin_addr, sizeof(in_addr) ); + } + + // process next address + p = p->ai_next; + } + + // free the linked list + freeaddrinfo(res); } else { @@ -275,15 +314,7 @@ void CInetAddress::setSockAddr( const sockaddr_in* saddr ) // Warning: when it can't find it, it take more than 4 seconds if ( CInetAddress::RetrieveNames ) { - hostent *phostent = gethostbyaddr( (char*)&saddr->sin_addr.s_addr, 4, AF_INET ); - if ( phostent == NULL ) - { - _HostName = ipAddress(); - } - else - { - _HostName = string( phostent->h_name ); - } + updateHostName(); } _Valid = true; } @@ -476,20 +507,52 @@ std::vector CInetAddress::localAddresses() // 2. Get address list vector vect; - uint i = 0; - for(;;) + struct addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version + hints.ai_socktype = SOCK_STREAM; + + struct addrinfo *res = NULL; + sint status = getaddrinfo(localhost, NULL, &hints, &res); + + if (status) { - hostent *phostent = gethostbyname( localhost ); - if ( phostent == NULL ) // will come here if the local hostname (/etc/hostname in Linux) is not the real name - throw ESocket( (string("Hostname resolution failed for ")+string(localhost)).c_str() ); - - if (phostent->h_addr_list[i] == 0) - break; - - vect.push_back( CInetAddress( (const in_addr*)(phostent->h_addr_list[i]), localhost ) ); - i++; + // will come here if the local hostname (/etc/hostname in Linux) is not the real name + throw ESocket( (string("Hostname resolution failed for ")+string(localhost)).c_str() ); } + struct addrinfo *p = res; + + // process all addresses + while (p != NULL) + { + // check address family + if (p->ai_family == AF_INET) + { + // ipv4 + struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; + + vect.push_back( CInetAddress( &ipv4->sin_addr, localhost ) ); + } + else if (p->ai_family == AF_INET6) + { + // ipv6 + // TODO: modify class to be able to handle IPv6 + + // struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; + + // convert the IP to a string + // inet_ntop(p->ai_family, addr, ipstr, sizeof(ipstr)); + // memcpy( &_SockAddr->sin_addr, &ipv6->sin_addr, sizeof(in_addr) ); + } + + // process next address + p = p->ai_next; + } + + // free the linked list + freeaddrinfo(res); + if(vect.empty()) { throw ESocket( (string("No network card detected for ")+string(localhost)).c_str() ); From d7943cfa7d1fddfe6ed426f0bafa41e1ce4a6c74 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 20 Aug 2010 13:27:17 +0200 Subject: [PATCH 02/56] Fixed: #955 CMake does not search luabind --- code/ryzom/CMakeLists.txt | 1 + code/ryzom/CMakeModules/FindLuabind.cmake | 55 +++++++++++++++++++++++ code/ryzom/client/src/CMakeLists.txt | 5 ++- 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 code/ryzom/CMakeModules/FindLuabind.cmake diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index 9cf6558d6..aa4430116 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -82,6 +82,7 @@ IF(WITH_LUA51) ELSE(WITH_LUA51) FIND_PACKAGE(Lua50 REQUIRED) ENDIF(WITH_LUA51) +FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) FIND_PACKAGE(Libwww) FIND_PACKAGE(ZLIB) diff --git a/code/ryzom/CMakeModules/FindLuabind.cmake b/code/ryzom/CMakeModules/FindLuabind.cmake new file mode 100644 index 000000000..c3722deb7 --- /dev/null +++ b/code/ryzom/CMakeModules/FindLuabind.cmake @@ -0,0 +1,55 @@ +# - Locate Luabind library +# This module defines +# LUABIND_LIBRARY, the library to link against +# LUABIND_FOUND, if false, do not try to link to LUABIND +# LUABIND_INCLUDE_DIR, where to find headers. + + +IF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + # in cache already + SET(LUABIND_FIND_QUIETLY TRUE) +ENDIF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + + + + +FIND_PATH(LUABIND_INCLUDE_DIR + luabind.hpp + PATHS + $ENV{LUABIND_DIR}/include + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + PATH_SUFFIXES luabind +) + + +FIND_LIBRARY(LUABIND_LIBRARY + NAMES luabind libluabind luabind_d libluabind_d libluabindd + PATHS + $ENV{LUABIND_DIR}/lib + /usr/local/lib + /usr/lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + + +IF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + SET(LUABIND_FOUND "YES") + IF(NOT LUABIND_FIND_QUIETLY) + MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}") + ENDIF(NOT LUABIND_FIND_QUIETLY) +ELSE(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + IF(NOT LUABIND_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find Luabind!") + ENDIF(NOT LUABIND_FIND_QUIETLY) +ENDIF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 5728d34c0..73bc18ee5 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -66,6 +66,7 @@ INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} + ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) @@ -79,6 +80,7 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ${NELGEORGES_LIBRARY} ${NEL3D_LIBRARY} ${LUA_LIBRARIES} + ${LUABIND_LIBRARY} ${CURL_LIBRARIES} ${NELSOUND_LIBRARY} ${NELSNDDRV_LIBRARY} @@ -86,8 +88,7 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ${NELPACS_LIBRARY} ${LIBWWW_LIBRARY} ${SEVENZIP_LIBRARY} - luabind # TODO: find luabind and expat cleanly using a find script - expat) + expat) # TODO: find expat cleanly using a find script IF(NOT APPLE AND NOT WIN32) TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES}) From b53426dd173eef8e31851674094f739fabf514c6 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 20 Aug 2010 13:30:28 +0200 Subject: [PATCH 03/56] Changed: Added more filters to .hgignore --- .hgignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.hgignore b/.hgignore index 0427edd20..cde2a553b 100644 --- a/.hgignore +++ b/.hgignore @@ -45,6 +45,7 @@ default_c *_debug core *.pc +*.gch # Mac OS X compile *.dylib @@ -133,12 +134,14 @@ moc_*.cpp *.moc # Misc garbage +*.rej *.orig *.cachefile *.cache *.patch *.7z external +.svn # build code/nel/build/* From 80b478b4082d6c7356a2725bf831437a9f59bb4d Mon Sep 17 00:00:00 2001 From: Matt Raykowski Date: Fri, 20 Aug 2010 08:44:58 -0500 Subject: [PATCH 04/56] Changed: #825 Fixed warning/error about C++ comment blocks in C code. --- code/nel/tools/3d/tile_edit_qt/pic/pic_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h index 18089e04e..1239f5af9 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h +++ b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h @@ -4,7 +4,7 @@ extern "C" { #endif -// ---------------------------------------------------------------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------------------------------------------------------------- */ typedef struct PIC_PICTURE { @@ -68,4 +68,4 @@ extern void Pic_SetError(unsigned char *msg, ...); #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif From eaa26434bc81064255175f84310c417dd4987661 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 21 Aug 2010 15:57:55 +0200 Subject: [PATCH 05/56] Changed: #825 Remove all warnings when compiling Ryzom --- code/nel/samples/net/udp/receive_task.h | 4 ++-- code/nel/src/3d/patch_lightmap.cpp | 5 +++++ code/nel/src/3d/patchuv_locator.cpp | 4 ++-- code/nel/src/3d/vegetable_manager.cpp | 4 ++++ code/nel/src/3d/zone_lighter.cpp | 12 ++++++------ 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/code/nel/samples/net/udp/receive_task.h b/code/nel/samples/net/udp/receive_task.h index 4d58483bf..1bebc3308 100644 --- a/code/nel/samples/net/udp/receive_task.h +++ b/code/nel/samples/net/udp/receive_task.h @@ -53,7 +53,7 @@ struct TReceivedMessage void vectorToAddress(); /// Set "disconnection" message for the current AddrFrom - void setTypeEvent( TEventType t ) { *_Data.begin() = t; } + void setTypeEvent( TEventType t ) { *_Data.begin() = (uint8)t; } void setDate() { *(sint64*)&(*(_Data.begin()+1)) = NLMISC::CTime::getLocalTime(); } @@ -69,7 +69,7 @@ struct TReceivedMessage const uint8 *userDataR() const { return &*_Data.begin() + MsgHeaderSize; } /// Return the size of user data - uint32 userSize() { return _Data.size() - MsgHeaderSize; } + uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; } /// Return the data vector (event type header byte + user data) vector& data() { return _Data; } diff --git a/code/nel/src/3d/patch_lightmap.cpp b/code/nel/src/3d/patch_lightmap.cpp index b5a6c8f8d..bd3886a71 100644 --- a/code/nel/src/3d/patch_lightmap.cpp +++ b/code/nel/src/3d/patch_lightmap.cpp @@ -1671,14 +1671,19 @@ void CPatch::getCurrentTileTLIColors(uint ts, uint tt, NLMISC::CRGBA corners[4] CRGBA tbMiddle; // left. tbEdges[0].avg2RGBOnly(tbCorners[0], tbCorners[2]); + tbEdges[0].A = 255; // bottom tbEdges[1].avg2RGBOnly(tbCorners[2], tbCorners[3]); + tbEdges[1].A = 255; // right tbEdges[2].avg2RGBOnly(tbCorners[1], tbCorners[3]); + tbEdges[2].A = 255; // up tbEdges[3].avg2RGBOnly(tbCorners[0], tbCorners[1]); + tbEdges[3].A = 255; // middle. tbMiddle.avg2RGBOnly(tbEdges[0], tbEdges[2]); + tbMiddle.A = 255; // just copy result according to tile pos in tessBlock. if(tlt==0) diff --git a/code/nel/src/3d/patchuv_locator.cpp b/code/nel/src/3d/patchuv_locator.cpp index 8608fd137..b42716e80 100644 --- a/code/nel/src/3d/patchuv_locator.cpp +++ b/code/nel/src/3d/patchuv_locator.cpp @@ -106,8 +106,8 @@ void CPatchUVLocator::build(const CPatch *patchCenter, sint edgeCenter, CPatch:: // Find the position. //============================= // Find the uv coord at start of the edge, for 2 patchs. - CVector2f uvCenter; - CVector2f uvNeighbor; + CVector2f uvCenter(0.f, 0.f); + CVector2f uvNeighbor(0.f, 0.f); float decal; // find the uv at start of edgeCenter, + decal due to bind 1/X. diff --git a/code/nel/src/3d/vegetable_manager.cpp b/code/nel/src/3d/vegetable_manager.cpp index 656f99dfe..bb472e75a 100644 --- a/code/nel/src/3d/vegetable_manager.cpp +++ b/code/nel/src/3d/vegetable_manager.cpp @@ -1121,6 +1121,8 @@ void CVegetableManager::addInstance(CVegetableInstanceGroup *ig, CVegetableLightEx &vegetLex= ig->VegetableLightEx; // Color of pointLights modulated by diffuse. CRGBA diffusePL[2]; + diffusePL[0] = CRGBA::Black; + diffusePL[1] = CRGBA::Black; if(vegetLex.NumLights>=1) { diffusePL[0].modulateFromColorRGBOnly(diffuseRGBA, vegetLex.Color[0]); @@ -2491,6 +2493,8 @@ uint CVegetableManager::updateInstanceLighting(CVegetableInstanceGroup *ig, uin CVegetableLightEx &vegetLex= ig->VegetableLightEx; // Color of pointLights modulated by diffuse. CRGBA diffusePL[2]; + diffusePL[0] = CRGBA::Black; + diffusePL[1] = CRGBA::Black; if(vegetLex.NumLights>=1) { diffusePL[0].modulateFromColorRGBOnly(vegetLI.MatDiffuse, vegetLex.Color[0]); diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 57cba49a8..5a8757605 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -1732,8 +1732,8 @@ void CZoneLighter::addTriangles (const CMeshBase &meshBase, const CMeshGeom &mes CVector v2=modelMT*(*vba.getVertexCoordPointer (triIndex[tri*3+2])); // UV - float u[3]; - float v[3]; + float u[3] = { 0.f }; + float v[3] = { 0.f }; for (uint i=0; i<3; i++) { // Get UV coordinates @@ -1764,8 +1764,8 @@ void CZoneLighter::addTriangles (const CMeshBase &meshBase, const CMeshGeom &mes CVector v2=modelMT*(*vba.getVertexCoordPointer (triIndex[tri*3+2])); // UV - float u[3]; - float v[3]; + float u[3] = { 0.f }; + float v[3] = { 0.f }; for (uint i=0; i<3; i++) { // Get UV coordinates @@ -1898,8 +1898,8 @@ void CZoneLighter::addTriangles (const CMeshBase &meshBase, const CMeshMRMGeom & CVector v2=modelMT*(*vba.getVertexCoordPointer (triIndex[tri*3+2])); // UV - float u[3]; - float v[3]; + float u[3] = { 0.f }; + float v[3] = { 0.f }; for (uint i=0; i<3; i++) { // Get UV coordinates From b5f6188757c80853994d3aa1db825cc7b4c6248e Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 22 Aug 2010 09:57:33 +0200 Subject: [PATCH 06/56] Fixed: #1044 Window content is black after switching windowed <-> fullscreen --- .../3d/driver/opengl/driver_opengl_window.cpp | 61 +++++++++++++------ 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index cdd4bdd20..d60395f62 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -1442,6 +1442,9 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) if (_win == EmptyWindow || !_DestroyWindow) return true; + if (getWindowStyle() == windowStyle) + return true; + #if defined(NL_OS_WINDOWS) // get current style @@ -1493,24 +1496,48 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) #elif defined(NL_OS_UNIX) - // Toggle fullscreen - XEvent xev; - xev.xclient.type = ClientMessage; - xev.xclient.serial = 0; - xev.xclient.send_event = True; - xev.xclient.display = _dpy; - xev.xclient.window = _win; - xev.xclient.message_type = XInternAtom(_dpy, "_NET_WM_STATE", False); - xev.xclient.format = 32; - xev.xclient.data.l[0] = windowStyle == EWSFullscreen ? _NET_WM_STATE_ADD:_NET_WM_STATE_REMOVE; - xev.xclient.data.l[1] = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); - xev.xclient.data.l[2] = 0; - xev.xclient.data.l[3] = 1; // 1 for Application, 2 for Page or Taskbar, 0 for old source - xev.xclient.data.l[4] = 0; - if (!XSendEvent(_dpy, DefaultRootWindow(_dpy), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev)) + XWindowAttributes attr; + XGetWindowAttributes(_dpy, _win, &attr); + + // if window is mapped use events else properties + if (attr.map_state != IsUnmapped) { - nlwarning("3D: Failed to toggle to fullscreen"); - return false; + // Toggle fullscreen + XEvent xev; + xev.xclient.type = ClientMessage; + xev.xclient.serial = 0; + xev.xclient.send_event = True; + xev.xclient.display = _dpy; + xev.xclient.window = _win; + xev.xclient.message_type = XInternAtom(_dpy, "_NET_WM_STATE", False); + xev.xclient.format = 32; + xev.xclient.data.l[0] = windowStyle == EWSFullscreen ? _NET_WM_STATE_ADD:_NET_WM_STATE_REMOVE; + xev.xclient.data.l[1] = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); + xev.xclient.data.l[2] = 0; + xev.xclient.data.l[3] = 1; // 1 for Application, 2 for Page or Taskbar, 0 for old source + xev.xclient.data.l[4] = 0; + if (!XSendEvent(_dpy, DefaultRootWindow(_dpy), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev)) + { + nlwarning("3D: Failed to toggle to fullscreen"); + return false; + } + } + else + { + Atom _NET_WM_STATE = XInternAtom(_dpy, "_NET_WM_STATE", False); + + if (windowStyle == EWSFullscreen) + { + Atom _NET_WM_STATE_FULLSCREEN = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); + + // set state property to fullscreen + XChangeProperty(_dpy, _win, _NET_WM_STATE, XA_ATOM, 32, PropModeReplace, (const unsigned char*)&_NET_WM_STATE_FULLSCREEN, 1); + } + else + { + // delete state property + XDeleteProperty(_dpy, _win, _NET_WM_STATE); + } } // show window (hack to avoid black window bug) From 4cf62350955454f93642aae3137ccd92c58c8fbe Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 25 Aug 2010 23:36:29 +0200 Subject: [PATCH 07/56] Changed: #929 Some reliability fixes for the max export plugin. --- .../nel_export/nel_export_export.cpp | 176 +++-- .../3d/plugin_max/nel_mesh_lib/calc_lm.cpp | 14 +- .../plugin_max/nel_mesh_lib/export_anim.cpp | 26 +- .../nel_mesh_lib/export_collision.cpp | 126 +-- .../plugin_max/nel_mesh_lib/export_light.cpp | 7 +- .../nel_mesh_lib/export_lod_character.cpp | 213 ++--- .../nel_mesh_lib/export_material.cpp | 1 + .../plugin_max/nel_mesh_lib/export_mesh.cpp | 732 +++++++++--------- .../nel_mesh_lib/export_mesh_interface.cpp | 95 ++- .../plugin_max/nel_mesh_lib/export_misc.cpp | 12 +- .../3d/plugin_max/nel_mesh_lib/export_nel.h | 2 +- .../nel_mesh_lib/export_particle_system.cpp | 3 +- .../plugin_max/nel_mesh_lib/export_scene.cpp | 16 +- .../nel_mesh_lib/export_skinning.cpp | 61 +- .../nel_mesh_lib/export_vegetable.cpp | 180 ++--- .../3d/plugin_max/scripts/nel_assets_png.ms | 5 + .../scripts/nel_assets_png_batched.ms | 5 +- .../scripts/nel_assets_png_database.ms | 5 + 18 files changed, 914 insertions(+), 765 deletions(-) diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp index c79295925..9f582bd23 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp @@ -17,6 +17,7 @@ #include "std_afx.h" #include "nel_export.h" #include "nel/misc/file.h" +#include "nel/misc/path.h" #include "nel/3d/shape.h" #include "nel/3d/animation.h" #include "nel/3d/skeleton_shape.h" @@ -34,94 +35,133 @@ using namespace NLMISC; bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time) { // Result to return - bool bRet=false; - - // Eval the object a time - ObjectState os = node.EvalWorldState(time); - - // Object exist ? - if (os.obj) + bool bRet = false; + char tempName[L_tmpnam]; + tmpnam(tempName); + + try { - // Skeleton shape - CSkeletonShape *skeletonShape=NULL; - TInodePtrInt *mapIdPtr=NULL; - TInodePtrInt mapId; + // Eval the object a time + ObjectState os = node.EvalWorldState(time); - // If model skinned ? - if (CExportNel::isSkin (node)) + // Object exist ? + if (os.obj) { - // Create a skeleton - INode *skeletonRoot=CExportNel::getSkeletonRootBone (node); + // Skeleton shape + CSmartPtr skeletonShape = NULL; + TInodePtrInt *mapIdPtr=NULL; + TInodePtrInt mapId; - // Skeleton exist ? - if (skeletonRoot) + // If model skinned ? + if (CExportNel::isSkin (node)) { - // Build a skeleton - skeletonShape=new CSkeletonShape(); + // Create a skeleton + INode *skeletonRoot = CExportNel::getSkeletonRootBone(node); - // Add skeleton bind pos info - CExportNel::mapBoneBindPos boneBindPos; - CExportNel::addSkeletonBindPos (node, boneBindPos); + // Skeleton exist ? + if (skeletonRoot) + { + // Build a skeleton + skeletonShape = new CSkeletonShape(); - // Build the skeleton based on the bind pos information - _ExportNel->buildSkeletonShape (*skeletonShape, *skeletonRoot, &boneBindPos, mapId, time); + // Add skeleton bind pos info + CExportNel::mapBoneBindPos boneBindPos; + CExportNel::addSkeletonBindPos (node, boneBindPos); - // Set the pointer to not NULL - mapIdPtr=&mapId; + // Build the skeleton based on the bind pos information + _ExportNel->buildSkeletonShape(*skeletonShape.getPtr(), *skeletonRoot, &boneBindPos, mapId, time); - // Erase the skeleton - if (skeletonShape) - delete skeletonShape; + // Set the pointer to not NULL + mapIdPtr=&mapId; + + // Erase the skeleton + skeletonShape = NULL; + } } - } - - DWORD t = timeGetTime(); - if (InfoLog) - InfoLog->display("Beg buildShape %s \n", node.GetName()); - // Export in mesh format - IShape* pShape=_ExportNel->buildShape (node, time, mapIdPtr, true); - if (InfoLog) - InfoLog->display("End buildShape in %d ms \n", timeGetTime()-t); - - // Conversion success ? - if (pShape) - { - // Open a file - COFile file; - if (file.open (sPath)) + + DWORD t = timeGetTime(); + if (InfoLog) + InfoLog->display("Beg buildShape %s \n", node.GetName()); + // Export in mesh format + CSmartPtr pShape = _ExportNel->buildShape(node, time, mapIdPtr, true); + if (InfoLog) + InfoLog->display("End buildShape in %d ms \n", timeGetTime()-t); + + // Conversion success ? + if (pShape.getPtr()) { + // Open a file + COFile file; + if (file.open(tempName)) + { + try + { + // Create a streamable shape + CShapeStream shapeStream(pShape); + + // Serial the shape + shapeStream.serial(file); + + // All is good + bRet = true; + } + catch (...) + { + nlwarning("Shape serialization failed!"); + try + { + file.close(); + } + catch (...) + { + + } + remove(tempName); + } + } + else + { + nlwarning("Failed to create file %s", tempName); + } + + // Delete the pointer + nldebug ("Delete the pointer"); try { - // Create a streamable shape - CShapeStream shapeStream (pShape); - - // Serial the shape - shapeStream.serial (file); - - // All is good - bRet=true; + bool tempBRet = bRet; + bRet = false; + pShape = NULL; + bRet = tempBRet; } catch (...) { - nlwarning("Shape serialization failed!"); - file.close(); - remove(sPath); + nlwarning("Failed to delete pShape pointer! Something might be wrong."); + remove(tempName); + bRet = false; } } - - // Delete the pointer - nldebug ("Delete the pointer"); - try - { - // memory leak, fixme - // delete pShape; - } - catch (...) - { - nlwarning("Failed to delete pShape pointer! Something might be wrong."); - } } } + catch (...) + { + nlwarning("Fatal exception at CNelExport::exportMesh."); + bRet = false; + } + + if (bRet) + { + try + { + remove(sPath); + } + catch (...) + { + + } + CFile::moveFile(sPath, tempName); + nlinfo("MOVE %s -> %s", tempName, sPath); + } + return bRet; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp index 9f5d95441..e65b4ea56 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp @@ -77,7 +77,8 @@ SLightBuild::SLightBuild() bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime) { // Get a pointer on the object's node - Object *obj = node->EvalWorldState(tvTime).obj; + ObjectState os = node->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (!obj) @@ -98,7 +99,7 @@ bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime) return false; if( deleteIt ) - maxLight->DeleteMe(); + maxLight->MaybeAutoDelete(); return true; } @@ -107,7 +108,8 @@ bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime) void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime) { // Get a pointer on the object's node - Object *obj = node->EvalWorldState(tvTime).obj; + ObjectState os = node->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (!obj) return; @@ -295,7 +297,7 @@ void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime) this->rSoftShadowConeLength = (float)atof(sTmp.c_str()); if( deleteIt ) - maxLight->DeleteMe(); + maxLight->MaybeAutoDelete(); } // *********************************************************************************************** @@ -2401,7 +2403,10 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB TempPlanes[nPlaneNb]->copyFirstLayerTo(*AllPlanes[AllPlanesPrevSize+nPlaneNb],(uint8)nLight); for( nPlaneNb = 0; nPlaneNb < (sint)FaceGroupByPlane.size(); ++nPlaneNb ) + { delete TempPlanes[nPlaneNb]; + TempPlanes[nPlaneNb] = NULL; + } } // Next group of face with the same smooth group and the same material @@ -2497,6 +2502,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB MoveFaceUV1( AllPlanes[i]->faces.begin(), AllPlanes[i]->faces.size(), AllPlanes[i]->x, AllPlanes[i]->y ); delete AllPlanes[i]; + AllPlanes[i] = NULL; } // Save the lightmap diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp index f47204575..3a5d5a259 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp @@ -264,6 +264,7 @@ void CExportNel::addParticleSystemTracks(CAnimation& animation, INode& node, con if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -281,6 +282,7 @@ void CExportNel::addParticleSystemTracks(CAnimation& animation, INode& node, con if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -325,6 +327,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -348,6 +351,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -371,6 +375,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -389,6 +394,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -413,6 +419,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -443,6 +450,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -541,7 +549,8 @@ void CExportNel::addLightTracks (NL3D::CAnimation& animation, INode& node, const { CExportDesc desc; - Object *obj = node.EvalWorldState(0).obj; + ObjectState os = node.EvalWorldState(0); + Object *obj = os.obj; // Check if there is an object if (!obj) @@ -567,6 +576,7 @@ void CExportNel::addLightTracks (NL3D::CAnimation& animation, INode& node, const if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -609,6 +619,7 @@ void CExportNel::addMorphTracks (NL3D::CAnimation& animation, INode& node, const if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -639,6 +650,7 @@ void CExportNel::addObjTracks (CAnimation& animation, Object& obj, const char* p if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -681,6 +693,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -705,6 +718,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -731,6 +745,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -755,6 +770,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -779,6 +795,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -862,6 +879,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -884,6 +902,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -906,6 +925,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -928,6 +948,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -950,6 +971,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -2319,7 +2341,7 @@ void CSSSBuild::compile(NL3D::CAnimation &dest, const char* sBaseName) { // no keys added delete finalTrack; - finalTrack= NULL; + finalTrack = NULL; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp index b0264a8e9..e417539ce 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp @@ -60,7 +60,8 @@ CCollisionMeshBuild* CExportNel::createCollisionMeshBuild(std::vector & for (node=0; nodeEvalWorldState(tvTime).obj; + ObjectState os = nodes[node]->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -70,72 +71,76 @@ CCollisionMeshBuild* CExportNel::createCollisionMeshBuild(std::vector & { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // get the mesh name - uint meshId = rootMeshNames.size(); - rootMeshNames.push_back(nodes[node]->GetName()); - bool collision = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION, 0) != 0; - bool exterior = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION_EXTERIOR, 0) != 0; - - bool deleteIt=false; - if (collision) + + if (tri) { - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - if (obj != tri) - deleteIt = true; + // get the mesh name + uint meshId = rootMeshNames.size(); + rootMeshNames.push_back(nodes[node]->GetName()); + bool collision = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION, 0) != 0; + bool exterior = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION_EXTERIOR, 0) != 0; - uint i; - Mesh &mesh = tri->GetMesh(); - - // Get the object matrix - CMatrix ToWorldSpace; - Matrix3 verticesToWorld = nodes[node]->GetObjectTM(tvTime); - convertMatrix (ToWorldSpace, verticesToWorld); - - // Convert the vertices - for (i=0; i<(uint)mesh.numVerts; ++i) + bool deleteIt=false; + if (collision) { - Point3 v=mesh.verts[i]; - CVector vv=ToWorldSpace*CVector (v.x, v.y, v.z); - pCollisionMeshBuild->Vertices.push_back(vv); - rootMeshVertices.push_back(node); + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + if (obj != tri) + deleteIt = true; + + uint i; + Mesh &mesh = tri->GetMesh(); + + // Get the object matrix + CMatrix ToWorldSpace; + Matrix3 verticesToWorld = nodes[node]->GetObjectTM(tvTime); + convertMatrix (ToWorldSpace, verticesToWorld); + + // Convert the vertices + for (i=0; i<(uint)mesh.numVerts; ++i) + { + Point3 v=mesh.verts[i]; + CVector vv=ToWorldSpace*CVector (v.x, v.y, v.z); + pCollisionMeshBuild->Vertices.push_back(vv); + rootMeshVertices.push_back(node); + } + + uint maxMatId = 0; + + // Convert the faces + for (i=0; i<(uint)mesh.numFaces; ++i) + { + facesRootMeshesInfo.push_back(make_pair(meshId, i)); + + pCollisionMeshBuild->Faces.resize(pCollisionMeshBuild->Faces.size()+1); + pCollisionMeshBuild->Faces.back().V[0] = mesh.faces[i].v[0]+totalVertices; + pCollisionMeshBuild->Faces.back().V[1] = mesh.faces[i].v[1]+totalVertices; + pCollisionMeshBuild->Faces.back().V[2] = mesh.faces[i].v[2]+totalVertices; + + pCollisionMeshBuild->Faces.back().Visibility[0] = ((mesh.faces[i].flags & EDGE_B) != 0); + pCollisionMeshBuild->Faces.back().Visibility[1] = ((mesh.faces[i].flags & EDGE_C) != 0); + pCollisionMeshBuild->Faces.back().Visibility[2] = ((mesh.faces[i].flags & EDGE_A) != 0); + + uint32 maxMaterialId = mesh.faces[i].getMatID(); + if (!exterior && maxMaterialId > maxMatId) + maxMatId = maxMaterialId; + sint32 sid = (exterior) ? -1 : totalSurfaces+maxMaterialId; + + pCollisionMeshBuild->Faces.back().Surface = sid; + pCollisionMeshBuild->Faces.back().Material = maxMaterialId; + } + + totalVertices = pCollisionMeshBuild->Vertices.size(); + totalFaces = pCollisionMeshBuild->Faces.size(); + totalSurfaces += maxMatId+1; } - uint maxMatId = 0; + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); - // Convert the faces - for (i=0; i<(uint)mesh.numFaces; ++i) - { - facesRootMeshesInfo.push_back(make_pair(meshId, i)); - - pCollisionMeshBuild->Faces.resize(pCollisionMeshBuild->Faces.size()+1); - pCollisionMeshBuild->Faces.back().V[0] = mesh.faces[i].v[0]+totalVertices; - pCollisionMeshBuild->Faces.back().V[1] = mesh.faces[i].v[1]+totalVertices; - pCollisionMeshBuild->Faces.back().V[2] = mesh.faces[i].v[2]+totalVertices; - - pCollisionMeshBuild->Faces.back().Visibility[0] = ((mesh.faces[i].flags & EDGE_B) != 0); - pCollisionMeshBuild->Faces.back().Visibility[1] = ((mesh.faces[i].flags & EDGE_C) != 0); - pCollisionMeshBuild->Faces.back().Visibility[2] = ((mesh.faces[i].flags & EDGE_A) != 0); - - uint32 maxMaterialId = mesh.faces[i].getMatID(); - if (!exterior && maxMaterialId > maxMatId) - maxMatId = maxMaterialId; - sint32 sid = (exterior) ? -1 : totalSurfaces+maxMaterialId; - - pCollisionMeshBuild->Faces.back().Surface = sid; - pCollisionMeshBuild->Faces.back().Material = maxMaterialId; - } - - totalVertices = pCollisionMeshBuild->Vertices.size(); - totalFaces = pCollisionMeshBuild->Faces.size(); - totalSurfaces += maxMatId+1; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); } } } @@ -436,6 +441,7 @@ void CExportNel::computeCollisionRetrieverFromScene(TimeValue time, // free the CCollisionMeshBuild. delete pCmb; + pCmb = NULL; // does igname match prefix/suffix??? if(igname.find(igNamePrefix)==0) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp index 14b38ad78..9bda607bb 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp @@ -200,7 +200,8 @@ void CExportNel::getLights (std::vector& vectLight, TimeValue time, INod node=_Ip->GetRootNode(); // Get a pointer on the object's node - Object *obj = node->EvalWorldState(time).obj; + ObjectState os = node->EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -235,9 +236,9 @@ void CExportNel::getLights (std::vector& vectLight, TimeValue time, INod // Add the light in the list vectLight.push_back (nelLight); - // Delete the triObject if we should... + // Delete the GenLight if we should... if (deleteIt) - maxLight->DeleteMe(); + maxLight->MaybeAutoDelete(); } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp index baccbe17b..40cdbf1e6 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp @@ -43,7 +43,8 @@ bool CExportNel::buildLodCharacter (NL3D::CLodCharacterShapeBuild& lodBuild, IN return false; // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -55,129 +56,131 @@ bool CExportNel::buildLodCharacter (NL3D::CLodCharacterShapeBuild& lodBuild, IN { // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (tri) + { + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); - // build the shape - { - // Array of name for the material - CMaxMeshBaseBuild maxBaseBuild; + // build the shape + { + // Array of name for the material + CMaxMeshBaseBuild maxBaseBuild; - // Fill the build interface of CMesh - CMeshBase::CMeshBaseBuild buildBaseMesh; - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); + // Fill the build interface of CMesh + CMeshBase::CMeshBaseBuild buildBaseMesh; + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); - /* Build a mesh. (duplicate UV/normals) - Use a CMeshMRM for an historic reason: simpler because don't use "matrix blocks". - */ - CMRMParameters mrmParams; - CMeshMRM meshMRM; - // To avoid heavy MRM compute, ask for only one lod (=> no poly reduction) - mrmParams.Divisor= 1; - mrmParams.NLods= 1; - meshMRM.build (buildBaseMesh, buildMesh, std::vector(), mrmParams); - const CMeshMRMGeom &meshMRMGeom= meshMRM.getMeshGeom(); - nlassert(meshMRMGeom.getNbLod()==1); + /* Build a mesh. (duplicate UV/normals) + Use a CMeshMRM for an historic reason: simpler because don't use "matrix blocks". + */ + CMRMParameters mrmParams; + CMeshMRM meshMRM; + // To avoid heavy MRM compute, ask for only one lod (=> no poly reduction) + mrmParams.Divisor= 1; + mrmParams.NLods= 1; + meshMRM.build (buildBaseMesh, buildMesh, std::vector(), mrmParams); + const CMeshMRMGeom &meshMRMGeom= meshMRM.getMeshGeom(); + nlassert(meshMRMGeom.getNbLod()==1); - // Build the lodBuild with the mesh - const CVertexBuffer &VB= meshMRMGeom.getVertexBuffer(); - uint32 format= VB.getVertexFormat(); - uint numVerts= VB.getNumVertices(); + // Build the lodBuild with the mesh + const CVertexBuffer &VB= meshMRMGeom.getVertexBuffer(); + uint32 format= VB.getVertexFormat(); + uint numVerts= VB.getNumVertices(); - // The mesh must have at least skinning. - if( (format & CVertexBuffer::PositionFlag) && meshMRMGeom.isSkinned() ) - { - uint i; - CVertexBufferRead vba; - VB.lock (vba); - - // build vertices and skinWeights - lodBuild.Vertices.resize(numVerts); - for(i=0;i triangleSelection; - lodBuild.TriangleIndices.resize(buildMesh.Faces.size() * 3); - triangleSelection.resize(buildMesh.Faces.size(), false); - uint dstTriIdx= 0; - for(i=0;i0;--n) - *(dst++)=*(src++); + for(i=0;i triangleSelection; + lodBuild.TriangleIndices.resize(buildMesh.Faces.size() * 3); + triangleSelection.resize(buildMesh.Faces.size(), false); + uint dstTriIdx= 0; + for(i=0;i0;--n) + *(dst++)=*(src++); + } + // if the material of this pass is the 0th material, flag tris for TextureInfo selection + if(meshMRMGeom.getRdrPassMaterial(0,i)==0) + { + for(uint tri= dstTriIdx/3; triDeleteMe(); + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + } } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp index 5d67684cb..640cf8a19 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp @@ -1294,6 +1294,7 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC // Ok, good texture pTexture=pTextureCube; delete srcTex; + srcTex = NULL; } else { diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp index afa742b61..aad5ee1b9 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp @@ -68,7 +68,8 @@ CMesh::CMeshBuild* CExportNel::createMeshBuild(INode& node, TimeValue tvTime, CM baseBuild = new CMeshBase::CMeshBaseBuild(); // Get a pointer on the object's node - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -79,35 +80,39 @@ CMesh::CMeshBuild* CExportNel::createMeshBuild(INode& node, TimeValue tvTime, CM { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (tri) + { - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; - // Description of materials - CMaxMeshBaseBuild maxBaseBuild; + // Description of materials + CMaxMeshBaseBuild maxBaseBuild; - // Fill the build interface of CMesh + // Fill the build interface of CMesh - // Reset the material array of the buildMesh because it will be rebuild by the exporter - baseBuild->Materials.clear(); + // Reset the material array of the buildMesh because it will be rebuild by the exporter + baseBuild->Materials.clear(); - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, tvTime); - convertMatrix (nodeMatrix, nodeMatrixMax); + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, tvTime); + convertMatrix (nodeMatrix, nodeMatrixMax); - buildBaseMeshInterface (*baseBuild, maxBaseBuild, node, tvTime, nodeMatrix); - buildMeshInterface (*tri, *pMeshBuild, *baseBuild, maxBaseBuild, node, tvTime, NULL, CMatrix::Identity, masterNodeMat, isMorphTarget); - + buildBaseMeshInterface (*baseBuild, maxBaseBuild, node, tvTime, nodeMatrix); + buildMeshInterface (*tri, *pMeshBuild, *baseBuild, maxBaseBuild, node, tvTime, NULL, CMatrix::Identity, masterNodeMat, isMorphTarget); + - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; + } } } @@ -126,7 +131,7 @@ static void copyMultiLodMeshBaseLod0Infos(CMeshBase::CMeshBaseBuild &dst, const // *************************************************************************** // Export a mesh -IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, bool buildLods) +NLMISC::CSmartPtr CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, bool buildLods) { // Is this a multi lod object ? @@ -134,14 +139,15 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt // Here, we must check what kind of node we can build with this mesh. // For the time, just Triobj is supported. - IShape *retShape=NULL; + CSmartPtr retShape = NULL; // If skinning, disable skin modifier if (nodeMap) enableSkinModifier (node, false); // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -184,264 +190,269 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - if (hasWaterMaterial(node, time)) // is this a water shape ? + if (tri) { - retShape = buildWaterShape(node, time); - } - else - { - // Mesh base ? - CMeshBase *meshBase; + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); - - // Is a multi lod object ? - uint lodCount=getScriptAppData (&node, NEL3D_APPDATA_LOD_NAME_COUNT, 0); - if (lodCount && buildLods) + if (hasWaterMaterial(node, time)) // is this a water shape ? { - // This is a multilod object - multiLodObject = true; + retShape = buildWaterShape(node, time); + } + else + { + // Mesh base ? + CSmartPtr meshBase = NULL; - // Listy of material names - std::vector listMaterialName; + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); - // Make the root mesh - CMeshMultiLod::CMeshMultiLodBuild multiLodBuild; - multiLodBuild.LodMeshes.reserve (lodCount+1); - - // Resize to one - bool isTransparent; - bool isOpaque; - multiLodBuild.LodMeshes.resize (1); - multiLodBuild.LodMeshes[0].MeshGeom=buildMeshGeom (node, time, nodeMap, multiLodBuild.BaseMesh, - listMaterialName, isTransparent, isOpaque, nodeMatrix); - multiLodBuild.LodMeshes[0].DistMax=getScriptAppData (&node, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); - multiLodBuild.LodMeshes[0].BlendLength=getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); - multiLodBuild.LodMeshes[0].Flags=0; - if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; - if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; - if ((getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; - if (isTransparent) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; - if (isOpaque) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; - multiLodBuild.StaticLod=getScriptAppData (&node, NEL3D_APPDATA_LOD_DYNAMIC_MESH, NEL3D_APPDATA_LOD_DYNAMIC_MESH_DEFAULT)==0; - - // Bacup scale, rot and pos, etc... - CMeshBase::CMeshBaseBuild bkupMeshBase; - copyMultiLodMeshBaseLod0Infos(bkupMeshBase, multiLodBuild.BaseMesh); - - // Build a world to local matrix - CMatrix worldToNodeMatrix; - - // Is first slot is skinned ? - INode *rootSkel=getSkeletonRootBone (node); - - // For all the other lods - for (uint lod=0; lodGetINodeByName(nodeName.c_str()); - if (lodNode) + // Listy of material names + std::vector listMaterialName; + + // Make the root mesh + CMeshMultiLod::CMeshMultiLodBuild multiLodBuild; + multiLodBuild.LodMeshes.reserve (lodCount+1); + + // Resize to one + bool isTransparent; + bool isOpaque; + multiLodBuild.LodMeshes.resize (1); + multiLodBuild.LodMeshes[0].MeshGeom=buildMeshGeom (node, time, nodeMap, multiLodBuild.BaseMesh, + listMaterialName, isTransparent, isOpaque, nodeMatrix); + multiLodBuild.LodMeshes[0].DistMax=getScriptAppData (&node, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); + multiLodBuild.LodMeshes[0].BlendLength=getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); + multiLodBuild.LodMeshes[0].Flags=0; + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; + if ((getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; + if (isTransparent) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; + if (isOpaque) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; + multiLodBuild.StaticLod=getScriptAppData (&node, NEL3D_APPDATA_LOD_DYNAMIC_MESH, NEL3D_APPDATA_LOD_DYNAMIC_MESH_DEFAULT)==0; + + // Bacup scale, rot and pos, etc... + CMeshBase::CMeshBaseBuild bkupMeshBase; + copyMultiLodMeshBaseLod0Infos(bkupMeshBase, multiLodBuild.BaseMesh); + + // Build a world to local matrix + CMatrix worldToNodeMatrix; + + // Is first slot is skinned ? + INode *rootSkel=getSkeletonRootBone (node); + + // For all the other lods + for (uint lod=0; lodGetNodeTM (time)); - - // Get the parent matrix - CMatrix parentMatrix; - if (rootSkel) + // Get the node + INode *lodNode=_Ip->GetINodeByName(nodeName.c_str()); + if (lodNode) { - // Yes.. - CMatrix tmp; - convertMatrix (tmp, rootSkel->GetNodeTM (time)); - parentMatrix=nodeTM; + // Index of the lod in the build structure + uint index=multiLodBuild.LodMeshes.size(); + + // Resize the build structure + multiLodBuild.LodMeshes.resize (index+1); + + // Get matrix node + CMatrix nodeTM; + convertMatrix (nodeTM, lodNode->GetNodeTM (time)); + + // Get the parent matrix + CMatrix parentMatrix; + if (rootSkel) + { + // Yes.. + CMatrix tmp; + convertMatrix (tmp, rootSkel->GetNodeTM (time)); + parentMatrix=nodeTM; + } + else + { + buildNeLMatrix (parentMatrix, bkupMeshBase.DefaultScale, bkupMeshBase.DefaultRotQuat, bkupMeshBase.DefaultPos); + } + + // Fill the structure + multiLodBuild.LodMeshes[index].MeshGeom=buildMeshGeom (*lodNode, time, nodeMap, multiLodBuild.BaseMesh, + listMaterialName, isTransparent, isOpaque, parentMatrix); + multiLodBuild.LodMeshes[index].DistMax=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); + multiLodBuild.LodMeshes[index].BlendLength=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); + multiLodBuild.LodMeshes[index].Flags=0; + if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; + if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; + if ((getScriptAppData (lodNode, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; + if (isTransparent) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; + if (isOpaque) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; + } + } + + // Restaure default pos, scale and rot, etc... + copyMultiLodMeshBaseLod0Infos(multiLodBuild.BaseMesh, bkupMeshBase); + + + // Make a CMeshMultiLod mesh object + CMeshMultiLod *multiMesh = new CMeshMultiLod; + ++multiMesh->crefs; // hack + + // Build it + multiMesh->build(multiLodBuild); + + // Return this pointer + meshBase = multiMesh; + + // ** force material to be animatable + if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) + { + /// todo hulud: check if material are animated before + for (uint i=0; isetAnimatedMaterial (i, listMaterialName[i]); + } + } + } + else + { + // Array of name for the material + CMaxMeshBaseBuild maxBaseBuild; + + // Fill the build interface of CMesh + CMeshBase::CMeshBaseBuild buildBaseMesh; + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); + + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); + + if( hasLightMap( node, time ) && _Options.bExportLighting ) + calculateLM(&buildMesh, &buildBaseMesh, node, time, maxBaseBuild.FirstMaterial, _Options.OutputLightmapLog); + + // optimized materials remap + std::vector materialRemap; + + // MRM mesh ? + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_MRM, 0)) + { + // Build a MRM parameters block + CMRMParameters parameters; + buildMRMParameters (node, parameters); + + // Get the blend shapes that can be linked + std::vector bsList; + getBSMeshBuild (bsList, node, time, nodeMap!=NULL); + + // CMeshMRM or CMeshMRMSkinned ? + + /* + * Here, export plugin choose between CMeshMRM and CMeshMRMSkinned + */ + if (CMeshMRMSkinned::isCompatible(buildMesh) && bsList.empty()) + { + // Make a CMesh object + CMeshMRMSkinned* meshMRMSkinned=new CMeshMRMSkinned; + + // Build the mesh with the build interface + meshMRMSkinned->build (buildBaseMesh, buildMesh, parameters); + + // optimize number of material + meshMRMSkinned->optimizeMaterialUsage(materialRemap); + + // Return this pointer + meshBase=meshMRMSkinned; } else { - buildNeLMatrix (parentMatrix, bkupMeshBase.DefaultScale, bkupMeshBase.DefaultRotQuat, bkupMeshBase.DefaultPos); + // Make a CMesh object + CMeshMRM* meshMRM=new CMeshMRM; + + // Build the mesh with the build interface + meshMRM->build (buildBaseMesh, buildMesh, bsList, parameters); + + // optimize number of material + meshMRM->optimizeMaterialUsage(materialRemap); + + // Return this pointer + meshBase=meshMRM; } - - // Fill the structure - multiLodBuild.LodMeshes[index].MeshGeom=buildMeshGeom (*lodNode, time, nodeMap, multiLodBuild.BaseMesh, - listMaterialName, isTransparent, isOpaque, parentMatrix); - multiLodBuild.LodMeshes[index].DistMax=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); - multiLodBuild.LodMeshes[index].BlendLength=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); - multiLodBuild.LodMeshes[index].Flags=0; - if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; - if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; - if ((getScriptAppData (lodNode, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; - if (isTransparent) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; - if (isOpaque) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; - } - } - - // Restaure default pos, scale and rot, etc... - copyMultiLodMeshBaseLod0Infos(multiLodBuild.BaseMesh, bkupMeshBase); - - - // Make a CMeshMultiLod mesh object - CMeshMultiLod* multiMesh=new CMeshMultiLod; - - // Build it - multiMesh->build (multiLodBuild); - - // Return this pointer - meshBase=multiMesh; - - // ** force material to be animatable - if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) - { - /// todo hulud: check if material are animated before - for (uint i=0; isetAnimatedMaterial (i, listMaterialName[i]); - } - } - } - else - { - // Array of name for the material - CMaxMeshBaseBuild maxBaseBuild; - - // Fill the build interface of CMesh - CMeshBase::CMeshBaseBuild buildBaseMesh; - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); - - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); - - if( hasLightMap( node, time ) && _Options.bExportLighting ) - calculateLM(&buildMesh, &buildBaseMesh, node, time, maxBaseBuild.FirstMaterial, _Options.OutputLightmapLog); - - // optimized materials remap - std::vector materialRemap; - - // MRM mesh ? - if (getScriptAppData (&node, NEL3D_APPDATA_LOD_MRM, 0)) - { - // Build a MRM parameters block - CMRMParameters parameters; - buildMRMParameters (node, parameters); - - // Get the blend shapes that can be linked - std::vector bsList; - getBSMeshBuild (bsList, node, time, nodeMap!=NULL); - - // CMeshMRM or CMeshMRMSkinned ? - - /* - * Here, export plugin choose between CMeshMRM and CMeshMRMSkinned - */ - if (CMeshMRMSkinned::isCompatible(buildMesh) && bsList.empty()) - { - // Make a CMesh object - CMeshMRMSkinned* meshMRMSkinned=new CMeshMRMSkinned; - - // Build the mesh with the build interface - meshMRMSkinned->build (buildBaseMesh, buildMesh, parameters); - - // optimize number of material - meshMRMSkinned->optimizeMaterialUsage(materialRemap); - - // Return this pointer - meshBase=meshMRMSkinned; } else { // Make a CMesh object - CMeshMRM* meshMRM=new CMeshMRM; + CMesh* mesh=new CMesh; // Build the mesh with the build interface - meshMRM->build (buildBaseMesh, buildMesh, bsList, parameters); + mesh->build (buildBaseMesh, buildMesh); + + // Must be done after the build to update vertex links + // Pass to buildMeshMorph if the original mesh is skinned or not + buildMeshMorph (buildMesh, node, time, nodeMap!=NULL); + mesh->setBlendShapes (buildMesh.BlendShapes); // optimize number of material - meshMRM->optimizeMaterialUsage(materialRemap); + mesh->optimizeMaterialUsage(materialRemap); // Return this pointer - meshBase=meshMRM; + meshBase=mesh; + } + + // Animate materials (must do it after optimizeMaterialUsage()); + if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) + { + for (uint i=0; i=0) + // animate it + meshBase->setAnimatedMaterial (dstMatId, matName); + } } } - else + + // check wether this mesh is auto-animated. Force to false if in view mode + if ( !_View && (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_AUTOMATIC_ANIMATION, 0) != 0) ) { - // Make a CMesh object - CMesh* mesh=new CMesh; - - // Build the mesh with the build interface - mesh->build (buildBaseMesh, buildMesh); - - // Must be done after the build to update vertex links - // Pass to buildMeshMorph if the original mesh is skinned or not - buildMeshMorph (buildMesh, node, time, nodeMap!=NULL); - mesh->setBlendShapes (buildMesh.BlendShapes); - - // optimize number of material - mesh->optimizeMaterialUsage(materialRemap); - - // Return this pointer - meshBase=mesh; + // yes, it is + meshBase->setAutoAnim(true); } - // Animate materials (must do it after optimizeMaterialUsage()); - if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) - { - for (uint i=0; i=0) - // animate it - meshBase->setAnimatedMaterial (dstMatId, matName); - } - } + // Return the mesh base + retShape = meshBase; } - // check wether this mesh is auto-animated. Force to false if in view mode - if ( !_View && (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_AUTOMATIC_ANIMATION, 0) != 0) ) - { - // yes, it is - meshBase->setAutoAnim(true); - } - - // Return the mesh base - retShape=meshBase; + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); } } @@ -450,7 +461,7 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt enableSkinModifier (node, true); // Set the dist max for this shape - if (retShape && !multiLodObject && buildLods) + if (retShape.getPtr() && !multiLodObject && buildLods) { // Get the dist max for this node float distmax = getScriptAppData (&node, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); @@ -1173,6 +1184,7 @@ void CExportNel::getBSMeshBuild (std::vector &bsList, INode CMeshBase::CMeshBaseBuild *dummyMBB = NULL; std::auto_ptr baseMB(createMeshBuild (node, time, dummyMBB, finalSpace)); delete dummyMBB; + dummyMBB = NULL; if (baseMB.get() == NULL) return; j = 0; @@ -1184,7 +1196,7 @@ void CExportNel::getBSMeshBuild (std::vector &bsList, INode ++j; } - bsList.resize (j); + bsList.resize(j, NULL); j = 0; for (i = 0; i < 100; ++i) @@ -1198,6 +1210,7 @@ void CExportNel::getBSMeshBuild (std::vector &bsList, INode // get the meshbuild of the morhp target bsList[j] = createMeshBuild (*pNode, time, pMBB, finalSpace, true); delete pMBB; + pMBB = NULL; // copy src normals from src mesh for vertices that are on interfaces CMesh::CMeshBuild *mb = bsList[j]; if (mb) @@ -1281,7 +1294,8 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP enableSkinModifier (node, false); // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -1291,104 +1305,111 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP { // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Coarse mesh ? - bool coarseMesh=(getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, 0)!=0) && (!_View); - - // No skeleton shape - if (coarseMesh) - nodeMap=NULL; - - // Array of name for the material - CMaxMeshBaseBuild maxBaseBuild; - - // Append material to the base - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, parentMatrix); - - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); - - // Get the node to parent matrix - CMatrix nodeToParentMatrix; - nodeToParentMatrix = parentMatrix.inverted () * nodeMatrix; - - // Fill the build interface of CMesh - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap, nodeToParentMatrix); - - // Append material names - isTransparent=false; - isOpaque=false; - for (uint i=0; i bsList; - getBSMeshBuild (bsList, node, time, nodeMap!=NULL); - - // Build the mesh with the build interface - meshMRMGeom->build (buildMesh, bsList, buildBaseMesh.Materials.size(), parameters); - - // Return this pointer - meshGeom=meshMRMGeom; - - for (uint32 bsListIt = 0; bsListIt < bsList.size(); ++bsListIt) - delete bsList[bsListIt]; - } - else - { - // Make a CMesh object - CMeshGeom* mGeom=new CMeshGeom; + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt = (obj != tri); // Coarse mesh ? + bool coarseMesh=(getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, 0)!=0) && (!_View); + + // No skeleton shape if (coarseMesh) + nodeMap=NULL; + + // Array of name for the material + CMaxMeshBaseBuild maxBaseBuild; + + // Append material to the base + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, parentMatrix); + + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); + + // Get the node to parent matrix + CMatrix nodeToParentMatrix; + nodeToParentMatrix = parentMatrix.inverted () * nodeMatrix; + + // Fill the build interface of CMesh + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap, nodeToParentMatrix); + + // Append material names + isTransparent=false; + isOpaque=false; + for (uint i=0; ibuild (buildMesh, buildBaseMesh.Materials.size()); + if( hasLightMap( node, time ) && _Options.bExportLighting ) + calculateLM(&buildMesh, &buildBaseMesh, node, time, maxBaseBuild.FirstMaterial, _Options.OutputLightmapLog); - // Return this pointer - meshGeom=mGeom; + // MRM mesh ? + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_MRM, 0) && (!coarseMesh) ) + { + // Build a MRM parameters block + CMRMParameters parameters; + buildMRMParameters (node, parameters); + + // Make a CMesh object + CMeshMRMGeom* meshMRMGeom=new CMeshMRMGeom; + + // Get the blend shapes but in mesh build form + std::vector bsList; + getBSMeshBuild (bsList, node, time, nodeMap!=NULL); + + // Build the mesh with the build interface + meshMRMGeom->build (buildMesh, bsList, buildBaseMesh.Materials.size(), parameters); + + // Return this pointer + meshGeom=meshMRMGeom; + + #ifdef NL_DONT_FIND_MAX_CRASH + for (uint32 bsListIt = 0; bsListIt < bsList.size(); ++bsListIt) + { + delete bsList[bsListIt]; + bsList[bsListIt] = NULL; + } + #endif + } + else + { + // Make a CMesh object + CMeshGeom* mGeom=new CMeshGeom; + + // Coarse mesh ? + if (coarseMesh) + { + // Force vertex format + buildMesh.VertexFlags=NL3D_COARSEMESH_VERTEX_FORMAT_EXPORT; + } + + // Build the mesh with the build interface + mGeom->build(buildMesh, buildBaseMesh.Materials.size()); + + // Return this pointer + meshGeom=mGeom; + } + + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); } } @@ -1397,7 +1418,7 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP enableSkinModifier (node, true); if (InfoLog) - InfoLog->display("buidlMeshGeom : %d ms\n", timeGetTime()-t); + InfoLog->display("buildMeshGeom : %d ms\n", timeGetTime()-t); if (InfoLog) InfoLog->display("End of %s \n", node.GetName()); @@ -1657,10 +1678,15 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time) // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; + + if (!obj) return NULL; // Get a triobject from the node - TriObject *tri = (TriObject *) obj->ConvertToType(0, Class_ID(TRIOBJ_CLASS_ID, 0)); + TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); + + if (!tri) return NULL; // Note that the TriObject should only be deleted // if the pointer to it is not equal to the object @@ -2033,7 +2059,8 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time) // Delete the triObject if we should... if (deleteIt) - tri->DeleteMe(); + tri->MaybeAutoDelete(); + tri = NULL; nlinfo("WaterShape : build succesful"); return ws; } @@ -2047,11 +2074,13 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time) // *************************************************************************** bool CExportNel::buildMeshAABBox(INode &node, NLMISC::CAABBox &dest, TimeValue time) { - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; if (!obj) return false; if (!obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) return false; // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (!tri) return false; // Note that the TriObject should only be deleted // if the pointer to it is not equal to the object // pointer that called ConvertToType() @@ -2073,10 +2102,11 @@ bool CExportNel::buildMeshAABBox(INode &node, NLMISC::CAABBox &dest, TimeValue t // if (deleteIt) { -#ifndef NL_DEBUG - tri->DeleteMe(); +#ifdef NL_DONT_FIND_MAX_CRASH + tri->MaybeAutoDelete(); #endif // NL_DEBUG } + tri = NULL; return true; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp index 4ec4f5ba3..e0b647da3 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp @@ -131,7 +131,8 @@ struct CMeshInterface bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime) { // Get a pointer on the object's node - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (!obj) return false; @@ -140,6 +141,8 @@ bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime) { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + + if (!tri) return false; // Note that the TriObject should only be deleted // if the pointer to it is not equal to the object @@ -177,9 +180,8 @@ bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime) } // if (deleteIt) - { - tri->DeleteMe(); - } + tri->MaybeAutoDelete(); + tri = NULL; return true; } return false; @@ -316,50 +318,53 @@ static void AddNodeToQuadGrid(const NLMISC::CAABBox &delimiter, TNodeFaceQG &des { nldebug((std::string("Adding ") + node.GetName() + std::string(" to mesh interface quad grid")).c_str()); // add this node tris - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; if (obj) { if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt = false; - if (obj != tri) - deleteIt = true; - Mesh &mesh = tri->GetMesh(); - - Matrix3 nodeMat = node.GetObjectTM(time); - CNodeFace nodeFace; - - NLMISC::CAABBox faceBBox; - - uint numFaceAdded = 0; - for(sint l = 0; l < mesh.getNumFaces(); ++l) + if (tri) { - for(uint m = 0; m < 3; ++m) + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt = false; + if (obj != tri) + deleteIt = true; + Mesh &mesh = tri->GetMesh(); + + Matrix3 nodeMat = node.GetObjectTM(time); + CNodeFace nodeFace; + + NLMISC::CAABBox faceBBox; + + uint numFaceAdded = 0; + for(sint l = 0; l < mesh.getNumFaces(); ++l) { - Point3 pos = nodeMat * mesh.getVert(mesh.faces[l].v[m]); - CExportNel::convertVector(nodeFace.P[m], pos); - } - // test if we must insert in quadgrid - nodeFace.buildBBox(faceBBox); - if (faceBBox.intersect(delimiter)) - { - nodeFace.SmoothGroup = mesh.faces[l].smGroup; - destQuadGrid.insert(faceBBox.getMin(), faceBBox.getMax(), nodeFace); - ++ numFaceAdded; - } - - } - nldebug("%d faces where added", numFaceAdded); - // - if (deleteIt) - { - tri->DeleteMe(); - } + for(uint m = 0; m < 3; ++m) + { + Point3 pos = nodeMat * mesh.getVert(mesh.faces[l].v[m]); + CExportNel::convertVector(nodeFace.P[m], pos); + } + // test if we must insert in quadgrid + nodeFace.buildBBox(faceBBox); + if (faceBBox.intersect(delimiter)) + { + nodeFace.SmoothGroup = mesh.faces[l].smGroup; + destQuadGrid.insert(faceBBox.getMin(), faceBBox.getMax(), nodeFace); + ++ numFaceAdded; + } + + } + nldebug("%d faces where added", numFaceAdded); + // + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; + } } } } @@ -478,16 +483,20 @@ static void ApplyMeshInterfacesUsingSceneNormals(INode &sceneBaseNode, std::vect */ static bool SelectVerticesInMeshFromInterfaces(const std::vector &inters, float threshold, INode &node, TimeValue tvTime) { - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object + if (!obj) return false; if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) { // Get a triobject from the node - TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (!tri) return false; if (obj != tri) { // not a mesh object, so do nothing - tri->DeleteMe(); + tri->MaybeAutoDelete(); + tri = NULL; return false; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp index 0f2ebdc18..0b2426758 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp @@ -511,7 +511,8 @@ std::string CExportNel::getNelObjectName (INode& node) { // Workaround for FX (don't know why, but the AppData are not copied when FX are duplicated, so try to get the name in another way) // If this is a particle system, try to get the name of the shape.from the param blocks - Object *obj = node.EvalWorldState(0).obj; + ObjectState os = node.EvalWorldState(0); + Object *obj = os.obj; // Check if there is an object if (obj) { @@ -542,7 +543,8 @@ std::string CExportNel::getNelObjectName (INode& node) } else { - Object *obj = node.EvalWorldState(0).obj; + ObjectState os = node.EvalWorldState(0); + Object *obj = os.obj; if (obj) { ad = obj->GetAppDataChunk (MAXSCRIPT_UTILITY_CLASS_ID, UTILITY_CLASS_ID, NEL3D_APPDATA_INSTANCE_SHAPE); @@ -906,7 +908,8 @@ void CExportNel::getObjectNodes (std::vector& vectNode, TimeValue time, node=_Ip->GetRootNode(); // Get a pointer on the object's node - Object *obj = node->EvalWorldState(time).obj; + ObjectState os = node->EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -1257,7 +1260,8 @@ void CExportNel::buildCamera(NL3D::CCameraInfo &cameraInfo, INode& node, TimeVal cameraInfo.Fov = genCamera->GetFOV(time); if (deleteIt) - genCamera->DeleteMe(); + genCamera->MaybeAutoDelete(); + genCamera = NULL; } } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h index 81fbac682..d413e1109 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h @@ -292,7 +292,7 @@ public: * * skeletonShape must be NULL if no bones. */ - NL3D::IShape* buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, + NLMISC::CSmartPtr buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, bool buildLods); /** diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp index 4d10a5508..4c6b6bc8b 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp @@ -26,7 +26,8 @@ using namespace NL3D; IShape* CExportNel::buildParticleSystem(INode& node, TimeValue time) { - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; nlassert(obj); std::string shapeName; // try to get the complete path diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp index 8395d11ce..4e7edea8a 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp @@ -249,8 +249,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v clusterTemp.Name = pNode->GetName(); vClusters.push_back (clusterTemp); - delete pMB; - delete pMBB; + delete pMB; pMB = NULL; + delete pMBB; pMBB = NULL; } } @@ -376,7 +376,9 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v vPortals.push_back (portalTemp); delete pMB; + pMB = NULL; delete pMBB; + pMBB = NULL; } } @@ -406,7 +408,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v * If it is a FX, we read its bbox from its shape * If we can't read it, we use the bbox of the fx helper in max */ - Object *obj = pNode->EvalWorldState(tvTime).obj; + ObjectState os = pNode->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (obj) { @@ -452,6 +455,7 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v buildMeshBBox = false; } delete ss.getShapePointer(); + ss.setShapePointer(NULL); } catch (NLMISC::Exception &e) { @@ -506,8 +510,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v } // debug purpose : to remove - delete pMB; - delete pMBB; + delete pMB; pMB = NULL; + delete pMBB; pMBB = NULL; } ++nNumIG; @@ -911,7 +915,7 @@ void CExportNel::buildScene (NL3D::CScene &scene, NL3D::CShapeBank &shapeBank, I // Swap pointer and release unlighted one. swap(ig, igOut); - delete igOut; + delete igOut; igOut = NULL; } // Add all models to the scene diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp index c48b840c7..c1809508f 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp @@ -1386,7 +1386,8 @@ bool CExportNel::mirrorPhysiqueSelection(INode &node, TimeValue tvTime, const st uint vertCount; // Get a pointer on the object's node. - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object ok= false; @@ -1398,35 +1399,39 @@ bool CExportNel::mirrorPhysiqueSelection(INode &node, TimeValue tvTime, const st { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Get the node matrix. TODO: Matrix headhache? - /*Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, tvTime); - convertMatrix (nodeMatrix, nodeMatrixMax);*/ - - // retrive Position geometry - vertCount= tri->NumPoints(); - tempVertex.resize(vertCount); - for(uint i=0;iGetPoint(i); - tempVertex[i].Pos.set(v.x, v.y, v.z); + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; + + // Get the node matrix. TODO: Matrix headhache? + /*Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, tvTime); + convertMatrix (nodeMatrix, nodeMatrixMax);*/ + + // retrive Position geometry + vertCount= tri->NumPoints(); + tempVertex.resize(vertCount); + for(uint i=0;iGetPoint(i); + tempVertex[i].Pos.set(v.x, v.y, v.z); + } + + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; + + // ok! + ok= true; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); - - // ok! - ok= true; } } if(!ok) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp index 6c054404a..6e10f9c78 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp @@ -33,7 +33,8 @@ bool CExportNel::buildVegetableShape (NL3D::CVegetableShape& skeletonShape, INo bool res = false; // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -42,116 +43,119 @@ bool CExportNel::buildVegetableShape (NL3D::CVegetableShape& skeletonShape, INo { // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Build a mesh base structure - CMeshBase::CMeshBaseBuild buildBaseMesh; - CMaxMeshBaseBuild maxBaseBuild; - - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); - - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); - - // Build a mesh - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, NULL); - - // Has UV 1 - if ((buildMesh.VertexFlags & CVertexBuffer::TexCoord0Flag) == 0) - { - // Error - outputErrorMessage ("Can't build vegetable mesh: need UV1 coordinates"); - } - else + + if (tri) { + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; + + // Build a mesh base structure + CMeshBase::CMeshBaseBuild buildBaseMesh; + CMaxMeshBaseBuild maxBaseBuild; + + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); + + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); + // Build a mesh - CMesh mesh; - mesh.build (buildBaseMesh, buildMesh); + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, NULL); - // Number of matrix block - if (mesh.getNbMatrixBlock () != 1) + // Has UV 1 + if ((buildMesh.VertexFlags & CVertexBuffer::TexCoord0Flag) == 0) { // Error - outputErrorMessage ("The object can't be skinned"); + outputErrorMessage ("Can't build vegetable mesh: need UV1 coordinates"); } else { - // Number of render pass - if (mesh.getNbRdrPass (0) != 1) + // Build a mesh + CMesh mesh; + mesh.build (buildBaseMesh, buildMesh); + + // Number of matrix block + if (mesh.getNbMatrixBlock () != 1) { // Error - outputErrorMessage ("The object must have less than one material!"); + outputErrorMessage ("The object can't be skinned"); } else { - // Build a vegetable mesh - CVegetableShapeBuild vegetableBuild; - - // Copy the vertex buffer - vegetableBuild.VB = mesh.getVertexBuffer (); - - // Copy the primitive block - vegetableBuild.PB = mesh.getRdrPassPrimitiveBlock (0, 0); - - // Get the appdata - vegetableBuild.AlphaBlend = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND, 0) == 0; - - // Alpha blend ? - if (vegetableBuild.AlphaBlend) + // Number of render pass + if (mesh.getNbRdrPass (0) != 1) { - // Default options - vegetableBuild.PreComputeLighting = true; - vegetableBuild.DoubleSided = true; - - // Lighted ? - vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_ON_LIGHTED, 0) == 0; + // Error + outputErrorMessage ("The object must have less than one material!"); } else { - // Lighted ? - vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) != 2; + // Build a vegetable mesh + CVegetableShapeBuild vegetableBuild; - // Precompute light ? - vegetableBuild.PreComputeLighting = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) == 0; + // Copy the vertex buffer + vegetableBuild.VB = mesh.getVertexBuffer (); - // Double sided ? - vegetableBuild.DoubleSided = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_DOUBLE_SIDED, 0) != BST_UNCHECKED; + // Copy the primitive block + vegetableBuild.PB = mesh.getRdrPassPrimitiveBlock (0, 0); + + // Get the appdata + vegetableBuild.AlphaBlend = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND, 0) == 0; + + // Alpha blend ? + if (vegetableBuild.AlphaBlend) + { + // Default options + vegetableBuild.PreComputeLighting = true; + vegetableBuild.DoubleSided = true; + + // Lighted ? + vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_ON_LIGHTED, 0) == 0; + } + else + { + // Lighted ? + vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) != 2; + + // Precompute light ? + vegetableBuild.PreComputeLighting = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) == 0; + + // Double sided ? + vegetableBuild.DoubleSided = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_DOUBLE_SIDED, 0) != BST_UNCHECKED; + } + + // PreComputeLighting? + if (vegetableBuild.PreComputeLighting) + { + // BestSidedPreComputeLighting? + vegetableBuild.BestSidedPreComputeLighting= CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_FORCE_BEST_SIDED_LIGHTING, 0) != BST_UNCHECKED; + } + + // Max bend weight + vegetableBuild.MaxBendWeight = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_FACTOR, NEL3D_APPDATA_BEND_FACTOR_DEFAULT); + + // BendMode + vegetableBuild.BendCenterMode = (CVegetableShapeBuild::TBendCenterMode)CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_CENTER, 0); + + // Build it + skeletonShape.build (vegetableBuild); + + // Ok + res = true; } - - // PreComputeLighting? - if (vegetableBuild.PreComputeLighting) - { - // BestSidedPreComputeLighting? - vegetableBuild.BestSidedPreComputeLighting= CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_FORCE_BEST_SIDED_LIGHTING, 0) != BST_UNCHECKED; - } - - // Max bend weight - vegetableBuild.MaxBendWeight = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_FACTOR, NEL3D_APPDATA_BEND_FACTOR_DEFAULT); - - // BendMode - vegetableBuild.BendCenterMode = (CVegetableShapeBuild::TBendCenterMode)CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_CENTER, 0); - - // Build it - skeletonShape.build (vegetableBuild); - - // Ok - res = true; } } - } - if (deleteIt) - tri->DeleteMe(); + if (deleteIt) + tri->MaybeAutoDelete(); + } } } diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms index 531c0f0b8..82d691d5f 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms @@ -101,3 +101,8 @@ for m in getClassInstances NelMaterial do m.delegate.ReflectionMap = undefined m.delegate.RefractionMap = undefined ) + +actionMan.executeAction 0 "40021" -- Selection: Select All +actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected +actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps +actionMan.executeAction 0 "40043" -- Selection: Select None diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms index b6b5e0434..cdff0431c 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -169,9 +169,12 @@ rollout assets_png_rollout "Properties" m.delegate.ReflectionMap = undefined m.delegate.RefractionMap = undefined ) - actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40021" -- Selection: Select All actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected + actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40043" -- Selection: Select None + return 1 ) diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms index cd372322c..2d119e4e0 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms @@ -141,3 +141,8 @@ for m in getClassInstances NelMaterial do m.delegate.ReflectionMap = undefined m.delegate.RefractionMap = undefined ) + +actionMan.executeAction 0 "40021" -- Selection: Select All +actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected +actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps +actionMan.executeAction 0 "40043" -- Selection: Select None From cfe8f1870fe7599f5e099d24db8883322adbb833 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 26 Aug 2010 09:56:30 +0200 Subject: [PATCH 08/56] Changed: #1074 sheets_packer using default static relative paths --- code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp | 3 --- code/ryzom/tools/sheets_packer/stdpch.h | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp index 92d87592f..340753f4a 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp @@ -148,9 +148,6 @@ const std::string ConfigFileName = "sheets_packer.cfg"; CClientConfig::CClientConfig() { SaveConfig = false; - DataPath.push_back("../../client/data/"); // Default Path for the Data. - DataPath.push_back("../../common/data_leveldesign/"); // Default Path for the Level Design Directory. - DataPath.push_back("../../common/data_common/"); // Default Path for the Level Design Directory. UpdatePackedSheet = true; // Update packed sheet if needed SceneName = ""; IdFilePath = ""; diff --git a/code/ryzom/tools/sheets_packer/stdpch.h b/code/ryzom/tools/sheets_packer/stdpch.h index 81db6e40c..d0135ae17 100644 --- a/code/ryzom/tools/sheets_packer/stdpch.h +++ b/code/ryzom/tools/sheets_packer/stdpch.h @@ -1,4 +1,3 @@ - #include #include @@ -35,7 +34,6 @@ //#include #ifdef NL_OS_WINDOWS +#define NOMINMAX #include -#undef min -#undef max #endif // NL_OS_WINDOWS From b80b9c4c583be741a2ef323deadd01109bcae03a Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 26 Aug 2010 14:49:11 +0200 Subject: [PATCH 09/56] Fixed: #1074 sheets_packer using default static relative paths --- code/ryzom/client/src/continent_manager.cpp | 12 ++++--- code/ryzom/client/src/continent_manager.h | 2 +- .../client/src/continent_manager_build.cpp | 10 +++--- .../client/src/continent_manager_build.h | 3 +- .../tools/sheets_packer/sheets_packer.cfg | 3 ++ .../tools/sheets_packer/sheets_packer.vcproj | 10 +++--- .../tools/sheets_packer/sheets_packer_cfg.cpp | 34 +++++-------------- .../tools/sheets_packer/sheets_packer_cfg.h | 20 ++++------- .../sheets_packer/sheets_packer_init.cpp | 2 +- 9 files changed, 38 insertions(+), 58 deletions(-) diff --git a/code/ryzom/client/src/continent_manager.cpp b/code/ryzom/client/src/continent_manager.cpp index 6e2f655f6..a9e8b3cb9 100644 --- a/code/ryzom/client/src/continent_manager.cpp +++ b/code/ryzom/client/src/continent_manager.cpp @@ -697,26 +697,28 @@ void CContinentManager::reloadSky() // *************************************************************************** void CContinentManager::loadContinentLandMarks() { + std::string dataPath = "../../client/data"; + if (ClientCfg.UpdatePackedSheet == false) { - readLMConts(); + readLMConts(dataPath); } else { - buildLMConts(); - readLMConts(); + buildLMConts("ryzom.world", "../../common/data_leveldesign/primitives", dataPath); + readLMConts(dataPath); } } // *************************************************************************** -void CContinentManager::readLMConts() +void CContinentManager::readLMConts(const std::string &dataPath) { CIFile f; string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false); if (sPackedFileName.empty()) - sPackedFileName = LM_PACKED_FILE_SAVE; + sPackedFileName = CPath::standardizePath(dataPath) + LM_PACKED_FILE; if (f.open(sPackedFileName)) { diff --git a/code/ryzom/client/src/continent_manager.h b/code/ryzom/client/src/continent_manager.h index 062e2ec82..1d9326280 100644 --- a/code/ryzom/client/src/continent_manager.h +++ b/code/ryzom/client/src/continent_manager.h @@ -127,7 +127,7 @@ public: protected: void loadContinentLandMarks(); - void readLMConts(); + void readLMConts(const std::string &dataPath); protected: diff --git a/code/ryzom/client/src/continent_manager_build.cpp b/code/ryzom/client/src/continent_manager_build.cpp index 7e6999c0c..8d83de984 100644 --- a/code/ryzom/client/src/continent_manager_build.cpp +++ b/code/ryzom/client/src/continent_manager_build.cpp @@ -67,7 +67,7 @@ void primitiveToLM(CContLandMark &lm, IPrimitive *p) } // *************************************************************************** -bool buildLMConts() +bool buildLMConts(const std::string &worldSheet, const std::string &primitivesPath, const std::string &dataPath) { bool bRebuild = false; @@ -75,7 +75,7 @@ bool buildLMConts() map AllContinents; // Map with all continents. { - CEntitySheet *sheet = SheetMngr.get(CSheetId("ryzom.world")); + CEntitySheet *sheet = SheetMngr.get(CSheetId(worldSheet)); if (!sheet || sheet->type() != CEntitySheet::WORLD) { @@ -100,7 +100,7 @@ bool buildLMConts() vector vRegionFiles; { vector vTmp; - CPath::getPathContent("../../common/data_leveldesign/primitives", true, false, true, vTmp); + CPath::getPathContent(primitivesPath, true, false, true, vTmp); for (uint32 i = 0; i < vTmp.size(); ++i) { string filename = CFile::getFilename(vTmp[i]); @@ -115,7 +115,7 @@ bool buildLMConts() string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false); if (sPackedFileName.empty()) { - sPackedFileName = LM_PACKED_FILE_SAVE; + sPackedFileName = NLMISC::CPath::standardizePath(dataPath) + LM_PACKED_FILE; bRebuild = true; } else @@ -253,7 +253,7 @@ bool buildLMConts() } else { - nlwarning("cannot find continent %s in ryzom.world", contName.c_str()); + nlwarning("cannot find continent %s in %s", contName.c_str(), worldSheet.c_str()); } } } diff --git a/code/ryzom/client/src/continent_manager_build.h b/code/ryzom/client/src/continent_manager_build.h index fdcd77c46..46361689f 100644 --- a/code/ryzom/client/src/continent_manager_build.h +++ b/code/ryzom/client/src/continent_manager_build.h @@ -83,10 +83,9 @@ public: } }; -extern bool buildLMConts(); +extern bool buildLMConts(const std::string &worldSheet, const std::string &primitivesPath, const std::string &dataPath); #define LM_PACKED_FILE "lmconts.packed" -#define LM_PACKED_FILE_SAVE "../../client/data/" LM_PACKED_FILE #define WORLD_MAP_FILE "global_world_map.primitive" #endif // CL_CONTINENT_MANAGER_BUILD_H diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.cfg b/code/ryzom/tools/sheets_packer/sheets_packer.cfg index 9f2647ec5..ab175d829 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.cfg +++ b/code/ryzom/tools/sheets_packer/sheets_packer.cfg @@ -4,4 +4,7 @@ ///////////////////////////////// ///////////////////////////////// DataPath = { "../../common/data_leveldesign", "../../common/data_common", "../../client/data" }; +WorldSheet = "ryzom.world"; +PrimitivesPath = "../../common/data_leveldesign/primitives"; +OutputDataPath = "../../client/data"; LigoPrimitiveClass = "world_editor_classes.xml"; diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj index 9c5d6d60d..f43f88af4 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj +++ b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj @@ -52,7 +52,7 @@ Optimization="4" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC" BasicRuntimeChecks="3" SmallerTypeCheck="true" RuntimeLibrary="3" @@ -140,7 +140,7 @@ Optimization="4" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC" BasicRuntimeChecks="3" SmallerTypeCheck="true" RuntimeLibrary="3" @@ -148,6 +148,7 @@ PrecompiledHeaderThrough="stdpch.h" WarningLevel="3" DebugInformationFormat="3" + OmitDefaultLibName="true" /> @@ -232,7 +232,7 @@ OmitFramePointers="true" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC" StringPooling="true" RuntimeLibrary="2" BufferSecurityCheck="false" @@ -325,7 +325,7 @@ OmitFramePointers="true" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC" StringPooling="true" RuntimeLibrary="2" BufferSecurityCheck="false" diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp index 340753f4a..77e05a7f7 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp @@ -147,12 +147,6 @@ const std::string ConfigFileName = "sheets_packer.cfg"; //--------------------------------------------------- CClientConfig::CClientConfig() { - SaveConfig = false; - UpdatePackedSheet = true; // Update packed sheet if needed - SceneName = ""; - IdFilePath = ""; - LanguageCode = "en"; // Default to english - FPExceptions = false; // Disable Floating Point Exceptions. }// CClientConfig // @@ -178,13 +172,14 @@ void setValues() } catch(EUnknownVar &) {nlwarning("Default value used for 'DataPath' !!!");} - // UpdatePackedSheet - READ_BOOL(UpdatePackedSheet) - - // SceneName - READ_STRING(SceneName) - // IdFile Path - READ_STRING(IdFilePath) + // World sheet name + READ_STRING(WorldSheet) + // Primitives path + READ_STRING(PrimitivesPath) + // Output data path + READ_STRING(OutputDataPath) + // Ligo primitive class + READ_STRING(LigoPrimitiveClass) ///////////// // FILTERS // @@ -216,13 +211,6 @@ void setValues() } } catch(EUnknownVar &) {} - - READ_STRING(LigoPrimitiveClass) - - // LanguageCode - READ_STRING(LanguageCode) - - READ_BOOL(FPExceptions) }// load // @@ -261,10 +249,4 @@ void CClientConfig::init(const std::string &configFileName) //----------------------------------------------- void CClientConfig::release () { - // Do we have to save the cfg file ? - if (AppCfg.SaveConfig) - { - // Save it - AppCfg.ConfigFile.save (); - } } diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h index 169693af4..6c1f2e12a 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h +++ b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h @@ -41,24 +41,18 @@ struct CClientConfig void init (const std::string &configFileName); - /// Save the cfg file when exit the client ? - bool SaveConfig; - /// Data Path. std::vector DataPath; - /// True if we want the packed sheet to be updated if needed - bool UpdatePackedSheet; - /// Name of the scene to play. - std::string SceneName; - /// Path for the Id file. - std::string IdFilePath; - // Enable/disable Floating Point Exceptions - bool FPExceptions; + + /// World sheet name + std::string WorldSheet; + /// Path where to find .primitive files + std::string PrimitivesPath; + /// Path where to create lmconts.packed + std::string OutputDataPath; std::string LigoPrimitiveClass; -// TODO - std::string LanguageCode; public: /// Constructor. diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp index f429aa634..9e1afe071 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp @@ -98,7 +98,7 @@ bool init() if (!LigoConfig.readPrimitiveClass (AppCfg.LigoPrimitiveClass.c_str(), false)) nlwarning ("Can't load primitive class file %s", AppCfg.LigoPrimitiveClass.c_str()); NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; - buildLMConts(); + buildLMConts(AppCfg.WorldSheet, AppCfg.PrimitivesPath, AppCfg.OutputDataPath); // The init is a success. return true; From 790cdf83c114c07306b499aac55758318f46a952 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 Aug 2010 16:48:44 +0200 Subject: [PATCH 10/56] Fixed: #1074 sheets_packer using default static relative paths --- code/ryzom/client/src/sheet_manager.cpp | 2 +- code/ryzom/client/src/sheet_manager.h | 9 +++++++++ code/ryzom/tools/sheets_packer/sheets_packer_init.cpp | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/sheet_manager.cpp b/code/ryzom/client/src/sheet_manager.cpp index fff3c5162..5ac3d2831 100644 --- a/code/ryzom/client/src/sheet_manager.cpp +++ b/code/ryzom/client/src/sheet_manager.cpp @@ -674,7 +674,7 @@ void CSheetManager::loadAllSheet(NLMISC::IProgressCallback &callBack, bool updat path.clear(); } if(path.empty()) - path = "../../client/data/" + TypeVersion[i].Type + ".packed_sheets"; + path = CPath::standardizePath(_OutputDataPath) + TypeVersion[i].Type + ".packed_sheets"; ::loadForm(extensions, path, entitySheetContainer, updatePackedSheet); TEntitySheetMap::iterator it = entitySheetContainer.begin(); diff --git a/code/ryzom/client/src/sheet_manager.h b/code/ryzom/client/src/sheet_manager.h index ee504f9fd..c0ba386a2 100644 --- a/code/ryzom/client/src/sheet_manager.h +++ b/code/ryzom/client/src/sheet_manager.h @@ -203,11 +203,20 @@ public: /// dump all visual slots indexes in a file void dumpVisualSlotsIndex(); + /// Set output data path + void setOutputDataPath(const std::string &dataPath) { _OutputDataPath = dataPath; } + + /// Return output data path + const std::string& getOutputDataPath() const { return _OutputDataPath; } + private: typedef std::vector TItemVector; typedef std::vector TSlots; TSlots _VisualSlots; + // directory where to create .packed_sheets + std::string _OutputDataPath; + protected: diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp index 9e1afe071..02f115d03 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp @@ -92,6 +92,7 @@ bool init() // load packed sheets nlinfo("Loading sheets..."); IProgressCallback callback; + SheetMngr.setOutputDataPath(AppCfg.OutputDataPath); SheetMngr.load (callback, true, true); // Make the lmconts.packed file From 7610d61b804a01ce9fa5fc25484407cb2e352e8a Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 Aug 2010 17:03:41 +0200 Subject: [PATCH 11/56] Changed: Allow to write interface into a PNG file --- code/nel/tools/3d/build_interface/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 207519aaa..1f8d50997 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -366,9 +366,20 @@ int main(int nNbArg, char **ppArgs) fmtName += ".tga"; if (outTga.open(fmtName)) { - GlobalTexture.writeTGA (outTga, 32); + std::string ext; + if (toLower(fmtName.find(".png")) != string::npos) + { + ext = "png"; + GlobalTexture.writePNG (outTga, 32); + } + else + { + ext = "tga"; + GlobalTexture.writeTGA (outTga, 32); + } + outTga.close(); - outString (string("Writing tga file : ") + fmtName + "\n"); + outString (toString("Writing %s file : %s\n", ext.c_str(), fmtName.c_str())); } else { From b2417a68ab6a1071b0f82b7485aa82c683c44779 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 Aug 2010 17:09:51 +0200 Subject: [PATCH 12/56] Changed: Bad parenthesis --- code/nel/tools/3d/build_interface/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 1f8d50997..ae317269b 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -367,7 +367,7 @@ int main(int nNbArg, char **ppArgs) if (outTga.open(fmtName)) { std::string ext; - if (toLower(fmtName.find(".png")) != string::npos) + if (toLower(fmtName).find(".png") != string::npos) { ext = "png"; GlobalTexture.writePNG (outTga, 32); From 1ff44fdb5039e63af18c75bb37d2d4e89b01f3ab Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 Aug 2010 20:00:23 +0200 Subject: [PATCH 13/56] Changed: Added DDSD_LINEARSIZE in tga2dds to avoid warning in CBitmap --- .../s3tc_compressor_lib/s3tc_compressor.cpp | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp index 49d4e5923..366c909c0 100644 --- a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp +++ b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp @@ -28,33 +28,34 @@ static void compressMipMap(uint8 *pixSrc, sint width, sint height, vector Date: Fri, 27 Aug 2010 20:21:15 +0200 Subject: [PATCH 14/56] Changed: code simplification for s3tc_compressor_lib --- code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp index 366c909c0..441d58020 100644 --- a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp +++ b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp @@ -34,7 +34,6 @@ static void compressMipMap(uint8 *pixSrc, sint width, sint height, vector Date: Fri, 27 Aug 2010 22:15:51 +0200 Subject: [PATCH 15/56] Fixed: #1082 Interface texturemaps can be configured in cfg file, png and tga inside interface texturemap treated equally. --- code/ryzom/client/src/client_cfg.cpp | 51 ++++++++++++++++++- code/ryzom/client/src/client_cfg.h | 13 ++++- .../src/interface_v3/interface_manager.cpp | 45 +++++++++++++--- .../client/src/interface_v3/view_renderer.cpp | 16 +++++- 4 files changed, 114 insertions(+), 11 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index d53e6f2c1..8e7206d15 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -169,6 +169,24 @@ else \ cfgWarning("CFG: Default value used for '"#variableName"' !!!"); \ +//----------------------------------------------- +/// Macro to read a String Vector from the CFG. +/// variableName : Variable Name to Read and Set. +//----------------------------------------------- +#define _READ_STRINGVECTOR(variableName) \ + /* Read the Variable Value From Script */ \ + varPtr = ClientCfg.ConfigFile.getVarPtr(#variableName); \ + /* Value found, set the Variable */ \ + if(varPtr) \ + { \ + ClientCfg.variableName.clear (); \ + int iSz = varPtr->size(); \ + for (int i = 0; i < iSz; i++) \ + ClientCfg.variableName.push_back(varPtr->asString(i)); \ + } \ + /* Use the Default Value */ \ + else \ + cfgWarning("CFG: Default value used for '"#variableName"' !!!"); \ //----------------------------------------------- // Macro for the dev version @@ -183,6 +201,7 @@ #define READ_STRING_DEV(variableName) _READ_STRING(variableName) #define READ_CVECTOR_DEV(variableName) _READ_CVECTOR(variableName) #define READ_ENUM_ASINT_DEV(type, variableName) _READ_ENUM_ASINT(type, variableName) +#define READ_STRINGVECTOR_DEV(variableName) _READ_STRINGVECTOR(variableName) #else // !FINAL_VERSION #define READ_BOOL_DEV(variableName) #define READ_INT_DEV(variableName) @@ -192,6 +211,7 @@ #define READ_STRING_DEV(variableName) #define READ_CVECTOR_DEV(variableName) #define READ_ENUM_ASINT_DEV(type, variableName) +#define READ_STRINGVECTOR_DEV(variableName) #endif // !FINAL_VERSION //----------------------------------------------- @@ -206,6 +226,7 @@ #define READ_STRING_FV(variableName) _READ_STRING(variableName) #define READ_CVECTOR_FV(variableName) _READ_CVECTOR(variableName) #define READ_ENUM_ASINT_FV(type, variableName) _READ_ENUM_ASINT(type, variableName) +#define READ_STRINGVECTOR_FV(variableName) _READ_STRINGVECTOR(variableName) /////////// // USING // @@ -277,7 +298,23 @@ CClientConfig::CClientConfig() Local = false; // Default is Net Mode. FSHost = ""; // Default Host. - + +#if 1 // Yubo hack + // The order is important here, because in a layer, global texture are rendered through this order + TexturesInterface.push_back("texture_interfaces_v3"); + // DXTC contain all items and bricks bitmaps, they must come after standard texture + TexturesInterface.push_back("new_texture_interfaces_dxtc"); + // Added icons by Yubo's Team 2009 + TexturesInterface.push_back("texture_extra"); +#else + TexturesInterface.push_back("texture_interfaces_v3"); + TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc"); +#endif + + TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui"); + + TexturesLoginInterface.push_back("texture_interfaces_v3_login"); + DisplayAccountButtons = true; CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; ConditionsTermsURL = "https://secure.ryzom.com/signup/terms_of_use.php"; @@ -703,6 +740,18 @@ void CClientConfig::setValues() ClientCfg.SelectedSlot = 0; } + // interface textures login menus + READ_STRINGVECTOR_FV(TexturesLoginInterface); + READ_STRINGVECTOR_FV(TexturesLoginInterfaceDXTC); + + // interface textures outgame menus + READ_STRINGVECTOR_FV(TexturesOutGameInterface); + READ_STRINGVECTOR_FV(TexturesOutGameInterfaceDXTC); + + // interface textures ingame and r2 + READ_STRINGVECTOR_FV(TexturesInterface); + READ_STRINGVECTOR_FV(TexturesInterfaceDXTC); + // interface files login menus ClientCfg.XMLLoginInterfaceFiles.clear (); CConfigFile::CVar *pcvXMLLoginInterface = ClientCfg.ConfigFile.getVarPtr("XMLLoginInterfaceFiles"); diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index d9d8f5b5e..dad8e8077 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -78,6 +78,18 @@ struct CClientConfig sint SelectCharacter; /// Selected slot in select char interface uint8 SelectedSlot; + + /// Textures for interface login + std::vector TexturesLoginInterface; + std::vector TexturesLoginInterfaceDXTC; + + /// Textures for interface outgame + std::vector TexturesOutGameInterface; + std::vector TexturesOutGameInterfaceDXTC; + + /// Textures for ingame interface and r2 interface + std::vector TexturesInterface; + std::vector TexturesInterfaceDXTC; /// vector of XML file names that describe the interfaces config for login std::vector XMLLoginInterfaceFiles; @@ -85,7 +97,6 @@ struct CClientConfig /// vector of XML file names that describe the interfaces config for outgame menus std::vector XMLOutGameInterfaceFiles; - /// vector of XML file names that describe the interfaces config std::vector XMLInterfaceFiles; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index efe64837e..d859d48d4 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -456,7 +456,19 @@ void CInterfaceManager::initLogin() return; } - loadTextures ("texture_interfaces_v3_login.tga", "texture_interfaces_v3_login.txt"); + nldebug("Textures Login Interface"); + + for (vector::iterator it = ClientCfg.TexturesLoginInterface.begin(), end = ClientCfg.TexturesLoginInterface.end(); it != end; ++it) + { + nldebug("Textures Login Interface: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", false); + } + + for (vector::iterator it = ClientCfg.TexturesLoginInterfaceDXTC.begin(), end = ClientCfg.TexturesLoginInterfaceDXTC.end(); it != end; ++it) + { + nldebug("Textures Login Interface DXTC: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", true); + } parseInterface (ClientCfg.XMLLoginInterfaceFiles, false); @@ -534,7 +546,19 @@ void CInterfaceManager::initOutGame() return; } - loadTextures ("texture_interfaces_v3_outgame_ui.tga", "texture_interfaces_v3_outgame_ui.txt"); + nldebug("Textures OutGame Interface"); + + for (vector::iterator it = ClientCfg.TexturesOutGameInterface.begin(), end = ClientCfg.TexturesOutGameInterface.end(); it != end; ++it) + { + nldebug("Textures OutGame Interface: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", false); + } + + for (vector::iterator it = ClientCfg.TexturesOutGameInterfaceDXTC.begin(), end = ClientCfg.TexturesOutGameInterfaceDXTC.end(); it != end; ++it) + { + nldebug("Textures OutGame Interface DXTC: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", true); + } parseInterface (ClientCfg.XMLOutGameInterfaceFiles, false); @@ -801,14 +825,19 @@ void CInterfaceManager::initInGame() // ------------------------------------------------------------------------------------------------ void CInterfaceManager::loadIngameInterfaceTextures() { - // The order is important here, because in a layer, global texture are rendered through this order - loadTextures ("texture_interfaces_v3.tga", "texture_interfaces_v3.txt"); + nldebug("Textures Ingame Interface"); - // DXTC contain all items and bricks bitmaps, they must come after standard texture - loadTextures ("new_texture_interfaces_dxtc.tga", "new_texture_interfaces_dxtc.txt"); + for (vector::iterator it = ClientCfg.TexturesInterface.begin(), end = ClientCfg.TexturesInterface.end(); it != end; ++it) + { + nldebug("Textures Ingame Interface: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", false); + } - // Added icons by Yubo's Team 2009 - loadTextures ("texture_extra.tga", "texture_extra.txt"); + for (vector::iterator it = ClientCfg.TexturesInterfaceDXTC.begin(), end = ClientCfg.TexturesInterfaceDXTC.end(); it != end; ++it) + { + nldebug("Textures Ingame Interface DXTC: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", true); + } } // ------------------------------------------------------------------------------------------------ diff --git a/code/ryzom/client/src/interface_v3/view_renderer.cpp b/code/ryzom/client/src/interface_v3/view_renderer.cpp index 9e131ec71..a2b38c3f5 100644 --- a/code/ryzom/client/src/interface_v3/view_renderer.cpp +++ b/code/ryzom/client/src/interface_v3/view_renderer.cpp @@ -744,6 +744,13 @@ void CViewRenderer::loadTextures (const std::string &textureFileName, const std: image.UVMax.V = uvMaxV; sTGAname = tgaName; sTGAname = strlwr(sTGAname); + string::size_type stripPng = sTGAname.find(".png"); + if (stripPng != string::npos) + { + sTGAname[stripPng + 1] = 't'; + sTGAname[stripPng + 2] = 'g'; + sTGAname[stripPng + 3] = 'a'; + } image.Name = sTGAname; image.GlobalTexturePtr = &(_GlobalTextures.back()); if (getTextureIdFromName(sTGAname) != -1) @@ -1025,7 +1032,14 @@ sint32 CViewRenderer::getTextureIdFromName (const string &sName) const static string nameLwr; nameLwr= sName; strlwr(nameLwr); - + string::size_type stripPng = nameLwr.find(".png"); + if (stripPng != string::npos) + { + nameLwr[stripPng + 1] = 't'; + nameLwr[stripPng + 2] = 'g'; + nameLwr[stripPng + 3] = 'a'; + } + // Search in map TTextureMap::const_iterator it= _TextureMap.find(nameLwr); if( it==_TextureMap.end() ) From 5b0a2493384c7304622dc1b9ff7dd3983bf77245 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 27 Aug 2010 22:29:13 +0200 Subject: [PATCH 16/56] Changed: #929 Max shape export runs all the way through now. Added: #929, #1082 Interface build project. --- .../build_gamedata/configuration/scripts.py | 14 + .../build_gamedata/configuration/tools.py | 2 + .../processes/interface/0_setup.py | 5 +- .../processes/interface/1_export.py | 18 +- .../processes/shape/1_export.py | 149 +++--- .../processes/shape/maxscript/shape_export.ms | 460 +++++++++--------- .../workspace/common/interface/directories.py | 86 ++++ .../workspace/common/interface/process.py | 35 ++ .../build_gamedata/workspace/projects.py | 1 + 9 files changed, 480 insertions(+), 290 deletions(-) create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/interface/process.py diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py index c217d6001..f85bd9117 100644 --- a/code/nel/tools/build_gamedata/configuration/scripts.py +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -181,6 +181,20 @@ def findFiles(log, dir_where, dir_sub, file_ext): printLog(log, "findFiles: file not dir or file?!" + filePath) return result +def findFilesNoSubdir(log, dir_where, file_ext): + result = [ ] + files = os.listdir(dir_where) + len_file_ext = len(file_ext) + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + fileFull = dir_where + "/" + fileName + if os.path.isfile(fileFull): + if fileName[-len_file_ext:].lower() == file_ext.lower(): + result += [ fileName ] + elif not os.path.isdir(fileFull): + printLog(log, "findFilesNoSubdir: file not dir or file?!" + filePath) + return result + def findFile(log, dir_where, file_name): files = os.listdir(dir_where) for fileName in files: diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py index d02f0347b..8a1cd388f 100644 --- a/code/nel/tools/build_gamedata/configuration/tools.py +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -49,6 +49,8 @@ LigoExportTimeout = 3600000 LigoBuildTimeout = 1800000 PacsPrimExportTimeout = 600000 +MaxShapeExportTimeout = 300000 # 5min + # *** TOOLS CONFIGURATION *** TgaToDdsTool = "tga2dds" diff --git a/code/nel/tools/build_gamedata/processes/interface/0_setup.py b/code/nel/tools/build_gamedata/processes/interface/0_setup.py index 64fdee329..d77614701 100644 --- a/code/nel/tools/build_gamedata/processes/interface/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/interface/0_setup.py @@ -45,8 +45,9 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") -for dir in InterfaceSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) +for dirs in InterfaceSourceDirectories: + for dir in dirs: + mkPath(log, DatabaseDirectory + "/" + dir) for dir in InterfaceDxtcSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) for dir in InterfaceFullscreenSourceDirectories: diff --git a/code/nel/tools/build_gamedata/processes/interface/1_export.py b/code/nel/tools/build_gamedata/processes/interface/1_export.py index d7ba086ac..37911ba7e 100644 --- a/code/nel/tools/build_gamedata/processes/interface/1_export.py +++ b/code/nel/tools/build_gamedata/processes/interface/1_export.py @@ -50,12 +50,14 @@ printLog(log, "") # For each interface directory printLog(log, ">>> Export interface <<<") mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory) -for dir in InterfaceSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - niouname = dir.replace("/", "_") +for dirs in InterfaceSourceDirectories: + niouname = dirs[0].replace("/", "_") newpath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + niouname mkPath(log, newpath) - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") + for dir in dirs: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".png") printLog(log, "") # For each interface directory to compress in one DXTC @@ -64,6 +66,7 @@ mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory) for dir in InterfaceDxtcSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".png") printLog(log, "") # For each interface fullscreen directory compress independently all in dds @@ -80,6 +83,12 @@ else: destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" if needUpdateLogRemoveDest(log, sourceFile, destFile): subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".png") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) printLog(log, "") # For each interface 3d directory @@ -88,6 +97,7 @@ mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) for dir in Interface3DSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".png") printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py index 432511d30..79f82c191 100644 --- a/code/nel/tools/build_gamedata/processes/shape/1_export.py +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -27,38 +27,46 @@ import time, sys, os, shutil, subprocess, distutils.dir_util sys.path.append("../../configuration") -if os.path.isfile("log.log"): - os.remove("log.log") -log = open("log.log", "w") +if os.path.isfile("temp_log.log"): + os.remove("temp_log.log") +log = open("temp_log.log", "w") from scripts import * from buildsite import * from process import * from tools import * from directories import * +# Todo: make a tool to verify the files :) + +def getTagFileName(filePath): + return os.path.split(filePath)[1] + ".tag" + def hackBigTree(): - # FO_S2_big_tree is corrupt on first export... - outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory - outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory - shapeName = "FO_S2_big_tree.shape" - tagName = "FO_S2_big_tree.max.tag" - hackName = "FO_S2_big_tree_hack.tag" - if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName): - printLog(log, "Removing bad export of FO_S2_big_tree") - printLog(log, "RM " + outDirWithCoarse + "/" + shapeName) - os.remove(outDirWithCoarse + "/" + shapeName) - printLog(log, "RM " + outDirTag + "/" + tagName) - os.remove(outDirTag + "/" + tagName) - printLog(log, "TAG " + outDirTag + "/" + hackName) - hackTagFile = open(outDirTag + "/" + hackName, "w") - hackTagFile.write("FO_S2_big_tree") - hackTagFile.close() - return 1 - elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName): - printLog(log, "Missing export of FO_S2_big_tree") - return 0 - else: - return 0 + return 0 + if EcosystemName == "jungle": + # FO_S2_big_tree is corrupt on first export... + outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory + outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory + shapeName = "FO_S2_big_tree.shape" + tagName = "FO_S2_big_tree.max.tag" + hackName = "FO_S2_big_tree_hack.tag" + if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName): + printLog(log, "Removing bad export of FO_S2_big_tree") + printLog(log, "RM " + outDirWithCoarse + "/" + shapeName) + os.remove(outDirWithCoarse + "/" + shapeName) + printLog(log, "RM " + outDirTag + "/" + tagName) + os.remove(outDirTag + "/" + tagName) + printLog(log, "TAG " + outDirTag + "/" + hackName) + hackTagFile = open(outDirTag + "/" + hackName, "w") + hackTagFile.write("FO_S2_big_tree") + hackTagFile.close() + return 1 + elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName): + printLog(log, "Missing export of FO_S2_big_tree") + return 0 + else: + return 0 + printLog(log, "") printLog(log, "-------") @@ -78,7 +86,7 @@ if BuildQuality == 0: if MaxAvailable: # Find tools Max = findMax(log, MaxDirectory, MaxExecutable) - # ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) printLog(log, "") # Export shape 3dsmax @@ -108,37 +116,66 @@ if MaxAvailable: os.remove(scriptDst) for dir in ShapeSourceDirectories: tagDiff = 1 + secondTry = 1 shapeSourceDir = DatabaseDirectory + "/" + dir mkPath(log, shapeSourceDir) - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("shape_source_directory", shapeSourceDir) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse) - newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse) - newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting) - newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow) - newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit)) - newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize) - newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling)) - newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog) - newline = newline.replace("shape_lightmap_path", outDirLightmap) - newline = newline.replace("output_directory_anim", outDirAnim) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirTag, "", ".tag") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .max files!") - tagDiff += hackBigTree() # force rerun also when big tree deleted - os.remove(scriptDst) + maxFiles = findFilesNoSubdir(log, shapeSourceDir, ".max") + for maxFile in maxFiles: + maxFilePath = shapeSourceDir + "/" + maxFile + tagFilePath = outDirTag + "/" + getTagFileName(maxFilePath) + if (needUpdate(log, maxFilePath, tagFilePath)): + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + # newline = newline.replace("shape_source_directory", shapeSourceDir) + newline = newline.replace("shape_max_file_path", maxFilePath) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse) + newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse) + newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting) + newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow) + newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit)) + newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize) + newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling)) + newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog) + newline = newline.replace("shape_lightmap_path", outDirLightmap) + newline = newline.replace("output_directory_anim", outDirAnim) + sDst.write(newline) + sSrc.close() + sDst.close() + retriesLeft = 5 + while retriesLeft > 0: + printLog(log, "MAXSCRIPT " + scriptDst + "; " + maxFilePath) + subprocess.call([ ExecTimeout, str(MaxShapeExportTimeout), Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) + lSrc = open(logFile, "r") + for line in lSrc: + if (len(line) > 0): + printLog(log, line.strip()) + lSrc.close() + os.remove(logFile) + if (os.path.exists(tagFilePath)): + printLog(log, "OK " + maxFilePath) + retriesLeft = 0 + else: + printLog(log, "FAIL " + maxFilePath) + retriesLeft = retriesLeft - 1 + os.remove(scriptDst) + else: + printLog(log, "SKIP " + maxFilePath) +#while tagDiff > 0: +# printLog(log, "MAXSCRIPT " + scriptDst) +# subprocess.call([ Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) +# tagList = findFiles(log, outDirTag, "", ".tag") +# newTagLen = len(tagList) +# tagDiff = newTagLen - tagLen +# tagLen = newTagLen +# printLog(log, "Exported " + str(tagDiff) + " .max files!") +# if not tagDiff > 0: +# tagDiff += hackBigTree() # force rerun also when big tree deleted +# if not tagDiff > 0: +# tagDiff += secondTry +# secondTry = 0 # Export clod 3dsmax printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") @@ -156,6 +193,6 @@ if MaxAvailable: printLog(log, "") log.close() - +shutil.move("temp_log.log", "log.log") # end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms index f8af9e878..84a35f0e7 100644 --- a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -99,40 +99,40 @@ fn isToBeExported node = ( if (isAccelerator node) == true then return false - + if ((classof node) == RklPatch) then return false - + if ((classof node) == nel_ps) then return false - + if ((classof node) == nel_pacs_cylinder) then return false - + if ((classof node) == nel_pacs_box) then return false - + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT if (doNotExport != undefined) then ( if (doNotExport == "1") then return false ) - + doNotExport = getappdata node NEL3D_APPDATA_COLLISION if (doNotExport != undefined) then ( if (doNotExport == "1") then return false ) - + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR if (doNotExport != undefined) then ( if (doNotExport == "1") then return false ) - + return true ) @@ -144,16 +144,16 @@ fn isAnimToBeExported node = return false if (automaticAnimation == "0") then return false - + if (isAccelerator node) == true then return false - + if ((classof node) == nel_pacs_cylinder) then return false - + if ((classof node) == nel_pacs_box) then return false - + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT if (doNotExport != undefined) then ( @@ -221,13 +221,13 @@ fn haveCoarseMesh node = ( -- Get the lod lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) - + -- Exist ? if (lod != undefined) then ( -- Select a node nd = execute ("$'"+lod+"'") - + -- Node exist ? if (nd != undefined) then ( @@ -245,267 +245,271 @@ fn goShapeExport = ( try ( - -- Get files in the shape_source_directory - files = getFiles "shape_source_directory/*.max" - - -- Sort files - sort files - - -- No file ? - if files.count != 0 then + -- Get filepath + filePath = "shape_max_file_path" + + try ( - -- For each files - for i = 1 to files.count do + -- Delete lod files + lod_array = #() + + -- Ok ? + ok = false + + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Get the tag file name + tag = ("output_directory_tag/" + (getFilenameFile filePath) + (getFilenameType filePath) + ".tag") + + -- Open the max project + nlerror ("Scanning file " + filePath + " ...") + if loadMaxFile filePath quiet:true == true then ( - try + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Add the lod + for node in geometry do ( - -- Delete lod files - lod_array = #() - - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Get lod count + nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT + if (nodeCount != undefined) then ( - -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] quiet:true == true then + -- For each lod + nodeCountNum = nodeCount as Integer + for lod = 1 to nodeCountNum do ( - -- Unhide category - unhidecategory() - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- Add the lod - for node in geometry do + -- Get the lod + lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) + + -- Exist ? + if (lod != undefined) then ( - -- Get lod count - nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT - if (nodeCount != undefined) then + -- Select a node + try ( - -- For each lod - nodeCountNum = nodeCount as Integer - for lod = 1 to nodeCountNum do - ( - -- Get the lod - lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) - - -- Exist ? - if (lod != undefined) then - ( - -- Select a node - try - ( - nd = execute ("$'"+lod+"'") - ) - catch - ( - nlerror ("Error in Execute $'"+lod+"' from node "+node.name) - nd = undefined - ) - - -- Node exist ? - if (nd != undefined) then - ( - append lod_array nd - ) - ) - ) - ) - ) - - -- Select objects for shadows - for node in geometry do - ( - if (node.parent == undefined) then + nd = execute ("$'"+lod+"'") + ) + catch ( - -- Cast shadow ? - if (isCastShadow node == true) then - ( - -- Select this node - selectmore node - ) - ) - ) - - -- Tag this file ? - tagThisFile = true - - -- Array of node to export - array_node = #() - - -- Add geometry - for node in geometry do - append array_node node - - -- Add shapes - for node in shapes do - append array_node node - - -- For each node - for node in array_node do - ( - -- It is root ? - if (node.parent == undefined) then + nlerror ("Error in Execute $'"+lod+"' from node "+node.name) + nd = undefined + ) + + -- Node exist ? + if (nd != undefined) then ( - -- Is not a skeleton ? - if (node.name != "Bip01") then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Not a lod ? - if ((isLod node) == false) then - ( - -- Output directory - if (haveCoarseMesh node) == true then - output = ("output_directory_with_coarse_mesh/"+(node.name)+".shape") - else - output = ("output_directory_without_coarse_mesh/"+(node.name)+".shape") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the shape - if (NelExportShapeEx node output shape_export_opt_shadow shape_export_opt_export_lighting "shape_lightmap_path" shape_export_opt_lighting_limit shape_export_opt_lumel_size shape_export_opt_oversampling true false shape_export_opt_lightmap_log) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting shape "+node.name+" in file "+files[i]) - tagThisFile = false - return 0 - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+files[i]) - tagThisFile = false - return 0 - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) + append lod_array nd ) ) - - -- Export default animations - - for node in objects do + ) + ) + ) + + -- Select objects for shadows + for node in geometry do + ( + if (node.parent == undefined) then + ( + -- Cast shadow ? + if (isCastShadow node == true) then + ( + -- Select this node + selectmore node + ) + ) + ) + + -- Tag this file ? + tagThisFile = true + + -- Array of node to export + array_node = #() + + -- Add geometry + for node in geometry do + append array_node node + + -- Add shapes + for node in shapes do + append array_node node + + -- For each node + for node in array_node do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then ( - -- Can export it ? - if (isAnimToBeExported node) == true then + -- Not a lod ? + if ((isLod node) == false) then ( - -- Anim output directory - output = ("output_directory_anim/"+(node.name)+".anim") - - -- Export the animation - if (NelExportAnimation #(node) output false) == false then + -- Output directory + if (haveCoarseMesh node) == true then + output = ("output_directory_with_coarse_mesh/"+(node.name)+".shape") + else + output = ("output_directory_without_coarse_mesh/"+(node.name)+".shape") + + -- Compare file date + if (NeLTestFileDate output filePath) == true then ( - nlerror ("ERROR exporting animation "+output) - return 0 + try + ( + -- Export the shape + if (NelExportShapeEx node output shape_export_opt_shadow shape_export_opt_export_lighting "shape_lightmap_path" shape_export_opt_lighting_limit shape_export_opt_lumel_size shape_export_opt_oversampling true false shape_export_opt_lightmap_log) == true then + ( + nlerror ("OK "+output) + exported = exported+1 + ) + else + ( + -- Error + nlerror ("ERROR exporting shape "+node.name+" in file "+filePath) + tagThisFile = false + return 0 + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+filePath) + tagThisFile = false + return 0 + ) ) else ( - nlerror ("OK "+output) + -- Error + nlerror ("SKIPPED "+output) + exported = exported+1 ) ) ) - - -- Write a tag file - if tagThisFile == true then - ( - tagFile = createFile tag - if tagFile == undefined then - ( - nlerror ("WARNING can't create tag file "+tag) - ) - else - ( - print "toto" to: tagFile - close tagFile - ) - ) - - -- Something exported - if exported == 0 then - ( - -- Error - nlerror ("WARNING no shape exported from the file "+files[i]) - ) + ) + ) + ) + + -- Export default animations + + for node in objects do + ( + -- Can export it ? + if (isAnimToBeExported node) == true then + ( + -- Anim output directory + output = ("output_directory_anim/"+(node.name)+".anim") + + -- Export the animation + if (NelExportAnimation #(node) output false) == false then + ( + nlerror ("ERROR exporting animation "+output) + return 0 ) else ( - -- Error - nlerror ("ERROR exporting shape: can't open the file "+files[i]) + nlerror ("OK "+output) ) ) + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + print "toto" to: tagFile + close tagFile ) - - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt ) - catch + + -- Something exported + if exported == 0 then ( -- Error - nlerror ("ERROR fatal error exporting shape in file " + files[i]) - -- return 0 + nlerror ("WARNING no shape exported from the file "+filePath) ) ) + else + ( + -- Error + nlerror ("ERROR exporting shape: can't open the file "+filePath) + ) + + try + ( + gc () + ) + catch + ( + nlerror ("ERROR gc " + getCurrentException()) + ) + + try + ( + -- Reset 3dsmax + resetMAXFile #noprompt + ) + catch + ( + nlerror ("ERROR resetMAXFile " + getCurrentException()) + ) + + try + ( + gc () + ) + catch + ( + nlerror ("ERROR gc " + getCurrentException()) + ) ) - else + catch ( - nlerror ("WARNING no max file in folder shape_source_directory") + -- Error + nlerror ("ERROR fatal error exporting shape in file " + filePath) + return 0 ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting shape in folder shape_source_directory") + nlerror ("ERROR fatal error exporting shape in file") return 0 ) ) -goShapeExport() +undo off +( + goShapeExport() +) nlerror ("BYE") quitMAX #noPrompt quitMAX () #noPrompt +quitMAX #noPrompt +quitMAX () #noPrompt diff --git a/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py new file mode 100644 index 000000000..2f92ebbc1 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py @@ -0,0 +1,86 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** COMMON PATH *** + +CommonPath = "common/interface" + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +#Interface directories +InterfaceSourceDirectories = [ ] +InterfaceSourceDirectories += [ [ "interfaces/v3" ] + [ "interfaces/ring_interface" ] ] +InterfaceSourceDirectories += [ [ "interfaces/v3_outgame/ui" ] ] +InterfaceSourceDirectories += [ [ "interfaces/v3_login" ] ] + +InterfaceDxtcSourceDirectories = [ ] +InterfaceDxtcSourceDirectories += [ "interfaces/v3_bricks" ] +InterfaceDxtcSourceDirectories += [ "interfaces/v3_items" ] +InterfaceDxtcSourceDirectories += [ "interfaces/v3_dxtc_misc" ] + +InterfaceFullscreenSourceDirectories = [ ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_fullscreen" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_outgame/fullscreen" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/abilities_items" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/buy_sell" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/camera_character" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/create_perso" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/fight" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/MatisTown" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/spell" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/talk_bot" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/abilities_items" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_quick_help/graph" ] + +Interface3DSourceDirectories = [ ] +Interface3DSourceDirectories += [ "interfaces/v3_outgame/3d" ] +Interface3DSourceDirectories += [ "interfaces/v3_doc/htm" ] +Interface3DSourceDirectories += [ "interfaces/v3_doc" ] +Interface3DSourceDirectories += [ "interfaces/v3_quick_help" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Interface directories +InterfaceExportDirectory = CommonPath + "/interface_export" +InterfaceDxtcExportDirectory = CommonPath + "/interface_dxtc_export" +InterfaceFullscreenExportDirectory = CommonPath + "/interface_fullscreen_export" +Interface3DExportDirectory = CommonPath + "/interface_3d_export" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Interface directories +InterfaceBuildDirectory = CommonPath + "/interface_build" +InterfaceDxtcBuildDirectory = CommonPath + "/interface_dxtc_build" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Lightmap directory +InterfaceClientDirectory = "interfaces" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py b/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py new file mode 100644 index 000000000..f2288f832 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py @@ -0,0 +1,35 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "interface" ] + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py index 035f43900..82b2f286d 100644 --- a/code/ryzom/tools/build_gamedata/workspace/projects.py +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -26,6 +26,7 @@ ProjectsToProcess = [ ] +ProjectsToProcess += [ "common/interface" ] ProjectsToProcess += [ "ecosystems/jungle" ] ProjectsToProcess += [ "continents/newbieland" ] From aa506598d056c4ae0cc9a7d8721102d75a2696b2 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 14:10:56 +0200 Subject: [PATCH 17/56] Fixed: #1080 Under Linux, load NeL drivers from a specific directory --- code/nel/CMakeLists.txt | 5 + code/nel/CMakeModules/nel.cmake | 98 +++++++++++-------- code/nel/config.h.cmake | 43 ++++++++ .../nel/src/3d/driver/direct3d/CMakeLists.txt | 8 +- code/nel/src/3d/driver/opengl/CMakeLists.txt | 11 +-- code/nel/src/3d/dru.cpp | 7 ++ .../src/sound/driver/dsound/CMakeLists.txt | 8 +- code/nel/src/sound/driver/fmod/CMakeLists.txt | 8 +- .../src/sound/driver/openal/CMakeLists.txt | 2 +- code/nel/src/sound/driver/sound_driver.cpp | 9 ++ .../src/sound/driver/xaudio2/CMakeLists.txt | 8 +- 11 files changed, 141 insertions(+), 66 deletions(-) create mode 100644 code/nel/config.h.cmake diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 3f1dc485b..94b0bf05e 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -189,6 +189,11 @@ IF(FINAL_VERSION) ADD_DEFINITIONS(-DFINAL_VERSION=1) ENDIF(FINAL_VERSION) +# config.h configuration and use by projects +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) +ADD_DEFINITIONS(-DHAVE_CONFIG_H) + ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(include) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index 6535e5739..c58b5a1a0 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -27,7 +27,7 @@ MACRO(NL_TARGET_DRIVER name) IF(WITH_STATIC_DRIVERS) ADD_LIBRARY(${name} STATIC ${ARGN}) ELSE(WITH_STATIC_DRIVERS) - ADD_LIBRARY(${name} SHARED ${ARGN}) + ADD_LIBRARY(${name} MODULE ${ARGN}) ENDIF(WITH_STATIC_DRIVERS) ENDMACRO(NL_TARGET_DRIVER) @@ -38,13 +38,15 @@ ENDMACRO(NL_TARGET_DRIVER) ### MACRO(NL_DEFAULT_PROPS name label) GET_TARGET_PROPERTY(type ${name} TYPE) - IF((${type} STREQUAL SHARED_LIBRARY) OR (${type} STREQUAL MODULE_LIBRARY)) - # Set versions only if target is a shared library or a module - SET(versions VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR}) - ENDIF((${type} STREQUAL SHARED_LIBRARY) OR (${type} STREQUAL MODULE_LIBRARY)) - SET_TARGET_PROPERTIES(${name} PROPERTIES - ${versions} - PROJECT_LABEL ${label}) + IF(${type} STREQUAL SHARED_LIBRARY) + # Set versions only if target is a shared library + SET_TARGET_PROPERTIES(${name} PROPERTIES + VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} + PROJECT_LABEL ${label}) + ELSE(${type} STREQUAL SHARED_LIBRARY) + SET_TARGET_PROPERTIES(${name} PROPERTIES + PROJECT_LABEL ${label}) + ENDIF(${type} STREQUAL SHARED_LIBRARY) ENDMACRO(NL_DEFAULT_PROPS) ### @@ -75,17 +77,17 @@ ENDMACRO(NL_ADD_RUNTIME_FLAGS) MACRO(NL_ADD_STATIC_VID_DRIVERS name) IF(WITH_STATIC_DRIVERS) IF(WIN32) - IF(WITH_DRIVER_DIRECT3D) - TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win) + IF(WITH_DRIVER_DIRECT3D) + TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win) ENDIF(WITH_DRIVER_DIRECT3D) - - IF(WITH_DRIVER_DSOUND) - TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) - ENDIF(WITH_DRIVER_DSOUND) - - IF(WITH_DRIVER_XAUDIO2) - TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) - ENDIF(WITH_DRIVER_XAUDIO2) + + IF(WITH_DRIVER_DSOUND) + TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) + ENDIF(WITH_DRIVER_DSOUND) + + IF(WITH_DRIVER_XAUDIO2) + TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) + ENDIF(WITH_DRIVER_XAUDIO2) ENDIF(WIN32) IF(WITH_DRIVER_OPENAL) @@ -98,9 +100,9 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name) IF(WITH_DRIVER_OPENGL) IF(WIN32) - TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win) - ELSE(WIN32) - TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win) + ELSE(WIN32) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) ENDIF(WIN32) ENDIF(WITH_DRIVER_OPENGL) ENDIF(WITH_STATIC_DRIVERS) @@ -109,13 +111,13 @@ ENDMACRO(NL_ADD_STATIC_VID_DRIVERS) MACRO(NL_ADD_STATIC_SND_DRIVERS name) IF(WITH_STATIC_DRIVERS) IF(WIN32) - IF(WITH_DRIVER_DSOUND) - TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) - ENDIF(WITH_DRIVER_DSOUND) - - IF(WITH_DRIVER_XAUDIO2) - TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) - ENDIF(WITH_DRIVER_XAUDIO2) + IF(WITH_DRIVER_DSOUND) + TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) + ENDIF(WITH_DRIVER_DSOUND) + + IF(WITH_DRIVER_XAUDIO2) + TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) + ENDIF(WITH_DRIVER_XAUDIO2) ENDIF(WIN32) IF(WITH_DRIVER_OPENAL) @@ -307,28 +309,46 @@ MACRO(NL_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/share path. IF(NOT NL_SHARE_PREFIX) IF(WIN32) - SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") - ELSE(WIN32) - SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.") - ENDIF(WIN32) + SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") + ELSE(WIN32) + SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.") + ENDIF(WIN32) ENDIF(NOT NL_SHARE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT NL_SBIN_PREFIX) - IF(WIN32) - SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") - ELSE(WIN32) - SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") - ENDIF(WIN32) + IF(WIN32) + SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") + ELSE(WIN32) + SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") + ENDIF(WIN32) ENDIF(NOT NL_SBIN_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT NL_BIN_PREFIX) IF(WIN32) - SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") ELSE(WIN32) - SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") ENDIF(WIN32) ENDIF(NOT NL_BIN_PREFIX) + ## Allow override of install_prefix/lib path. + IF(NOT NL_LIB_PREFIX) + IF(WIN32) + SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.") + ELSE(WIN32) + SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.") + ENDIF(WIN32) + ENDIF(NOT NL_LIB_PREFIX) + + ## Allow override of install_prefix/lib path. + IF(NOT NL_DRIVER_PREFIX) + IF(WIN32) + SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.") + ELSE(WIN32) + SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.") + ENDIF(WIN32) + ENDIF(NOT NL_DRIVER_PREFIX) + ENDMACRO(NL_SETUP_PREFIX_PATHS) diff --git a/code/nel/config.h.cmake b/code/nel/config.h.cmake new file mode 100644 index 000000000..5296b3d50 --- /dev/null +++ b/code/nel/config.h.cmake @@ -0,0 +1,43 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#cmakedefine HAVE_DL_H 1 +#cmakedefine HAVE_EXECINFO_H 1 +#cmakedefine HAVE_ICONV 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LANGINFO_CODESET 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_PAM_MISC_H 1 +#cmakedefine HAVE_PAM_PAM_APPL_H 1 +#cmakedefine HAVE_PTHREAD 1 +#cmakedefine HAVE_SECURITY_PAM_APPL_H 1 +#cmakedefine HAVE_SECURITY_PAM_MISC_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_SYS_MOUNT_H 1 +#cmakedefine HAVE_SYS_PARAM_H 1 +#cmakedefine HAVE_SYS_STATVFS_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_UTIME_H 1 +#cmakedefine HAVE_WCHAR_H 1 + +#cmakedefine HAVE_BACKTRACE 1 +#cmakedefine HAVE_INET_NTOA 1 +#cmakedefine HAVE_INET_NTOP 1 +#cmakedefine HAVE_INET_PTON 1 +#cmakedefine HAVE_STRERROR 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE_STRPTIME 1 +#cmakedefine HAVE_STRTOK_R 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_STATVFS 1 +#cmakedefine HAVE_STAT64 1 + +#cmakedefine NL_BIN_PREFIX "${NL_BIN_PREFIX}" +#cmakedefine NL_ETC_PREFIX "${NL_ETC_PREFIX}" +#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_PREFIX}" +#cmakedefine NL_LIB_PREFIX "${NL_LIB_PREFIX}" +#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_PREFIX}" + +#endif // CONFIG_H diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index 0bf8aa40f..cd3f24bb9 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -2,9 +2,9 @@ FILE(GLOB SRC *.cpp *.h *.def) NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INC} ${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${LIBXML2_LIBRARIES} ${FREETYPE_LIB} ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) +TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_direct3d_win "Driver, Video: Direct3D") NL_ADD_RUNTIME_FLAGS(nel_drv_direct3d_win) @@ -12,13 +12,11 @@ NL_ADD_LIB_SUFFIX(nel_drv_direct3d_win) ADD_DEFINITIONS(/Ddriver_direct3d_EXPORTS) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_direct3d_win ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.h ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_direct3d_win RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 46d98148b..ac9611295 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -12,8 +12,9 @@ ENDIF(WIN32) NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_LIBRARIES}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY}) NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "Driver, Video: OpenGL") NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) @@ -27,7 +28,7 @@ ELSE(WIN32) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA}) ELSE(APPLE) - TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIBRARIES}) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIB}) IF(XF86VidMode_FOUND) INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR}) ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS}) @@ -41,13 +42,11 @@ ELSE(WIN32) ENDIF(APPLE) ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(NOT APPLE AND WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp) ENDIF(NOT APPLE AND WITH_PCH) -INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 5e18f760b..290a51124 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -25,6 +25,9 @@ #include "nel/3d/vertex_buffer.h" #include "nel/3d/index_buffer.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H #ifdef NL_OS_WINDOWS # define NOMINMAX @@ -75,6 +78,10 @@ IDriver *CDRU::createGlDriver() throw (EDru) // hInst=LoadLibrary(NL3D_GL_DLL_NAME); CLibrary driverLib; +#if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) + driverLib.addLibPath(NL_DRIVER_PREFIX); +#endif + // if (!hInst) if (!driverLib.loadLibrary(NL3D_GL_DLL_NAME, true, true, false)) { diff --git a/code/nel/src/sound/driver/dsound/CMakeLists.txt b/code/nel/src/sound/driver/dsound/CMakeLists.txt index acf3376f3..18031084a 100644 --- a/code/nel/src/sound/driver/dsound/CMakeLists.txt +++ b/code/nel/src/sound/driver/dsound/CMakeLists.txt @@ -2,20 +2,18 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_DRIVER(nel_drv_dsound ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_dsound ${LIBXML2_LIBRARIES} nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_dsound nelmisc nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_dsound "Driver, Sound: DirectSound") NL_ADD_LIB_SUFFIX(nel_drv_dsound) NL_ADD_RUNTIME_FLAGS(nel_drv_dsound) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_dsound ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/fmod/CMakeLists.txt b/code/nel/src/sound/driver/fmod/CMakeLists.txt index ec5427ebd..3262799cf 100644 --- a/code/nel/src/sound/driver/fmod/CMakeLists.txt +++ b/code/nel/src/sound/driver/fmod/CMakeLists.txt @@ -2,20 +2,18 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_DRIVER(nel_drv_fmod ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FMOD_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_fmod ${LIBXML2_LIBRARIES} ${FMOD_LIBRARY} nelsnd_lowlevel) +INCLUDE_DIRECTORIES(${FMOD_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_fmod ${FMOD_LIBRARY} nelmisc nelsnd_lowlevel) NL_DEFAULT_PROPS(nel_drv_fmod "Driver, Sound: FMOD") NL_ADD_LIB_SUFFIX(nel_drv_fmod) NL_ADD_RUNTIME_FLAGS(nel_drv_fmod) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_fmod ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.h ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index f1b76ad9d..b0abc074c 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -37,7 +37,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_openal ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/sound_driver.cpp b/code/nel/src/sound/driver/sound_driver.cpp index c0ca3d5bc..e4bc219b5 100644 --- a/code/nel/src/sound/driver/sound_driver.cpp +++ b/code/nel/src/sound/driver/sound_driver.cpp @@ -18,6 +18,10 @@ #include "nel/sound/driver/sound_driver.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + #ifdef NL_OS_WINDOWS # define NOMINMAX # include @@ -201,6 +205,11 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD } CLibrary driverLib; + +#if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) + driverLib.addLibPath(NL_DRIVER_PREFIX); +#endif + // Load it (adding standard nel pre/suffix, looking in library path and not taking ownership) if (!driverLib.loadLibrary(dllName, true, true, false)) { diff --git a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt index 7ed375902..187d7e1da 100644 --- a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt +++ b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt @@ -28,20 +28,18 @@ SOURCE_GROUP(efx FILES NL_TARGET_DRIVER(nel_drv_xaudio2 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_xaudio2 ${LIBXML2_LIBRARIES} nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY} ${VORBIS_LIBRARIES} ${OGG_LIBRARY}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_xaudio2 nelmisc nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_xaudio2 "Driver, Sound: XAudio2") NL_ADD_LIB_SUFFIX(nel_drv_xaudio2) NL_ADD_RUNTIME_FLAGS(nel_drv_xaudio2) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_xaudio2 ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.h ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) From b99425d5eb4f639d6c85dcd4f7ef6aaaadb59529 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 14:44:24 +0200 Subject: [PATCH 18/56] Changed: Allow user to specify externals location for CMake --- code/nel/CMakeLists.txt | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 94b0bf05e..12398e297 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -11,6 +11,8 @@ # * NL_SHARE_PREFIX (default: $CMAKE_INSTALL_PREFIX/share) # * NL_BIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/bin) # * NL_SBIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/sbin) +# * NL_LIB_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib) +# * NL_DRIVER_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib (windows) or $CMAKE_INSTALL_PREFIX/lib/nel) # * Enable building of documentation: add -DBUILD_DOCUMENTATION:BOOL=ON - new make target: DoxygenDoc # * Updating version: update header (above) but also update NL_VERSION below. # * To build binary archive, use the 'package' target. @@ -38,10 +40,23 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) CHECK_OUT_OF_SOURCE() IF(WIN32) - SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}") + IF(NOT EXTERNAL_PATH) + SET(EXTERNAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty" CACHE PATH "3rd party libraries root path.") + ENDIF(NOT EXTERNAL_PATH) + + IF(NOT EXTERNAL_INCLUDE_PATH) + SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include" CACHE PATH "3rd party libraries include path.") + ENDIF(NOT EXTERNAL_INCLUDE_PATH) + + IF(NOT EXTERNAL_LIBRARY_PATH) + SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib" CACHE PATH "3rd party libraries lib path.") + ENDIF(NOT EXTERNAL_LIBRARY_PATH) + + SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") # Stupid hack for FindOpenAL.cmake - SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty;${CMAKE_INCLUDE_PATH}") - SET(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}") + SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}") + SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}") + IF(NOT DEFINED ENV{QTDIR}) SET(ENV{QTDIR} "c:/qt/4.5.0") ENDIF(NOT DEFINED ENV{QTDIR}) From c962ee318b7e95d6d1ad9341d5b3fd02dbd9037c Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 14:49:21 +0200 Subject: [PATCH 19/56] Changed: Added tga2dds project if libsquish is found (s3tc dependency removed) --- code/nel/CMakeLists.txt | 4 +- code/nel/CMakeModules/FindS3TC.cmake | 50 ---------------------- code/nel/tools/3d/CMakeLists.txt | 6 ++- code/nel/tools/3d/tga_2_dds/CMakeLists.txt | 11 +++++ 4 files changed, 16 insertions(+), 55 deletions(-) delete mode 100644 code/nel/CMakeModules/FindS3TC.cmake create mode 100644 code/nel/tools/3d/tga_2_dds/CMakeLists.txt diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 12398e297..1e49af1e3 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -217,9 +217,7 @@ IF(WITH_SAMPLES) ENDIF(WITH_SAMPLES) IF(WITH_TOOLS) - IF(WIN32) - FIND_PACKAGE(S3TC) - ENDIF(WIN32) + FIND_PACKAGE(Squish) ADD_SUBDIRECTORY(tools) ENDIF(WITH_TOOLS) diff --git a/code/nel/CMakeModules/FindS3TC.cmake b/code/nel/CMakeModules/FindS3TC.cmake deleted file mode 100644 index f4efb8c5e..000000000 --- a/code/nel/CMakeModules/FindS3TC.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# - Locate S3TC library -# This module defines -# S3TC_LIBRARY, the library to link against -# S3TC_FOUND, if false, do not try to link to S3TC -# S3TC_INCLUDE_DIR, where to find headers. - -IF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - # in cache already - SET(S3TC_FIND_QUIETLY TRUE) -ENDIF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - - -FIND_PATH(S3TC_INCLUDE_DIR - s3_intrf.h - PATHS - $ENV{S3TC_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES S3TC -) - -FIND_LIBRARY(S3TC_LIBRARY - NAMES s3tc libs3tc - PATHS - $ENV{S3TC_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - SET(S3TC_FOUND "YES") - IF(NOT S3TC_FIND_QUIETLY) - MESSAGE(STATUS "Found S3TC: ${S3TC_LIBRARY}") - ENDIF(NOT S3TC_FIND_QUIETLY) -ELSE(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) - IF(NOT S3TC_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find S3TC!") - ENDIF(NOT S3TC_FIND_QUIETLY) -ENDIF(S3TC_LIBRARY AND S3TC_INCLUDE_DIR) diff --git a/code/nel/tools/3d/CMakeLists.txt b/code/nel/tools/3d/CMakeLists.txt index 1010bbe7d..4e21da876 100644 --- a/code/nel/tools/3d/CMakeLists.txt +++ b/code/nel/tools/3d/CMakeLists.txt @@ -40,11 +40,13 @@ IF(WITH_MAXPLUGIN) ENDIF(MAXSDK_FOUND) ENDIF(WITH_MAXPLUGIN) +IF(SQUISH_FOUND) + ADD_SUBDIRECTORY(tga_2_dds) +ENDIF(SQUISH_FOUND) + # These use WIndows-specific things that need to be fixed. #ig_elevation #lightmap_optimizer #object_viewer_exe #hls_bank_maker -#s3tc_compressor_lib -#tga_2_dds #plugin_max diff --git a/code/nel/tools/3d/tga_2_dds/CMakeLists.txt b/code/nel/tools/3d/tga_2_dds/CMakeLists.txt new file mode 100644 index 000000000..e1ffed3af --- /dev/null +++ b/code/nel/tools/3d/tga_2_dds/CMakeLists.txt @@ -0,0 +1,11 @@ +FILE(GLOB SRC *.cpp *.h ../s3tc_compressor_lib/*.cpp ../s3tc_compressor_lib/*.h) + +ADD_EXECUTABLE(tga2dds ${SRC}) + +INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(tga2dds ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) +NL_DEFAULT_PROPS(tga2dds "Tools, 3D: tga2dds") +NL_ADD_RUNTIME_FLAGS(tga2dds) + +INSTALL(TARGETS tga2dds RUNTIME DESTINATION bin COMPONENT tools3d) From 6328b3fd56fc0c97757917b957e39e3eaafa2281 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 14:56:29 +0200 Subject: [PATCH 20/56] Changed: Tweaked CMake default flags to use identical settings as VC++ projects --- code/nel/CMakeModules/nel.cmake | 34 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index c58b5a1a0..2f41e5d77 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -226,12 +226,25 @@ MACRO(NL_SETUP_BUILD) ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug") IF(WIN32) - SET(NL_DEBUG_CFLAGS "/EHa /Ob1 /Zi") - SET(NL_RELEASE_CFLAGS "/EHa /Zi /Ox /Ob2 /Oi /Ot /Oy /GT /GF /GS-") - SET(NL_RELEASEDEBUG_CFLAGS "/EHa /DNL_RELEASE_DEBUG /Zi /Ob2 /GF") + # don't use a /O[012x] flag if you want custom optimizations + SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-") + SET(SIZE_OPTIMIZATIONS "/O1") + # without inlining it's unusable, use custom optimizations again + SET(MIN_OPTIMIZATIONS "/Ob1") + + SET(CMAKE_C_FLAGS_DEBUG "/MDd /Zi /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS}") + SET(CMAKE_C_FLAGS_RELEASE "/MD /Zi /D NDEBUG ${SPEED_OPTIMIZATIONS}") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Zi /D NDEBUG ${SPEED_OPTIMIZATIONS}") + SET(CMAKE_C_FLAGS_MINSIZEREL "/MD /D NDEBUG ${SIZE_OPTIMIZATIONS}") + SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) + SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) + SET(CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL}) + + SET(NL_DEBUG_CFLAGS "/EHa /Zi") + SET(NL_RELEASE_CFLAGS "/EHa /Zi") SET(NL_DEBUG_LINK_FLAGS "/NODEFAULTLIB:msvcrt") SET(NL_RELEASE_LINK_FLAGS "/OPT:REF /OPT:ICF") - SET(NL_RELEASEDEBUG_LINK_FLAGS "/OPT:REF /OPT:ICF") ELSE(WIN32) SET(PLATFORM_CFLAGS "-ftemplate-depth-24 -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-long-long -Wno-unused") IF(WITH_COVERAGE) @@ -243,7 +256,6 @@ MACRO(NL_SETUP_BUILD) ENDIF(NOT APPLE) SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -g") SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -O6 -g") - SET(NL_RELEASEDEBUG_CFLAGS "-DNL_RELEASE_DEBUG -g -finline-functions -O3 ") SET(NL_NONE_CFLAGS "-DNL_RELEASE -g -finline-functions -O2 ") ENDIF(WIN32) @@ -286,14 +298,14 @@ MACRO(NL_SETUP_BUILD_FLAGS) SET(CMAKE_LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE} ${NL_RELEASE_LINK_FLAGS} ${PLATFORM_LINKFLAGS} ") ## RelWithDebInfo - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_LINK_FLAGS_RELWITHDEBINFO "${CMAKE_LINK_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_LINK_FLAGS} ${PLATFORM_LINKFLAGS} ") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_LINK_FLAGS_RELWITHDEBINFO "${CMAKE_LINK_FLAGS_RELWITHDEBINFO} ${NL_RELEASE_LINK_FLAGS} ${PLATFORM_LINKFLAGS} ") ## MinSizeRel - SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_LINK_CFLAGS} ${PLATFORM_LINKFLAGS} ") + SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} ${NL_RELEASE_LINK_CFLAGS} ${PLATFORM_LINKFLAGS} ") ENDMACRO(NL_SETUP_BUILD_FLAGS) MACRO(NL_SETUP_PREFIX_PATHS) From 65062f5deec43ecfe1f40e275f1fb66fbcfd7e63 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 15:02:00 +0200 Subject: [PATCH 21/56] Changed: #825 Remove all warnings when compiling Ryzom --- code/nel/samples/net/login_system/client.cpp | 2 +- code/nel/samples/net/udp/client.cpp | 6 +++--- code/nel/samples/net/udp/graph.cpp | 2 +- code/nel/samples/pacs/main.cpp | 10 +++++----- code/nel/tools/3d/zone_dump/zone_dump.cpp | 2 +- code/nel/tools/3d/zone_lighter/zone_lighter.cpp | 2 +- .../client/src/client_sheets/client_sheets.vcproj | 2 +- code/ryzom/client/src/client_sheets/sbrick_sheet.cpp | 3 +-- code/ryzom/client/src/init.cpp | 1 + code/ryzom/client/src/interface_v3/action_handler.cpp | 2 +- code/ryzom/common/src/game_share/dir_light_setup.cpp | 9 +++++---- .../src/game_share/generate_module_interface.xslt | 6 +++--- code/ryzom/tools/client/client_config/cfg_file.cpp | 2 +- code/ryzom/tools/client/client_config/display_dlg.cpp | 3 +-- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/code/nel/samples/net/login_system/client.cpp b/code/nel/samples/net/login_system/client.cpp index 408baea65..22cf3e675 100644 --- a/code/nel/samples/net/login_system/client.cpp +++ b/code/nel/samples/net/login_system/client.cpp @@ -95,7 +95,7 @@ int main (int argc, char **argv) Password = fgets(buf, 256, stdin); } // crypt with md5 the password - CHashKeyMD5 hk = getMD5((uint8*)Password.c_str(), Password.size()); + CHashKeyMD5 hk = getMD5((uint8*)Password.c_str(), (uint32)Password.size()); string CPassword = hk.toString(); nlinfo("The crypted password is %s", CPassword.c_str()); diff --git a/code/nel/samples/net/udp/client.cpp b/code/nel/samples/net/udp/client.cpp index 51ed287ce..06f494138 100644 --- a/code/nel/samples/net/udp/client.cpp +++ b/code/nel/samples/net/udp/client.cpp @@ -213,8 +213,8 @@ void cbInfo (CMessage &msgin, TSockId from, CCallbackNetBase &netbase) #ifdef USE_3D string token = "MeanPongTime "; - uint pos=line.find (token); - uint pos2=line.find (" ", pos+token.size()); + string::size_type pos=line.find (token); + string::size_type pos2=line.find (" ", pos+token.size()); uint32 val = atoi(line.substr (pos+token.size(), pos2-pos-token.size()).c_str()); LagGraph.addOneValue ((float)val); #endif @@ -309,7 +309,7 @@ int main( int argc, char **argv ) UTextContext *TextContext= Driver->createTextContext(CPath::lookup("n019003l.pfb")); TextContext->setFontSize(18); - Camera.setPerspective(80*Pi/180, 1.33, 0.15, 1000); + Camera.setPerspective(80*(float)Pi/180, 1.33f, 0.15f, 1000); CEvent3dMouseListener MouseListener; MouseListener.addToServer(Driver->EventServer); diff --git a/code/nel/samples/net/udp/graph.cpp b/code/nel/samples/net/udp/graph.cpp index 3d52279dc..86255e826 100644 --- a/code/nel/samples/net/udp/graph.cpp +++ b/code/nel/samples/net/udp/graph.cpp @@ -81,7 +81,7 @@ void CGraph::render (NL3D::UDriver *Driver, NL3D::UTextContext *TextContext) CVertexBuffer vbuffer; vbuffer.setVertexFormat (CVertexBuffer::PositionFlag); - vbuffer.setNumVertices (Values.size() * 2); + vbuffer.setNumVertices ((uint32)Values.size() * 2); float pos = X+Width-1; uint i = 0; diff --git a/code/nel/samples/pacs/main.cpp b/code/nel/samples/pacs/main.cpp index 256acf9b3..d3d87a938 100644 --- a/code/nel/samples/pacs/main.cpp +++ b/code/nel/samples/pacs/main.cpp @@ -264,7 +264,7 @@ int main () } // Keyboard - if (arrayObj.size()) + if (!arrayObj.empty()) { // Manipulate selected primitive keyboard (pDriver, deltaTime, *(arrayObj[selected])); @@ -273,7 +273,8 @@ int main () if (pDriver->AsyncListener.isKeyDown (KeyDELETE)) { // remove all but one - if (arrayObj.size() > 1) { + if (arrayObj.size() > 1) + { arrayObj[arrayObj.size()-1]->remove (*container, *pScene); arrayObj.resize (arrayObj.size()-1); } @@ -281,7 +282,7 @@ int main () // Check selected if (selected>=arrayObj.size()) - selected=arrayObj.size()-1; + selected=(uint)arrayObj.size()-1; //if (selected<0) // selected=0; @@ -312,8 +313,7 @@ int main () clearColor=CRGBA::Black; // Setup view matrix - int size=arrayObj.size(); - if (size) + if (!arrayObj.empty()) { // Setup hotspot for the 3d listener plistener->setHotSpot (arrayObj[selected]->getPos()); diff --git a/code/nel/tools/3d/zone_dump/zone_dump.cpp b/code/nel/tools/3d/zone_dump/zone_dump.cpp index d8ea987fd..9e37aa0b3 100644 --- a/code/nel/tools/3d/zone_dump/zone_dump.cpp +++ b/code/nel/tools/3d/zone_dump/zone_dump.cpp @@ -177,7 +177,7 @@ int main(int argc, char* argv[]) } // Triangle count - triangles+=faces.size(); + triangles+=(uint32)faces.size(); } } else diff --git a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp index 6df94365d..8608958e0 100644 --- a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp +++ b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp @@ -82,7 +82,7 @@ class CMyZoneLighter : public CZoneLighter pgId= min(pgId, (uint)(BAR_LENGTH-1)); sprintf (msg, "\r%s: %s", message, progressbar[pgId]); uint i; - for (i=strlen(msg); i<79; i++) + for (i=(uint)strlen(msg); i<79; i++) msg[i]=' '; msg[i]=0; printf ("%s\r", msg); diff --git a/code/ryzom/client/src/client_sheets/client_sheets.vcproj b/code/ryzom/client/src/client_sheets/client_sheets.vcproj index 46037a090..666bd3449 100644 --- a/code/ryzom/client/src/client_sheets/client_sheets.vcproj +++ b/code/ryzom/client/src/client_sheets/client_sheets.vcproj @@ -114,7 +114,7 @@ Optimization="4" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../../common/src/" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LIBXML_STATIC" StringPooling="true" MinimalRebuild="true" ExceptionHandling="2" diff --git a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp index c9379e1ed..98640bbca 100644 --- a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp @@ -404,8 +404,7 @@ void CSBrickSheet::build (const NLGEORGES::UFormElm &root) // **** Magic only: try to get a ResistType against this brick for(i=0;i 0) { std::string::size_type e = allparam.find('='); diff --git a/code/ryzom/common/src/game_share/dir_light_setup.cpp b/code/ryzom/common/src/game_share/dir_light_setup.cpp index 1f7998d5e..23f393227 100644 --- a/code/ryzom/common/src/game_share/dir_light_setup.cpp +++ b/code/ryzom/common/src/game_share/dir_light_setup.cpp @@ -25,10 +25,11 @@ //----------------------------------------------- -CDirLightSetup::CDirLightSetup() : Ambiant(0, 0, 0), - Diffuse(255, 255, 255), - Specular(0, 0, 0), - Direction(1.f, 0.f, 0.f) +CDirLightSetup::CDirLightSetup() : + Ambiant(0, 0, 0), + Diffuse(255, 255, 255), + Specular(0, 0, 0), + Direction(1.f, 0.f, 0.f) { } diff --git a/code/ryzom/common/src/game_share/generate_module_interface.xslt b/code/ryzom/common/src/game_share/generate_module_interface.xslt index 2a4f16e63..425e699a4 100644 --- a/code/ryzom/common/src/game_share/generate_module_interface.xslt +++ b/code/ryzom/common/src/game_share/generate_module_interface.xslt @@ -170,9 +170,9 @@ namespace // unused interceptors std::string fwdBuildModuleManifest() const { return std::string(); } - void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {}; - void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {}; - void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {}; + void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {} + void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {} + void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {} // process module message interceptor bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); diff --git a/code/ryzom/tools/client/client_config/cfg_file.cpp b/code/ryzom/tools/client/client_config/cfg_file.cpp index 1af5083e1..6c7e13768 100644 --- a/code/ryzom/tools/client/client_config/cfg_file.cpp +++ b/code/ryzom/tools/client/client_config/cfg_file.cpp @@ -97,7 +97,7 @@ bool GetBool (const char *var) // Available ? if (variable) { - string _bool = strlwr (variable->asString ()); + string _bool = toLower (variable->asString ()); if (_bool == "true") return true; if (_bool == "false") diff --git a/code/ryzom/tools/client/client_config/display_dlg.cpp b/code/ryzom/tools/client/client_config/display_dlg.cpp index b5c15210b..3379d9d71 100644 --- a/code/ryzom/tools/client/client_config/display_dlg.cpp +++ b/code/ryzom/tools/client/client_config/display_dlg.cpp @@ -495,8 +495,7 @@ CDisplayDlg::TDriver CDisplayDlg::getActualDriver() const std::string deviceName; uint64 drvVersion; CSystemInfo::getVideoInfo(deviceName, drvVersion); - strlwr(deviceName); - return strstr(deviceName.c_str(), "radeon") != NULL ? Direct3D : OpenGL; + return strstr(toLower(deviceName).c_str(), "radeon") != NULL ? Direct3D : OpenGL; } } return OpenGL; From 4f02a8591ac2846194438cc6707ce916769e8551 Mon Sep 17 00:00:00 2001 From: rti Date: Sat, 28 Aug 2010 17:33:44 +0200 Subject: [PATCH 22/56] Fixed: #1080 cmake MODULE compiles to *.so, adjusted dynloadlib accordingly --- code/nel/src/misc/dynloadlib.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/nel/src/misc/dynloadlib.cpp b/code/nel/src/misc/dynloadlib.cpp index b047b1317..4393bb335 100644 --- a/code/nel/src/misc/dynloadlib.cpp +++ b/code/nel/src/misc/dynloadlib.cpp @@ -67,9 +67,6 @@ void *nlGetSymbolAddress(NL_LIB_HANDLE libHandle, const std::string &procName) #ifdef NL_OS_WINDOWS const string nlLibPrefix; // empty const string nlLibExt(".dll"); -#elif defined(NL_OS_MAC) - const string nlLibPrefix("lib"); - const string nlLibExt(".dylib"); #elif defined(NL_OS_UNIX) const string nlLibPrefix("lib"); const string nlLibExt(".so"); From ee40f8f9b565dbc78a7344ba21d16d2398ae7eaf Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 30 Aug 2010 17:14:48 +0200 Subject: [PATCH 23/56] Changed: Updated samples CMake projects --- .../samples/3d/cluster_viewer/CMakeLists.txt | 13 ++++------ code/nel/samples/3d/font/CMakeLists.txt | 5 +--- .../samples/3d/shape_viewer/CMakeLists.txt | 13 ++-------- code/nel/samples/georges/CMakeLists.txt | 5 +--- code/nel/samples/misc/debug/CMakeLists.txt | 5 +--- code/nel/samples/misc/i18n/CMakeLists.txt | 5 +--- code/nel/samples/misc/log/CMakeLists.txt | 5 +--- code/nel/samples/misc/strings/CMakeLists.txt | 5 +--- code/nel/samples/net/chat/CMakeLists.txt | 24 +++++-------------- .../net/class_transport/CMakeLists.txt | 23 ++++++------------ .../samples/net/login_system/CMakeLists.txt | 20 +++++----------- code/nel/samples/net/udp/CMakeLists.txt | 3 --- code/nel/samples/pacs/CMakeLists.txt | 17 ++++--------- code/nel/samples/sound_sources/CMakeLists.txt | 14 ++++------- 14 files changed, 41 insertions(+), 116 deletions(-) diff --git a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt index 16208dd28..0a46dc127 100644 --- a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt @@ -4,34 +4,31 @@ ADD_EXECUTABLE(nl_sample_clusterview WIN32 ${SRC}) ADD_DEFINITIONS(-DCV_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_clusterview/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_clusterview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +TARGET_LINK_LIBRARIES(nl_sample_clusterview ${PLATFORM_LINKFLAGS} nelmisc nel3d) NL_ADD_RUNTIME_FLAGS(nl_sample_clusterview) NL_DEFAULT_PROPS(nl_sample_clusterview "Samples, 3D: Cluster Viewer") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_clusterview RUNTIME DESTINATION bin COMPONENT samples3d) INSTALL(FILES main.cvs readme.txt DESTINATION share/nel/nl_sample_clusterview COMPONENT samples3d) -INSTALL(DIRECTORY groups/ +INSTALL(DIRECTORY groups/ DESTINATION share/nel/nl_sample_clusterview/groups COMPONENT samples3d PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "Makefile*" EXCLUDE) -INSTALL(DIRECTORY fonts/ +INSTALL(DIRECTORY fonts/ DESTINATION share/nel/nl_sample_clusterview/fonts COMPONENT samples3d PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "Makefile*" EXCLUDE) -INSTALL(DIRECTORY max/ +INSTALL(DIRECTORY max/ DESTINATION share/nel/nl_sample_clusterview/max COMPONENT samples3d PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "Makefile*" EXCLUDE) -INSTALL(DIRECTORY shapes/ +INSTALL(DIRECTORY shapes/ DESTINATION share/nel/nl_sample_clusterview/shapes COMPONENT samples3d PATTERN "CVS" EXCLUDE diff --git a/code/nel/samples/3d/font/CMakeLists.txt b/code/nel/samples/3d/font/CMakeLists.txt index 503fa3e7a..aa0d078f2 100644 --- a/code/nel/samples/3d/font/CMakeLists.txt +++ b/code/nel/samples/3d/font/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_font WIN32 ${SRC}) ADD_DEFINITIONS(-DFONT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_font/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_font ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +TARGET_LINK_LIBRARIES(nl_sample_font ${PLATFORM_LINKFLAGS} nelmisc nel3d) NL_DEFAULT_PROPS(nl_sample_font "Samples, 3D: Font") NL_ADD_RUNTIME_FLAGS(nl_sample_font) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_font RUNTIME DESTINATION bin COMPONENT samples3d) INSTALL(FILES beteckna.ttf DESTINATION share/nel/nl_sample_font COMPONENT samples3d) diff --git a/code/nel/samples/3d/shape_viewer/CMakeLists.txt b/code/nel/samples/3d/shape_viewer/CMakeLists.txt index e0544ef1e..19cfcf1e8 100644 --- a/code/nel/samples/3d/shape_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/shape_viewer/CMakeLists.txt @@ -2,17 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_shapeview WIN32 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_shapeview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -NL_DEFAULT_PROPS(nl_sample_shapeview "Samples, 3D: Font") +TARGET_LINK_LIBRARIES(nl_sample_shapeview ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(nl_sample_shapeview "Samples, 3D: Shape Viewer") NL_ADD_RUNTIME_FLAGS(nl_sample_shapeview) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_shapeview PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, 3D: Shape Viewer") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_shapeview RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/georges/CMakeLists.txt b/code/nel/samples/georges/CMakeLists.txt index abbeb60af..e556f98c8 100644 --- a/code/nel/samples/georges/CMakeLists.txt +++ b/code/nel/samples/georges/CMakeLists.txt @@ -4,13 +4,10 @@ ADD_EXECUTABLE(nl_sample_georges ${SRC}) ADD_DEFINITIONS(-DGF_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_georges/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_georges ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelgeorges nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_georges ${PLATFORM_LINKFLAGS} nelgeorges nelmisc) NL_DEFAULT_PROPS(nl_sample_georges "Samples: Georges") NL_ADD_RUNTIME_FLAGS(nl_sample_georges) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_georges RUNTIME DESTINATION bin COMPONENT samplesgeorges) INSTALL(FILES boolean.typ coolfilesinfo.dfn default.sample_config int.typ positiondata.dfn sample_config.dfn string.typ sheet_id.bin DESTINATION share/nel/nl_sample_georges/ COMPONENT samplesgeorges) diff --git a/code/nel/samples/misc/debug/CMakeLists.txt b/code/nel/samples/misc/debug/CMakeLists.txt index 4b0569045..c8aab3ad3 100644 --- a/code/nel/samples/misc/debug/CMakeLists.txt +++ b/code/nel/samples/misc/debug/CMakeLists.txt @@ -2,11 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_debug ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_debug ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_debug ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_debug "Samples, Misc: Debugging") NL_ADD_RUNTIME_FLAGS(nl_sample_debug) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_debug RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/i18n/CMakeLists.txt b/code/nel/samples/misc/i18n/CMakeLists.txt index 9fc44db13..18ce622a7 100644 --- a/code/nel/samples/misc/i18n/CMakeLists.txt +++ b/code/nel/samples/misc/i18n/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_i18n ${SRC}) ADD_DEFINITIONS(-DNL_LANG_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_i18n/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_i18n ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_i18n ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_i18n "Samples, Misc: I18N") NL_ADD_RUNTIME_FLAGS(nl_sample_i18n) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_i18n RUNTIME DESTINATION bin COMPONENT samplesmisc) INSTALL(FILES de.uxt en.uxt fr.uxt DESTINATION share/nel/nl_sample_i18n COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/log/CMakeLists.txt b/code/nel/samples/misc/log/CMakeLists.txt index 7f7085c83..a22007735 100644 --- a/code/nel/samples/misc/log/CMakeLists.txt +++ b/code/nel/samples/misc/log/CMakeLists.txt @@ -2,11 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_log ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_log ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_log ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_log "Samples, Misc: Logging") NL_ADD_RUNTIME_FLAGS(nl_sample_log) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_log RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/strings/CMakeLists.txt b/code/nel/samples/misc/strings/CMakeLists.txt index c0942fc2d..52e2b126e 100644 --- a/code/nel/samples/misc/strings/CMakeLists.txt +++ b/code/nel/samples/misc/strings/CMakeLists.txt @@ -2,11 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_strings ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_strings ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_strings ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_strings "Samples, Misc: Strings") NL_ADD_RUNTIME_FLAGS(nl_sample_strings) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_strings RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/net/chat/CMakeLists.txt b/code/nel/samples/net/chat/CMakeLists.txt index b9e79d9d0..14bed2ee7 100644 --- a/code/nel/samples/net/chat/CMakeLists.txt +++ b/code/nel/samples/net/chat/CMakeLists.txt @@ -1,28 +1,16 @@ - - ADD_EXECUTABLE(nl_sample_chatclient client.cpp kbhit.cpp kbhit.h) -ADD_EXECUTABLE(nl_sample_chatserver server.cpp) +ADD_EXECUTABLE(nl_sample_chatserver WIN32 server.cpp) ADD_DEFINITIONS(-DCHAT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_chat/\\"") - -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_chatclient ${PLATFORM_LINKFLAGS} nelmisc nelnet) +NL_DEFAULT_PROPS(nl_sample_chatclient "Samples, Net, Chat: Chat Client") +NL_ADD_RUNTIME_FLAGS(nl_sample_chatclient) + TARGET_LINK_LIBRARIES(nl_sample_chatserver ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_chatclient PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE" - PROJECT_LABEL "Samples, Net, Chat: Chat Client") - SET_TARGET_PROPERTIES(nl_sample_chatserver PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, Net, Chat: Chat Server") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_DEFAULT_PROPS(nl_sample_chatserver "Samples, Net, Chat: Chat Server") +NL_ADD_RUNTIME_FLAGS(nl_sample_chatserver) INSTALL(TARGETS nl_sample_chatclient nl_sample_chatserver RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES chat_service.cfg client.cfg DESTINATION share/nel/nl_sample_chat COMPONENT samplesnet) diff --git a/code/nel/samples/net/class_transport/CMakeLists.txt b/code/nel/samples/net/class_transport/CMakeLists.txt index f8f67522e..96912209e 100644 --- a/code/nel/samples/net/class_transport/CMakeLists.txt +++ b/code/nel/samples/net/class_transport/CMakeLists.txt @@ -1,25 +1,16 @@ -ADD_EXECUTABLE(nl_sample_ct_ai_service ai_service.cpp) +ADD_EXECUTABLE(nl_sample_ct_ai_service WIN32 ai_service.cpp) -ADD_EXECUTABLE(nl_sample_ct_gd_service gd_service.cpp) +ADD_EXECUTABLE(nl_sample_ct_gd_service WIN32 gd_service.cpp) ADD_DEFINITIONS(-DNL_CT_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_class_transport/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_ct_ai_service ${PLATFORM_LINKFLAGS} nelmisc nelnet) +NL_DEFAULT_PROPS(nl_sample_ct_ai_service "Samples, Net, Class Transport: AI Service") +NL_ADD_RUNTIME_FLAGS(nl_sample_ct_ai_service) + TARGET_LINK_LIBRARIES(nl_sample_ct_gd_service ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_ct_ai_service PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, Net, Class Transport: AI Service") - SET_TARGET_PROPERTIES(nl_sample_ct_gd_service PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, Net, Class Transport: GD Service") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_DEFAULT_PROPS(nl_sample_ct_gd_service "Samples, Net, Class Transport: GD Service") +NL_ADD_RUNTIME_FLAGS(nl_sample_ct_gd_service) INSTALL(TARGETS nl_sample_ct_ai_service nl_sample_ct_gd_service RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES ai_service.cfg gd_service.cfg DESTINATION share/nel/nl_sample_class_transport COMPONENT samplesnet) diff --git a/code/nel/samples/net/login_system/CMakeLists.txt b/code/nel/samples/net/login_system/CMakeLists.txt index e10000242..75b3d623f 100644 --- a/code/nel/samples/net/login_system/CMakeLists.txt +++ b/code/nel/samples/net/login_system/CMakeLists.txt @@ -1,24 +1,16 @@ ADD_EXECUTABLE(nl_sample_ls_client client.cpp) -ADD_EXECUTABLE(nl_sample_ls_fes frontend_service.cpp) +ADD_EXECUTABLE(nl_sample_ls_fes WIN32 frontend_service.cpp) ADD_DEFINITIONS(-DNL_LS_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_login_system/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_ls_client ${PLATFORM_LINKFLAGS} nelmisc nelnet) +NL_DEFAULT_PROPS(nl_sample_ls_client "Samples, Net, Login Service: LS Client") +NL_ADD_RUNTIME_FLAGS(nl_sample_ls_client) + TARGET_LINK_LIBRARIES(nl_sample_ls_fes ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_ls_client PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Net, Login Service: LS Client") - SET_TARGET_PROPERTIES(nl_sample_ls_fes PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, Net, Login Service: LS Frontend") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_DEFAULT_PROPS(nl_sample_ls_fes "Samples, Net, Login Service: LS Frontend") +NL_ADD_RUNTIME_FLAGS(nl_sample_ls_fes) INSTALL(TARGETS nl_sample_ls_client nl_sample_ls_fes RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES frontend_service.cfg client.cfg DESTINATION share/nel/nl_sample_login_system COMPONENT samplesnet) diff --git a/code/nel/samples/net/udp/CMakeLists.txt b/code/nel/samples/net/udp/CMakeLists.txt index 8b0511728..8a5d1d479 100644 --- a/code/nel/samples/net/udp/CMakeLists.txt +++ b/code/nel/samples/net/udp/CMakeLists.txt @@ -10,7 +10,6 @@ IF(WITH_3D) ADD_DEFINITIONS(-DUSE_3D) ENDIF(WITH_3D) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_udpclient ${PLATFORM_LINKFLAGS} nelmisc nelnet nel3d) TARGET_LINK_LIBRARIES(nl_sample_udpserver ${PLATFORM_LINKFLAGS} nelmisc nelnet) NL_DEFAULT_PROPS(nl_sample_udpclient "Samples, Net, UDP: UDP Client") @@ -18,8 +17,6 @@ NL_DEFAULT_PROPS(nl_sample_udpserver "Samples, Net, UDP: UDP Server") NL_ADD_RUNTIME_FLAGS(nl_sample_udpclient) NL_ADD_RUNTIME_FLAGS(nl_sample_udpserver) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_udpclient nl_sample_udpserver RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES bench_service.cfg client.cfg readme.txt DESTINATION share/nel/nl_sample_udp COMPONENT samplesnet) diff --git a/code/nel/samples/pacs/CMakeLists.txt b/code/nel/samples/pacs/CMakeLists.txt index 53a080ab9..abce2411e 100644 --- a/code/nel/samples/pacs/CMakeLists.txt +++ b/code/nel/samples/pacs/CMakeLists.txt @@ -1,23 +1,16 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(nl_sample_pacs ${SRC}) +ADD_EXECUTABLE(nl_sample_pacs WIN32 ${SRC}) ADD_DEFINITIONS(-DNL_PACS_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_pacs/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_pacs ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nelpacs nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_pacs PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples: PACS") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(nl_sample_pacs ${PLATFORM_LINKFLAGS} nelmisc nelpacs nel3d) +NL_DEFAULT_PROPS(nl_sample_pacs "Samples: PACS") +NL_ADD_RUNTIME_FLAGS(nl_sample_pacs) INSTALL(TARGETS nl_sample_pacs RUNTIME DESTINATION bin COMPONENT samplespacs) INSTALL(FILES readme.txt DESTINATION share/nel/nl_sample_pacs COMPONENT samplespacs) -INSTALL(DIRECTORY shapes/ +INSTALL(DIRECTORY shapes/ DESTINATION share/nel/nl_sample_pacs/shapes COMPONENT samplespacs PATTERN "CVS" EXCLUDE diff --git a/code/nel/samples/sound_sources/CMakeLists.txt b/code/nel/samples/sound_sources/CMakeLists.txt index 405b25387..288bb6cd0 100644 --- a/code/nel/samples/sound_sources/CMakeLists.txt +++ b/code/nel/samples/sound_sources/CMakeLists.txt @@ -4,18 +4,12 @@ ADD_EXECUTABLE(nl_sample_sound_sources ${SRC}) ADD_DEFINITIONS(-DNL_SOUND_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_sound/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_sound_sources ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nelsound nelsnd_lowlevel) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_sound_sources PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples: Sound System") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(nl_sample_sound_sources ${PLATFORM_LINKFLAGS} nelmisc nelsound) +NL_DEFAULT_PROPS(nl_sample_sound_sources "Samples: Sound System") +NL_ADD_RUNTIME_FLAGS(nl_sample_sound_sources) INSTALL(TARGETS nl_sample_sound_sources RUNTIME DESTINATION bin COMPONENT samplessound) -INSTALL(DIRECTORY data/ +INSTALL(DIRECTORY data/ DESTINATION share/nel/nl_sample_sound/data COMPONENT samplespacs PATTERN "CVS" EXCLUDE From 47b3d5ce60183543cd9628497ca6045f0d9446e1 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 30 Aug 2010 17:41:15 +0200 Subject: [PATCH 24/56] Changed: Use of CFile::getApplicationDirectory --- code/nel/tools/3d/zviewer/zviewer.cpp | 5 ++--- code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp | 5 ++--- code/nel/tools/pacs/build_ig_boxes/main.cpp | 5 ++--- code/nel/tools/pacs/build_indoor_rbank/main.cpp | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/code/nel/tools/3d/zviewer/zviewer.cpp b/code/nel/tools/3d/zviewer/zviewer.cpp index 01a1c36c1..ccbdf4b56 100644 --- a/code/nel/tools/3d/zviewer/zviewer.cpp +++ b/code/nel/tools/3d/zviewer/zviewer.cpp @@ -957,11 +957,10 @@ int main(int /* argc */, char ** /* argv */) NLMISC::CApplicationContext myApplicationContext; #ifdef NL_OS_UNIX - std::string homeDir = getenv("HOME"); - NLMISC::CPath::addSearchPath( homeDir + "/.nel"); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX - NLMISC::CPath::addSearchPath(NL_ZVIEWER_CFG); + NLMISC::CPath::addSearchPath(NL_ZVIEWER_CFG); initViewerConfig("zviewer.cfg"); diff --git a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp index 2755e2a96..c84b328ef 100644 --- a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp +++ b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp @@ -424,11 +424,10 @@ int main( int argc, char ** argv ) NLMISC::CApplicationContext appContext; #ifdef NL_OS_UNIX - std::string homeDir = getenv("HOME"); - NLMISC::CPath::addSearchPath( homeDir + "/.nel"); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX - NLMISC::CPath::addSearchPath(NL_MK_SH_ID_CFG); + NLMISC::CPath::addSearchPath(NL_MK_SH_ID_CFG); // read args if( argc < 2 ) diff --git a/code/nel/tools/pacs/build_ig_boxes/main.cpp b/code/nel/tools/pacs/build_ig_boxes/main.cpp index de308ed25..9d420745d 100644 --- a/code/nel/tools/pacs/build_ig_boxes/main.cpp +++ b/code/nel/tools/pacs/build_ig_boxes/main.cpp @@ -86,11 +86,10 @@ void init() try { #ifdef NL_OS_UNIX - std::string homeDir = getenv("HOME"); - NLMISC::CPath::addSearchPath( homeDir + "/.nel"); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX - NLMISC::CPath::addSearchPath(NL_BIB_CFG); + NLMISC::CPath::addSearchPath(NL_BIB_CFG); CConfigFile cf; uint i; diff --git a/code/nel/tools/pacs/build_indoor_rbank/main.cpp b/code/nel/tools/pacs/build_indoor_rbank/main.cpp index e237f9bcd..9fbd77d1e 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/main.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/main.cpp @@ -122,11 +122,10 @@ void initConfig() try { #ifdef NL_OS_UNIX - std::string homeDir = getenv("HOME"); - NLMISC::CPath::addSearchPath( homeDir + "/.nel"); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX - NLMISC::CPath::addSearchPath(NL_BIRB_CFG); + NLMISC::CPath::addSearchPath(NL_BIRB_CFG); CConfigFile cf; From 06ec6effa869966b49c6302cb3d0c88e94492ab7 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 30 Aug 2010 17:41:53 +0200 Subject: [PATCH 25/56] Fixed: tga2dds compilation under Linux --- .../3d/s3tc_compressor_lib/s3tc_compressor.h | 4 +- code/nel/tools/3d/tga_2_dds/tga2dds.cpp | 108 +++++++++--------- 2 files changed, 55 insertions(+), 57 deletions(-) diff --git a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.h b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.h index 33c819fcc..dde40428c 100644 --- a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.h +++ b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.h @@ -43,8 +43,8 @@ #define DDSCAPS_MIPMAP 0x00400000l #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) + ((uint32)(uint8)(ch0) | ((uint32)(uint8)(ch1) << 8) | \ + ((uint32)(uint8)(ch2) << 16) | ((uint32)(uint8)(ch3) << 24 )) #endif diff --git a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp index c36906f75..41a0ca9f6 100644 --- a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp +++ b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp @@ -54,8 +54,19 @@ uint8 getType(const char *sFileNameDest) return NOT_DEFINED; } CS3TCCompressor::DDS_HEADER h; - fread(&dds,1,4,f); - fread(&h,sizeof(CS3TCCompressor::DDS_HEADER),1,f); + + if (fread(&dds,1,4,f) != 4) + { + fclose(f); + return NOT_DEFINED; + } + + if (fread(&h,sizeof(CS3TCCompressor::DDS_HEADER),1,f) != 1) + { + fclose(f); + return NOT_DEFINED; + } + if(fclose(f)) { cerr<0) { return DXT1A; } - + if(h.ddpf.dwFourCC==MAKEFOURCC('D','X', 'T', '3')) { return DXT3; @@ -94,9 +105,21 @@ bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) { return false; } + CS3TCCompressor::DDS_HEADER h; - fread(&dds,1,4,f); - fread(&h,sizeof(::DDS_HEADER),1,f); + + if (fread(&dds,1,4,f) != 4) + { + fclose(f); + return false; + } + + if (fread(&h,sizeof(::DDS_HEADER),1,f) != 1) + { + fclose(f); + return false; + } + if(fclose(f)) { cerr<0) algoOk=true; break; - + case DXT3: if(h.ddpf.dwFourCC==MAKEFOURCC('D','X', 'T', '3')) algoOk=true; @@ -129,7 +152,7 @@ bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) } if(!algoOk) return false; - + // Test Mipmap. bool fileHasMipMap= (h.dwFlags&DDSD_MIPMAPCOUNT) && (h.dwMipMapCount>1); if(fileHasMipMap==wantMipMap) @@ -142,51 +165,35 @@ bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) bool dataCheck(const char *sFileNameSrc, const char *sFileNameDest, uint8& algo, bool wantMipMap) { - HANDLE h1 = CreateFile( sFileNameSrc, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(h1 == INVALID_HANDLE_VALUE) + uint32 lastWriteTime1 = CFile::getFileModificationDate(sFileNameSrc); + + if (!lastWriteTime1) { cerr<<"Can't open file "< lastWriteTime2) { return false; } - if(nComp==-1) + if (lastWriteTime1 < lastWriteTime2) { if(!sameType(sFileNameDest, algo, wantMipMap)) { return false; // file exists but a new compression type is required } - return true; } return true; } - void writeInstructions() { cout< [-o ] [-a ] [-m]"<>2; } } @@ -379,14 +386,12 @@ int main(int argc, char **argv) return 0; } - // Reading TGA or PNG and converting to RGBA //==================================== CBitmap picTga; CBitmap picTga2; CBitmap picSrc; - std::string inputFileName(argv[1]); if(inputFileName.find("_usercolor") RGBADest; RGBADest.resize(height*width*4); uint dstRGBADestId= 0; - - - // UserColor //=========== @@ -488,15 +490,14 @@ int main(int argc, char **argv) if (pos == std::string::npos) { // name whithout extension - userColorFileName = inputFileName + "_usercolor"; + userColorFileName = inputFileName + "_usercolor"; } else { // append input filename extension userColorFileName = inputFileName.substr(0,pos) + "_usercolor" + inputFileName.substr(pos); } - - + // Reading second Tga for user color, don't complain if _usercolor is missing NLMISC::CIFile input2; if (CPath::exists(userColorFileName) && input2.open(userColorFileName)) @@ -508,8 +509,6 @@ int main(int argc, char **argv) nlassert(height2==height); picTga2.convertToType (CBitmap::RGBA); - - RGBASrc2 = picTga2.getPixels(); NLMISC::CRGBA *pRGBASrc = (NLMISC::CRGBA*)&RGBASrc[0]; @@ -519,7 +518,7 @@ int main(int argc, char **argv) { // If no UserColor, must take same RGB, and keep same Alpha from src1 !!! So texture can have both alpha // userColor and other alpha usage. - if(pRGBASrc2[i].A==255) + if(pRGBASrc2[i].A==255) { RGBADest[dstRGBADestId++]= pRGBASrc[i].R; RGBADest[dstRGBADestId++]= pRGBASrc[i].G; @@ -610,12 +609,12 @@ int main(int argc, char **argv) cerr<<"Can't open output file "< Date: Mon, 30 Aug 2010 17:42:17 +0200 Subject: [PATCH 26/56] Changed: #825 Remove all warnings when compiling Ryzom --- code/nel/samples/sound_sources/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/nel/samples/sound_sources/main.cpp b/code/nel/samples/sound_sources/main.cpp index 27f6b8b64..50d28de6a 100644 --- a/code/nel/samples/sound_sources/main.cpp +++ b/code/nel/samples/sound_sources/main.cpp @@ -62,7 +62,7 @@ void Init() AudioMixer->setSamplePath("data/samplebank"); // Packed sheet option, this mean we want packed sheet generated in 'data' folder AudioMixer->setPackedSheetOption("data", true); - + printf("Select NLSOUND Driver:\n"); printf(" [1] FMod\n"); printf(" [2] OpenAl\n"); @@ -71,7 +71,7 @@ void Init() printf("> "); int selection = getchar(); printf("\n"); - + // init with 32 tracks, EAX enabled, no ADPCM, and activate automatic sample bank loading AudioMixer->init(32, true, false, NULL, true, (UAudioMixer::TDriver)(selection - '0')/*UAudioMixer::DriverFMod*/); @@ -143,7 +143,7 @@ void OnMove( const CVector& listenerpos ) * Note: The NeL vector coordinate system is described as follows: * \verbatim * (top) - * z + * z * | y (front) * | / * -----x (right) @@ -151,7 +151,7 @@ void OnMove( const CVector& listenerpos ) */ int main() { - new CApplicationContext(); // crash at end if on stack ... + CApplicationContext *appContext = new CApplicationContext(); // crash at end if on stack ... // Initialization Init(); @@ -208,4 +208,8 @@ int main() delete src1; delete src2; delete AudioMixer; + + delete appContext; + + return 0; } From ad51d5044950e7a843b864851fb9ffdf60340c6b Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 30 Aug 2010 18:38:00 +0200 Subject: [PATCH 27/56] Changed: Prevent Windows to draw background of NeL windows and some other messages --- .../3d/driver/opengl/driver_opengl_window.cpp | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index d60395f62..2aed89013 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -56,9 +56,13 @@ namespace NL3D bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { H_AUTO_OGL(GlWndProc) + + if (!driver) + return false; + if(message == WM_SIZE) { - if (driver != NULL) + if (!driver->_FullScreen) { RECT rect; GetClientRect (driver->_win, &rect); @@ -70,7 +74,7 @@ bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM } else if(message == WM_MOVE) { - if (driver != NULL) + if (!driver->_FullScreen) { RECT rect; GetWindowRect (hWnd, &rect); @@ -113,14 +117,37 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l trapMessage = GlWndProc (pDriver, hWnd, message, wParam, lParam); } + // we don't want Windows to erase background + if (message == WM_ERASEBKGND) + { + return TRUE; + } + + if (message == WM_SYSCOMMAND) + { + switch (wParam) + { #ifdef NL_DISABLE_MENU - // disable menu (F10, ALT and ALT+SPACE key doesn't freeze or open the menu) - if(message == WM_SYSCOMMAND && wParam == SC_KEYMENU) - return 0; + // disable menu (F10, ALT and ALT+SPACE key doesn't freeze or open the menu) + case SC_KEYMENU: #endif // NL_DISABLE_MENU + // Screensaver Trying To Start? + case SC_SCREENSAVE: + + // Monitor Trying To Enter Powersave? + case SC_MONITORPOWER: + + // Prevent From Happening + return 0; + + default: + break; + } + } + // disable menu (default ALT-F4 behavior is disabled) - if(message == WM_CLOSE) + if (message == WM_CLOSE) { if(pDriver && pDriver->ExitFunc) { @@ -219,21 +246,6 @@ bool GlWndProc(CDriverGL *driver, XEvent &e) } return true; - -/* - else if (message == WM_ACTIVATE) - { - WORD fActive = LOWORD(wParam); - if (fActive == WA_INACTIVE) - { - driver->_WndActive = false; - } - else - { - driver->_WndActive = true; - } - } -*/ } #endif // NL_OS_UNIX From 42aa859245432c0b0370059ab81ca3fd0726d18e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 30 Aug 2010 23:24:13 +0200 Subject: [PATCH 28/56] Added: #929 Added the objects build project and updated the max file batch convert script. --- .../scripts/nel_assets_png_batched.ms | 40 ++-- .../build_gamedata/configuration/scripts.py | 6 +- .../processes/anim/maxscript/anim_export.ms | 185 ++++++++++++++++++ .../build_gamedata/processes/map/2_build.py | 12 +- .../build_gamedata/processes/shape/0_setup.py | 3 + .../processes/shape/1_export.py | 49 +---- .../build_gamedata/processes/shape/2_build.py | 38 +++- .../processes/shape/3_install.py | 14 +- .../workspace/common/objects/directories.py | 93 +++++++++ .../workspace/common/objects/process.py | 77 ++++++++ .../workspace/common/sky/directories.py | 123 ++++++++++++ .../workspace/common/sky/process.py | 80 ++++++++ .../continents/newbieland/directories.py | 2 + .../ecosystems/jungle/directories.py | 32 +-- .../workspace/ecosystems/jungle/process.py | 4 + .../build_gamedata/workspace/projects.py | 2 + 16 files changed, 665 insertions(+), 95 deletions(-) create mode 100644 code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/objects/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sky/process.py diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms index cdff0431c..76956165a 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -41,22 +41,32 @@ fn getAbsoluteDestination t = fn getFixedTexturePath t = ( - if (doesFileExist (getAbsoluteSource t)) then + absoluteDestination = (getAbsoluteDestination t) + if (not (doesFileExist absoluteDestination)) and (((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Batiments") != undefined) or ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories\\Vv2\\") != undefined)) then ( - if not (doesFileExist (getAbsoluteDestination t)) then + testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Accessories\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then ( - makeDir (getFilenamePath (getAbsoluteDestination t)) all:true - renameFile (getAbsoluteSource t) (getAbsoluteDestination t) - ) - if (doesFileExist (getAbsoluteDestination t)) then - ( - if (getAbsoluteDestination t) != (getAbsoluteSource t) then - ( - deleteFile (getAbsoluteSource t) - ) + absoluteDestination = testDestination ) ) - return (getAbsoluteDestination t) + if (not (doesFileExist absoluteDestination)) and (((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Batiments") != undefined) or ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories\\") != undefined)) then + ( + testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Accessories\\Vv2\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + absoluteDestination = testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories\\") != undefined) then + ( + testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + absoluteDestination = testDestination + ) + ) + return absoluteDestination ) fn renameTexture t = @@ -169,12 +179,14 @@ rollout assets_png_rollout "Properties" m.delegate.ReflectionMap = undefined m.delegate.RefractionMap = undefined ) - + actionMan.executeAction 0 "40021" -- Selection: Select All actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps actionMan.executeAction 0 "40043" -- Selection: Select None - + + max views redraw + return 1 ) diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py index f85bd9117..774061e25 100644 --- a/code/nel/tools/build_gamedata/configuration/scripts.py +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -135,6 +135,10 @@ def copyFilesExtNoTreeIfNeeded(log, dir_source, dir_target, file_ext): files = findFiles(log, dir_source, "", file_ext) copyFileListNoTreeIfNeeded(log, dir_source, dir_target, files) +def copyFilesExtNoSubdirIfNeeded(log, dir_source, dir_target, file_ext): + files = findFilesNoSubdir(log, dir_source, file_ext) + copyFileListNoTreeIfNeeded(log, dir_source, dir_target, files) + def copyFilesNoTreeIfNeeded(log, dir_source, dir_target): copyFileListNoTreeIfNeeded(log, dir_source, dir_target, os.listdir(dir_source)) @@ -192,7 +196,7 @@ def findFilesNoSubdir(log, dir_where, file_ext): if fileName[-len_file_ext:].lower() == file_ext.lower(): result += [ fileName ] elif not os.path.isdir(fileFull): - printLog(log, "findFilesNoSubdir: file not dir or file?!" + filePath) + printLog(log, "findFilesNoSubdir: file not dir or file?!" + fileFull) return result def findFile(log, dir_where, file_name): diff --git a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms new file mode 100644 index 000000000..ce7c83405 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms @@ -0,0 +1,185 @@ +NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +try +( + -- Get files in the anim_source_directory + files = getFiles "anim_source_directory/*.max" + gc () + + -- Sort files + sort files + gc () + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + nlerror ("Scanning file "+files[i]+" ...") + + try + ( + -- Output file + output = ("output_directory/"+(getFilenameFile files[i])+".anim") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + -- Free memory and file handles + gc () + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + if (loadMaxFile files[i] quiet:true) == true then + ( + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + select $Bip01 + + -- Always uncheck triangle pelvis + if (classof $Bip01) == Biped_Object then + ( + $Bip01.controller.figureMode = true + $Bip01.controller.trianglepelvis = false + $Bip01.controller.figureMode = false + ) + ) + + -- For each node + for node in objects do + ( + exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION + if (exportNodeAnmation != undefined) then + ( + if (exportNodeAnmation == "1") then + ( + selectmore node + + -- Is it a biped ? + if (classof node.controller) == Vertical_Horizontal_Turn then + ( + -- Always uncheck triangle pelvis + node.controller.trianglepelvis = false + ) + ) + ) + ) + + if ((selection as array).count != 0) then + ( + -- Export the animation + if (NelExportAnimation (selection as array) output false) == false then + ( + nlerror ("ERROR exporting animation "+files[i]) + ) + else + ( + nlerror ("OK "+output) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting animation: no node animated to export in file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting animation: can't open the file "+files[i]) + ) + ) + else + ( + nlerror ("SKIPPED "+files[i]) + ) + ) + catch + ( + -- Error + nlerror ("ERROR error exporting animation in files " + files[i]) + ) + ) + ) + else + ( + nlerror ("WARNING no animation file in folder anim_source_directory") + ) +) +catch +( + -- Error + nlerror ("ERROR fatal error exporting animation in folder anim_source_directory") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/map/2_build.py b/code/nel/tools/build_gamedata/processes/map/2_build.py index abff9ec7a..44d28979f 100644 --- a/code/nel/tools/build_gamedata/processes/map/2_build.py +++ b/code/nel/tools/build_gamedata/processes/map/2_build.py @@ -63,13 +63,13 @@ else: mkPath(log, sourcePath) destPath = ExportBuildDirectory + "/" + MapBuildDirectory mkPath(log, destPath) - files = findFiles(log, sourcePath, "", ".tga") + files = findFilesNoSubdir(log, sourcePath, ".tga") for file in files: sourceFile = sourcePath + "/" + file destFile = destPath + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" if needUpdateLogRemoveDest(log, sourceFile, destFile): subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-m", "-r" + str(ReduceBitmapFactor) ]) - files = findFiles(log, sourcePath, "", ".png") + files = findFilesNoSubdir(log, sourcePath, ".png") for file in files: sourceFile = sourcePath + "/" + file destFile = destPath + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" @@ -78,14 +78,14 @@ else: printLog(log, "") printLog(log, ">>> Build map uncompressed: copy tga, png, dds <<<") -for dir in MapSourceDirectories: +for dir in MapUncompressedSourceDirectories: sourcePath = DatabaseDirectory + "/" + dir mkPath(log, sourcePath) destPath = ExportBuildDirectory + "/" + MapBuildDirectory mkPath(log, destPath) - copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".dds") - copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".png") - copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".tga") + copyFilesExtNoSubdirIfNeeded(log, sourcePath, destPath, ".dds") + copyFilesExtNoSubdirIfNeeded(log, sourcePath, destPath, ".png") + copyFilesExtNoSubdirIfNeeded(log, sourcePath, destPath, ".tga") printLog(log, ">>> Build panoply <<<") printLog(log, "********************************") diff --git a/code/nel/tools/build_gamedata/processes/shape/0_setup.py b/code/nel/tools/build_gamedata/processes/shape/0_setup.py index 54c53826c..214067583 100644 --- a/code/nel/tools/build_gamedata/processes/shape/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -61,10 +61,13 @@ mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) # Setup build directories printLog(log, ">>> Setup build directories <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) # Setup client directories printLog(log, ">>> Setup client directories <<<") mkPath(log, ClientDataDirectory + "/" + ShapeClientDirectory) +mkPath(log, ClientDataDirectory + "/" + LightmapClientDirectory) log.close() diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py index 79f82c191..9ee7a3099 100644 --- a/code/nel/tools/build_gamedata/processes/shape/1_export.py +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -36,38 +36,9 @@ from process import * from tools import * from directories import * -# Todo: make a tool to verify the files :) - def getTagFileName(filePath): return os.path.split(filePath)[1] + ".tag" -def hackBigTree(): - return 0 - if EcosystemName == "jungle": - # FO_S2_big_tree is corrupt on first export... - outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory - outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory - shapeName = "FO_S2_big_tree.shape" - tagName = "FO_S2_big_tree.max.tag" - hackName = "FO_S2_big_tree_hack.tag" - if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName): - printLog(log, "Removing bad export of FO_S2_big_tree") - printLog(log, "RM " + outDirWithCoarse + "/" + shapeName) - os.remove(outDirWithCoarse + "/" + shapeName) - printLog(log, "RM " + outDirTag + "/" + tagName) - os.remove(outDirTag + "/" + tagName) - printLog(log, "TAG " + outDirTag + "/" + hackName) - hackTagFile = open(outDirTag + "/" + hackName, "w") - hackTagFile.write("FO_S2_big_tree") - hackTagFile.close() - return 1 - elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName): - printLog(log, "Missing export of FO_S2_big_tree") - return 0 - else: - return 0 - - printLog(log, "") printLog(log, "-------") printLog(log, "--- Export shape") @@ -150,8 +121,9 @@ if MaxAvailable: subprocess.call([ ExecTimeout, str(MaxShapeExportTimeout), Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) lSrc = open(logFile, "r") for line in lSrc: - if (len(line) > 0): - printLog(log, line.strip()) + lineStrip = line.strip() + if (len(lineStrip) > 0): + printLog(log, lineStrip) lSrc.close() os.remove(logFile) if (os.path.exists(tagFilePath)): @@ -163,19 +135,6 @@ if MaxAvailable: os.remove(scriptDst) else: printLog(log, "SKIP " + maxFilePath) -#while tagDiff > 0: -# printLog(log, "MAXSCRIPT " + scriptDst) -# subprocess.call([ Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) -# tagList = findFiles(log, outDirTag, "", ".tag") -# newTagLen = len(tagList) -# tagDiff = newTagLen - tagLen -# tagLen = newTagLen -# printLog(log, "Exported " + str(tagDiff) + " .max files!") -# if not tagDiff > 0: -# tagDiff += hackBigTree() # force rerun also when big tree deleted -# if not tagDiff > 0: -# tagDiff += secondTry -# secondTry = 0 # Export clod 3dsmax printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") @@ -193,6 +152,8 @@ if MaxAvailable: printLog(log, "") log.close() +if os.path.isfile("log.log"): + os.remove("log.log") shutil.move("temp_log.log", "log.log") # end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/2_build.py b/code/nel/tools/build_gamedata/processes/shape/2_build.py index c0e158918..ae2f026bb 100644 --- a/code/nel/tools/build_gamedata/processes/shape/2_build.py +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -63,17 +63,35 @@ if ClodConfigFile != "": printLog(log, "******** TODO ********") printLog(log, "********************************") -printLog(log, ">>> LightmapOptimizer <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") +printLog(log, ">>> Optimize lightmaps <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +removeFilesRecursive(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +copyFiles(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +subprocess.call([ LightmapOptimizer, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory, ExportBuildDirectory + "/" + ShapeExportDirectory, ExportBuildDirectory + "/" + ShapeTagExportDirectory, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ]) -printLog(log, ">>> TgaToDds <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") +printLog(log, ">>> Convert lightmaps in 16 or 8 bits <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) +lightMapTgas = findFilesNoSubdir(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory, ".tga") +listLm8Bit = [ ] +listLm8BitFile = open(ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt", "r") +for line in listLm8BitFile: + lineStrip = line.strip() + if (len(lineStrip) > 0): + listLm8Bit += [ lineStrip ] +for lightMapTga in lightMapTgas: + srcTga = ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/" + lightMapTga + dstTga = ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory + "/" + lightMapTga + if needUpdateLogRemoveDest(log, srcTga, dstTga): + if lightMapTga in listLm8Bit: # THIS MAY NOT WORK, PLEASE VERIFY CONTENTS OF list_lm_8bit.txt!!! + subprocess.call([ TgaToDds, srcTga, "-o", dstTga, "-a", "tga8" ]) + else: + subprocess.call([ TgaToDds, srcTga, "-o", dstTga, "-a", "tga16" ]) -if 1: # todo: CoarseMeshTextureNames length > 0 ... +if len(CoarseMeshTextureNames) > 0: printLog(log, ">>> Build coarse meshes <<<") shapeWithCoarseMesh = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory mkPath(log, shapeWithCoarseMesh) @@ -111,6 +129,8 @@ if 1: # todo: CoarseMeshTextureNames length > 0 ... os.remove("config_generated.cfg") for tn in CoarseMeshTextureNames: subprocess.call([ TgaToDds, shapeWithCoarseMesh + "/" + tn + ".tga", "-o", shapeWithCoarseMeshBuilded + "/" + tn + ".dds", "-a", "5" ]) +else: + printLog(log, ">>> No coarse meshes <<<") log.close() diff --git a/code/nel/tools/build_gamedata/processes/shape/3_install.py b/code/nel/tools/build_gamedata/processes/shape/3_install.py index 3253a46fc..6667acdac 100644 --- a/code/nel/tools/build_gamedata/processes/shape/3_install.py +++ b/code/nel/tools/build_gamedata/processes/shape/3_install.py @@ -43,26 +43,26 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +printLog(log, ">>> Install shape <<<") clientPath = ClientDataDirectory + "/" + ShapeClientDirectory mkPath(log, clientPath) - -printLog(log, ">>> Install shape <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeExportDirectory, clientPath, ".shape") mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".shape") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".dds") -#if test "$lightmap_install_directory"; then -# mkdir $client_directory/$lightmap_install_directory 2>> log.log 2> /dev/null -# cp -u -p -R lightmap_16_bits/. $client_directory/$lightmap_install_directory 2>> log.log -#fi - mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory, clientPath, ".anim") # ls anim | grep ".anim" >> $client_directory/auto_animations_list.txt +printLog(log, ">>> Install shape lightmaps <<<") +clientPath = ClientDataDirectory + "/" + LightmapClientDirectory +mkPath(log, clientPath) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory, clientPath, ".tga") + printLog(log, "") log.close() diff --git a/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py new file mode 100644 index 000000000..0a5d2c46a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py @@ -0,0 +1,93 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON PATH *** + +CommonPath = "common/objects" + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/fyros/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/matis/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/zorai/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/generique/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/caravan/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/animated_light" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/fyros/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/tryker/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/matis/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/zorai/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/generique/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/caravan/agents/_textures/accessories" ] + +MapUncompressedSourceDirectories = [ ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeExportDirectory = CommonPath + "/shape" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = "objects" + +# Map directory +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = "objects" + +# Lightmap directory +LightmapClientDirectory = "objects" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/objects/process.py b/code/ryzom/tools/build_gamedata/workspace/common/objects/process.py new file mode 100644 index 000000000..cdd53ce02 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/objects/process.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] # not fully implemented, but works for this process +ProcessToComplete += [ "map" ] # not fully implemented, but works for this process + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py new file mode 100644 index 000000000..453850db4 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py @@ -0,0 +1,123 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON PATH *** + +CommonName = "sky" +CommonPath = "common/" + CommonName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "sky_v2/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "sky_v2/textures/textures" ] + +MapUncompressedSourceDirectories = [ ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/desert" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/forest" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/jungle" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/lacustre" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/desert" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/forest" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/jungle" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/lacustre" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/nodds" ] + +# Ig directories +IgLandSourceDirectories = [ ] +IgOtherSourceDirectories = [ ] +IgOtherSourceDirectories += [ "sky_v2/max" ] +IgPrimitiveSourceDirectories = [ ] + +# Animation directories +AnimSourceDirectories = [ ] +AnimSourceDirectories += [ "sky_v2/max" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeExportDirectory = CommonPath + "/shape" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Ig directories +IgStaticLandExportDirectory = CommonPath + "/ig_static_land" # Landscape IG eported from 3dsmax not elevated by the heightmap +IgStaticOtherExportDirectory = CommonPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax +IgStaticTagExportDirectory = CommonPath + "/ig_static_tag" # Tag for exported 3dsmax files + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Ig directories +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + +# Map directory +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + +# Lightmap directory +LightmapClientDirectory = CommonName + +# Animation directory +AnimClientDirectory = CommonName + +# Ig directory +IgClientDirectory = CommonName diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py b/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py new file mode 100644 index 000000000..84d2dac64 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +#ProcessToComplete += [ "anim" ] +#ProcessToComplete += [ "ig" ] +#ProcessToComplete += [ "ig_light" ] + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py index 11633a34a..cec353865 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py @@ -33,6 +33,8 @@ EcosystemName = "jungle" EcosystemPath = "ecosystems/" + EcosystemName ContinentName = "newbieland" ContinentPath = "continents/" + ContinentName +CommonName = ContinentName +CommonPath = ContinentPath # *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** ContinentLeveldesignWorldDirectory = ContinentName diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py index f18db50b5..e888b35b8 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py @@ -26,12 +26,14 @@ # along with this program. If not, see . # -# *** SOURCE DIRECTORIES IN THE DATABASE *** - # *** ECOSYSTEM NAME *** EcosystemName = "jungle" EcosystemPath = "ecosystems/" + EcosystemName +CommonPath = EcosystemPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** # Shape directories ShapeSourceDirectories = [ ] @@ -147,11 +149,11 @@ PacsPrimSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" # *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** # Shape directories -ShapeTagExportDirectory = "ecosystems/" + EcosystemName + "/shape_tag" -ShapeExportDirectory = "ecosystems/" + EcosystemName + "/shape" -ShapeWithCoarseMeshExportDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh" -ShapeLightmapNotOptimizedExportDirectory = "ecosystems/" + EcosystemName + "/shape_lightmap_not_optimized" -ShapeAnimExportDirectory = "ecosystems/" + EcosystemName + "/shape_anim" +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeExportDirectory = CommonPath + "/shape" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" # Smallbank directories SmallbankExportDirectory = "ecosystems/" + EcosystemName + "/smallbank" @@ -184,11 +186,13 @@ ZoneExportDirectory = "ecosystems/" + EcosystemName + "/zone" # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** # Map directories -MapBuildDirectory = "ecosystems/" + EcosystemName + "/map" -MapPanoplyBuildDirectory = "ecosystems/" + EcosystemName + "/map_panoply" +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" # Shape directories -ShapeWithCoarseMeshBuildDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_builded" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" # Farbank directories FarbankBuildDirectory = "ecosystems/" + EcosystemName + "/farbank" @@ -218,15 +222,15 @@ ClientSetupDirectories += [ "jungle_vegetable_sets" ] ClientSetupDirectories += [ "jungle_pacs_prim" ] ClientSetupDirectories += [ "jungle_lightmaps" ] -# Shape directory +# Map directory MapClientDirectory = "jungle_maps" +# Map directory +BitmapClientDirectory = MapClientDirectory + # Shape directory ShapeClientDirectory = "jungle_shapes" -# Map directory -BitmapClientDirectory = "jungle_maps" - # Lightmap directory LightmapClientDirectory = "jungle_lightmaps" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py index ddd54fadf..18f80cfe0 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py @@ -69,6 +69,10 @@ ShapeExportOptLightmapLog = "false" # Coarse mesh texture mul size TextureMulSizeValue = "1.5" +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + # *** COARSE MESH TEXTURE NAME *** CoarseMeshTextureNames = [ ] CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_sp" ] diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py index 82b2f286d..ac4e3ab72 100644 --- a/code/ryzom/tools/build_gamedata/workspace/projects.py +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -27,6 +27,8 @@ ProjectsToProcess = [ ] ProjectsToProcess += [ "common/interface" ] +ProjectsToProcess += [ "common/objects" ] +ProjectsToProcess += [ "common/sky" ] ProjectsToProcess += [ "ecosystems/jungle" ] ProjectsToProcess += [ "continents/newbieland" ] From 328dc084ac793fbf85cc65bd7a2b0bfd614b43c1 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 31 Aug 2010 00:23:26 +0200 Subject: [PATCH 29/56] Added: #929 Some more path fixing rules for max batch asset convert. --- .../scripts/nel_assets_png_batched.ms | 60 +++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms index 76956165a..df0de20b5 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -21,6 +21,10 @@ fn getAbsoluteDestination t = ( return ((getFilenamePath t) + "\\" + (getFilenameFile (filenameFromPath t)) + ".png") ) + else if ((findString t "E:\\Ryzom\\tryker") != undefined) then + ( + return "W:\\database\\Stuff\\Tryker\\Decors\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png" + ) else if ((findString t "\\tronc.") != undefined) then ( return "W:\\database\\database_proto\\stuff\\fyros\\objects\\tronc.png" @@ -47,7 +51,7 @@ fn getFixedTexturePath t = testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Accessories\\" + (getFilenameFile (filenameFromPath t)) + ".png") if (doesFileExist testDestination) then ( - absoluteDestination = testDestination + return testDestination ) ) if (not (doesFileExist absoluteDestination)) and (((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Batiments") != undefined) or ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories\\") != undefined)) then @@ -55,15 +59,63 @@ fn getFixedTexturePath t = testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Accessories\\Vv2\\" + (getFilenameFile (filenameFromPath t)) + ".png") if (doesFileExist testDestination) then ( - absoluteDestination = testDestination + return testDestination ) ) - if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories\\") != undefined) then + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories") != undefined) then ( testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") if (doesFileExist testDestination) then ( - absoluteDestination = testDestination + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\noutilise\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\vv2\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\tempautel\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Fyros\\Decors\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination ) ) return absoluteDestination From 99181c4a9dc12058c6dde2b4084e200b6b9f5e44 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 31 Aug 2010 09:28:49 +0200 Subject: [PATCH 30/56] Fixed: sound_source compilation under Linux --- code/nel/samples/sound_sources/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/nel/samples/sound_sources/CMakeLists.txt b/code/nel/samples/sound_sources/CMakeLists.txt index 288bb6cd0..f241e68d1 100644 --- a/code/nel/samples/sound_sources/CMakeLists.txt +++ b/code/nel/samples/sound_sources/CMakeLists.txt @@ -2,7 +2,9 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(nl_sample_sound_sources ${SRC}) -ADD_DEFINITIONS(-DNL_SOUND_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_sound/\\"") +ADD_DEFINITIONS(-DNL_SOUND_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_sound/\\"" ${LIBXML2_DEFINITIONS}) + +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_sound_sources ${PLATFORM_LINKFLAGS} nelmisc nelsound) NL_DEFAULT_PROPS(nl_sample_sound_sources "Samples: Sound System") From bce05f44f95c084672e5ee39f29e650ce5cfcce3 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 31 Aug 2010 09:43:59 +0200 Subject: [PATCH 31/56] Changed: #1051 Progress tweak --- .../tools/client/client_patcher/main.cpp | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/code/ryzom/tools/client/client_patcher/main.cpp b/code/ryzom/tools/client/client_patcher/main.cpp index 23e2c9420..9f4e8c166 100644 --- a/code/ryzom/tools/client/client_patcher/main.cpp +++ b/code/ryzom/tools/client/client_patcher/main.cpp @@ -82,13 +82,32 @@ void printDownload(const std::string &str) static const uint maxLength = 160; static char spaces[maxLength]; + + uint length = 0; + + if (useUtf8) + { + ucstring utf8Str; + utf8Str.fromUtf8(str); + length = (uint)utf8Str.length(); + } + else + { + length = (uint)str.length(); + } + + sint diff = length - previousLength; + + if (diff > 0 && length < maxLength) + { + memset(spaces, ' ', length); + spaces[length] = '\0'; + + // "erase" previous line + printf("%s\r", spaces); + fflush(stdout); + } - memset(spaces, ' ', previousLength); - spaces[previousLength] = '\0'; - - // "erase" previous line - printf("%s\r", spaces); - // display download in purple if (useEsc) { @@ -108,8 +127,10 @@ void printDownload(const std::string &str) SetConsoleTextAttribute(hStdout, attributes); #endif } + + fflush(stdout); - previousLength = (uint)str.length(); + previousLength = length; } int main(int argc, char *argv[]) From ca710cdac43cd09043eee87d8f5ab4853ec8948b Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 1 Sep 2010 10:03:34 +0200 Subject: [PATCH 32/56] Changed: Updated tools CMake projects --- code/nel/tools/3d/CMakeLists.txt | 2 +- code/nel/tools/3d/ig_elevation/CMakeLists.txt | 9 +++++---- .../tools/3d/lightmap_optimizer/CMakeLists.txt | 9 +++------ code/nel/tools/3d/shapes_exporter/CMakeLists.txt | 15 ++++----------- code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt | 12 +++--------- code/nel/tools/georges/georges2csv/CMakeLists.txt | 3 +++ code/nel/tools/pacs/build_rbank/CMakeLists.txt | 2 ++ 7 files changed, 21 insertions(+), 31 deletions(-) diff --git a/code/nel/tools/3d/CMakeLists.txt b/code/nel/tools/3d/CMakeLists.txt index 4e21da876..99598307d 100644 --- a/code/nel/tools/3d/CMakeLists.txt +++ b/code/nel/tools/3d/CMakeLists.txt @@ -25,7 +25,6 @@ SUBDIRS( build_coarse_mesh IF(WIN32) ADD_SUBDIRECTORY(object_viewer) ADD_SUBDIRECTORY(object_viewer_exe) - ADD_SUBDIRECTORY(panoply_maker) ADD_SUBDIRECTORY(tile_edit) ENDIF(WIN32) @@ -41,6 +40,7 @@ IF(WITH_MAXPLUGIN) ENDIF(WITH_MAXPLUGIN) IF(SQUISH_FOUND) + ADD_SUBDIRECTORY(panoply_maker) ADD_SUBDIRECTORY(tga_2_dds) ENDIF(SQUISH_FOUND) diff --git a/code/nel/tools/3d/ig_elevation/CMakeLists.txt b/code/nel/tools/3d/ig_elevation/CMakeLists.txt index ad0e04024..5f6c4a7c4 100644 --- a/code/nel/tools/3d/ig_elevation/CMakeLists.txt +++ b/code/nel/tools/3d/ig_elevation/CMakeLists.txt @@ -1,12 +1,13 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nel3d") -SET(NL3D_LIB ${LIBNAME}) - ADD_EXECUTABLE(ig_elevation ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(ig_elevation ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NL3D_LIB}) + +TARGET_LINK_LIBRARIES(ig_elevation ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(ig_elevation "Tools, 3D: ig_elevation") +NL_ADD_RUNTIME_FLAGS(ig_elevation) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS ig_elevation RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt index 865886999..3a15f394b 100644 --- a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt +++ b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt @@ -1,12 +1,9 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(lightmap_optimizer ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(lightmap_optimizer ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NLMISC_LIB}) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(lightmap_optimizer ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(lightmap_optimizer "Tools, 3D: lightmap_optimizer") +NL_ADD_RUNTIME_FLAGS(lightmap_optimizer) INSTALL(TARGETS lightmap_optimizer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/shapes_exporter/CMakeLists.txt b/code/nel/tools/3d/shapes_exporter/CMakeLists.txt index b84f03876..26e3c9004 100644 --- a/code/nel/tools/3d/shapes_exporter/CMakeLists.txt +++ b/code/nel/tools/3d/shapes_exporter/CMakeLists.txt @@ -1,16 +1,9 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(shapes_exporter ${SRC}) +ADD_EXECUTABLE(shapes_exporter WIN32 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(shapes_exporter ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(shapes_exporter PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Tools, 3D: Shapes Exporter") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(shapes_exporter ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(shapes_exporter "Tools, 3D: Shapes Exporter") +NL_ADD_RUNTIME_FLAGS(shapes_exporter) INSTALL(TARGETS shapes_exporter RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt b/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt index f98a96a4d..946309274 100644 --- a/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt +++ b/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt @@ -2,14 +2,8 @@ FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h) ADD_EXECUTABLE(zone_ig_lighter ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(zone_ig_lighter ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(zone_ig_lighter PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Tools, 3D: zone_ig_lighter") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(zone_ig_lighter ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(zone_ig_lighter "Tools, 3D: zone_ig_lighter") +NL_ADD_RUNTIME_FLAGS(zone_ig_lighter) INSTALL(TARGETS zone_ig_lighter RUNTIME DESTINATION bin COMPONENT tools3d) diff --git a/code/nel/tools/georges/georges2csv/CMakeLists.txt b/code/nel/tools/georges/georges2csv/CMakeLists.txt index 419430cc1..61e7b001a 100644 --- a/code/nel/tools/georges/georges2csv/CMakeLists.txt +++ b/code/nel/tools/georges/georges2csv/CMakeLists.txt @@ -3,8 +3,11 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(georges2csv ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(georges2csv ${PLATFORM_LINKFLAGS} nelmisc nelgeorges) NL_DEFAULT_PROPS(georges2csv "Tools, Georges: georges2csv") NL_ADD_RUNTIME_FLAGS(georges2csv) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + INSTALL(TARGETS georges2csv RUNTIME DESTINATION bin COMPONENT toolsgeorges) diff --git a/code/nel/tools/pacs/build_rbank/CMakeLists.txt b/code/nel/tools/pacs/build_rbank/CMakeLists.txt index 7d74c68d4..57cdaaf18 100644 --- a/code/nel/tools/pacs/build_rbank/CMakeLists.txt +++ b/code/nel/tools/pacs/build_rbank/CMakeLists.txt @@ -10,5 +10,7 @@ TARGET_LINK_LIBRARIES(build_rbank ${PLATFORM_LINKFLAGS} nelpacs nel3d nelligo ne NL_DEFAULT_PROPS(build_rbank "Tools, PACS: build_rbank") NL_ADD_RUNTIME_FLAGS(build_rbank) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + INSTALL(TARGETS build_rbank RUNTIME DESTINATION bin COMPONENT toolspacs) INSTALL(FILES build_rbank.cfg DESTINATION etc/nel COMPONENT toolspacs) From aceaccc3c0c1922028ab94786b281c3c2e4f2e6d Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 1 Sep 2010 13:44:01 +0200 Subject: [PATCH 33/56] Fixed: 3dsmax plugins compilation (64 bits and STLport) --- .../3d/ligo/plugin_max/ligoscape_utility.h | 1 + .../tools/3d/ligo/plugin_max/max_to_ligo.cpp | 2 + code/nel/tools/3d/ligo/plugin_max/script.cpp | 2 + .../3d/plugin_max/nel_3dsmax_shared/StdAfx.h | 1 + .../nel_3dsmax_shared/nel_3dsmax_shared.cpp | 2 +- .../3d/plugin_max/nel_export/nel_export.cpp | 4 +- .../nel_export/nel_export_node_properties.cpp | 122 +++++++++--------- .../3d/plugin_max/nel_export/progress.cpp | 8 +- .../tools/3d/plugin_max/nel_export/std_afx.h | 1 + .../tools/3d/plugin_max/nel_mesh_lib/StdAfx.h | 1 + .../plugin_max/nel_patch_converter/PO2RPO.h | 1 + .../nel_patch_converter.cpp | 2 +- .../plugin_max/nel_patch_converter/script.cpp | 1 + .../nel_patch_edit/np_edit_patch_mod.cpp | 4 +- .../plugin_max/nel_patch_edit/np_editpops.cpp | 2 +- .../nel_patch_edit/np_epm_selection.cpp | 6 +- .../nel_patch_edit/np_epm_surface.cpp | 22 ++-- .../plugin_max/nel_patch_edit/np_epm_tess.cpp | 8 +- .../3d/plugin_max/nel_patch_edit/np_main.cpp | 12 +- .../3d/plugin_max/nel_patch_edit/np_mods.cpp | 4 +- .../plugin_max/nel_patch_edit/np_rollup.cpp | 12 +- .../3d/plugin_max/nel_patch_edit/stdafx.h | 1 + .../plugin_max/nel_patch_lib/nel_patch_mesh.h | 6 +- .../3d/plugin_max/nel_patch_lib/stdafx.h | 1 + .../plugin_max/nel_patch_paint/DllEntry.cpp | 4 +- .../plugin_max/nel_patch_paint/paint_main.cpp | 2 +- .../plugin_max/nel_patch_paint/paint_pops.cpp | 2 +- .../nel_patch_paint/paint_rollup.cpp | 6 +- .../3d/plugin_max/nel_patch_paint/stdafx.h | 1 + .../vertex_tree_paint.cpp | 14 +- .../nel_vertex_tree_paint/vertex_tree_paint.h | 3 +- .../plugin_max/tile_utility/tile_utility.cpp | 2 +- .../3d/plugin_max/tile_utility/tile_utility.h | 1 + 33 files changed, 138 insertions(+), 123 deletions(-) diff --git a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h index b1c9d081e..ab2375eae 100644 --- a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h +++ b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h @@ -14,6 +14,7 @@ #ifndef __PLUGIN_MAX__H #define __PLUGIN_MAX__H +#include #include "Max.h" #include #include diff --git a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp index 9e143df06..7500b027b 100644 --- a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp @@ -14,6 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include + // From MAXSDK #include diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 97b9a97ad..228bf5349 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -16,6 +16,8 @@ #define EXPORT_GET_ALLOCATOR +#include + // Various MAX and MXS includes #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h index 0099fe7af..86627aaf7 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h @@ -30,6 +30,7 @@ // Insert your headers here #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp index 2c5cedd65..d30a5cadb 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . #include "stdafx.h" -#include "..\nel_patch_lib\rpo.h" +#include "../nel_patch_lib/rpo.h" #include "nel_3dsmax_shared.h" #include "nel/misc/app_context.h" diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index 04e815eac..7b8d2862e 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -59,7 +59,7 @@ void *CNelExportClassDesc::Create(BOOL loading) } -int CALLBACK OptionsDialogCallback ( +INT_PTR CALLBACK OptionsDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -217,7 +217,7 @@ int CALLBACK OptionsDialogCallback ( } extern HINSTANCE hInstance; -static BOOL CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // Set locale to english setlocale (LC_NUMERIC, "English"); diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp index f56ed592a..d6218fedf 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp @@ -309,22 +309,22 @@ public: HWND SubVPDlg[VP_COUNT]; }; -int CALLBACK MRMDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK AccelDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK InstanceDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK LightmapDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK Lightmap2DialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK VegetableDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK VertexProgramDialogCallBack (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK MiscDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK AnimationDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MRMDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AccelDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK InstanceDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK LightmapDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK Lightmap2DialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VegetableDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VertexProgramDialogCallBack (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MiscDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AnimationDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); const char *SubText[TAB_COUNT] = {"LOD & MRM", "Accelerator", "Instance", "Lighting", "LMC", "Vegetable", "VertexProgram", "Misc", "Animation"}; const int SubTab[TAB_COUNT] = {IDD_LOD, IDD_ACCEL, IDD_INSTANCE, IDD_LIGHTMAP, IDD_LIGHTMAP2, IDD_VEGETABLE, IDD_VERTEX_PROGRAM, IDD_MISC, IDD_ANIM}; DLGPROC SubProc[TAB_COUNT] = {MRMDialogCallback, AccelDialogCallback, InstanceDialogCallback, LightmapDialogCallback, Lightmap2DialogCallback, VegetableDialogCallback, VertexProgramDialogCallBack, MiscDialogCallback, AnimationDialogCallback}; // VertexPrograms. -int CALLBACK VPWindTreeCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VPWindTreeCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); const int SubVPTab[VP_COUNT] = {IDD_VP_WINDTREE}; DLGPROC SubVPProc[VP_COUNT] = {VPWindTreeCallback}; @@ -417,7 +417,7 @@ void VegetableStateChanged (HWND hwndDlg) void AccelStateChanged (HWND hwndDlg) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); bool cluster = (currentParam->AcceleratorType&NEL3D_APPDATA_ACCEL_TYPE) == NEL3D_APPDATA_ACCEL_CLUSTER; bool portal = (currentParam->AcceleratorType&NEL3D_APPDATA_ACCEL_TYPE) == NEL3D_APPDATA_ACCEL_PORTAL; @@ -464,22 +464,22 @@ void exploreNode(INode *node) } -int CALLBACK AccelDialogCallback ( +INT_PTR CALLBACK AccelDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Fill the known sound groups by parsing the max node tree. { @@ -635,22 +635,22 @@ int CALLBACK AccelDialogCallback ( // *************************************************************************** -int CALLBACK MRMDialogCallback ( +INT_PTR CALLBACK MRMDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text std::string winName=(*(currentParam->ListNode->begin()))->GetName(); @@ -903,22 +903,22 @@ int CALLBACK MRMDialogCallback ( // *************************************************************************** -int CALLBACK InstanceDialogCallback ( +INT_PTR CALLBACK InstanceDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_SHAPE), currentParam->InstanceShape.c_str()); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_NAME), currentParam->InstanceName.c_str()); @@ -1019,22 +1019,22 @@ int CALLBACK InstanceDialogCallback ( // *************************************************************************** -int CALLBACK LightmapDialogCallback ( +INT_PTR CALLBACK LightmapDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_LUMELSIZEMUL), currentParam->LumelSizeMul.c_str()); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_RADIUS), currentParam->SoftShadowRadius.c_str()); @@ -1298,14 +1298,14 @@ struct CLMCParamFrom }; // *************************************************************************** -int CALLBACK LMCCopyFromDialogCallback( +INT_PTR CALLBACK LMCCopyFromDialogCallback( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLMCParamFrom *lmcParam=(CLMCParamFrom *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLMCParamFrom *lmcParam=(CLMCParamFrom *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); uint i; switch (uMsg) @@ -1313,8 +1313,8 @@ int CALLBACK LMCCopyFromDialogCallback( case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - lmcParam=(CLMCParamFrom *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + lmcParam=(CLMCParamFrom *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // init the colors nlctassert(CLodDialogBoxParam::NumLightGroup==3); @@ -1519,22 +1519,22 @@ void lmcCopyFrom(CLodDialogBoxParam *currentParam, HWND parentDlg) } // *************************************************************************** -int CALLBACK Lightmap2DialogCallback ( +INT_PTR CALLBACK Lightmap2DialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // retrieve the color choosing Ctrl nlctassert(CLodDialogBoxParam::NumLightGroup==3); @@ -1642,22 +1642,22 @@ int CALLBACK Lightmap2DialogCallback ( // *************************************************************************** -int CALLBACK VegetableDialogCallback ( +INT_PTR CALLBACK VegetableDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE), BM_SETCHECK, currentParam->Vegetable, 0); @@ -1762,22 +1762,22 @@ int CALLBACK VegetableDialogCallback ( } // *************************************************************************** -int CALLBACK VertexProgramDialogCallBack ( +INT_PTR CALLBACK VertexProgramDialogCallBack ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // test wether v.p are bypassed for that object (this may happen when a v.p is needed by a material of this mesh) if (!currentParam->VertexProgramBypassed) @@ -2028,22 +2028,22 @@ static void updateVPWTStaticForControl(HWND hwndDlg, HWND ctrlWnd, CVPWindTreeAp } -int CALLBACK VPWindTreeCallback ( +INT_PTR CALLBACK VPWindTreeCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Init controls CVPWindTreeAppData &vpwt= currentParam->VertexProgramWindTree; @@ -2266,22 +2266,22 @@ int CALLBACK VPWindTreeCallback ( // *************************************************************************** -int CALLBACK MiscDialogCallback ( +INT_PTR CALLBACK MiscDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_FLOATING_OBJECT), BM_SETCHECK, currentParam->FloatingObject, 0); // Ligoscape @@ -2399,22 +2399,22 @@ int CALLBACK MiscDialogCallback ( // *************************************************************************** -int CALLBACK AnimationDialogCallback ( +INT_PTR CALLBACK AnimationDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_NOTE_TRACK), BM_SETCHECK, currentParam->ExportNoteTrack, 0); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_SSS_TRACK), BM_SETCHECK, currentParam->ExportSSSTrack, 0); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_ANIMATED_MATERIALS), BM_SETCHECK, currentParam->ExportAnimatedMaterials, 0); @@ -2468,22 +2468,22 @@ int CALLBACK AnimationDialogCallback ( // *************************************************************************** -int CALLBACK LodDialogCallback ( +INT_PTR CALLBACK LodDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text std::string winName=(*(currentParam->ListNode->begin()))->GetName(); @@ -2602,7 +2602,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) { // Get - uint nNumSelNode=listNode.size(); + uint nNumSelNode=(uint)listNode.size(); if (nNumSelNode) { @@ -3220,7 +3220,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) if (param.ListActived) { // Write size of the list - uint sizeList=std::min (param.ListLodName.size(), (uint)NEL3D_APPDATA_LOD_NAME_COUNT_MAX); + uint sizeList=std::min ((uint)param.ListLodName.size(), (uint)NEL3D_APPDATA_LOD_NAME_COUNT_MAX); CExportNel::setScriptAppData (node, NEL3D_APPDATA_LOD_NAME_COUNT, (int)sizeList); // Write the strings diff --git a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp index 4c1a239ca..7dd24b761 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp @@ -26,7 +26,7 @@ using namespace NLMISC; // ----------------------------------------------------------------------------------------------- // Window dialog callback // ----------------------------------------------------------------------------------------------- -int CALLBACK CalculatingDialogCallback ( +INT_PTR CALLBACK CalculatingDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -34,14 +34,14 @@ int CALLBACK CalculatingDialogCallback ( ) { double TimeCurrent = CTime::ticksToSecond( CTime::getPerformanceTime() ); - CProgressBar *pClass = (CProgressBar*)GetWindowLong (hwndDlg, GWL_USERDATA); + CProgressBar *pClass = (CProgressBar*)GetWindowLongPtr (hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - pClass = (CProgressBar*)GetWindowLong (hwndDlg, GWL_USERDATA); + LONG res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + pClass = (CProgressBar*)GetWindowLongPtr (hwndDlg, GWLP_USERDATA); CenterWindow( hwndDlg, theCNelExport._Ip->GetMAXHWnd() ); ShowWindow( hwndDlg, SW_SHOWNORMAL ); diff --git a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h index dcc52202d..326c0b9c1 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h +++ b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h index 9a99b5fc1..65b65651e 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h @@ -26,6 +26,7 @@ //#include "nel/misc/types_nl.h" // Max SDK includes //#define NOMINMAX +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h b/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h index 991ec01ff..51e7255b8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h @@ -18,6 +18,7 @@ #ifndef __PMESH2RKLPMESH__H #define __PMESH2RKLPMESH__H +#include #include "Max.h" #include "resource.h" #include "istdplug.h" diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp index 0310ecef7..eee8b1cf8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp @@ -121,7 +121,7 @@ void PO2RPO::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode * // ----------------------------------------------------------------------------------------------------------------------------------------------------------- extern HINSTANCE hInstance; -BOOL CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp index 731d9aefb..b324c2cc6 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp @@ -21,6 +21,7 @@ #define _CRT_SECURE_NO_DEPRECATE +#include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp index cdc3d5ed9..ef7a87642 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp @@ -264,7 +264,7 @@ void EditPatchMod::NewSetByOperator(TSTR &newName, Tab < int> &sets, int op) // Named selection set copy/paste methods follow... -static BOOL CALLBACK PickSetNameDlgProc( +static INT_PTR CALLBACK PickSetNameDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static TSTR *name; @@ -328,7 +328,7 @@ BOOL EditPatchMod::GetUniqueSetName(TSTR &name) -static BOOL CALLBACK PickSetDlgProc( +static INT_PTR CALLBACK PickSetDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp index 89da6fbe1..22a678ec0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp @@ -50,7 +50,7 @@ EPTempData::EPTempData(EditPatchMod *m,EditPatchData *pd) mod = m; } -void EPTempData::Invalidate(DWORD part,BOOL patchValid) +void EPTempData::Invalidate(PartID part,BOOL patchValid) { if ( !patchValid ) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp index 1370a93cf..cee83b2b0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp @@ -9,9 +9,9 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void ChangePatchType(PatchMesh *patch, int index, int type); extern BOOL filterVerts; // ------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp index 154e5b78c..164748768 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp @@ -15,7 +15,7 @@ extern int sbmParams[4]; extern DWORD sbsParams[3]; // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectByMatDlgProc( +INT_PTR CALLBACK SelectByMatDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static int *param; @@ -84,7 +84,7 @@ void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0 // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static DWORD *param; switch (msg) @@ -137,9 +137,9 @@ BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -150,7 +150,7 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hTilePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->tileNum = SetupIntSpinner(hDlg, IDC_TILE_MAT_SPIN, IDC_TILE_MAT, 0, 65535, 0); ep->tileRot = SetupIntSpinner(hDlg, IDC_TILE_ROT_SPIN, IDC_TILE_ROT, 0, 3, 0); ep->SetTileDlgEnables(); @@ -249,9 +249,9 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -262,7 +262,7 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hEdgePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->SetEdgeDlgEnables(); return TRUE; } @@ -324,9 +324,9 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -339,7 +339,7 @@ BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->matSpin = SetupIntSpinner(hDlg, IDC_MAT_IDSPIN, IDC_MAT_ID, 1, MAX_MATID, 0); ep->tessUSpin = SetupIntSpinner(hDlg, IDC_TESS_U_SPIN, IDC_TESS_U2, 1, 4, RPO_DEFAULT_TESSEL); ep->tessVSpin = SetupIntSpinner(hDlg, IDC_TESS_V_SPIN, IDC_TESS_V2, 1, 4, RPO_DEFAULT_TESSEL); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp index d73ea12ce..ec95d6ce5 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp @@ -10,7 +10,7 @@ #define PROMPT_TIME 2000 extern AdvParams sParams; -BOOL CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); // ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -212,7 +212,7 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -223,7 +223,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSurfPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)ep); if (!ep->settingViewportTess && ep->settingDisp && ep->GetProdTess().type == TESS_SET) ep->settingDisp = FALSE; TessApprox t; @@ -599,7 +599,7 @@ static ISpinnerControl* psMaxTrisSpin = NULL; // this max matches the MI max. #define MAX_SUBDIV 7 static BOOL initing = FALSE; // this is a hack but CenterWindow causes bad commands -BOOL CALLBACK +INT_PTR CALLBACK AdvParametersDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp index 5cab14922..42389e4d0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp @@ -9,12 +9,12 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void CancelEditPatchModes(IObjParam *ip); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp index 8470f3653..c2696674a 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp @@ -96,12 +96,12 @@ __declspec( dllexport ) ULONG CanAutoDefer() BOOL CALLBACK DefaultSOTProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { - IObjParam *ip = (IObjParam*)GetWindowLong(hWnd,GWL_USERDATA); + IObjParam *ip = (IObjParam*)GetWindowLongPtr(hWnd,GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; case WM_LBUTTONDOWN: diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp index 86a35b083..be29c758c 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp @@ -33,10 +33,10 @@ extern void CancelEditPatchModes(IObjParam *ip); extern void LoadImages(); -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { static char string[64]; - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); ICustToolbar *iToolbar; if (!ep && message != WM_INITDIALOG) return FALSE; @@ -104,7 +104,7 @@ BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSelectPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); // Set up the editing level selector LoadImages(); iToolbar = GetICustToolbar(GetDlgItem(hDlg, IDC_SELTYPE)); @@ -349,9 +349,9 @@ void EditPatchMod::SetOpsDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -367,7 +367,7 @@ BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ep->hOpsPanel = hDlg; for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ICustButton *but = GetICustButton(GetDlgItem(hDlg, IDC_ATTACH)); but->SetHighlightColor(GREEN_WASH); but->SetType(CBT_CHECK); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h index 5adc0636d..cb4ae8ecf 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h @@ -1,4 +1,5 @@ #pragma warning (disable : 4786) +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h index 508a9b843..12238a87b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h @@ -521,7 +521,7 @@ public: // Get map hit size uint getMapHitSize () const { - return _Data._MapHitToTileIndex->size (); + return (uint)_Data._MapHitToTileIndex->size (); } // Remap a triangle @@ -534,7 +534,7 @@ public: // Get the patch user info size uint getUIPatchSize () const { - return _Data._UIPatch->size(); + return (uint)_Data._UIPatch->size(); } // Get a patch user info @@ -558,7 +558,7 @@ public: // Get vertex user info size uint getUIVertexSize () const { - return _Data._UIVertex->size(); + return (uint)_Data._UIVertex->size(); } // Get a vertex user info diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h index f295970f5..8962b86bc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h @@ -20,6 +20,7 @@ #define _CRT_SECURE_NO_DEPRECATE #pragma warning (disable : 4786) +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp index d7fd70aec..a3578a0bc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp @@ -112,11 +112,11 @@ __declspec( dllexport ) ULONG CanAutoDefer() BOOL CALLBACK DefaultSOTProc( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { - IObjParam *ip = (IObjParam*)GetWindowLong(hWnd,GWL_USERDATA); + IObjParam *ip = (IObjParam*)GetWindowLongPtr(hWnd,GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; case WM_LBUTTONDOWN: diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp index c03c0994e..46934e653 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp @@ -3,7 +3,7 @@ // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void CancelEditPatchModes(IObjParam *ip); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp index e7e6d57dd..9fa7d8953 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp @@ -23,7 +23,7 @@ EPTempData::EPTempData(PaintPatchMod *m,PaintPatchData *pd) mod = m; } -void EPTempData::Invalidate(DWORD part,BOOL patchValid) +void EPTempData::Invalidate(PartID part,BOOL patchValid) { if ( !patchValid ) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp index 6785fdd3d..37b73fdc1 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp @@ -44,9 +44,9 @@ void PaintPatchMod::SetOpsDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - PaintPatchMod *ep =(PaintPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + PaintPatchMod *ep =(PaintPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -57,7 +57,7 @@ BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ep =(PaintPatchMod *)lParam; ep->hOpsPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); CheckDlgButton(hDlg, IDC_INCLUDE_MESHES, ep->includeMeshes); CheckDlgButton(hDlg, IDC_PRELOAD_TILES, ep->preloadTiles); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h index bb52ca5e3..4e731a3ff 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h @@ -1,6 +1,7 @@ #pragma warning (disable : 4786) // max.h include uses min/max in 3dsmax 2010 sdk +#include #include "Max.h" #ifdef min # undef min diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp index 0e61183c2..4ab422f9a 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp @@ -49,11 +49,11 @@ class VertexPaintClassDesc:public ClassDesc { static VertexPaintClassDesc VertexPaintDesc; ClassDesc* GetVertexPaintDesc() {return &VertexPaintDesc;} -static BOOL CALLBACK VertexPaintDlgProc( +static INT_PTR CALLBACK VertexPaintDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { int numPoints; - VertexPaint *mod = (VertexPaint*)GetWindowLong(hWnd,GWL_USERDATA); + VertexPaint *mod = (VertexPaint*)GetWindowLongPtr(hWnd,GWLP_USERDATA); if (!mod && msg!=WM_INITDIALOG) return FALSE; int comboResult; @@ -86,7 +86,7 @@ static BOOL CALLBACK VertexPaintDlgProc( case WM_INITDIALOG: LoadImages(); mod = (VertexPaint*)lParam; - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); mod->hParams = hWnd; mod->iPaintButton = GetICustButton(GetDlgItem(hWnd, IDC_PAINT)); mod->iPaintButton->SetType(CBT_CHECK); @@ -217,14 +217,14 @@ LRESULT APIENTRY colorSwatchSubclassWndProc( case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: { HWND hPanel = GetParent(hwnd); - LONG mod = GetWindowLong(hPanel,GWL_USERDATA); + LONG mod = GetWindowLongPtr(hPanel,GWLP_USERDATA); if (mod) { ((VertexPaint*)mod)->PaletteButton(hwnd); } } break; case WM_DESTROY: - SetWindowLong(hwnd, GWL_WNDPROC, (LONG) colorSwatchOriginalWndProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) colorSwatchOriginalWndProc); // Fallthrough... default: return CallWindowProc(colorSwatchOriginalWndProc, hwnd, uMsg, wParam, lParam); @@ -419,13 +419,13 @@ void VertexPaint::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) int i; for (i=0; i #include "Max.h" #include "resource.h" #include "istdplug.h" @@ -101,7 +102,7 @@ public: class VertexPaint : public Modifier { friend class PaintMouseProc; - friend BOOL CALLBACK VertexPaintDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + friend INT_PTR CALLBACK VertexPaintDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); public: static IObjParam* ip; diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp index 5ca8454fa..46c9f35cb 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp @@ -83,7 +83,7 @@ class Tile_utilityClassDesc:public ClassDesc2 static Tile_utilityClassDesc Tile_utilityDesc; ClassDesc2* GetTile_utilityDesc() {return &Tile_utilityDesc;} -static BOOL CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h index 336c7aec2..5962f6809 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h @@ -22,6 +22,7 @@ #define _CRT_SECURE_NO_DEPRECATE +#include #include #include #include From e3ea9207414f10ed5213e1f61ba8994fd6c6300d Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 1 Sep 2010 13:54:42 +0200 Subject: [PATCH 34/56] Changed: Updated 3dsmax plugins CMake projects --- .../tools/3d/ligo/plugin_max/CMakeLists.txt | 16 ++++++-------- .../nel_3dsmax_shared/CMakeLists.txt | 16 ++++++-------- .../3d/plugin_max/nel_export/CMakeLists.txt | 16 ++++++-------- .../3d/plugin_max/nel_mesh_lib/CMakeLists.txt | 17 +++++---------- .../nel_patch_converter/CMakeLists.txt | 15 +++++-------- .../plugin_max/nel_patch_edit/CMakeLists.txt | 17 +++++---------- .../nel_patch_edit_adv/CMakeLists.txt | 17 +++++---------- .../plugin_max/nel_patch_lib/CMakeLists.txt | 21 +++++-------------- .../plugin_max/nel_patch_paint/CMakeLists.txt | 14 +++++-------- .../nel_vertex_tree_paint/CMakeLists.txt | 18 ++++++---------- .../3d/plugin_max/tile_utility/CMakeLists.txt | 17 +++++---------- 11 files changed, 59 insertions(+), 125 deletions(-) diff --git a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt index 29081370f..41123aa21 100644 --- a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt +++ b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt @@ -3,8 +3,8 @@ FILE(GLOB SRC *.cpp *.h ../../ig_lighter_lib/*.cpp ../../ig_lighter_lib/*.h) ADD_LIBRARY(ligoscape_utility SHARED ligoscape_utility.rc ${SRC} ligoscape_utility.def) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(ligoscape_utility - ${LIBXML2_LIBRARIES} nelmisc nelligo nel3d @@ -15,15 +15,11 @@ TARGET_LINK_LIBRARIES(ligoscape_utility nel_3dsmax_shared comctl32) -SET_TARGET_PROPERTIES(ligoscape_utility PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - SUFFIX ".dlx" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: Ligoscape Utility") - +SET_TARGET_PROPERTIES(ligoscape_utility PROPERTIES SUFFIX ".dlx") +NL_DEFAULT_PROPS(ligoscape_utility "MAX Plugin: Ligoscape Utility") +NL_ADD_RUNTIME_FLAGS(ligoscape_utility) +NL_ADD_LIB_SUFFIX(ligoscape_utility) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS ligoscape_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt index 27359b29d..37a9bb0be 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_3dsmax_shared SHARED ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_3dsmax_shared - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -12,15 +11,12 @@ TARGET_LINK_LIBRARIES(nel_3dsmax_shared ${MAXSDK_LIBRARIES} Version.lib) -SET_TARGET_PROPERTIES(nel_3dsmax_shared PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL 3DSMAX Shared") +NL_DEFAULT_PROPS(nel_3dsmax_shared "MAX Plugin: NeL 3DSMAX Shared") +NL_ADD_RUNTIME_FLAGS(nel_3dsmax_shared) +NL_ADD_LIB_SUFFIX(nel_3dsmax_shared) +SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlx") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_3DSMAX_SHARED_EXPORTS) +ADD_DEFINITIONS(-DNEL_3DSMAX_SHARED_EXPORTS) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_3dsmax_shared ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) diff --git a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt index 848deb77e..0c2a215dc 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt @@ -7,8 +7,8 @@ LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/last_lightmap.cpp ADD_LIBRARY(nel_export SHARED ${SRC} nel_export.rc) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nel_export - ${LIBXML2_LIBRARIES} nelmisc nelpacs nel3d @@ -19,15 +19,11 @@ TARGET_LINK_LIBRARIES(nel_export ${MAXSDK_LIBRARIES} Version.lib comctl32.lib) - -SET_TARGET_PROPERTIES(nel_export PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlu" - PROJECT_LABEL "MAX Plugin: NeL Export") + +NL_DEFAULT_PROPS(nel_export "MAX Plugin: NeL Export") +NL_ADD_RUNTIME_FLAGS(nel_export) +NL_ADD_LIB_SUFFIX(nel_export) +SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlu") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt index 3e55c015a..555edd263 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt @@ -2,18 +2,11 @@ FILE(GLOB SRC *.cpp *.h) ADD_LIBRARY(nel_mesh_lib STATIC ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR} ${MAXSDK_CS_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_mesh_lib ${LIBXML2_LIBRARIES} nelmisc) -SET_TARGET_PROPERTIES(nel_mesh_lib PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Mesh Library") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR} ${MAXSDK_CS_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_mesh_lib nelmisc) +NL_DEFAULT_PROPS(nel_mesh_lib "MAX Plugin: NeL Mesh Library") +NL_ADD_RUNTIME_FLAGS(nel_mesh_lib) +NL_ADD_LIB_SUFFIX(nel_mesh_lib) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_mesh_lib ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt index e70f7471f..3d06dd679 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_patch_converter SHARED ${SRC} nel_patch_converter.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_converter - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,13 +13,9 @@ TARGET_LINK_LIBRARIES(nel_patch_converter Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_converter PROPERTIES - VERSION ${NL_VERSION} - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlm" - PROJECT_LABEL "MAX Plugin: NeL Patch Converter") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_patch_converter PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_converter "MAX Plugin: NeL Patch Converter") +NL_ADD_RUNTIME_FLAGS(nel_patch_converter) +NL_ADD_LIB_SUFFIX(nel_patch_converter) INSTALL(TARGETS nel_patch_converter RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt index b99689017..5c7b42843 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_patch_edit SHARED ${SRC} mods.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_edit - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,16 +13,10 @@ TARGET_LINK_LIBRARIES(nel_patch_edit Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_edit PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlm" - PROJECT_LABEL "MAX Plugin: NeL Patch Editor") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_patch_edit PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_edit "MAX Plugin: NeL Patch Editor") +NL_ADD_RUNTIME_FLAGS(nel_patch_edit) +NL_ADD_LIB_SUFFIX(nel_patch_edit) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_patch_edit ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt index 15f2dab27..52a8b1bbd 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_patch_edit_adv SHARED ${SRC} mods.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_edit_adv - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,15 +13,9 @@ TARGET_LINK_LIBRARIES(nel_patch_edit_adv Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_edit_adv PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - SUFFIX ".dlm" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Patch Edit (Adv)") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_patch_edit_adv PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_edit_adv "MAX Plugin: NeL Patch Edit (Adv)") +NL_ADD_RUNTIME_FLAGS(nel_patch_edit_adv) +NL_ADD_LIB_SUFFIX(nel_patch_edit_adv) INSTALL(TARGETS nel_patch_edit_adv RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt index 6110cc0d3..c27ec5345 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt @@ -2,21 +2,10 @@ FILE(GLOB SRC *.cpp *.h) ADD_LIBRARY(nel_patch_lib STATIC ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_patch_lib - ${LIBXML2_LIBRARIES} - nelmisc - nel3d - ${MAXSDK_LIBRARIES}) -SET_TARGET_PROPERTIES(nel_patch_lib PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Patch Library") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_patch_lib nelmisc nel3d ${MAXSDK_LIBRARIES}) +NL_DEFAULT_PROPS(nel_patch_lib "MAX Plugin: NeL Patch Library") +NL_ADD_RUNTIME_FLAGS(nel_patch_lib) +NL_ADD_LIB_SUFFIX(nel_patch_lib) INSTALL(TARGETS nel_patch_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt index 8b0c940e9..29ddbd82f 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt @@ -5,8 +5,8 @@ LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/nel_paint.cpp) ADD_LIBRARY(nel_patch_paint SHARED ${SRC} nel_patch_paint.rc) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nel_patch_paint - ${LIBXML2_LIBRARIES} nelmisc nelligo nel3d @@ -17,14 +17,10 @@ TARGET_LINK_LIBRARIES(nel_patch_paint Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_paint PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - VERSION ${NL_VERSION} - SUFFIX ".dlm" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Patch Painter") +SET_TARGET_PROPERTIES(nel_patch_paint PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_paint "MAX Plugin: NeL Patch Painter") +NL_ADD_RUNTIME_FLAGS(nel_patch_paint) +NL_ADD_LIB_SUFFIX(nel_patch_paint) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt index 4fa021475..52462143f 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt @@ -2,9 +2,9 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_vertex_tree_paint SHARED ${SRC} vertex_tree_paint.def vertex_tree_paint.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nel_vertex_tree_paint - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,15 +14,9 @@ TARGET_LINK_LIBRARIES(nel_vertex_tree_paint Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_vertex_tree_paint PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlm" - PROJECT_LABEL "MAX Plugin: NeL Vertex Tree Painter") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_vertex_tree_paint PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_vertex_tree_paint "MAX Plugin: NeL Vertex Tree Painter") +NL_ADD_RUNTIME_FLAGS(nel_vertex_tree_paint) +NL_ADD_LIB_SUFFIX(nel_vertex_tree_paint) INSTALL(TARGETS nel_vertex_tree_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt index 8430da2ec..5fc407eee 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(tile_utility SHARED ${SRC} tile_utility.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(tile_utility - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,15 +13,9 @@ TARGET_LINK_LIBRARIES(tile_utility Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(tile_utility PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - SUFFIX ".dlu" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: Tile Utility") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(tile_utility PROPERTIES SUFFIX ".dlu") +NL_DEFAULT_PROPS(tile_utility "MAX Plugin: Tile Utility") +NL_ADD_RUNTIME_FLAGS(tile_utility) +NL_ADD_LIB_SUFFIX(tile_utility) INSTALL(TARGETS tile_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) From f362c9363b8f82cbce3b7128727e602909afeffb Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Sep 2010 15:15:30 +0200 Subject: [PATCH 35/56] Changed: #964 Skip over deleted bones in skinning when exporting from max. --- .../nel_mesh_lib/export_skinning.cpp | 102 +++++++++++------- 1 file changed, 61 insertions(+), 41 deletions(-) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp index c1809508f..57f742972 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp @@ -748,15 +748,20 @@ uint CExportNel::buildSkinning (CMesh::CMeshBuild& buildMesh, const TInodePtrInt { if (blendedInterface) { - // Get the bone weight - float weight=blendedInterface->GetWeight(bone); - // Get node INode *node=blendedInterface->GetNode(bone); - nlassert (node); - - // Insert in the map - weightMap.insert (std::map::value_type (weight, node)); + if (node == NULL) + { + nlwarning("node == NULL; bone = %i / %i", bone, boneCount); + } + else + { + // Get the bone weight + float weight=blendedInterface->GetWeight(bone); + + // Insert in the map + weightMap.insert (std::map::value_type (weight, node)); + } } else { @@ -1191,49 +1196,64 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind for (boneIndex=0; boneIndexGetNode(boneIndex); + INode *bone = blendedInterface->GetNode(boneIndex); - // Get the bind matrix of the bone - Matrix3 bindPos; - int res=physiqueInterface->GetInitNodeTM (bone, bindPos); - nlassert (res==MATRIX_RETURNED); - - // Add an entry inthe map - if (boneBindPos.insert (mapBoneBindPos::value_type (bone, bindPos)).second) + if (bone == NULL) { -#ifdef NL_DEBUG - // *** Debug info + nlwarning("bone == NULL; boneIndex = %i / %i", boneIndex, count); + } + else + { + // Get the bind matrix of the bone + Matrix3 bindPos; + int res = physiqueInterface->GetInitNodeTM (bone, bindPos); - // Bone name - std::string boneName=getName (*bone); + if (res != MATRIX_RETURNED) + { + nlwarning("res != MATRIX_RETURNED; res = %i; boneIndex = %i / %i", res, boneIndex, count); + nlwarning("bone = %i", (uint32)(void *)bone); + std::string boneName = getName (*bone); + nlwarning("boneName = %s", boneName.c_str()); + nlassert(false); + } - // Local matrix - Matrix3 nodeTM; - nodeTM=bone->GetNodeTM (0); + // Add an entry inthe map + if (boneBindPos.insert (mapBoneBindPos::value_type (bone, bindPos)).second) + { + #ifdef NL_DEBUG + // *** Debug info - // Offset matrix - Matrix3 offsetScaleTM (TRUE); - Matrix3 offsetRotTM (TRUE); - Matrix3 offsetPosTM (TRUE); - ApplyScaling (offsetScaleTM, bone->GetObjOffsetScale ()); - offsetRotTM.SetRotate (bone->GetObjOffsetRot ()); - offsetPosTM.SetTrans (bone->GetObjOffsetPos ()); - Matrix3 offsetTM = offsetScaleTM * offsetRotTM * offsetPosTM; + // Bone name + std::string boneName=getName (*bone); - // Local + offset matrix - Matrix3 nodeOffsetTM = offsetTM * nodeTM; + // Local matrix + Matrix3 nodeTM; + nodeTM=bone->GetNodeTM (0); - // Init TM - Matrix3 initTM; - int res=physiqueInterface->GetInitNodeTM (bone, initTM); - nlassert (res==MATRIX_RETURNED); + // Offset matrix + Matrix3 offsetScaleTM (TRUE); + Matrix3 offsetRotTM (TRUE); + Matrix3 offsetPosTM (TRUE); + ApplyScaling (offsetScaleTM, bone->GetObjOffsetScale ()); + offsetRotTM.SetRotate (bone->GetObjOffsetRot ()); + offsetPosTM.SetTrans (bone->GetObjOffsetPos ()); + Matrix3 offsetTM = offsetScaleTM * offsetRotTM * offsetPosTM; - // invert - initTM.Invert(); - Matrix3 compNode=nodeTM*initTM; - Matrix3 compOffsetNode=nodeOffsetTM*initTM; - Matrix3 compOffsetNode2=nodeOffsetTM*initTM; + // Local + offset matrix + Matrix3 nodeOffsetTM = offsetTM * nodeTM; + + // Init TM + Matrix3 initTM; + int res=physiqueInterface->GetInitNodeTM (bone, initTM); + nlassert (res==MATRIX_RETURNED); + + // invert + initTM.Invert(); + Matrix3 compNode=nodeTM*initTM; + Matrix3 compOffsetNode=nodeOffsetTM*initTM; + Matrix3 compOffsetNode2=nodeOffsetTM*initTM; #endif // NL_DEBUG + } } } } From c8ee84fbe43a8ef3a3fffd72974c5ad890787560 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Sep 2010 15:15:55 +0200 Subject: [PATCH 36/56] Changed: #964 Some more rules for batched max convert paths. --- .../3d/plugin_max/scripts/nel_assets_png_batched.ms | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms index df0de20b5..fa107376b 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -118,6 +118,19 @@ fn getFixedTexturePath t = return testDestination ) ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\sky_V2\\textures\\textures") != undefined) then + ( + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\nodds\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\desert\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\forest\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\jungle\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\lacustre\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + ) return absoluteDestination ) From ad068c46bbd061241906a75653ba5d07b2989aab Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Sep 2010 15:17:34 +0200 Subject: [PATCH 37/56] Changed: #964 Add remapping in client of tga filenames onto png files for unprocessed textures from the png asset database. --- code/ryzom/client/src/init.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index e7ac5e1e8..75e12fba5 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -763,6 +763,7 @@ void prelogInit() // Remap tga files on dds files. CPath::remapExtension ("dds", "tga", true); CPath::remapExtension ("dds", "png", true); + CPath::remapExtension ("png", "tga", true); FPU_CHECKER_ONCE uint i; From d4caf01eb193cb38a7578da469f19a43dcf6ecc0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Sep 2010 15:24:43 +0200 Subject: [PATCH 38/56] Added: #929 Process for anim, font, swt, clodbank, pacs_prim, ps, skel. Project for objects, sky, contruction, fauna, fonts, outgame, sfx. --- .../build_gamedata/configuration/scripts.py | 43 +++ .../build_gamedata/configuration/tools.py | 1 + .../build_gamedata/processes/anim/1_export.py | 33 ++- .../build_gamedata/processes/anim/2_build.py | 7 +- .../processes/anim/todo_export_maxscript | 0 .../processes/clodbank/0_setup.py | 85 ++++++ .../processes/clodbank/1_export.py | 93 ++++++ .../processes/clodbank/2_build.py | 68 +++++ .../processes/clodbank/3_install.py | 57 ++++ .../clodbank/maxscript/clod_export.ms | 2 +- .../build_gamedata/processes/font/0_setup.py | 1 + .../build_gamedata/processes/font/1_export.py | 11 + .../processes/font/3_install.py | 12 +- .../build_gamedata/processes/ig/1_export.py | 55 ++-- .../processes/ig_light/2_build.py | 2 +- .../build_gamedata/processes/ligo/1_export.py | 66 ++--- .../processes/pacs_prim/0_setup.py | 65 ++++ .../processes/pacs_prim/1_export.py | 104 +++++++ .../processes/pacs_prim/2_build.py | 49 ++++ .../processes/pacs_prim/3_install.py | 57 ++++ .../pacs_prim/maxscript/pacs_prim_export.ms | 161 ++++++++++ .../processes/properties/0_setup.py | 125 ++++++++ .../processes/properties/1_export.py | 44 +++ .../processes/properties/2_build.py | 42 +++ .../processes/properties/3_install.py | 43 +++ .../build_gamedata/processes/ps/0_setup.py | 65 ++++ .../build_gamedata/processes/ps/1_export.py | 60 ++++ .../build_gamedata/processes/ps/2_build.py | 49 ++++ .../build_gamedata/processes/ps/3_install.py | 57 ++++ .../build_gamedata/processes/shape/0_setup.py | 5 +- .../processes/shape/1_export.py | 13 +- .../build_gamedata/processes/shape/2_build.py | 21 +- .../processes/shape/3_install.py | 4 +- .../build_gamedata/processes/skel/1_export.py | 40 ++- .../processes/skel/maxscript/skel_export.ms | 162 ++++++++++ .../processes/skel/todo_export_maxscript | 0 .../build_gamedata/processes/swt/1_export.py | 34 ++- .../processes/swt/maxscript/swt_export.ms | 2 +- .../processes/swt/todo_export_maxscript | 0 .../processes/veget/1_export.py | 27 +- .../build_gamedata/processes/zone/2_build.py | 2 +- .../processes/zone_light/0_setup.py | 26 -- .../processes/zone_light/2_build.py | 4 +- .../common/construction/directories.py | 141 +++++++++ .../workspace/common/construction/process.py | 110 +++++++ .../common/construction/properties_base.cfg | 51 ++++ .../construction/properties_draft.cfg} | 0 .../construction/properties_final.cfg} | 2 +- .../workspace/common/fauna/anim_builder.cfg | 15 + .../workspace/common/fauna/directories.py | 277 ++++++++++++++++++ .../workspace/common/fauna/process.py | 109 +++++++ .../workspace/common/fonts/directories.py | 59 ++++ .../workspace/common/fonts/process.py | 43 +++ .../workspace/common/interface/directories.py | 10 +- .../workspace/common/interface/process.py | 10 + .../workspace/common/objects/directories.py | 3 +- .../workspace/common/outgame/directories.py | 141 +++++++++ .../workspace/common/outgame/process.py | 110 +++++++ .../common/outgame/properties_base.cfg | 51 ++++ .../common/outgame/properties_draft.cfg | 93 ++++++ .../common/outgame/properties_final.cfg | 93 ++++++ .../workspace/common/sfx/directories.py | 102 +++++++ .../workspace/common/sfx/process.py | 87 ++++++ .../workspace/common/sky/anim_builder.cfg | 15 + .../workspace/common/sky/directories.py | 49 +++- .../workspace/common/sky/process.py | 43 ++- .../workspace/common/sky/properties_base.cfg | 51 ++++ .../workspace/common/sky/properties_draft.cfg | 93 ++++++ .../workspace/common/sky/properties_final.cfg | 93 ++++++ .../continents/newbieland/directories.py | 104 +++++-- .../continents/newbieland/process.py | 43 ++- ...e_lighter_base.cfg => properties_base.cfg} | 22 +- .../newbieland/properties_draft.cfg | 93 ++++++ .../newbieland/properties_final.cfg | 93 ++++++ .../ecosystems/jungle/directories.py | 8 +- .../workspace/ecosystems/jungle/process.py | 5 +- .../build_gamedata/workspace/projects.py | 23 +- 77 files changed, 3845 insertions(+), 194 deletions(-) delete mode 100644 code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/clodbank/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/clodbank/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/clodbank/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/clodbank/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/properties/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/properties/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/properties/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/properties/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/ps/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/ps/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/ps/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/ps/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms delete mode 100644 code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript delete mode 100644 code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/construction/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/construction/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/construction/properties_base.cfg rename code/ryzom/tools/build_gamedata/workspace/{continents/newbieland/zone_lighter_draft.cfg => common/construction/properties_draft.cfg} (100%) rename code/ryzom/tools/build_gamedata/workspace/{continents/newbieland/zone_lighter_final.cfg => common/construction/properties_final.cfg} (94%) create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/fauna/anim_builder.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/fauna/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/fauna/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/fonts/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/fonts/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/outgame/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/outgame/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_base.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_draft.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_final.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sfx/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sfx/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sky/anim_builder.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sky/properties_base.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sky/properties_draft.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/common/sky/properties_final.cfg rename code/ryzom/tools/build_gamedata/workspace/continents/newbieland/{zone_lighter_base.cfg => properties_base.cfg} (52%) create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_draft.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_final.cfg diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py index 774061e25..a919b89a6 100644 --- a/code/nel/tools/build_gamedata/configuration/scripts.py +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -215,6 +215,49 @@ def findFile(log, dir_where, file_name): printLog(log, "findFile: file not dir or file?! " + filePath) return "" +def needUpdateDirNoSubdirLogExt(log, dir_source, ext_source, dir_dest, ext_dest): + latestSourceFile = 0 + latestDestFile = 0 + sourceFiles = findFilesNoSubdir(log, dir_source, ext_source) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + fileTime = os.stat(dir_source + "/" + file).st_mtime + if (fileTime > latestSourceFile): + latestSourceFile = fileTime + for file in destFiles: + fileTime = os.stat(dir_dest + "/" + file).st_mtime + if (fileTime > latestDestFile): + latestDestFile = fileTime + if latestSourceFile > latestDestFile or len(sourceFiles) > len(destFiles): + printLog(log, "UPDATE; Source: " + str(latestSourceFile) + ", " + str(len(sourceFiles)) + " files; Dest: " + str(latestDestFile) + ", " + str(len(destFiles)) + " files") + return 1 + else: + printLog(log, "SKIP *") + return 0 + +def needUpdateDirNoSubdirLogExtMultidir(log, all_dir_base, all_dir_source, dir_source, ext_source, dir_dest, ext_dest): + latestSourceFile = 0 + latestDestFile = 0 + sourceFilesAll = [ ] + for dir in all_dir_source: + sourceFilesAll += findFilesNoSubdir(log, all_dir_base + "/" + dir, ext_source) + sourceFiles = findFilesNoSubdir(log, dir_source, ext_source) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + fileTime = os.stat(dir_source + "/" + file).st_mtime + if (fileTime > latestSourceFile): + latestSourceFile = fileTime + for file in destFiles: + fileTime = os.stat(dir_dest + "/" + file).st_mtime + if (fileTime > latestDestFile): + latestDestFile = fileTime + if latestSourceFile > latestDestFile or len(sourceFilesAll) > len(destFiles): + printLog(log, "UPDATE; Source: " + str(latestSourceFile) + ", " + str(len(sourceFilesAll)) + " files; Dest: " + str(latestDestFile) + ", " + str(len(destFiles)) + " files") + return 1 + else: + printLog(log, "SKIP *") + return 0 + def findTool(log, dirs_where, file_name, suffix): try: for dir in dirs_where: diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py index 8a1cd388f..ed3e2fbb8 100644 --- a/code/nel/tools/build_gamedata/configuration/tools.py +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -84,3 +84,4 @@ LandExportTool = "land_export" PrimExportTool = "prim_export" IgElevationTool = "ig_elevation" IgAddTool = "ig_add" +BuildClodBankTool = "build_clod_bank" diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py index fe6770ced..5ab68c730 100644 --- a/code/nel/tools/build_gamedata/processes/anim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -49,12 +49,39 @@ printLog(log, "") # For each anim directory printLog(log, ">>> Export anim 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) for dir in AnimSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, AnimSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + AnimExportDirectory, ".anim")): + scriptSrc = "maxscript/anim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/anim_export.ms" + logFile = ScriptDirectory + "/processes/anim/log.log" + outDirAnim = ExportBuildDirectory + "/" + AnimExportDirectory + animSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outDirAnim, "", ".anim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("anim_source_directory", animSourceDir) + newline = newline.replace("output_directory", outDirAnim) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "anim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outDirAnim, "", ".anim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .anim files!") + os.remove(scriptDst) + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/2_build.py b/code/nel/tools/build_gamedata/processes/anim/2_build.py index 3cd6ead71..8b6a902bd 100644 --- a/code/nel/tools/build_gamedata/processes/anim/2_build.py +++ b/code/nel/tools/build_gamedata/processes/anim/2_build.py @@ -56,7 +56,12 @@ else: mkPath(log, srcDir) destDir = ExportBuildDirectory + "/" + AnimBuildDirectory mkPath(log, destDir) - subprocess.call([ AnimBuilder, srcDir, destDir, ScriptDirectory + "/configuration/zone_lighter_properties.cfg" ]) + if DoOptimizeAnimations: + printLog(log, ">>> Optimizing animations <<<") + subprocess.call([ AnimBuilder, srcDir, destDir, ActiveProjectDirectory + "/anim_builder.cfg" ]) + else: + printLog(log, ">>> Not optimizing animations <<<") + copyFilesNoTreeIfNeeded(log, srcDir, destDir) printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py b/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py new file mode 100644 index 000000000..e28f629d9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup clodbank +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in ClodSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ClodBankBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + AnimBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ShapeClientDirectory) + +# Setup configuration files +printLog(log, ">>> Setup configuration files <<<") +mkPath(log, ActiveProjectDirectory + "/generated") +cfgOut = open(ActiveProjectDirectory + "/generated/clod_paths.cfg", "w") +cfgOut.write("\n") +cfgOut.write("// The search pathes, look in the current process\n") +cfgOut.write("search_pathes = \n") +cfgOut.write("{\n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + ClodExportDirectory + "\", \n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + SkelExportDirectory + "\", \n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + AnimBuildDirectory + "\", \n") +cfgOut.write("};\n") +cfgOut.write("\n") +cfgOut.close() + + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py new file mode 100644 index 000000000..d4da536fb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py @@ -0,0 +1,93 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export clodbank +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +Max = findMax(log, MaxDirectory, MaxExecutable) +printLog(log, "") + +# For each clodbank directory +printLog(log, ">>> Export clodbank 3dsmax <<<") +mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) +for dir in ClodSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, ClodSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ClodTagExportDirectory, ".tag")): + scriptSrc = "maxscript/clod_export.ms" + scriptDst = MaxUserDirectory + "/scripts/clod_export.ms" + logFile = ScriptDirectory + "/processes/clodbank/log.log" + outDirClod = ExportBuildDirectory + "/" + ClodExportDirectory + outDirTag = ExportBuildDirectory + "/" + ClodTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outDirTag, "", ".tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("shape_source_directory", maxSourceDir) + newline = newline.replace("output_directory_clod", outDirClod) + newline = newline.replace("output_directory_tag", outDirTag) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "clod_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outDirTag, "", ".tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/2_build.py b/code/nel/tools/build_gamedata/processes/clodbank/2_build.py new file mode 100644 index 000000000..8155c0e00 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/2_build.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build clodbank +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildClodBank = findTool(log, ToolDirectories, BuildClodBankTool, ToolSuffix) +printLog(log, "") + +# Build clodbank +printLog(log, ">>> Build clodbank <<<") +if BuildClodBank == "": + toolLogFail(log, BuildClodBankTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + ClodExportDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + ClodBankBuildDirectory + mkPath(log, destDir) + mkPath(log, ActiveProjectDirectory + "/generated") + destFile = destDir + "/" + ClodBankFileName + configFile = DatabaseDirectory + "/" + ClodConfigFile + subprocess.call([ BuildClodBank, ActiveProjectDirectory + "/generated/clod_paths.cfg", configFile, destFile ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/3_install.py b/code/nel/tools/build_gamedata/processes/clodbank/3_install.py new file mode 100644 index 000000000..6879f3da8 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install clodbank +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install clodbank <<<") +srcDir = ExportBuildDirectory + "/" + ClodBankBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + ShapeClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms index 49326a260..17c7aeb9c 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -132,7 +132,7 @@ fn goClodExport = ( -- Open the max project nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] quiet:true == true then + if (loadMaxFile files[i] quiet:true) == true then ( -- Unhide category unhidecategory() diff --git a/code/nel/tools/build_gamedata/processes/font/0_setup.py b/code/nel/tools/build_gamedata/processes/font/0_setup.py index bf61fce0e..3eb5a97fd 100644 --- a/code/nel/tools/build_gamedata/processes/font/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/font/0_setup.py @@ -50,6 +50,7 @@ for dir in FontSourceDirectories: # Setup export directories printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + FontExportDirectory) # Setup build directories printLog(log, ">>> Setup build directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/font/1_export.py b/code/nel/tools/build_gamedata/processes/font/1_export.py index 54292bec5..34089b83d 100644 --- a/code/nel/tools/build_gamedata/processes/font/1_export.py +++ b/code/nel/tools/build_gamedata/processes/font/1_export.py @@ -43,6 +43,17 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +printLog(log, ">>> Export font <<<") +fontExportDir = ExportBuildDirectory + "/" + FontExportDirectory +mkPath(log, fontExportDir) +for dir in FontSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".ttf") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".afm") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".pfb") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".pfm") + + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/font/3_install.py b/code/nel/tools/build_gamedata/processes/font/3_install.py index 55da60bed..4415c1195 100644 --- a/code/nel/tools/build_gamedata/processes/font/3_install.py +++ b/code/nel/tools/build_gamedata/processes/font/3_install.py @@ -45,14 +45,14 @@ printLog(log, "") clientPath = ClientDataDirectory + "/" + FontClientDirectory mkPath(log, clientPath) +fontExportDir = ExportBuildDirectory + "/" + FontExportDirectory +mkPath(log, fontExportDir) printLog(log, ">>> Install font <<<") -for dir in FontSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".ttf") - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".afm") - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfb") - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfm") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".ttf") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".afm") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".pfb") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".pfm") printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/ig/1_export.py b/code/nel/tools/build_gamedata/processes/ig/1_export.py index 8921b2d1a..c8eb2d363 100644 --- a/code/nel/tools/build_gamedata/processes/ig/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ig/1_export.py @@ -46,38 +46,39 @@ printLog(log, "") Max = "" #find later -def igExport(sourceDir, targetDir): +def igExport(all_source_base, all_source_dir, sourceDir, targetDir): scriptSrc = "maxscript/ig_export.ms" scriptDst = MaxUserDirectory + "/scripts/ig_export.ms" logFile = ScriptDirectory + "/processes/ig/log.log" outDirTag = ExportBuildDirectory + "/" + IgStaticTagExportDirectory outDirIg = ExportBuildDirectory + "/" + targetDir igSourceDir = DatabaseDirectory + "/" + sourceDir - tagList = findFiles(log, outDirTag, "", ".tag") - tagLen = len(tagList) - if os.path.isfile(scriptDst): - os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("ig_source_directory", igSourceDir) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("output_directory_ig", outDirIg) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "ig_export.ms", "-q", "-mi", "-vn" ]) + if (needUpdateDirNoSubdirLogExtMultidir(log, all_source_base, all_source_dir, igSourceDir, ".max", outDirTag, ".max.tag")): tagList = findFiles(log, outDirTag, "", ".tag") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .max files!") - os.remove(scriptDst) - return + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("ig_source_directory", igSourceDir) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("output_directory_ig", outDirIg) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "ig_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outDirTag, "", ".tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + return if MaxAvailable: @@ -93,14 +94,14 @@ if MaxAvailable: mkPath(log, ExportBuildDirectory + "/" + IgStaticLandExportDirectory) for dir in IgLandSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) - igExport(dir, IgStaticLandExportDirectory) + igExport(DatabaseDirectory, IgLandSourceDirectories, dir, IgStaticLandExportDirectory) # Export ig other 3dsmax printLog(log, ">>> Export ig other 3dsmax <<<") mkPath(log, ExportBuildDirectory + "/" + IgStaticOtherExportDirectory) for dir in IgOtherSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) - igExport(dir, IgStaticOtherExportDirectory) + igExport(DatabaseDirectory, IgOtherSourceDirectories, dir, IgStaticOtherExportDirectory) printLog(log, "") diff --git a/code/nel/tools/build_gamedata/processes/ig_light/2_build.py b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py index 90b962012..c8f8a05d3 100644 --- a/code/nel/tools/build_gamedata/processes/ig_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py @@ -56,7 +56,7 @@ else: mkPath(log, srcDir) destDir = ExportBuildDirectory + "/" + IgOtherLightedBuildDirectory mkPath(log, destDir) - subprocess.call([ IgLighter, srcDir, destDir, ActiveProjectDirectory + "/generated/zone_lighter.cfg" ]) + subprocess.call([ IgLighter, srcDir, destDir, ActiveProjectDirectory + "/generated/properties.cfg" ]) printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index 4ae323c43..ea111fa2a 100644 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -62,40 +62,40 @@ if LigoExportLand == "" or LigoExportOnePass == 1: mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) - printLog(log, "WRITE " + ligoIniPath) - ligoIni = open(ligoIniPath, "w") - ligoIni.write("[LigoConfig]\n") - ligoIni.write("LigoPath=" + DatabaseDirectory + "/" + LigoMaxSourceDirectory + "/\n") - ligoIni.write("LigoExportPath=" + DatabaseDirectory + "/" + LigoDatabaseExportDirectory + "/\n") - ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory + "/\n") - ligoIni.close() - - outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory - logFile = ScriptDirectory + "/processes/ligo/log.log" - smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" - - scriptSrc = "maxscript/nel_ligo_export.ms" - scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" - - if os.path.isfile(scriptDst): + if (needUpdateDirNoSubdirLogExt(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoTagExportDirectory, ".max.tag")): + printLog(log, "WRITE " + ligoIniPath) + ligoIni = open(ligoIniPath, "w") + ligoIni.write("[LigoConfig]\n") + ligoIni.write("LigoPath=" + DatabaseDirectory + "/" + LigoMaxSourceDirectory + "/\n") + ligoIni.write("LigoExportPath=" + DatabaseDirectory + "/" + LigoDatabaseExportDirectory + "/\n") + ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory + "/\n") + ligoIni.close() + + outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory + logFile = ScriptDirectory + "/processes/ligo/log.log" + smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" + + scriptSrc = "maxscript/nel_ligo_export.ms" + scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" + + if os.path.isfile(scriptDst): + os.remove(scriptDst) + + printLog(log, "WRITE " + scriptDst) + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("bankFilename", smallBank) + sDst.write(newline) + sSrc.close() + sDst.close() + + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-vn" ]) + os.remove(scriptDst) - - printLog(log, "WRITE " + scriptDst) - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("bankFilename", smallBank) - sDst.write(newline) - sSrc.close() - sDst.close() - - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-vn" ]) - - os.remove(scriptDst) - printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py b/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py new file mode 100644 index 000000000..db68c6484 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup pacs_prim +# \date 2010-08-31 16:50GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in PacsPrimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + PacsPrimClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py new file mode 100644 index 000000000..819f6700d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export pacs_prim +# \date 2010-08-31 16:50GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +Max = findMax(log, MaxDirectory, MaxExecutable) +printLog(log, "") + +# For each pacs_prim directory +printLog(log, ">>> Export pacs_prim 3dsmax <<<") +mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) +for dir in PacsPrimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, PacsPrimSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimExportDirectory, ".pacs_prim")): + scriptSrc = "maxscript/pacs_prim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/pacs_prim_export.ms" + logFile = ScriptDirectory + "/processes/pacs_prim/log.log" + outDirPacsPrim = ExportBuildDirectory + "/" + PacsPrimExportDirectory + pacs_primSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outDirPacsPrim, "", ".pacs_prim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("pacs_prim_source_directory", pacs_primSourceDir) + newline = newline.replace("output_directory", outDirPacsPrim) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "pacs_prim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outDirPacsPrim, "", ".pacs_prim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .pacs_prim files!") + os.remove(scriptDst) + +printLog(log, ">>> List pacs_prim <<<") +outDirPacsPrim = ExportBuildDirectory + "/" + PacsPrimExportDirectory +mkPath(log, outDirPacsPrim) +listPath = ExportBuildDirectory + "/" + PacsPrimExportDirectory + "/landscape_col_prim_pacs_list.txt" +if os.path.isfile(listPath): + os.remove(listPath) +if WantLandscapeColPrimPacsList: + exportedPacsPrims = findFiles(log, outDirPacsPrim, "", ".pacs_prim") + printLog(log, "WRITE " + listPath) + listFile = open(listPath, "w") + for exported in exportedPacsPrims: + listFile.write(exported + "\n") + listFile.close() + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py b/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py new file mode 100644 index 000000000..84186d962 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build pacs_prim +# \date 2010-08-31 16:50GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py b/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py new file mode 100644 index 000000000..abd174652 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install pacs_prim +# \date 2010-08-31 16:50GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + PacsPrimClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install pacs_prim <<<") +mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) +copyFilesExtNoSubdirIfNeeded(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory, clientPath, ".pacs_prim") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms new file mode 100644 index 000000000..0c8e5b8e0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms @@ -0,0 +1,161 @@ + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +try +( + -- Get files in the "pacs_prim_source_directory" directory + files = getFiles "pacs_prim_source_directory/*.max" + gc () + + -- Sort files + sort files + gc () + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- Output file + output = "output_directory/" + (getFilenameFile files[i]) + ".pacs_prim" + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + -- Free memory and file handles + gc () + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if (loadMaxFile files[i] quiet:true) == true then + ( + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Select all PACS primitives + for i in geometry do + ( + if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then + selectmore i + ) + + -- Array of node + arrayNode = selection as array + + -- Something to export ? + if (arrayNode.count != 0) then + ( + -- Export the collision + if (NelExportPACSPrimitives arrayNode output) == false then + ( + nlerror ("ERROR exporting PACS primitives in file "+files[i]) + ) + else + ( + nlerror ("OK PACS primitives in file "+files[i]) + ) + ) + else + ( + nlerror ("WARNING no PACS primitives in file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting collision: can't open the file "+files[i]) + ) + ) + else + ( + nlerror ("SKIPPED "+files[i]) + ) + ) + catch + ( + -- Error + nlerror ("ERROR error exporting collision in files " + files[i]) + ) + ) + ) + else + ( + nlerror ("WARNING no collision file in folder pacs_prim_source_directory") + ) +) +catch +( + -- Error + nlerror ("ERROR fatal error exporting collision in folder pacs_prim_source_directory") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/properties/0_setup.py b/code/nel/tools/build_gamedata/processes/properties/0_setup.py new file mode 100644 index 000000000..64fb5b198 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/0_setup.py @@ -0,0 +1,125 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup properties") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + + +mkPath(log, ActiveProjectDirectory + "/generated") +zlp = open(ActiveProjectDirectory + "/generated/properties.cfg", "w") +ps = open(ActiveProjectDirectory + "/properties_base.cfg", "r") +for line in ps: + try: + SmallbankExportDirectory + except NameError: + SmallbankExportDirectory = "_invalid" + try: + FarbankBuildDirectory + except NameError: + FarbankBuildDirectory = "_invalid" + try: + EcosystemName + except NameError: + EcosystemName = "_invalid" + try: + EcosystemPath + except NameError: + EcosystemPath = "_invalid" + try: + ContinentName + except NameError: + ContinentName = "_invalid" + try: + ContinentPath + except NameError: + ContinentPath = "_invalid" + try: + BankTileBankName + except NameError: + BankTileBankName = "_invalid" + try: + IgLandBuildDirectory + except NameError: + IgLandBuildDirectory = "_invalid" + try: + IgOtherBuildDirectory + except NameError: + IgOtherBuildDirectory = "_invalid" + try: + RbankOutputBuildDirectory + except NameError: + RbankOutputBuildDirectory = "_invalid" + try: + RbankRbankName + except NameError: + RbankRbankName = "_invalid" + newline = line.replace("%ExportBuildDirectory%", ExportBuildDirectory) + newline = newline.replace("%SmallbankExportDirectory%", SmallbankExportDirectory) + newline = newline.replace("%FarbankBuildDirectory%", FarbankBuildDirectory) + newline = newline.replace("%EcosystemName%", EcosystemName) + newline = newline.replace("%EcosystemPath%", EcosystemPath) + newline = newline.replace("%ContinentName%", ContinentName) + newline = newline.replace("%ContinentPath%", ContinentPath) + newline = newline.replace("%CommonName%", CommonName) + newline = newline.replace("%CommonPath%", CommonPath) + newline = newline.replace("%BankTileBankName%", BankTileBankName) + newline = newline.replace("%IgLandBuildDirectory%", IgLandBuildDirectory) + newline = newline.replace("%IgOtherBuildDirectory%", IgOtherBuildDirectory) + newline = newline.replace("%RbankOutputBuildDirectory%", RbankOutputBuildDirectory) + newline = newline.replace("%RbankRbankName%", RbankRbankName) + newline = newline.replace("%BuildQuality%", str(BuildQuality)) + zlp.write(newline) +ps.close() +if (BuildQuality == 1): + ps = open(ActiveProjectDirectory + "/properties_final.cfg", "r") +else: + ps = open(ActiveProjectDirectory + "/properties_draft.cfg", "r") +for line in ps: + zlp.write(line) +zlp.close() +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/properties/1_export.py b/code/nel/tools/build_gamedata/processes/properties/1_export.py new file mode 100644 index 000000000..f494d646e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/1_export.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/properties/2_build.py b/code/nel/tools/build_gamedata/processes/properties/2_build.py new file mode 100644 index 000000000..d2d245947 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/2_build.py @@ -0,0 +1,42 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/properties/3_install.py b/code/nel/tools/build_gamedata/processes/properties/3_install.py new file mode 100644 index 000000000..68daf1f4a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/3_install.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/0_setup.py b/code/nel/tools/build_gamedata/processes/ps/0_setup.py new file mode 100644 index 000000000..54c1ee692 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in PsSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + PsExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + PsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/1_export.py b/code/nel/tools/build_gamedata/processes/ps/1_export.py new file mode 100644 index 000000000..ea5ed019c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/1_export.py @@ -0,0 +1,60 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# For each ps directory +printLog(log, ">>> Export ps 3dsmax <<<") +mkPath(log, ExportBuildDirectory + "/" + PsExportDirectory) +for dir in PsSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + PsExportDirectory, ".ps") + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + PsExportDirectory, ".shape") + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + PsExportDirectory, ".primitive") + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/2_build.py b/code/nel/tools/build_gamedata/processes/ps/2_build.py new file mode 100644 index 000000000..b75c4e145 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/3_install.py b/code/nel/tools/build_gamedata/processes/ps/3_install.py new file mode 100644 index 000000000..67671d031 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install ps <<<") +srcDir = ExportBuildDirectory + "/" + PsExportDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + PsClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/0_setup.py b/code/nel/tools/build_gamedata/processes/shape/0_setup.py index 214067583..5183c38de 100644 --- a/code/nel/tools/build_gamedata/processes/shape/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -53,13 +53,16 @@ for dir in MapSourceDirectories: # Setup export directories printLog(log, ">>> Setup export directories <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeTagExportDirectory) -mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) +if ClodConfigFile != "": + mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) # Setup build directories printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py index 9ee7a3099..be3fb93e7 100644 --- a/code/nel/tools/build_gamedata/processes/shape/1_export.py +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -27,6 +27,8 @@ import time, sys, os, shutil, subprocess, distutils.dir_util sys.path.append("../../configuration") +if os.path.isfile("log.log"): + os.remove("log.log") if os.path.isfile("temp_log.log"): os.remove("temp_log.log") log = open("temp_log.log", "w") @@ -70,7 +72,7 @@ if MaxAvailable: logFile = ScriptDirectory + "/processes/shape/log.log" outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory mkPath(log, outDirTag) - outDirWithoutCoarse = ExportBuildDirectory + "/" + ShapeExportDirectory + outDirWithoutCoarse = ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory mkPath(log, outDirWithoutCoarse) outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory mkPath(log, outDirWithCoarse) @@ -137,10 +139,11 @@ if MaxAvailable: printLog(log, "SKIP " + maxFilePath) # Export clod 3dsmax - printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") - printLog(log, "********************************") - printLog(log, "******** TODO ********") - printLog(log, "********************************") + # this is historical garbage, just use the clodbank process.. :-) + #printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") + #printLog(log, "********************************") + #printLog(log, "******** TODO ********") + #printLog(log, "********************************") # cat ../clodbank/maxscript/clod_export.ms #| sed -e "s&shape_source_directory&$database_directory/$i&g" diff --git a/code/nel/tools/build_gamedata/processes/shape/2_build.py b/code/nel/tools/build_gamedata/processes/shape/2_build.py index ae2f026bb..60873e12a 100644 --- a/code/nel/tools/build_gamedata/processes/shape/2_build.py +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -57,21 +57,28 @@ if DoBuildShadowSkin: printLog(log, "******** TODO ********") printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) if ClodConfigFile != "": - printLog(log, ">>> BuildClodtex <<<") - printLog(log, "********************************") - printLog(log, "******** TODO ********") - printLog(log, "********************************") + mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) + printLog(log, ">>> Build CLodTex <<<") + subprocess.call([ BuildClodtex, "-d", DatabaseDirectory + "/" + ClodConfigFile, ExportBuildDirectory + "/" + ClodExportDirectory, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory ]) +else: + printLog(log, ">>> Copy Shape <<<") + copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, ".shape") +# copy lightmap_not_optimized to lightmap printLog(log, ">>> Optimize lightmaps <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeTagExportDirectory) -mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) removeFilesRecursive(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) copyFiles(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) -subprocess.call([ LightmapOptimizer, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory, ExportBuildDirectory + "/" + ShapeExportDirectory, ExportBuildDirectory + "/" + ShapeTagExportDirectory, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ]) +# Optimize lightmaps if any. Additionnaly, output a file indicating which lightmaps are 8 bits +subprocess.call([ LightmapOptimizer, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, ExportBuildDirectory + "/" + ShapeTagExportDirectory, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ]) +# Convert lightmap in 16 bits mode if they are not 8 bits lightmap printLog(log, ">>> Convert lightmaps in 16 or 8 bits <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) @@ -91,6 +98,7 @@ for lightMapTga in lightMapTgas: else: subprocess.call([ TgaToDds, srcTga, "-o", dstTga, "-a", "tga16" ]) +# Corse meshes for this process ? if len(CoarseMeshTextureNames) > 0: printLog(log, ">>> Build coarse meshes <<<") shapeWithCoarseMesh = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory @@ -127,6 +135,7 @@ if len(CoarseMeshTextureNames) > 0: cf.close() subprocess.call([ BuildCoarseMesh, "config_generated.cfg" ]) os.remove("config_generated.cfg") + # Convert the coarse texture to dds for tn in CoarseMeshTextureNames: subprocess.call([ TgaToDds, shapeWithCoarseMesh + "/" + tn + ".tga", "-o", shapeWithCoarseMeshBuilded + "/" + tn + ".dds", "-a", "5" ]) else: diff --git a/code/nel/tools/build_gamedata/processes/shape/3_install.py b/code/nel/tools/build_gamedata/processes/shape/3_install.py index 6667acdac..393216e8f 100644 --- a/code/nel/tools/build_gamedata/processes/shape/3_install.py +++ b/code/nel/tools/build_gamedata/processes/shape/3_install.py @@ -46,8 +46,8 @@ printLog(log, "") printLog(log, ">>> Install shape <<<") clientPath = ClientDataDirectory + "/" + ShapeClientDirectory mkPath(log, clientPath) -mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeExportDirectory, clientPath, ".shape") +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, clientPath, ".shape") mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".shape") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".dds") diff --git a/code/nel/tools/build_gamedata/processes/skel/1_export.py b/code/nel/tools/build_gamedata/processes/skel/1_export.py index 32744a224..aad402658 100644 --- a/code/nel/tools/build_gamedata/processes/skel/1_export.py +++ b/code/nel/tools/build_gamedata/processes/skel/1_export.py @@ -49,14 +49,46 @@ printLog(log, "") # For each skel directory printLog(log, ">>> Export skel 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) for dir in SkelSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) -printLog(log, "") + if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, SkelSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SkelExportDirectory, ".skel")): + scriptSrc = "maxscript/skel_export.ms" + scriptDst = MaxUserDirectory + "/scripts/skel_export.ms" + logFile = ScriptDirectory + "/processes/skel/log.log" + outDirSkel = ExportBuildDirectory + "/" + SkelExportDirectory + skelSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outDirSkel, "", ".skel") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("skel_source_directory", skelSourceDir) + newline = newline.replace("output_directory", outDirSkel) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "skel_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outDirSkel, "", ".skel") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .skel files!") + os.remove(scriptDst) +printLog(log, ">>> Export skel directly <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + SkelExportDirectory, ".skel") + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms new file mode 100644 index 000000000..02cdcac38 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms @@ -0,0 +1,162 @@ +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +try +( + -- Get files in the skel_source_directory + files = getFiles "skel_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- Output file + output = ("output_directory/"+(getFilenameFile files[i])+".skel") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if (loadMaxFile files[i] quiet:true) == true then + ( + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + -- Select Bip01 + select $Bip01 + + if ($ != undefined) then + ( + -- Set figure mode on + if ((classof $) == Biped_Object) then + ( + $.controller.figureMode = true + ) + + -- Export the skeleton template + if (NelExportSkeleton $ output) == false then + ( + nlerror ("ERROR exporting skeleton "+files[i]) + ) + else + ( + nlerror ("OK "+output) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting skeleton: no Bip01 node in file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting skeleton: no Bip01 node in file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting skeleton: can't open the file "+files[i]) + ) + ) + else + ( + nlerror ("SKIPPED "+files[i]) + ) + ) + catch + ( + -- Error + nlerror ("ERROR error exporting skeleton in files " + files[i]) + ) + ) + ) + else + ( + nlerror ("WARNING no skeleton file in folder skel_source_directory") + ) +) +catch +( + -- Error + nlerror ("ERROR fatal error exporting skeleton in folder skel_source_directory") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/nel/tools/build_gamedata/processes/swt/1_export.py b/code/nel/tools/build_gamedata/processes/swt/1_export.py index 924ba2a6d..c65e6f793 100644 --- a/code/nel/tools/build_gamedata/processes/swt/1_export.py +++ b/code/nel/tools/build_gamedata/processes/swt/1_export.py @@ -49,14 +49,40 @@ printLog(log, "") # For each swt directory printLog(log, ">>> Export skeleton weigths 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) for dir in SwtSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) -printLog(log, "") + if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, SwtSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SwtExportDirectory, ".swt")): + scriptSrc = "maxscript/swt_export.ms" + scriptDst = MaxUserDirectory + "/scripts/swt_export.ms" + logFile = ScriptDirectory + "/processes/swt/log.log" + outDirSwt = ExportBuildDirectory + "/" + SwtExportDirectory + swtSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outDirSwt, "", ".swt") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("swt_source_directory", swtSourceDir) + newline = newline.replace("output_directory", outDirSwt) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "swt_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outDirSwt, "", ".swt") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .swt files!") + os.remove(scriptDst) +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms index 98cdb0c30..87517c831 100644 --- a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms +++ b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms @@ -84,7 +84,7 @@ try -- Open the max project nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] == true then + if (loadMaxFile files[i] quiet:true) == true then ( -- Unhide category unhidecategory() diff --git a/code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py index 39e03c484..ce9179dd5 100644 --- a/code/nel/tools/build_gamedata/processes/veget/1_export.py +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -69,19 +69,20 @@ if MaxAvailable: for dir in VegetSourceDirectories: vegetSourceDir = DatabaseDirectory + "/" + dir mkPath(log, vegetSourceDir) - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("veget_source_directory", vegetSourceDir) - newline = newline.replace("output_directory_veget", outputDirVeget) - newline = newline.replace("output_directory_tag", outputDirTag) - sDst.write(newline) - sSrc.close() - sDst.close() - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) - os.remove(scriptDst) + if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, VegetSourceDirectories, vegetSourceDir, ".max", outputDirTag, ".max.tag")): + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("veget_source_directory", vegetSourceDir) + newline = newline.replace("output_directory_veget", outputDirVeget) + newline = newline.replace("output_directory_tag", outputDirTag) + sDst.write(newline) + sSrc.close() + sDst.close() + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + os.remove(scriptDst) printLog(log, "") diff --git a/code/nel/tools/build_gamedata/processes/zone/2_build.py b/code/nel/tools/build_gamedata/processes/zone/2_build.py index cdbecfe12..42d033102 100644 --- a/code/nel/tools/build_gamedata/processes/zone/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone/2_build.py @@ -61,7 +61,7 @@ if BuildQuality == 1: mkPath(log, ExportBuildDirectory + "/" + ZoneDependBuildDirectory) mkPath(log, ActiveProjectDirectory + "/generated") configFile = ActiveProjectDirectory + "/generated/zone_dependencies.cfg" - templateCf = open(ActiveProjectDirectory + "/generated/zone_lighter.cfg", "r") + templateCf = open(ActiveProjectDirectory + "/generated/properties.cfg", "r") cf = open(configFile, "w") for line in templateCf: cf.write(line) diff --git a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py index e4792e9e6..112a3c9c7 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py @@ -43,32 +43,6 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") -mkPath(log, ActiveProjectDirectory + "/generated") -zlp = open(ActiveProjectDirectory + "/generated/zone_lighter.cfg", "w") -ps = open(ActiveProjectDirectory + "/zone_lighter_base.cfg", "r") -for line in ps: - newline = line.replace("%ExportBuildDirectory%", ExportBuildDirectory) - newline = newline.replace("%SmallbankExportDirectory%", SmallbankExportDirectory) - newline = newline.replace("%FarbankBuildDirectory%", FarbankBuildDirectory) - newline = newline.replace("%EcosystemName%", EcosystemName) - newline = newline.replace("%EcosystemPath%", EcosystemPath) - newline = newline.replace("%BankTileBankName%", BankTileBankName) - newline = newline.replace("%IgLandBuildDirectory%", IgLandBuildDirectory) - newline = newline.replace("%IgOtherBuildDirectory%", IgOtherBuildDirectory) - newline = newline.replace("%RbankOutputBuildDirectory%", RbankOutputBuildDirectory) - newline = newline.replace("%RbankRbankName%", RbankRbankName) - newline = newline.replace("%BuildQuality%", str(BuildQuality)) - zlp.write(newline) -ps.close() -if (BuildQuality == 1): - ps = open(ActiveProjectDirectory + "/zone_lighter_final.cfg", "r") -else: - ps = open(ActiveProjectDirectory + "/zone_lighter_draft.cfg", "r") -for line in ps: - zlp.write(line) -zlp.close() -printLog(log, "") - # Setup source directories printLog(log, ">>> Setup source directories <<<") for dir in WaterMapSourceDirectories: diff --git a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py index dc6cccdfa..a96f4e94e 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py @@ -68,7 +68,7 @@ else: destFile = destDir + "/" + file[0:-len(".zonew")] + ".zonel" if (needUpdateLogRemoveDest(log, srcFile, destFile)): dependFile = destDir + "/" + file[0:-len(".zonew")] + ".depend" - subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/zone_lighter.cfg", dependFile ]) + subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") # For each zone_light ig @@ -94,7 +94,7 @@ else: if (needUpdateLogRemoveDest(log, igsrcFile, destFile)): srcFile = srcDir + "/" + file dependFile = destDir + "/" + file[0:-len(".zonel")] + ".depend" - subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/zone_lighter.cfg", dependFile ]) + subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") log.close() diff --git a/code/ryzom/tools/build_gamedata/workspace/common/construction/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/construction/directories.py new file mode 100644 index 000000000..a55f23182 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/directories.py @@ -0,0 +1,141 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "construction" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** +ContinentLeveldesignWorldDirectory = "" # DISABLED + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/Generique/Decors/Constructions" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/Generique/Decors/_Textures/Batiments" ] + +MapUncompressedSourceDirectories = [ ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo" + +# Ig directories +IgLandSourceDirectories = [ ] +IgOtherSourceDirectories = [ ] +IgOtherSourceDirectories += [ "stuff/Generique/Decors/Constructions" ] +IgPrimitiveSourceDirectories = [ ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles" + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/displace" + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Ig directories +IgStaticLandExportDirectory = CommonPath + "/ig_static_land" # Landscape IG eported from 3dsmax not elevated by the heightmap +IgStaticOtherExportDirectory = CommonPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax +IgStaticTagExportDirectory = CommonPath + "/ig_static_tag" # Tag for exported 3dsmax files + +# Zone directories +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Ig directories +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ligo directories +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + +# Lightmap directory +LightmapClientDirectory = CommonName + +# Animation directory +AnimClientDirectory = CommonName + +# Ig directory +IgClientDirectory = CommonName diff --git a/code/ryzom/tools/build_gamedata/workspace/common/construction/process.py b/code/ryzom/tools/build_gamedata/workspace/common/construction/process.py new file mode 100644 index 000000000..6c4508985 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/process.py @@ -0,0 +1,110 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "properties" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "ig" ] +ProcessToComplete += [ "ig_light" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "construction" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# Name of the tilebank to use +BankTileBankName = "" + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + +# *** LIGO OPTIONS *** +LigoExportLand = "" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_invalid.png" +LigoExportHeightmap1 = "big_invalid.png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_invalid.png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/jungle/jungle.bank" + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_base.cfg b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_base.cfg new file mode 100644 index 000000000..2fa378594 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_base.cfg @@ -0,0 +1,51 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/ecosystems/jungle/smallbank/jungle.smallbank"; +bankfar_name = "%ExportBuildDirectory%/ecosystems/jungle/farbank/jungle.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/common/construction/shape", // Construction directory + "%ExportBuildDirectory%/common/construction/shape_with_coarse_mesh", // Construction directory + "%ExportBuildDirectory%/common/construction/map", // Construction directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +//sun_direction = { -0.095, +1.0, -0.50 }; +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_draft.cfg similarity index 100% rename from code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg rename to code/ryzom/tools/build_gamedata/workspace/common/construction/properties_draft.cfg diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_final.cfg similarity index 94% rename from code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg rename to code/ryzom/tools/build_gamedata/workspace/common/construction/properties_final.cfg index ccb91159d..522c15d44 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_final.cfg @@ -6,7 +6,7 @@ load_ig = 1; compute_dependencies_with_igs = 1; // Enable shadows. 0 disable, 1 enable -shadow = 0; // FIXME: should be 1, but missing .depend files +shadow = 1; // Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. zbuffer_landscape_size = 32768; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fauna/anim_builder.cfg b/code/ryzom/tools/build_gamedata/workspace/common/fauna/anim_builder.cfg new file mode 100644 index 000000000..08128b23e --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fauna/anim_builder.cfg @@ -0,0 +1,15 @@ + +// *************************** +// Animation Optimizer +// *************************** + +// Tracks which contain one of those name (eg "Bip01 Finger11.rotquat") will be mark as "Low Precision". +// Usefull for memory optimisation. Avoid setting legs or root bones. Warning: case sensitive. +anim_low_precision_tracks= +{ +"Finger", +"Ponytail", +}; + +// The Sample Rate. +anim_sample_rate= 30; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fauna/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/fauna/directories.py new file mode 100644 index 000000000..ac8baa134 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fauna/directories.py @@ -0,0 +1,277 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fauna" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Skeleton directories +SkelSourceDirectories = [ ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique_monture/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/chien/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/familier/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiforet/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiguard/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/carnitree/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/electroalg/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/endrobouchea/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/phytopsy/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/sapenslaver/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/swarmplant/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_2/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_3/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_4/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_2/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_3/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_4/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/cute/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/frahar/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/gibbai/animation/skeletons" ] + +# Skeleton template weight directories +SwtSourceDirectories = [ ] + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/clapclap" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/ryzetacee" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique_monture/sagass_selle" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/mektoub" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/mektoubselle" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/mektoubpack" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/chorani" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/jungler" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/regus" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/varinx" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/capryni" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/filin" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/cococlaw" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/estrasson" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/hachtaha" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/diranak" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/familier/dag" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/ryzerb" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/ryzoholok" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiforet" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiguard" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_2" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_3" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_4" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_2" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_3" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_4" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitihank" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinagan" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinarak" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinega" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinokto" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitimandib" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/pucetron" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/kitifly" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/kitikil" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/kazoar" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/lightbird" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/yber" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/arma" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/bul" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/vampignon" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/kakty" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/ryzoholo" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/zerx" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/carnitree" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/electroalg" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/endrobouchea" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/phytopsy" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/sapenslaver" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/swarmplant" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/cute" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/frahar" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/gibbai" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/aquatique" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/chiens" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/coureur" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/crustaces" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/grand_ryzomien" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/kitin" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/kitin_volant" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/oiseau" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/pachyderme/vampignon" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/ryzomien/kakty" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/ryzomien/ryzoholo" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/c03" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/h05" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/h12" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/c02" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/c07" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/h01" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/h04" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/c05" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/c06" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/h07" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/h11" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/c01" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/h08" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/h10" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/c04" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/h02" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/h06" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/h09" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/familier/h03" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/ryzomien/c04" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/familier/h03" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/homins_degeneres/cute" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/homins_degeneres/frahar" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/homins_degeneres/gibbai" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitin_queen" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/fyros/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/tryker/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/jungle/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/primes_racines/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/goo/agents/_textures/monster" ] + +MapUncompressedSourceDirectories = [ ] + +# Animation directories +AnimSourceDirectories = [ ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique_monture/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/chien/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/familier/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiforet/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiguard/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/carnitree/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/electroalg/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/endrobouchea/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/phytopsy/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/sapenslaver/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/swarmplant/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_2/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_3/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_4/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_2/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_3/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_4/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/cute/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/frahar/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/gibbai/animation/anims" ] + +# cLoD shape directories +ClodSourceDirectories = [ ] +ClodSourceDirectories += [ "stuff/lod_actors/lod_fauna" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Skeleton directories +SkelExportDirectory = CommonPath + "/skel" + +# Skeleton template weight directories +SwtExportDirectory = CommonPath + "/swt" + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Animation directories +AnimExportDirectory = CommonPath + "/anim_export" + +# cLoD directories +ClodExportDirectory = CommonPath + "/clod_export" +ClodTagExportDirectory = CommonPath + "/clod_tag_export" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Animation directories +AnimBuildDirectory = CommonPath + "/anim" + +# cLoD directories +ClodBankBuildDirectory = CommonPath + "/clod_bank" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" +LightmapClientDirectory = ShapeClientDirectory + +# Animation directory +AnimClientDirectory = CommonName + "_animations" + +# Skeleton directory +SkelClientDirectory = CommonName + "_skeletons" + +# Skeleton directory +SwtClientDirectory = CommonName + "_swt" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fauna/process.py b/code/ryzom/tools/build_gamedata/workspace/common/fauna/process.py new file mode 100644 index 000000000..76e2cfc32 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fauna/process.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "skel" ] +ProcessToComplete += [ "swt" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "anim" ] +ProcessToComplete += [ "clodbank" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fauna" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + + +# *** CLODBANK OPTIONS *** + +ClodConfigFile = "stuff/lod_actors/lod_" + CommonName + "/clod_" + CommonName + "_script.cfg" +ClodBankFileName = CommonName + ".clodbank" + + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + + +# *** SHADOW SKIN OPTIONS *** +# Fauna are made of a single skin. Allow only 1000 faces for each monster (whatever the original nb faces) +BuildShadowSkin = 1 +BuildShadowSkinRatio = 100 +BuildShadowSkinMaxface = 1000 + + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 1 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fonts/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/fonts/directories.py new file mode 100644 index 000000000..7840625f8 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fonts/directories.py @@ -0,0 +1,59 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fonts" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Font directories +FontSourceDirectories = [ ] +FontSourceDirectories += [ "fonts" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Font directories +FontExportDirectory = CommonPath + "/font" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Font directory +FontClientDirectory = CommonName + + +# end of file + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fonts/process.py b/code/ryzom/tools/build_gamedata/workspace/common/fonts/process.py new file mode 100644 index 000000000..e1e6d4824 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fonts/process.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "font" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fonts" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# end of file diff --git a/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py index 2f92ebbc1..e733bea15 100644 --- a/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py @@ -26,9 +26,15 @@ # along with this program. If not, see . # -# *** COMMON PATH *** -CommonPath = "common/interface" +# *** COMMON NAMES AND PATHS *** +EcosystemName = "interface" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + # *** SOURCE DIRECTORIES IN THE DATABASE *** diff --git a/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py b/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py index f2288f832..29585bdcd 100644 --- a/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py @@ -30,6 +30,16 @@ ProcessToComplete = [ ] ProcessToComplete += [ "interface" ] + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "interface" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + # *** MAPS OPTIONS *** ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py index 0a5d2c46a..fcd134e00 100644 --- a/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py @@ -60,7 +60,7 @@ MapUncompressedSourceDirectories = [ ] # Shape directories ShapeTagExportDirectory = CommonPath + "/shape_tag" -ShapeExportDirectory = CommonPath + "/shape" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" ShapeAnimExportDirectory = CommonPath + "/shape_anim" @@ -73,6 +73,7 @@ MapBuildDirectory = CommonPath + "/map" MapPanoplyBuildDirectory = CommonPath + "/map_panoply" # Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/outgame/directories.py new file mode 100644 index 000000000..fe7618b72 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/directories.py @@ -0,0 +1,141 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "outgame" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** +ContinentLeveldesignWorldDirectory = "" # DISABLED + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/outgame/appart_crea" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/outgame/_textures" ] + +MapUncompressedSourceDirectories = [ ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo" + +# Ig directories +IgLandSourceDirectories = [ ] +IgOtherSourceDirectories = [ ] +IgOtherSourceDirectories += [ "stuff/outgame/appart_crea" ] +IgPrimitiveSourceDirectories = [ ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles" + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/displace" + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Ig directories +IgStaticLandExportDirectory = CommonPath + "/ig_static_land" # Landscape IG eported from 3dsmax not elevated by the heightmap +IgStaticOtherExportDirectory = CommonPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax +IgStaticTagExportDirectory = CommonPath + "/ig_static_tag" # Tag for exported 3dsmax files + +# Zone directories +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Ig directories +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ligo directories +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + +# Lightmap directory +LightmapClientDirectory = CommonName + +# Animation directory +AnimClientDirectory = CommonName + +# Ig directory +IgClientDirectory = CommonName diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/process.py b/code/ryzom/tools/build_gamedata/workspace/common/outgame/process.py new file mode 100644 index 000000000..9097c3b3a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/process.py @@ -0,0 +1,110 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "properties" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "ig" ] +ProcessToComplete += [ "ig_light" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "outgame" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# Name of the tilebank to use +BankTileBankName = "" + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + +# *** LIGO OPTIONS *** +LigoExportLand = "" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_invalid.png" +LigoExportHeightmap1 = "big_invalid.png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_invalid.png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/jungle/jungle.bank" + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_base.cfg b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_base.cfg new file mode 100644 index 000000000..a4ffbf3ca --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_base.cfg @@ -0,0 +1,51 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/ecosystems/jungle/smallbank/jungle.smallbank"; +bankfar_name = "%ExportBuildDirectory%/ecosystems/jungle/farbank/jungle.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/common/outgame/shape", // Outgame directory + "%ExportBuildDirectory%/common/outgame/shape_with_coarse_mesh", // Outgame directory + "%ExportBuildDirectory%/common/outgame/map", // Outgame directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +//sun_direction = { -0.095, +1.0, -0.50 }; +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_final.cfg b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_final.cfg new file mode 100644 index 000000000..522c15d44 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 1; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sfx/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/sfx/directories.py new file mode 100644 index 000000000..5de327a3a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sfx/directories.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sfx" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# PS directories +PsSourceDirectories = [ ] +PsSourceDirectories += [ "sfx/buildings" ] +PsSourceDirectories += [ "sfx/environment" ] +PsSourceDirectories += [ "sfx/fighting" ] +PsSourceDirectories += [ "sfx/magic" ] +PsSourceDirectories += [ "sfx/moving" ] +PsSourceDirectories += [ "sfx/teaser" ] +PsSourceDirectories += [ "sfx/forage" ] +PsSourceDirectories += [ "sfx/monsters" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "sfx/maps" ] + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "sfx/meshtoparticle" ] + +MapUncompressedSourceDirectories = [ ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# PS directories +PsExportDirectory = CommonPath + "/ps" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Particule system directory +PsClientDirectory = "sfx" + +# Map directory +MapClientDirectory = "sfx" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = "sfx" + +# Lightmap directory +LightmapClientDirectory = "sfx" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sfx/process.py b/code/ryzom/tools/build_gamedata/workspace/common/sfx/process.py new file mode 100644 index 000000000..a2f63c1ef --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sfx/process.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "ps" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "shape" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sfx" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/anim_builder.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/anim_builder.cfg new file mode 100644 index 000000000..08128b23e --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/anim_builder.cfg @@ -0,0 +1,15 @@ + +// *************************** +// Animation Optimizer +// *************************** + +// Tracks which contain one of those name (eg "Bip01 Finger11.rotquat") will be mark as "Low Precision". +// Usefull for memory optimisation. Avoid setting legs or root bones. Warning: case sensitive. +anim_low_precision_tracks= +{ +"Finger", +"Ponytail", +}; + +// The Sample Rate. +anim_sample_rate= 30; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py index 453850db4..ba46541dd 100644 --- a/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py @@ -27,10 +27,17 @@ # -# *** COMMON PATH *** +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sky" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath -CommonName = "sky" -CommonPath = "common/" + CommonName + +# *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** +ContinentLeveldesignWorldDirectory = "" # DISABLED # *** SOURCE DIRECTORIES IN THE DATABASE *** @@ -54,12 +61,21 @@ MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/jungle" ] MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/lacustre" ] MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/nodds" ] +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo" + # Ig directories IgLandSourceDirectories = [ ] IgOtherSourceDirectories = [ ] IgOtherSourceDirectories += [ "sky_v2/max" ] IgPrimitiveSourceDirectories = [ ] +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles" + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/displace" + # Animation directories AnimSourceDirectories = [ ] AnimSourceDirectories += [ "sky_v2/max" ] @@ -69,7 +85,7 @@ AnimSourceDirectories += [ "sky_v2/max" ] # Shape directories ShapeTagExportDirectory = CommonPath + "/shape_tag" -ShapeExportDirectory = CommonPath + "/shape" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" ShapeAnimExportDirectory = CommonPath + "/shape_anim" @@ -79,6 +95,17 @@ IgStaticLandExportDirectory = CommonPath + "/ig_static_land" # Landscape IG epor IgStaticOtherExportDirectory = CommonPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax IgStaticTagExportDirectory = CommonPath + "/ig_static_tag" # Tag for exported 3dsmax files +# Zone directories +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme + +# Animation directories +AnimExportDirectory = CommonPath + "/anim_export" + # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** @@ -87,6 +114,7 @@ MapBuildDirectory = CommonPath + "/map" MapPanoplyBuildDirectory = CommonPath + "/map_panoply" # Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" @@ -101,13 +129,22 @@ IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscap IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ligo directories +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape + +# Animation directories +AnimBuildDirectory = CommonPath + "/anim" + # *** INSTALL DIRECTORIES IN THE CLIENT DATA *** # Map directory MapClientDirectory = CommonName - -# Map directory BitmapClientDirectory = MapClientDirectory # Shape directory diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py b/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py index 84d2dac64..e68c6853e 100644 --- a/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py @@ -26,13 +26,24 @@ # *** PROCESS CONFIGURATION *** + # *** PROCESS CONFIG *** ProcessToComplete = [ ] +ProcessToComplete += [ "properties" ] ProcessToComplete += [ "shape" ] ProcessToComplete += [ "map" ] -#ProcessToComplete += [ "anim" ] -#ProcessToComplete += [ "ig" ] -#ProcessToComplete += [ "ig_light" ] +ProcessToComplete += [ "anim" ] +ProcessToComplete += [ "ig" ] +ProcessToComplete += [ "ig_light" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sky" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath # *** SHAPE EXPORT OPTIONS *** @@ -65,9 +76,11 @@ DoBuildShadowSkin = 0 ClodConfigFile = "" + # *** COARSE MESH TEXTURE NAME *** CoarseMeshTextureNames = [ ] + # *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** MultipleTilesPostfix = [ ] MultipleTilesPostfix += [ "_sp" ] @@ -75,6 +88,30 @@ MultipleTilesPostfix += [ "_su" ] MultipleTilesPostfix += [ "_au" ] MultipleTilesPostfix += [ "_wi" ] +# Name of the tilebank to use +BankTileBankName = "" + + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + + +# *** LIGO OPTIONS *** +LigoExportLand = "" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_invalid.png" +LigoExportHeightmap1 = "big_invalid.png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_invalid.png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/jungle/jungle.bank" + + # *** MAPS OPTIONS *** ReduceBitmapFactor = 0 + + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_base.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_base.cfg new file mode 100644 index 000000000..6b6cd9e75 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_base.cfg @@ -0,0 +1,51 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/ecosystems/jungle/smallbank/jungle.smallbank"; +bankfar_name = "%ExportBuildDirectory%/ecosystems/jungle/farbank/jungle.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/common/sky/shape", // Sky directory + "%ExportBuildDirectory%/common/sky/shape_with_coarse_mesh", // Sky directory + "%ExportBuildDirectory%/common/sky/map", // Sky directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +//sun_direction = { -0.095, +1.0, -0.50 }; +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_final.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_final.cfg new file mode 100644 index 000000000..522c15d44 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 1; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py index cec353865..381f6be4b 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py @@ -42,6 +42,16 @@ ContinentLeveldesignWorldDirectory = ContinentName # *** SOURCE DIRECTORIES IN THE DATABASE *** +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/" + ContinentName + "/sky" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/" + ContinentName + "/sky" ] + +MapUncompressedSourceDirectories = [ ] + # Ligo directories LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" @@ -63,9 +73,20 @@ TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName # Displace directory DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" +# Ligo primitive directory used in the client +PsSourceDirectories = [ ] +PsSourceDirectories += [ "primitive_microlife/" + ContinentName ] + # *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + # Ligo directories LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" @@ -89,57 +110,80 @@ IgStaticLandExportDirectory = ContinentPath + "/ig_static_land" # Landscape IG e IgStaticOtherExportDirectory = ContinentPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax IgStaticTagExportDirectory = ContinentPath + "/ig_static_tag" # Tag for exported 3dsmax files +# PS directories +PsExportDirectory = CommonPath + "/ps" + # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + # Ligo directories -LigoZoneBuildDirectory = ContinentPath + "/ligo_zones" -LigoIgLandBuildDirectory = ContinentPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap -LigoIgOtherBuildDirectory = ContinentPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape # Zone directories -ZoneWeldBuildDirectory = ContinentPath + "/zone_weld" -ZoneDependBuildDirectory = ContinentPath + "/zone_depend" -ZoneLightWaterShapesLightedExportDirectory = ContinentPath + "/zone_lwsl_temp" #fixme -ZoneLightBuildDirectory = ContinentPath + "/zone_lighted" #fixme -ZoneLightDependBuildDirectory = ContinentPath + "/zone_lighted_depend" #fixme -ZoneLightIgLandBuildDirectory = ContinentPath + "/zone_lighted_ig_land" #fixme +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme # Farbank directories FarbankBuildDirectory = EcosystemPath + "/farbank" # Ig directories -IgElevLandPrimBuildDirectory = ContinentPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) -IgElevLandLigoBuildDirectory = ContinentPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap -IgElevLandStaticBuildDirectory = ContinentPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap -IgTempLandMergeBuildDirectory = ContinentPath + "/ig_temp_land_merge" -IgTempLandCompareBuildDirectory = ContinentPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison -IgLandBuildDirectory = ContinentPath + "/ig_land" # Final IG directory for landscape IGs -IgOtherBuildDirectory = ContinentPath + "/ig_other" # Final IG directory for village or construction IGs -IgOtherLightedBuildDirectory = ContinentPath + "/ig_other_lighted" +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" # Rbank directories -RbankBboxBuildDirectory = ContinentPath + "/rbank_bbox" -RbankTessellationBuildDirectory = ContinentPath + "/rbank_tessellation" -RbankSmoothBuildDirectory = ContinentPath + "/rbank_smooth" -RbankRawBuildDirectory = ContinentPath + "/rbank_raw" -RbankPreprocBuildDirectory = ContinentPath + "/rbank_preproc" -RbankMeshBuildDirectory = ContinentPath + "/rbank_cmb" -RbankRetrieversBuildDirectory = ContinentPath + "/rbank_retrievers" -RbankOutputBuildDirectory = ContinentPath + "/rbank_output" +RbankBboxBuildDirectory = CommonPath + "/rbank_bbox" +RbankTessellationBuildDirectory = CommonPath + "/rbank_tessellation" +RbankSmoothBuildDirectory = CommonPath + "/rbank_smooth" +RbankRawBuildDirectory = CommonPath + "/rbank_raw" +RbankPreprocBuildDirectory = CommonPath + "/rbank_preproc" +RbankMeshBuildDirectory = CommonPath + "/rbank_cmb" +RbankRetrieversBuildDirectory = CommonPath + "/rbank_retrievers" +RbankOutputBuildDirectory = CommonPath + "/rbank_output" # *** INSTALL DIRECTORIES IN THE CLIENT DATA *** +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Shape lightmaps directory +LightmapClientDirectory = ShapeClientDirectory + # Ig directory -IgClientDirectory = ContinentName + "_ig" +IgClientDirectory = CommonName + "_ig" # Zone directory -ZoneClientDirectory = ContinentName + "_zones" -WaterMapsClientDirectory = ContinentName + "_zones" +ZoneClientDirectory = CommonName + "_zones" +WaterMapsClientDirectory = ZoneClientDirectory # PACS directory -PacsClientDirectory = ContinentName + "_pacs" +PacsClientDirectory = CommonName + "_pacs" # PS directory -IgClientDirectory = ContinentName + "_ig" +PsClientDirectory = CommonName + "_ig" diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py index b543cba32..b13dcfc78 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py @@ -29,13 +29,16 @@ # *** PROCESS CONFIG *** ProcessToComplete = [ ] +ProcessToComplete += [ "properties" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "shape" ] ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process (not yet), but does not export max files ProcessToComplete += [ "zone" ] # works, need to check completeness ProcessToComplete += [ "ig" ] # fully implemented ProcessToComplete += [ "zone_light" ] # works, need to check completeness ProcessToComplete += [ "rbank" ] # works, need to check completeness ProcessToComplete += [ "ig_light" ] # fully implemented -#ProcessToComplete += [ "ps" ] # not implemented +ProcessToComplete += [ "ps" ] # *** ECOSYSTEM AND CONTINENT NAMES *** @@ -50,6 +53,40 @@ LandscapeName = ContinentName ContinentFile = ContinentName + "/" + ContinentName + ".continent" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + # *** BANK EXPORT OPTIONS *** # *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** @@ -111,3 +148,7 @@ RbankShapePaths += [ "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_bu RbankShapePaths += [ "common/sfx/ps" ] # RbankShapePaths += [ "l:/leveldesign/world_edit_files" ] +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_base.cfg similarity index 52% rename from code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg rename to code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_base.cfg index 4b886d584..27c73e966 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_base.cfg @@ -6,15 +6,19 @@ bankfar_name = "%ExportBuildDirectory%/%FarbankBuildDirectory%/%EcosystemName%.f // Search pathes search_pathes = { - "%ExportBuildDirectory%/continents/newbieland/ig_land", // Instance group directory - "%ExportBuildDirectory%/continents/newbieland/ig_other", // Instance group directory - "%ExportBuildDirectory%/continents/newbieland/shape", // Shape directory - "%ExportBuildDirectory%/continents/newbieland/shape_with_coarse_mesh", // Shape directory - "%ExportBuildDirectory%/common/sfx/processes/ps/ps", // Sfx directory - "%ExportBuildDirectory%/ecosystems/jungle/shape", // Shape directory - "%ExportBuildDirectory%/ecosystems/jungle/shape_with_coarse_mesh", // Shape directory - "%ExportBuildDirectory%/ecosystems/jungle/map/tga", // Map directory - "%ExportBuildDirectory%/continents/newbieland/zone_light/water_shapes_lighted", // Water shape lighted directory + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/ecosystems/%EcosystemName%/shape", // Shape directory + "%ExportBuildDirectory%/ecosystems/%EcosystemName%/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/ecosystems/%EcosystemName%/map", // Map directory + "%ExportBuildDirectory%/continents/%ContinentName%/zone_light/water_shapes_lighted", // Water shape lighted directory + "%ExportBuildDirectory%/continents/%ContinentName%/ig_land", // Instance group directory + "%ExportBuildDirectory%/continents/%ContinentName%/ig_other", // Instance group directory + "%ExportBuildDirectory%/continents/%ContinentName%/shape", // Shape directory + "%ExportBuildDirectory%/continents/%ContinentName%/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/continents/%ContinentName%/map", // Map directory }; // Additional ig file name diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_final.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_final.cfg new file mode 100644 index 000000000..522c15d44 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 1; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py index e888b35b8..c6fbe35cf 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py @@ -150,7 +150,7 @@ PacsPrimSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" # Shape directories ShapeTagExportDirectory = CommonPath + "/shape_tag" -ShapeExportDirectory = CommonPath + "/shape" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" ShapeAnimExportDirectory = CommonPath + "/shape_anim" @@ -182,6 +182,9 @@ LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" # Zone directories ZoneExportDirectory = "ecosystems/" + EcosystemName + "/zone" +# PACS primitives directories +PacsPrimExportDirectory = "ecosystems/" + EcosystemName + "/pacs_prim" + # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** @@ -190,6 +193,7 @@ MapBuildDirectory = CommonPath + "/map" MapPanoplyBuildDirectory = CommonPath + "/map_panoply" # Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" @@ -250,4 +254,4 @@ VegetSetClientDirectory = "jungle_vegetable_sets" VegetClientDirectory = "jungle_vegetables" # PACS primitives directories -PacsPrimitiveClientDirectory = "jungle_pacs_prim" +PacsPrimClientDirectory = "jungle_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py index 18f80cfe0..babdec16f 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py @@ -37,7 +37,7 @@ ProcessToComplete += [ "displace" ] # OK ProcessToComplete += [ "veget" ] # OK ProcessToComplete += [ "vegetset" ] # OK ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process, but does not export max files -##ProcessToComplete += [ "pacs_prim" ] +ProcessToComplete += [ "pacs_prim" ] # *** MAP EXPORT OPTIONS *** PanoplyFileList = [ ] @@ -110,3 +110,6 @@ ReduceBitmapFactor = 0 DoBuildShadowSkin = False ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py index ac4e3ab72..e04f683f6 100644 --- a/code/ryzom/tools/build_gamedata/workspace/projects.py +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -26,11 +26,32 @@ ProjectsToProcess = [ ] + +# Common projects +ProjectsToProcess += [ "common/fonts" ] ProjectsToProcess += [ "common/interface" ] ProjectsToProcess += [ "common/objects" ] -ProjectsToProcess += [ "common/sky" ] +ProjectsToProcess += [ "common/sfx" ] +ProjectsToProcess += [ "common/fauna" ] + +# Ecosystem projects ProjectsToProcess += [ "ecosystems/jungle" ] + +# Continent projects ProjectsToProcess += [ "continents/newbieland" ] +# Common projects depending on continent projects +ProjectsToProcess += [ "common/construction" ] # Depends on jungle/newbieland due to ig_light tool usage of properties.cfg... +ProjectsToProcess += [ "common/outgame" ] # Depends on jungle/newbieland due to ig_light tool usage of properties.cfg... +ProjectsToProcess += [ "common/sky" ] # Depends on jungle/newbieland due to ig_light tool usage of properties.cfg... + +# TODO +#ProjectsToProcess += [ "common/characters" ] # TODO +#ProjectsToProcess += [ "common/characters_maps_hr" ] # TODO +#ProjectsToProcess += [ "common/characters_maps_lr" ] # TODO +#ProjectsToProcess += [ "ecosystems/desert" ] # TODO +#ProjectsToProcess += [ "ecosystems/lacustre" ] # TODO +#ProjectsToProcess += [ "ecosystems/primes_racines" ] # TODO + # end of file From 16535f7e84b907aec64241e8154d3cecc7b2d062 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 1 Sep 2010 21:03:30 +0200 Subject: [PATCH 39/56] Changed: Updated tools and samples CMake projects --- code/nel/samples/3d/cegui/CMakeLists.txt | 16 +++++--------- code/nel/samples/3d/qtnel/CMakeLists.txt | 13 +++++++----- .../samples/misc/types_check/CMakeLists.txt | 6 ++---- .../nel/tools/3d/object_viewer/CMakeLists.txt | 12 ++++------- .../tools/3d/object_viewer_exe/CMakeLists.txt | 9 ++------ .../nel/tools/3d/panoply_maker/CMakeLists.txt | 16 +++++--------- code/nel/tools/3d/tile_edit/CMakeLists.txt | 18 ++++++---------- code/nel/tools/3d/tile_edit_qt/CMakeLists.txt | 11 ++++++---- .../logic/logic_editor_dll/CMakeLists.txt | 21 ++++--------------- .../logic/logic_editor_exe/CMakeLists.txt | 13 +++--------- .../tools/misc/message_box_qt/CMakeLists.txt | 10 +++++---- .../tools/misc/words_dic_qt/CMakeLists.txt | 11 ++++++---- code/nel/tools/nel_unit_test/CMakeLists.txt | 6 +++--- 13 files changed, 62 insertions(+), 100 deletions(-) diff --git a/code/nel/samples/3d/cegui/CMakeLists.txt b/code/nel/samples/3d/cegui/CMakeLists.txt index 6e8a19a3f..8cd7b85c3 100644 --- a/code/nel/samples/3d/cegui/CMakeLists.txt +++ b/code/nel/samples/3d/cegui/CMakeLists.txt @@ -1,19 +1,13 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(nl_sample_cegui ${SRC}) +ADD_EXECUTABLE(nl_sample_cegui WIN32 ${SRC}) ADD_DEFINITIONS(-DCEGUI_DATA_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_cegui/datafiles/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CEGUI_INCLUDE_DIRS}) -TARGET_LINK_LIBRARIES(nl_sample_cegui ${LIBXML2_LIBRARIES} ${CEGUI_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_cegui PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, 3D: NeL CEGUI Demo") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${CEGUI_INCLUDE_DIRS}) +TARGET_LINK_LIBRARIES(nl_sample_cegui ${CEGUI_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(nl_sample_cegui "Samples, 3D: NeL CEGUI Demo") +NL_ADD_RUNTIME_FLAGS(nl_sample_cegui) INSTALL(TARGETS nl_sample_cegui RUNTIME DESTINATION bin COMPONENT samples3d) INSTALL(DIRECTORY datafiles/ diff --git a/code/nel/samples/3d/qtnel/CMakeLists.txt b/code/nel/samples/3d/qtnel/CMakeLists.txt index 2fd366069..ed14f6374 100644 --- a/code/nel/samples/3d/qtnel/CMakeLists.txt +++ b/code/nel/samples/3d/qtnel/CMakeLists.txt @@ -17,12 +17,15 @@ SET( QT_USE_QTOPENGL TRUE) QT4_WRAP_CPP( QTNEL_MOC_SRCS ${QTNEL_HDR}) #ADD_EXECUTABLE(qtnel ${TILE_EDIT_SRC} ${TILE_EDIT_MOC_SRCS} ${TILE_EDIT_RC_SRCS} ${TILE_EDIT_UI_HDRS}) -ADD_EXECUTABLE(qtnel ${QTNEL_SRC} ${QTNEL_MOC_SRCS} ${QTNEL_HDR}) +ADD_EXECUTABLE(qtnel WIN32 ${QTNEL_SRC} ${QTNEL_MOC_SRCS} ${QTNEL_HDR}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${QT_INCLUDES}) -TARGET_LINK_LIBRARIES(qtnel ${LIBXML2_LIBRARIES} ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -SET_TARGET_PROPERTIES(qtnel PROPERTIES PROJECT_LABEL "Samples, 3D: Qt Viewer Widget") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +TARGET_LINK_LIBRARIES(qtnel ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(qtnel "Samples, 3D: Qt Viewer Widget") +NL_ADD_RUNTIME_FLAGS(qtnel) + +ADD_DEFINITIONS(${QT_DEFINITIONS}) INSTALL(TARGETS qtnel RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/misc/types_check/CMakeLists.txt b/code/nel/samples/misc/types_check/CMakeLists.txt index 229a085f7..600896be8 100644 --- a/code/nel/samples/misc/types_check/CMakeLists.txt +++ b/code/nel/samples/misc/types_check/CMakeLists.txt @@ -2,10 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_types_check ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_types_check ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_types_check ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(nl_sample_types_check "Samples, MISC: Types check sample") NL_ADD_RUNTIME_FLAGS(nl_sample_types_check) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/tools/3d/object_viewer/CMakeLists.txt b/code/nel/tools/3d/object_viewer/CMakeLists.txt index 1268a92b8..718b5fbfa 100644 --- a/code/nel/tools/3d/object_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer/CMakeLists.txt @@ -10,21 +10,17 @@ SET(CMAKE_MFC_FLAG 2) ADD_LIBRARY(object_viewer_dll SHARED ${SRC} object_viewer.rc) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(object_viewer_dll - ${LIBXML2_LIBRARIES} nelmisc nel3d nelsound nelsnd_lowlevel Version.lib) -SET_TARGET_PROPERTIES(object_viewer_dll PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "Tools, 3D: Object Viewer DLL") +NL_DEFAULT_PROPS(object_viewer_dll "Tools, 3D: Object Viewer DLL") +NL_ADD_RUNTIME_FLAGS(object_viewer_dll) +NL_ADD_LIB_SUFFIX(object_viewer_dll) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DOBJECT_VIEWER_LIB_EXPORTS) diff --git a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt index 4f9c946f1..e1283f61b 100644 --- a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt @@ -5,21 +5,16 @@ ADD_DEFINITIONS(-D_AFXDLL) SET(CMAKE_MFC_FLAG 2) ADD_EXECUTABLE(object_viewer WIN32 ${SRC} object_viewer_exe.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES( object_viewer - ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d nelsound nelsnd_lowlevel object_viewer_dll) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -SET_TARGET_PROPERTIES(object_viewer PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Tools, 3D: Object Viewer") +NL_DEFAULT_PROPS(object_viewer "Tools, 3D: Object Viewer") +NL_ADD_RUNTIME_FLAGS(object_viewer) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp) diff --git a/code/nel/tools/3d/panoply_maker/CMakeLists.txt b/code/nel/tools/3d/panoply_maker/CMakeLists.txt index b0d0c0f90..ad6154d55 100644 --- a/code/nel/tools/3d/panoply_maker/CMakeLists.txt +++ b/code/nel/tools/3d/panoply_maker/CMakeLists.txt @@ -2,16 +2,10 @@ FILE(GLOB SRC *.cpp *.h ../s3tc_compressor_lib/*.h ../s3tc_compressor_lib/*.cpp) ADD_EXECUTABLE(panoply_maker ${SRC}) -FIND_PACKAGE(Squish REQUIRED) +INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${SQUISH_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(panoply_maker ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(panoply_maker PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Tools, 3D: panoply_maker") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(panoply_maker ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) +NL_DEFAULT_PROPS(panoply_maker "Tools, 3D: panoply_maker") +NL_ADD_RUNTIME_FLAGS(panoply_maker) -INSTALL(TARGETS panoply_maker RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS panoply_maker RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/tile_edit/CMakeLists.txt b/code/nel/tools/3d/tile_edit/CMakeLists.txt index 08bc21575..4b353049b 100644 --- a/code/nel/tools/3d/tile_edit/CMakeLists.txt +++ b/code/nel/tools/3d/tile_edit/CMakeLists.txt @@ -4,20 +4,14 @@ ENABLE_LANGUAGE(RC) ADD_EXECUTABLE(tile_edit WIN32 ${SRC} tile_edit_exe.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES( tile_edit - ${LIBXML2_LIBRARIES} - ${PLATFORM_LINKFLAGS} - nelmisc - nel3d) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -D_AFXDLL) +TARGET_LINK_LIBRARIES(tile_edit ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(tile_edit "Tools, 3D: Tile Editor") +NL_ADD_RUNTIME_FLAGS(tile_edit) + +ADD_DEFINITIONS(-D_AFXDLL) IF(WIN32) - SET_TARGET_PROPERTIES(tile_edit PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - EXCLUDE_FROM_DEFAULT_BUILD 1 - PROJECT_LABEL "Tools, 3D: Tile Editor") + SET_TARGET_PROPERTIES(tile_edit PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1) ENDIF(WIN32) #INSTALL(TARGETS tile_edit RUNTIME DESTINATION bin COMPONENT tools3d) diff --git a/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt b/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt index c7425ebb2..6db560108 100644 --- a/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt +++ b/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt @@ -17,10 +17,13 @@ QT4_WRAP_CPP( TILE_EDIT_MOC_SRCS ${TILE_EDIT_HDR}) ADD_EXECUTABLE(tile_edit_qt ${TILE_EDIT_SRC} ${TILE_EDIT_MOC_SRCS} ${TILE_EDIT_RC_SRCS} ${TILE_EDIT_UI_HDRS}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${QT_INCLUDES}) -TARGET_LINK_LIBRARIES(tile_edit_qt ${LIBXML2_LIBRARIES} ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -SET_TARGET_PROPERTIES(tile_edit_qt PROPERTIES PROJECT_LABEL "Tools, 3D: Qt Tile Editor") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +TARGET_LINK_LIBRARIES(tile_edit_qt ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(tile_edit_qt "Tools, 3D: Qt Tile Editor") +NL_ADD_RUNTIME_FLAGS(tile_edit_qt) + +ADD_DEFINITIONS(${QT_DEFINITIONS}) INSTALL(TARGETS tile_edit_qt RUNTIME DESTINATION bin COMPONENT tools3d) diff --git a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt index 5a89f28b2..f08b36c0a 100644 --- a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt @@ -6,23 +6,10 @@ ADD_DEFINITIONS(-D_AFXDLL) SET(CMAKE_MFC_FLAG 2) ADD_LIBRARY(logic_editor_dll SHARED ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(logic_editor_dll ${LIBXML2_LIBRARIES} nelmisc nellogic nelnet) -SET_TARGET_PROPERTIES(logic_editor_dll PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "Tools, Logic: Logic Editor DLL") - -IF(WIN32) - SET_TARGET_PROPERTIES(logic_editor_dll PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - ) -ENDIF(WIN32) - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(logic_editor_dll ${PLATFORM_LINKFLAGS} nelmisc nellogic nelnet) +NL_DEFAULT_PROPS(logic_editor_dll "Tools, Logic: Logic Editor DLL") +NL_ADD_RUNTIME_FLAGS(logic_editor_dll) +NL_ADD_LIB_SUFFIX(logic_editor_dll) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(logic_editor_dll ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) diff --git a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt index 5f2a4779b..396027c0b 100644 --- a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt @@ -2,16 +2,9 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(logic_editor WIN32 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(logic_editor ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc logic_editor_dll) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - -IF(WIN32) - SET_TARGET_PROPERTIES(logic_editor PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Tools, Logic: Logic Editor") -ENDIF(WIN32) +TARGET_LINK_LIBRARIES(logic_editor ${PLATFORM_LINKFLAGS} nelmisc logic_editor_dll) +NL_DEFAULT_PROPS(logic_editor "Tools, Logic: Logic Editor") +NL_ADD_RUNTIME_FLAGS(logic_editor) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(logic_editor ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) diff --git a/code/nel/tools/misc/message_box_qt/CMakeLists.txt b/code/nel/tools/misc/message_box_qt/CMakeLists.txt index f1e75bf97..f77fc3fd4 100644 --- a/code/nel/tools/misc/message_box_qt/CMakeLists.txt +++ b/code/nel/tools/misc/message_box_qt/CMakeLists.txt @@ -9,10 +9,12 @@ SET( QT_USE_QTXML TRUE) ADD_EXECUTABLE(message_box_qt ${MESSAGE_BOX_SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${QT_INCLUDES}) -TARGET_LINK_LIBRARIES(message_box_qt ${LIBXML2_LIBRARIES} ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -SET_TARGET_PROPERTIES(message_box_qt PROPERTIES PROJECT_LABEL "Tools, Misc: Qt Message Box") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +TARGET_LINK_LIBRARIES(message_box_qt ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(message_box_qt "Tools, Misc: Qt Message Box") + +ADD_DEFINITIONS(${QT_DEFINITIONS}) INSTALL(TARGETS message_box_qt RUNTIME DESTINATION bin COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt index d2a98f837..572db3eb7 100644 --- a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt +++ b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt @@ -22,10 +22,13 @@ QT4_WRAP_CPP( WORDS_DIC_MOC_SRCS ${WORDS_DIC_HDR}) ADD_EXECUTABLE(words_dic_qt ${WORDS_DIC_SRC} ${WORDS_DIC_MOC_SRCS} ${WORDS_DIC_RC_SRCS} ${WORDS_DIC_UI_HDRS} ${WORDS_DIC_RC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${QT_INCLUDES}) -TARGET_LINK_LIBRARIES(words_dic_qt ${LIBXML2_LIBRARIES} ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -SET_TARGET_PROPERTIES(words_dic_qt PROPERTIES PROJECT_LABEL "Tools, Misc: Qt Words Dic") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +TARGET_LINK_LIBRARIES(words_dic_qt ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(words_dic_qt "Tools, Misc: Qt Words Dic") +NL_ADD_RUNTIME_FLAGS(words_dic_qt) + +ADD_DEFINITIONS(${QT_DEFINITIONS}) INSTALL(TARGETS words_dic_qt RUNTIME DESTINATION bin COMPONENT toolsmisc) INSTALL(FILES words_dic.cfg DESTINATION etc/nel COMPONENT toolsmisc) diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index 66fefc76a..c8a091e47 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -2,12 +2,12 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(nel_unit_test ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CPPTEST_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_unit_test ${LIBXML2_LIBRARIES} ${CPPTEST_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nelnet nelligo) +INCLUDE_DIRECTORIES(${CPPTEST_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(nel_unit_test ${CPPTEST_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nelnet nelligo) NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") NL_ADD_RUNTIME_FLAGS(nel_unit_test) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) ADD_DEFINITIONS(-DNEL_UNIT_BASE="\\"${PROJECT_SOURCE_DIR}/tools/nel_unit_test/\\"") INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION bin) From 44ae363d648d7adb339831f0c0082dddd99c3617 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 1 Sep 2010 21:46:06 +0200 Subject: [PATCH 40/56] Changed: removed MFC dependencies to object_viewer --- .../3d/object_viewer_exe/object_viewer_exe.rc | 2 +- code/nel/tools/3d/object_viewer_exe/std_afx.h | 23 ------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc b/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc index bbc7e0d13..54045351c 100644 --- a/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc +++ b/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS diff --git a/code/nel/tools/3d/object_viewer_exe/std_afx.h b/code/nel/tools/3d/object_viewer_exe/std_afx.h index a6acb9503..44b1cfadd 100644 --- a/code/nel/tools/3d/object_viewer_exe/std_afx.h +++ b/code/nel/tools/3d/object_viewer_exe/std_afx.h @@ -26,27 +26,4 @@ #define NOMINMAX -#include // MFC core and standard components -#include // MFC extensions - -#ifndef _AFX_NO_OLE_SUPPORT -#include // MFC OLE classes -#include // MFC OLE dialog classes -#include // MFC Automation classes -#endif // _AFX_NO_OLE_SUPPORT - - -#ifndef _AFX_NO_DB_SUPPORT -#include // MFC ODBC database classes -#endif // _AFX_NO_DB_SUPPORT - -#ifndef _AFX_NO_DAO_SUPPORT -#include // MFC DAO database classes -#endif // _AFX_NO_DAO_SUPPORT - -#include // MFC support for Internet Explorer 4 Common Controls -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - #endif From 6781fcf098d4b56e3a794f93b7c0addb60975d50 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 1 Sep 2010 21:46:39 +0200 Subject: [PATCH 41/56] Fixed: warning when destination file doesn'texist --- code/nel/tools/3d/tga_2_dds/tga2dds.cpp | 33 ++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp index 41a0ca9f6..4328c48fb 100644 --- a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp +++ b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp @@ -37,18 +37,18 @@ using namespace std; #define NOT_DEFINED 0xff -bool sameType(const char *sFileNameDest, uint8 algo); -bool dataCheck(const char *sFileNameSrc, const char *sFileNameDest, uint8 algo); +bool sameType(const std::string &sFileNameDest, uint8 algo); +bool dataCheck(const std::string &sFileNameSrc, const std::string &FileNameDest, uint8 algo); std::string getOutputFileName(const std::string &inputFileName); void writeInstructions(); -uint8 getType(const char *sFileNameDest) +uint8 getType(const std::string &sFileNameDest) { uint32 dds; - FILE *f = fopen(sFileNameDest,"rb"); + FILE *f = fopen(sFileNameDest.c_str(),"rb"); if(f==NULL) { return NOT_DEFINED; @@ -97,10 +97,10 @@ uint8 getType(const char *sFileNameDest) return NOT_DEFINED; } -bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) +bool sameType(const std::string &sFileNameDest, uint8 &algo, bool wantMipMap) { uint32 dds; - FILE *f = fopen(sFileNameDest,"rb"); + FILE *f = fopen(sFileNameDest.c_str(),"rb"); if(f==NULL) { return false; @@ -163,23 +163,22 @@ bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) -bool dataCheck(const char *sFileNameSrc, const char *sFileNameDest, uint8& algo, bool wantMipMap) +bool dataCheck(const std::string &sFileNameSrc, const std::string &sFileNameDest, uint8& algo, bool wantMipMap) { - uint32 lastWriteTime1 = CFile::getFileModificationDate(sFileNameSrc); - - if (!lastWriteTime1) + if (!CFile::fileExists(sFileNameSrc)) { - cerr<<"Can't open file "< lastWriteTime2) { return false; @@ -430,7 +429,7 @@ int main(int argc, char **argv) // Check dest algo if (OptAlgo==NOT_DEFINED) - OptAlgo = getType (outputFileName.c_str()); + OptAlgo = getType (outputFileName); // Choose Algo. if(OptAlgo!=NOT_DEFINED) @@ -447,7 +446,7 @@ int main(int argc, char **argv) // Data check //=========== - if(dataCheck(inputFileName.c_str(),outputFileName.c_str(), OptAlgo, OptMipMap)) + if(dataCheck(inputFileName,outputFileName, OptAlgo, OptMipMap)) { cout< Date: Wed, 1 Sep 2010 23:30:06 +0200 Subject: [PATCH 42/56] Changed: Removed propagation of dependencies to other projects (fix lintian warnings) --- code/nel/src/3d/CMakeLists.txt | 7 +++++-- code/nel/src/georges/CMakeLists.txt | 4 +++- code/nel/src/ligo/CMakeLists.txt | 2 ++ code/nel/src/logic/CMakeLists.txt | 2 ++ code/nel/src/misc/CMakeLists.txt | 2 ++ code/nel/src/net/CMakeLists.txt | 7 ++----- code/nel/src/pacs/CMakeLists.txt | 7 +++++-- code/nel/src/sound/CMakeLists.txt | 6 ++++-- 8 files changed, 25 insertions(+), 12 deletions(-) diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index 4ea6f3bae..8a33bbed0 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -664,10 +664,13 @@ SOURCE_GROUP(Shadows FILES NL_TARGET_LIB(nel3d ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARY} ${JPEG_LIBRARY}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) + +TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARY}) +SET_TARGET_PROPERTIES(nel3d PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nel3d "Library: NeL 3D") NL_ADD_STATIC_VID_DRIVERS(nel3d) + NL_ADD_LIB_SUFFIX(nel3d) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/src/georges/CMakeLists.txt b/code/nel/src/georges/CMakeLists.txt index 07bdeac61..c8bba42b3 100644 --- a/code/nel/src/georges/CMakeLists.txt +++ b/code/nel/src/georges/CMakeLists.txt @@ -7,7 +7,9 @@ SOURCE_GROUP(headers FILES ${PRIV_H} ${PUB_H}) NL_TARGET_LIB(nelgeorges ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelgeorges nelmisc) + +TARGET_LINK_LIBRARIES(nelgeorges ${LIBXML2_LIBRARIES} nelmisc) +SET_TARGET_PROPERTIES(nelgeorges PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelgeorges "Library: NeL Georges") NL_ADD_LIB_SUFFIX(nelgeorges) diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index 0ee8ac180..f55667919 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -3,7 +3,9 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nelligo ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nelligo ${LIBXML2_LIBRARIES} nelmisc) +SET_TARGET_PROPERTIES(nelligo PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelligo "Library: NeL Ligo") NL_ADD_LIB_SUFFIX(nelligo) diff --git a/code/nel/src/logic/CMakeLists.txt b/code/nel/src/logic/CMakeLists.txt index 0f01f0641..17e805ff9 100644 --- a/code/nel/src/logic/CMakeLists.txt +++ b/code/nel/src/logic/CMakeLists.txt @@ -3,7 +3,9 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nellogic ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nellogic ${LIBXML2_LIBRARIES} nelmisc nelnet) +SET_TARGET_PROPERTIES(nellogic PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nellogic "Library: NeL Logic") NL_ADD_LIB_SUFFIX(nellogic) diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index 63f9f4330..7d3a949a3 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -22,7 +22,9 @@ IF(WIN32) ENDIF(WIN32) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${PNG_INCLUDE_DIR} config_file) + TARGET_LINK_LIBRARIES(nelmisc ${LIBXML2_LIBRARIES} ${PNG_LIBRARIES} ${WINSOCK2_LIB}) +SET_TARGET_PROPERTIES(nelmisc PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelmisc "Library: NeL Misc") NL_ADD_LIB_SUFFIX(nelmisc) diff --git a/code/nel/src/net/CMakeLists.txt b/code/nel/src/net/CMakeLists.txt index fa6e35e05..a81b8a46e 100644 --- a/code/nel/src/net/CMakeLists.txt +++ b/code/nel/src/net/CMakeLists.txt @@ -11,15 +11,12 @@ IF(WITH_GTK) ENDIF(GTK2_FOUND) ENDIF(WITH_GTK) - -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelnet ${LIBXML2_LIBRARIES} nelmisc) +TARGET_LINK_LIBRARIES(nelnet nelmisc) +SET_TARGET_PROPERTIES(nelnet PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelnet "Library: NeL Net") NL_ADD_LIB_SUFFIX(nelnet) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelnet ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.h ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.cpp) ENDIF(WITH_PCH) diff --git a/code/nel/src/pacs/CMakeLists.txt b/code/nel/src/pacs/CMakeLists.txt index 4f1c5e48d..d98204de4 100644 --- a/code/nel/src/pacs/CMakeLists.txt +++ b/code/nel/src/pacs/CMakeLists.txt @@ -3,12 +3,15 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nelpacs ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelpacs ${LIBXML2_LIBRARIES} nelmisc) + +TARGET_LINK_LIBRARIES(nelpacs nelmisc) +SET_TARGET_PROPERTIES(nelpacs PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelpacs "Library: NeL PACS") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) NL_ADD_LIB_SUFFIX(nelpacs) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelpacs ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.cpp) ENDIF(WITH_PCH) diff --git a/code/nel/src/sound/CMakeLists.txt b/code/nel/src/sound/CMakeLists.txt index 1841005f6..cf32c419b 100644 --- a/code/nel/src/sound/CMakeLists.txt +++ b/code/nel/src/sound/CMakeLists.txt @@ -3,13 +3,15 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nelsound ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nelsound ${LIBXML2_LIBRARIES} nelmisc nelligo nelgeorges nel3d nelsnd_lowlevel) +SET_TARGET_PROPERTIES(nelsound PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelsound "Library: NeL Sound") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - NL_ADD_LIB_SUFFIX(nelsound) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelsound ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.cpp) ENDIF(WITH_PCH) From d4346ef7712a51f9a2c55935c9bff5fec75c78d0 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 09:31:24 +0200 Subject: [PATCH 43/56] Changed: Added PCH to nelligo --- code/nel/src/ligo/ligo_config.cpp | 1 + code/nel/src/ligo/ligo_error.cpp | 1 + code/nel/src/ligo/ligo_material.cpp | 1 + code/nel/src/ligo/primitive.cpp | 1 + code/nel/src/ligo/primitive_class.cpp | 1 + code/nel/src/ligo/primitive_configuration.cpp | 1 + code/nel/src/ligo/primitive_utils.cpp | 2 +- code/nel/src/ligo/stdligo.cpp | 24 +++++++ code/nel/src/ligo/stdligo.h | 63 +++++++++++++++++++ code/nel/src/ligo/transition.cpp | 1 + code/nel/src/ligo/zone_bank.cpp | 1 + code/nel/src/ligo/zone_edge.cpp | 1 + code/nel/src/ligo/zone_region.cpp | 1 + code/nel/src/ligo/zone_template.cpp | 1 + 14 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 code/nel/src/ligo/stdligo.cpp create mode 100644 code/nel/src/ligo/stdligo.h diff --git a/code/nel/src/ligo/ligo_config.cpp b/code/nel/src/ligo/ligo_config.cpp index e68197572..8d4b730f0 100644 --- a/code/nel/src/ligo/ligo_config.cpp +++ b/code/nel/src/ligo/ligo_config.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/ligo/ligo_config.h" #include "nel/ligo/primitive.h" diff --git a/code/nel/src/ligo/ligo_error.cpp b/code/nel/src/ligo/ligo_error.cpp index bebaaddfe..1330a60a7 100644 --- a/code/nel/src/ligo/ligo_error.cpp +++ b/code/nel/src/ligo/ligo_error.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "ligo_error.h" namespace NLLIGO diff --git a/code/nel/src/ligo/ligo_material.cpp b/code/nel/src/ligo/ligo_material.cpp index 3b125c1d9..121a30127 100644 --- a/code/nel/src/ligo/ligo_material.cpp +++ b/code/nel/src/ligo/ligo_material.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "ligo_material.h" // Ligo include diff --git a/code/nel/src/ligo/primitive.cpp b/code/nel/src/ligo/primitive.cpp index 3b33aa51d..4c1b3f9dd 100644 --- a/code/nel/src/ligo/primitive.cpp +++ b/code/nel/src/ligo/primitive.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/misc/types_nl.h" #include "nel/misc/hierarchical_timer.h" #include "nel/ligo/primitive.h" diff --git a/code/nel/src/ligo/primitive_class.cpp b/code/nel/src/ligo/primitive_class.cpp index a9b208162..528653786 100644 --- a/code/nel/src/ligo/primitive_class.cpp +++ b/code/nel/src/ligo/primitive_class.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/ligo/primitive_class.h" #include "nel/ligo/primitive.h" #include "nel/ligo/ligo_config.h" diff --git a/code/nel/src/ligo/primitive_configuration.cpp b/code/nel/src/ligo/primitive_configuration.cpp index b03eeb0dc..00de1dc7b 100644 --- a/code/nel/src/ligo/primitive_configuration.cpp +++ b/code/nel/src/ligo/primitive_configuration.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/ligo/primitive_configuration.h" #include "nel/ligo/ligo_config.h" #include "nel/ligo/primitive.h" diff --git a/code/nel/src/ligo/primitive_utils.cpp b/code/nel/src/ligo/primitive_utils.cpp index 2172980dd..455599730 100644 --- a/code/nel/src/ligo/primitive_utils.cpp +++ b/code/nel/src/ligo/primitive_utils.cpp @@ -1,5 +1,5 @@ - +#include "stdligo.h" #include "nel/ligo/primitive_utils.h" diff --git a/code/nel/src/ligo/stdligo.cpp b/code/nel/src/ligo/stdligo.cpp new file mode 100644 index 000000000..c0f179857 --- /dev/null +++ b/code/nel/src/ligo/stdligo.cpp @@ -0,0 +1,24 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdligo.h" + + +// leave not static else this workaround don't work +void dummyToAvoidStupidCompilerWarning_std_ligo_cpp() +{ +} + diff --git a/code/nel/src/ligo/stdligo.h b/code/nel/src/ligo/stdligo.h new file mode 100644 index 000000000..01e82a4a3 --- /dev/null +++ b/code/nel/src/ligo/stdligo.h @@ -0,0 +1,63 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "nel/misc/types_nl.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Include from libxml2 +#include + +#include "nel/misc/debug.h" +#include "nel/misc/common.h" +#include "nel/misc/fast_mem.h" +#include "nel/misc/system_info.h" +#include "nel/misc/mem_displayer.h" +#include "nel/misc/matrix.h" +#include "nel/misc/stream.h" +#include "nel/misc/path.h" +#include "nel/misc/string_common.h" +#include "nel/misc/config_file.h" +#include "nel/misc/i_xml.h" +#include "nel/misc/o_xml.h" +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/vector.h" +#include "nel/misc/rgba.h" +#include "nel/misc/file.h" diff --git a/code/nel/src/ligo/transition.cpp b/code/nel/src/ligo/transition.cpp index 5158f5b87..571bed290 100644 --- a/code/nel/src/ligo/transition.cpp +++ b/code/nel/src/ligo/transition.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "transition.h" // Ligo include diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index 240ec23a1..38b2ca5d6 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdligo.h" #include "zone_bank.h" diff --git a/code/nel/src/ligo/zone_edge.cpp b/code/nel/src/ligo/zone_edge.cpp index 235ba0880..b635da499 100644 --- a/code/nel/src/ligo/zone_edge.cpp +++ b/code/nel/src/ligo/zone_edge.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" // Ligo include #include "zone_edge.h" #include "nel/ligo/ligo_config.h" diff --git a/code/nel/src/ligo/zone_region.cpp b/code/nel/src/ligo/zone_region.cpp index ff19aa536..222940100 100644 --- a/code/nel/src/ligo/zone_region.cpp +++ b/code/nel/src/ligo/zone_region.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "zone_region.h" using namespace NLMISC; diff --git a/code/nel/src/ligo/zone_template.cpp b/code/nel/src/ligo/zone_template.cpp index a42ae50aa..2680ee9e9 100644 --- a/code/nel/src/ligo/zone_template.cpp +++ b/code/nel/src/ligo/zone_template.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "zone_template.h" #include "ligo_error.h" #include "nel/ligo/ligo_config.h" From b83fdd467eff80dd4a841b96653e24e146266c66 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 09:31:54 +0200 Subject: [PATCH 44/56] Changed: Added PCH to nelligo --- code/nel/src/ligo/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index f55667919..ea75aff0d 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -12,5 +12,9 @@ NL_ADD_LIB_SUFFIX(nelligo) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(nelligo ${CMAKE_CURRENT_SOURCE_DIR}/stdligo.h ${CMAKE_CURRENT_SOURCE_DIR}/stdligo.cpp) +ENDIF(WITH_PCH) + NL_GEN_PC(nel-ligo.pc) INSTALL(TARGETS nelligo LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) From 0ec41da752d15ec3aa51dd583f44240aadbbac7e Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 09:32:30 +0200 Subject: [PATCH 45/56] Changed: #841 Change the wrong header in the source code --- code/nel/src/ligo/primitive_utils.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/nel/src/ligo/primitive_utils.cpp b/code/nel/src/ligo/primitive_utils.cpp index 455599730..2e5e5edd8 100644 --- a/code/nel/src/ligo/primitive_utils.cpp +++ b/code/nel/src/ligo/primitive_utils.cpp @@ -1,3 +1,15 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . #include "stdligo.h" #include "nel/ligo/primitive_utils.h" From 1481d48ab878cd16d28642bc905ea93dbb947cec Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 09:54:46 +0200 Subject: [PATCH 46/56] Fixed: non detection of STLport libs under Windows --- code/nel/CMakeModules/FindSTLport.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/nel/CMakeModules/FindSTLport.cmake b/code/nel/CMakeModules/FindSTLport.cmake index f2b9be4e8..09acc0201 100644 --- a/code/nel/CMakeModules/FindSTLport.cmake +++ b/code/nel/CMakeModules/FindSTLport.cmake @@ -32,6 +32,8 @@ FIND_LIBRARY(STLPORT_LIBRARY_DEBUG stlportstld_x stlportstld_x.5.2 stlportd + stlportd_statix + stlportd_static PATHS /usr/local/lib /usr/lib @@ -51,6 +53,8 @@ FIND_LIBRARY(STLPORT_LIBRARY_RELEASE stlport stlport_x stlport_x.5.2 + stlport_statix + stlport_static PATHS /usr/local/lib /usr/lib From 3bb72a0d06ce51bed9cc5923637e51d221698621 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 09:56:54 +0200 Subject: [PATCH 47/56] Changed: Removed propagation of dependencies to other projects (fix lintian warnings) --- code/nel/samples/3d/cegui/CMakeLists.txt | 1 + code/nel/src/sound/driver/CMakeLists.txt | 9 ++++++--- .../nel_launcher_windows_ext2/CMakeLists.txt | 14 +++++--------- .../snowballs2/server/position/src/CMakeLists.txt | 15 ++++++--------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/code/nel/samples/3d/cegui/CMakeLists.txt b/code/nel/samples/3d/cegui/CMakeLists.txt index 8cd7b85c3..a293c8cfd 100644 --- a/code/nel/samples/3d/cegui/CMakeLists.txt +++ b/code/nel/samples/3d/cegui/CMakeLists.txt @@ -5,6 +5,7 @@ ADD_EXECUTABLE(nl_sample_cegui WIN32 ${SRC}) ADD_DEFINITIONS(-DCEGUI_DATA_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_cegui/datafiles/\\"") INCLUDE_DIRECTORIES(${CEGUI_INCLUDE_DIRS}) + TARGET_LINK_LIBRARIES(nl_sample_cegui ${CEGUI_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) NL_DEFAULT_PROPS(nl_sample_cegui "Samples, 3D: NeL CEGUI Demo") NL_ADD_RUNTIME_FLAGS(nl_sample_cegui) diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index c720886e1..ea5b7e0d1 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -1,12 +1,15 @@ FILE(GLOB SRC *.cpp *.h) -nl_target_lib(nelsnd_lowlevel ${SRC}) +NL_TARGET_LIB(nelsnd_lowlevel ${SRC}) INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nelsnd_lowlevel nelmisc ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY}) -nl_default_props(nelsnd_lowlevel "Library: NeL Sound Lowlevel") +SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nelsnd_lowlevel "Library: NeL Sound Lowlevel") NL_ADD_STATIC_VID_DRIVERS(nelsnd_lowlevel) -nl_add_lib_suffix(nelsnd_lowlevel) + +NL_ADD_LIB_SUFFIX(nelsnd_lowlevel) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelsnd_lowlevel ${CMAKE_CURRENT_SOURCE_DIR}/stdsound_lowlevel.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound_lowlevel.cpp) diff --git a/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt b/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt index c80badf81..4bdc373b1 100644 --- a/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt +++ b/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt @@ -1,20 +1,16 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nel3d") -SET(NL3D_LIB ${LIBNAME}) - ADD_EXECUTABLE(nel_launcher_ext2 WIN32 ${SRC} nel_launcher.rc) IF(CURL_FOUND) ADD_DEFINITIONS(-DUSE_CURL) ENDIF(CURL_FOUND) ADD_DEFINITIONS(-DNL_LAUNCHER_CFG="\\"${NL_ETC_PREFIX}/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NELMISC_INCLUDE_DIRS}) -TARGET_LINK_LIBRARIES(nel_launcher_ext2 ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NELNET_LIBRARY} ${NELMISC_LIBRARY} ${ZLIB_LIBRARY} ${CURL_LIBRARY}) -SET_TARGET_PROPERTIES(nel_launcher_ext2 PROPERTIES - LINK_FLAGS "/NODEFAULTLIB:libcmt" - PROJECT_LABEL "Launcher: NeL Launcher Ext2") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${NELMISC_INCLUDE_DIRS}) + +TARGET_LINK_LIBRARIES(nel_launcher_ext2 ${PLATFORM_LINKFLAGS} ${NELNET_LIBRARY} ${NELMISC_LIBRARY} ${ZLIB_LIBRARY} ${CURL_LIBRARY}) +NL_DEFAULT_PROPS(nel_launcher_ext2 "Launcher: NeL Launcher Ext2") +NL_ADD_RUNTIME_FLAGS(nel_launcher_ext2) INSTALL(TARGETS nel_launcher_ext2 RUNTIME DESTINATION bin COMPONENT launcher) INSTALL(FILES nel_launcher.cfg DESTINATION etc/nel COMPONENT launcher) diff --git a/code/snowballs2/server/position/src/CMakeLists.txt b/code/snowballs2/server/position/src/CMakeLists.txt index 229f402ed..034d5edd4 100644 --- a/code/snowballs2/server/position/src/CMakeLists.txt +++ b/code/snowballs2/server/position/src/CMakeLists.txt @@ -1,14 +1,11 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(sno_position ${SRC}) +ADD_EXECUTABLE(sno_position WIN32 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NELMISC_INCLUDE_DIRS}) -TARGET_LINK_LIBRARIES(sno_position ${PLATFORM_LINKFLAGS} ${LIBXML2_LIBRARIES} ${NELMISC_LIBRARY} ${NELNET_LIBRARY}) -IF(WIN32) - SET_TARGET_PROPERTIES(sno_position PROPERTIES - LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Services: Snowballs Position") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${NELMISC_INCLUDE_DIRS}) + +TARGET_LINK_LIBRARIES(sno_position ${PLATFORM_LINKFLAGS} ${NELMISC_LIBRARY} ${NELNET_LIBRARY}) +NL_DEFAULT_PROPS(sno_position "Services: Snowballs Position") +NL_ADD_RUNTIME_FLAGS(sno_position) INSTALL(TARGETS sno_position RUNTIME DESTINATION sbin COMPONENT services) From 811b229f52bf248176ad168532bacc818bd8f9f5 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 11:02:03 +0200 Subject: [PATCH 48/56] Changed: #878 Fix typos in comments/code --- code/nel/src/misc/win_event_emitter.cpp | 2 ++ code/ryzom/client/src/client_cfg.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index 57924c06c..fc01a8b62 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -305,6 +305,8 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA case WM_INPUTLANGCHANGE: if ( _IMEEventsEnabled ) { + // wParam = Specifies the character set of the new locale. + // lParam = Input locale identifier. server->postEvent( new CEventIME( msg, (uint32)wParam, (uint32)lParam, this ) ); return true; // trap message } diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 8e7206d15..987261227 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -298,7 +298,7 @@ CClientConfig::CClientConfig() Local = false; // Default is Net Mode. FSHost = ""; // Default Host. - + #if 1 // Yubo hack // The order is important here, because in a layer, global texture are rendered through this order TexturesInterface.push_back("texture_interfaces_v3"); @@ -306,15 +306,15 @@ CClientConfig::CClientConfig() TexturesInterface.push_back("new_texture_interfaces_dxtc"); // Added icons by Yubo's Team 2009 TexturesInterface.push_back("texture_extra"); -#else +#else TexturesInterface.push_back("texture_interfaces_v3"); TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc"); #endif - + TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui"); - + TexturesLoginInterface.push_back("texture_interfaces_v3_login"); - + DisplayAccountButtons = true; CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; ConditionsTermsURL = "https://secure.ryzom.com/signup/terms_of_use.php"; @@ -2034,7 +2034,7 @@ void CClientConfig::init(const string &configFileName) { std::string defaultConfigFileName = "client_default.cfg"; bool found = false; - + if (CFile::isExists(defaultConfigFileName)) found = true; #ifdef RYZOM_ETC_PREFIX From 8c7aec84c38b53190db685bf711cde28c7412d74 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 11:23:32 +0200 Subject: [PATCH 49/56] Changed: Check for MFC (to disable tools using MFC if not found) --- code/nel/CMakeLists.txt | 4 ++++ code/nel/CMakeModules/nel.cmake | 1 + 2 files changed, 5 insertions(+) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 1e49af1e3..c41a69906 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -150,6 +150,10 @@ IF(WITH_SOUND) ENDIF(WITH_DRIVER_FMOD) ENDIF(WITH_SOUND) +IF(WITH_MFC) + FIND_PACKAGE(MFC) +ENDIF(WITH_MFC) + IF(WITH_GTK) FIND_PACKAGE(GTK2) ENDIF(WITH_GTK) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index 2f41e5d77..c97c03f4c 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -196,6 +196,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_MAXPLUGIN "Build NeL 3dsMax Plugin" OFF) OPTION(WITH_SAMPLES "Build NeL Samples" ON ) OPTION(WITH_TESTS "Build NeL Unit Tests" ON ) + OPTION(WITH_MFC "With MFC Support" ON ) OPTION(WITH_GTK "With GTK Support" OFF) OPTION(WITH_QT "With QT Support" OFF) OPTION(WITH_STLPORT "With STLport support." OFF) From aff9d7946d1cc8543c9a3a55525008ebdf2cac33 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 11:27:25 +0200 Subject: [PATCH 50/56] Fixed: nel_unit_test compilation --- code/nel/tools/nel_unit_test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index c8a091e47..f939bcaf5 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -2,12 +2,12 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(nel_unit_test ${SRC}) -INCLUDE_DIRECTORIES(${CPPTEST_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CPPTEST_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_unit_test ${CPPTEST_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nelnet nelligo) NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") NL_ADD_RUNTIME_FLAGS(nel_unit_test) -ADD_DEFINITIONS(-DNEL_UNIT_BASE="\\"${PROJECT_SOURCE_DIR}/tools/nel_unit_test/\\"") +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_UNIT_BASE="\\"${PROJECT_SOURCE_DIR}/tools/nel_unit_test/\\"") INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION bin) From e9c9345826a3525bd4a3125ec5d694413dbdc464 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 12:48:33 +0200 Subject: [PATCH 51/56] Changed: Updated tools CMake projects --- code/nel/tools/3d/CMakeLists.txt | 41 +++++++++++-------- .../tools/3d/hls_bank_maker/CMakeLists.txt | 11 +++++ code/nel/tools/3d/ig_add/CMakeLists.txt | 2 +- code/nel/tools/3d/ig_elevation/CMakeLists.txt | 2 +- .../3d/lightmap_optimizer/CMakeLists.txt | 2 +- code/nel/tools/CMakeLists.txt | 15 ++++--- code/nel/tools/logic/CMakeLists.txt | 7 ++-- code/nel/tools/memory/CMakeLists.txt | 1 + code/nel/tools/memory/memlog/CMakeLists.txt | 9 ++++ code/nel/tools/memory/memlog/StdAfx.cpp | 8 ---- code/nel/tools/memory/memlog/StdAfx.h | 19 --------- code/nel/tools/memory/memlog/memlog.cpp | 17 +++++++- code/nel/tools/sound/CMakeLists.txt | 1 + 13 files changed, 76 insertions(+), 59 deletions(-) create mode 100644 code/nel/tools/3d/hls_bank_maker/CMakeLists.txt create mode 100644 code/nel/tools/memory/CMakeLists.txt create mode 100644 code/nel/tools/memory/memlog/CMakeLists.txt delete mode 100644 code/nel/tools/memory/memlog/StdAfx.cpp delete mode 100644 code/nel/tools/memory/memlog/StdAfx.h create mode 100644 code/nel/tools/sound/CMakeLists.txt diff --git a/code/nel/tools/3d/CMakeLists.txt b/code/nel/tools/3d/CMakeLists.txt index 99598307d..550293ad3 100644 --- a/code/nel/tools/3d/CMakeLists.txt +++ b/code/nel/tools/3d/CMakeLists.txt @@ -1,4 +1,5 @@ -SUBDIRS( build_coarse_mesh +SUBDIRS( + build_coarse_mesh build_far_bank build_smallbank ig_lighter @@ -22,31 +23,35 @@ SUBDIRS( build_coarse_mesh zone_check_bind zone_dump zviewer) -IF(WIN32) - ADD_SUBDIRECTORY(object_viewer) - ADD_SUBDIRECTORY(object_viewer_exe) - ADD_SUBDIRECTORY(tile_edit) + +IF(WIN32) + ADD_SUBDIRECTORY(ig_elevation) + ADD_SUBDIRECTORY(lightmap_optimizer) + + IF(MFC_FOUND) + ADD_SUBDIRECTORY(object_viewer) + ADD_SUBDIRECTORY(object_viewer_exe) + ADD_SUBDIRECTORY(tile_edit) + ENDIF(MFC_FOUND) + + IF(WITH_MAXPLUGIN) + IF(MAXSDK_FOUND) + ADD_SUBDIRECTORY(plugin_max) + ADD_SUBDIRECTORY(ligo) + ENDIF(MAXSDK_FOUND) + ENDIF(WITH_MAXPLUGIN) + ENDIF(WIN32) IF(WITH_QT) ADD_SUBDIRECTORY(tile_edit_qt) ENDIF(WITH_QT) -IF(WITH_MAXPLUGIN) - IF(MAXSDK_FOUND) - ADD_SUBDIRECTORY(plugin_max) - ADD_SUBDIRECTORY(ligo) - ENDIF(MAXSDK_FOUND) -ENDIF(WITH_MAXPLUGIN) - IF(SQUISH_FOUND) ADD_SUBDIRECTORY(panoply_maker) ADD_SUBDIRECTORY(tga_2_dds) + ADD_SUBDIRECTORY(hls_bank_maker) ENDIF(SQUISH_FOUND) -# These use WIndows-specific things that need to be fixed. -#ig_elevation -#lightmap_optimizer -#object_viewer_exe -#hls_bank_maker -#plugin_max +#crash_log_analyser +#shapes_exporter diff --git a/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt new file mode 100644 index 000000000..ffc3ef01a --- /dev/null +++ b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt @@ -0,0 +1,11 @@ +FILE(GLOB SRC *.cpp *.h ../panoply_maker/hls_bank_texture_info.cpp ../panoply_maker/hls_bank_texture_info.h ../s3tc_compressor_lib/*.cpp ../s3tc_compressor_lib/*.h) + +ADD_EXECUTABLE(hls_bank_maker ${SRC}) + +INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(hls_bank_maker ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) +NL_DEFAULT_PROPS(hls_bank_maker "Tools, 3D: hls_bank_maker") +NL_ADD_RUNTIME_FLAGS(hls_bank_maker) + +INSTALL(TARGETS hls_bank_maker RUNTIME DESTINATION bin COMPONENT tools3d) diff --git a/code/nel/tools/3d/ig_add/CMakeLists.txt b/code/nel/tools/3d/ig_add/CMakeLists.txt index a5556d78c..cda86000f 100644 --- a/code/nel/tools/3d/ig_add/CMakeLists.txt +++ b/code/nel/tools/3d/ig_add/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(ig_add ${SRC}) -TARGET_LINK_LIBRARIES(ig_add ${PLATFORM_LINKFLAGS} nel3d) +TARGET_LINK_LIBRARIES(ig_add ${PLATFORM_LINKFLAGS} nel3d nelmisc) NL_DEFAULT_PROPS(ig_add "Tools, 3D: ig_add") NL_ADD_RUNTIME_FLAGS(ig_add) diff --git a/code/nel/tools/3d/ig_elevation/CMakeLists.txt b/code/nel/tools/3d/ig_elevation/CMakeLists.txt index 5f6c4a7c4..2e428cc7a 100644 --- a/code/nel/tools/3d/ig_elevation/CMakeLists.txt +++ b/code/nel/tools/3d/ig_elevation/CMakeLists.txt @@ -4,7 +4,7 @@ ADD_EXECUTABLE(ig_elevation ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(ig_elevation ${PLATFORM_LINKFLAGS} nelmisc nel3d) +TARGET_LINK_LIBRARIES(ig_elevation ${PLATFORM_LINKFLAGS} nelmisc nel3d nelligo) NL_DEFAULT_PROPS(ig_elevation "Tools, 3D: ig_elevation") NL_ADD_RUNTIME_FLAGS(ig_elevation) diff --git a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt index 3a15f394b..7104d05f8 100644 --- a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt +++ b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(lightmap_optimizer ${SRC}) -TARGET_LINK_LIBRARIES(lightmap_optimizer ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(lightmap_optimizer ${PLATFORM_LINKFLAGS} nel3d nelmisc) NL_DEFAULT_PROPS(lightmap_optimizer "Tools, 3D: lightmap_optimizer") NL_ADD_RUNTIME_FLAGS(lightmap_optimizer) diff --git a/code/nel/tools/CMakeLists.txt b/code/nel/tools/CMakeLists.txt index 6385953c0..5cb92eca4 100644 --- a/code/nel/tools/CMakeLists.txt +++ b/code/nel/tools/CMakeLists.txt @@ -1,22 +1,27 @@ -SUBDIRS(misc) +SUBDIRS(misc memory) IF(WITH_3D) - SUBDIRS(3d) + ADD_SUBDIRECTORY(3d) ENDIF(WITH_3D) IF(WITH_PACS) - SUBDIRS(pacs) + ADD_SUBDIRECTORY(pacs) ENDIF(WITH_PACS) IF(WITH_LOGIC) - SUBDIRS(logic) + ADD_SUBDIRECTORY(logic) ENDIF(WITH_LOGIC) IF(WITH_GEORGES) - SUBDIRS(georges) + ADD_SUBDIRECTORY(georges) ENDIF(WITH_GEORGES) +IF(WITH_SOUND) + ADD_SUBDIRECTORY(sound) +ENDIF(WITH_SOUND) + IF(WITH_TESTS) ADD_SUBDIRECTORY(nel_unit_test) ENDIF(WITH_TESTS) +#build_gamedata diff --git a/code/nel/tools/logic/CMakeLists.txt b/code/nel/tools/logic/CMakeLists.txt index 4b920eb14..0ac435351 100644 --- a/code/nel/tools/logic/CMakeLists.txt +++ b/code/nel/tools/logic/CMakeLists.txt @@ -1,4 +1,3 @@ -IF(WIN32) - SUBDIRS( logic_editor_dll - logic_editor_exe) -ENDIF(WIN32) +IF(MFC_FOUND) + SUBDIRS(logic_editor_dll logic_editor_exe) +ENDIF(MFC_FOUND) diff --git a/code/nel/tools/memory/CMakeLists.txt b/code/nel/tools/memory/CMakeLists.txt new file mode 100644 index 000000000..e5ce29869 --- /dev/null +++ b/code/nel/tools/memory/CMakeLists.txt @@ -0,0 +1 @@ +SUBDIRS(memlog) diff --git a/code/nel/tools/memory/memlog/CMakeLists.txt b/code/nel/tools/memory/memlog/CMakeLists.txt new file mode 100644 index 000000000..7b9c1fc24 --- /dev/null +++ b/code/nel/tools/memory/memlog/CMakeLists.txt @@ -0,0 +1,9 @@ +FILE(GLOB SRC *.cpp *.h) + +ADD_EXECUTABLE(memlog ${SRC}) + +TARGET_LINK_LIBRARIES(memlog ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(memlog "Tools, Memory: memlog") +NL_ADD_RUNTIME_FLAGS(memlog) + +INSTALL(TARGETS memlog RUNTIME DESTINATION bin COMPONENT toolsmisc) diff --git a/code/nel/tools/memory/memlog/StdAfx.cpp b/code/nel/tools/memory/memlog/StdAfx.cpp deleted file mode 100644 index 41dd9a36c..000000000 --- a/code/nel/tools/memory/memlog/StdAfx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// memlog.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/code/nel/tools/memory/memlog/StdAfx.h b/code/nel/tools/memory/memlog/StdAfx.h deleted file mode 100644 index dcf951b4e..000000000 --- a/code/nel/tools/memory/memlog/StdAfx.h +++ /dev/null @@ -1,19 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__39F9814B_8C9D_4AA7_958F_111437B98069__INCLUDED_) -#define AFX_STDAFX_H__39F9814B_8C9D_4AA7_958F_111437B98069__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__39F9814B_8C9D_4AA7_958F_111437B98069__INCLUDED_) diff --git a/code/nel/tools/memory/memlog/memlog.cpp b/code/nel/tools/memory/memlog/memlog.cpp index dff34ad6d..53a843718 100644 --- a/code/nel/tools/memory/memlog/memlog.cpp +++ b/code/nel/tools/memory/memlog/memlog.cpp @@ -1,7 +1,20 @@ -// memlog.cpp : Defines the entry point for the console application. +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited // +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . -#include "stdafx.h" +#include #include #include diff --git a/code/nel/tools/sound/CMakeLists.txt b/code/nel/tools/sound/CMakeLists.txt new file mode 100644 index 000000000..d3f5a12fa --- /dev/null +++ b/code/nel/tools/sound/CMakeLists.txt @@ -0,0 +1 @@ + From 6cf96b9e36e2fb388a7f4303d7599f4db1f7525d Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 13:02:03 +0200 Subject: [PATCH 52/56] Changed: #825 Remove all warnings when compiling Ryzom --- code/nel/src/sound/clustered_sound.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/nel/src/sound/clustered_sound.cpp b/code/nel/src/sound/clustered_sound.cpp index 71b1dec50..3a75ee4f4 100644 --- a/code/nel/src/sound/clustered_sound.cpp +++ b/code/nel/src/sound/clustered_sound.cpp @@ -493,6 +493,9 @@ void CClusteredSound::soundTraverse(const std::vector &clusters, CSo CSoundTravContext &travContext = curClusters.back().second; CClusterSoundStatus css; + css.DistFactor = 0.0f; + css.Position = CVector::Null; + css.PosAlpha = 0.0f; css.Gain = travContext.Gain; css.Dist = travContext.Dist; css.Direction = travContext.Direction; From f0d758bc6af1a078cebafc4f5484aaf40907c29f Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 2 Sep 2010 18:23:02 +0200 Subject: [PATCH 53/56] Changed: Moved config.h stuff in ConfigureChecks.cmake --- code/ryzom/CMakeLists.txt | 5 ----- code/ryzom/CMakeModules/ConfigureChecks.cmake | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index aa4430116..aa4368a71 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -113,11 +113,6 @@ IF(FINAL_VERSION) ADD_DEFINITIONS(-DFINAL_VERSION=1) ENDIF(FINAL_VERSION) -# config.h configuration and use by projects -CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) -INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) -ADD_DEFINITIONS(-DHAVE_CONFIG_H) - ADD_SUBDIRECTORY(common) IF(WITH_CLIENT) diff --git a/code/ryzom/CMakeModules/ConfigureChecks.cmake b/code/ryzom/CMakeModules/ConfigureChecks.cmake index 982cca4b1..4a0c76e1d 100644 --- a/code/ryzom/CMakeModules/ConfigureChecks.cmake +++ b/code/ryzom/CMakeModules/ConfigureChecks.cmake @@ -44,5 +44,6 @@ MACRO(NL_CONFIGURE_CHECKS) CHECK_FUNCTION_EXISTS("stat64" HAVE_STAT64) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_DEFINITIONS(-DHAVE_CONFIG_H) ENDMACRO(NL_CONFIGURE_CHECKS) From 73bfbdc4f88cdb9ee4818055522a83913e64962e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 3 Sep 2010 12:31:07 +0200 Subject: [PATCH 54/56] Fixed: georges2csv.vcproj dependencies --- .../georges/georges2csv/georges2csv.vcproj | 162 +++++++++--------- 1 file changed, 82 insertions(+), 80 deletions(-) diff --git a/code/nel/tools/georges/georges2csv/georges2csv.vcproj b/code/nel/tools/georges/georges2csv/georges2csv.vcproj index 5099fe41a..a75693980 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.vcproj +++ b/code/nel/tools/georges/georges2csv/georges2csv.vcproj @@ -4,6 +4,7 @@ Version="9,00" Name="georges2csv" ProjectGUID="{885542B1-BE3C-401A-A2A4-DA49E48DF0AB}" + RootNamespace="georges2csv" TargetFrameworkVersion="0" > @@ -95,86 +96,6 @@ Name="VCPostBuildEventTool" /> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + Date: Fri, 3 Sep 2010 12:33:08 +0200 Subject: [PATCH 55/56] Changed: #964 Max asset batch converter now also shows maps in older max versions. --- code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms | 1 + 1 file changed, 1 insertion(+) diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms index fa107376b..7b39adb21 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -247,6 +247,7 @@ rollout assets_png_rollout "Properties" actionMan.executeAction 0 "40021" -- Selection: Select All actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected + actionMan.executeAction 0 "40807" -- Views: Activate All Maps actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps actionMan.executeAction 0 "40043" -- Selection: Select None From a3b71cdb3e5b422a922945e42bf1325d2d65f2fc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 3 Sep 2010 12:37:35 +0200 Subject: [PATCH 56/56] Added: #929 Generators for ecosystem projects, all four ecosystem projects, generators for max exporter scripts, rbank cmb export. Changed: #929 Improved skipping of exported max files, corrected search paths for some tools configurations. --- .../build_gamedata/configuration/scripts.py | 25 ++ .../ecosystem_project_template/directories.py | 196 ++++++++++ .../ecosystem_project_template/process.py | 120 ++++++ .../build_gamedata/generators/generate_all.py | 65 ++++ .../generators/generate_ecosystem_projects.py | 278 ++++++++++++++ .../generate_simple_max_exporters.py | 104 +++++ .../generate_tagged_max_exporters.py | 114 ++++++ .../generators/max_exporter_scripts/anim.ms | 69 ++++ .../generators/max_exporter_scripts/anim.py | 0 .../generators/max_exporter_scripts/clod.ms | 123 ++++++ .../generators/max_exporter_scripts/clod.py | 0 .../generators/max_exporter_scripts/cmb.ms | 59 +++ .../generators/max_exporter_scripts/cmb.py | 0 .../generators/max_exporter_scripts/ig.ms | 172 +++++++++ .../max_exporter_scripts/pacs_prim.ms | 47 +++ .../max_exporter_scripts/pacs_prim.py | 16 + .../generators/max_exporter_scripts/skel.ms | 53 +++ .../generators/max_exporter_scripts/skel.py | 8 + .../generators/max_exporter_scripts/swt.ms | 28 ++ .../generators/max_exporter_scripts/swt.py | 0 .../generators/max_exporter_scripts/veget.ms | 113 ++++++ .../generators/max_exporter_scripts/veget.py | 0 .../generators/max_exporter_scripts/zone.ms | 86 +++++ .../generators/max_exporter_scripts/zone.py | 8 + .../simple_max_exporter_template/0_setup.py | 65 ++++ .../1_export_footer.py | 7 + .../1_export_header.py | 92 +++++ .../simple_max_exporter_template/2_build.py | 49 +++ .../simple_max_exporter_template/3_install.py | 57 +++ .../export_footer.ms | 74 ++++ .../export_header.ms | 63 +++ .../tagged_max_exporter_template/0_setup.py | 66 ++++ .../1_export_footer.py | 7 + .../1_export_header.py | 96 +++++ .../tagged_max_exporter_template/2_build.py | 49 +++ .../tagged_max_exporter_template/3_install.py | 57 +++ .../export_footer.ms | 89 +++++ .../export_header.ms | 63 +++ .../build_gamedata/processes/anim/1_export.py | 83 ++-- .../processes/anim/maxscript/anim_export.ms | 177 +++++---- .../processes/clodbank/1_export.py | 90 +++-- .../clodbank/maxscript/clod_export.ms | 302 ++++++++------- .../build_gamedata/processes/ig/1_export.py | 28 +- .../processes/ig/maxscript/ig_export.ms | 360 +++++++++--------- .../build_gamedata/processes/ligo/0_setup.py | 2 +- .../build_gamedata/processes/ligo/1_export.py | 6 +- .../processes/pacs_prim/1_export.py | 85 +++-- .../pacs_prim/maxscript/pacs_prim_export.ms | 133 ++++--- .../build_gamedata/processes/rbank/0_setup.py | 4 + .../processes/rbank/1_export.py | 59 ++- .../processes/rbank/maxscript/cmb_export.ms | 211 ++++++++++ .../processes/shape/1_export.py | 20 +- .../build_gamedata/processes/skel/1_export.py | 84 ++-- .../processes/skel/maxscript/skel_export.ms | 170 +++++---- .../build_gamedata/processes/swt/1_export.py | 84 ++-- .../processes/swt/maxscript/swt_export.ms | 122 +++--- .../build_gamedata/processes/veget/0_setup.py | 2 +- .../processes/veget/1_export.py | 65 ++-- .../build_gamedata/processes/veget/2_build.py | 2 +- .../processes/veget/3_install.py | 10 +- .../processes/veget/maxscript/veget_export.ms | 242 ++++++------ .../build_gamedata/processes/zone/0_setup.py | 2 +- .../build_gamedata/processes/zone/1_export.py | 64 +++- .../processes/zone/maxscript/zone_export.ms | 223 +++++++++++ .../processes/zone_light/0_setup.py | 1 + .../processes/zone_light/2_build.py | 8 +- .../continents/newbieland/directories.py | 10 +- .../continents/newbieland/process.py | 11 +- .../ecosystems/desert/directories.py | 245 ++++++++++++ .../workspace/ecosystems/desert/process.py | 128 +++++++ .../ecosystems/jungle/directories.py | 104 +++-- .../workspace/ecosystems/jungle/process.py | 49 ++- .../ecosystems/lacustre/directories.py | 257 +++++++++++++ .../workspace/ecosystems/lacustre/process.py | 128 +++++++ .../ecosystems/primes_racines/directories.py | 242 ++++++++++++ .../ecosystems/primes_racines/process.py | 128 +++++++ .../build_gamedata/workspace/projects.py | 7 +- 77 files changed, 5430 insertions(+), 1036 deletions(-) create mode 100644 code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py create mode 100644 code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_all.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms create mode 100644 code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py index a919b89a6..128238494 100644 --- a/code/nel/tools/build_gamedata/configuration/scripts.py +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -215,6 +215,31 @@ def findFile(log, dir_where, file_name): printLog(log, "findFile: file not dir or file?! " + filePath) return "" +def needUpdateDirByTagLog(log, dir_source, ext_source, dir_dest, ext_dest): + updateCount = 0 + skipCount = 0 + lenSrcExt = len(ext_source) + sourceFiles = findFilesNoSubdir(log, dir_source, ext_source) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + sourceFile = dir_source + "/" + file + tagFile = dir_dest + "/" + file[0:-lenSrcExt] + ext_dest + if os.path.isfile(tagFile): + sourceTime = os.stat(sourceFile).st_mtime + tagTime = os.stat(tagFile).st_mtime + if (sourceTime > tagTime): + updateCount = updateCount + 1 + else: + skipCount = skipCount + 1 + else: + updateCount = updateCount + 1 + if updateCount > 0: + printLog(log, "UPDATE " + str(updateCount) + " / " + str(len(sourceFiles)) + "; SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 1 + else: + printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 0 + def needUpdateDirNoSubdirLogExt(log, dir_source, ext_source, dir_dest, ext_dest): latestSourceFile = 0 latestDestFile = 0 diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py new file mode 100644 index 000000000..50157963e --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py @@ -0,0 +1,196 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for '%PreGenEcosystemName%' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "%PreGenEcosystemName%" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "%PreGenDatabaseRootName%" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +%PreGenMapSubdirectories%MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +%PreGenTileSourceDirectories% +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py new file mode 100644 index 000000000..7a7478b99 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py @@ -0,0 +1,120 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for '%PreGenEcosystemName%' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "%PreGenEcosystemName%" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "%PreGenShapeExportOptExportLighting%" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "%PreGenShapeExportOptShadow%" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = %PreGenShapeExportOptLightingLimit% + +# Lightmap lumel size +ShapeExportOptLumelSize = "%PreGenShapeExportOptLumelSize%" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = %PreGenShapeExportOptOversampling% + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "%PreGenShapeExportOpt8BitsLightmap%" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "%PreGenShapeExportOptLightmapLog%" + +# Coarse mesh texture mul size +TextureMulSizeValue = "%PreGenTextureMulSizeValue%" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +%PreGenCoarseMeshTextureNames% +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +%PreGenMultipleTilesPostfix% +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/nel/tools/build_gamedata/generators/generate_all.py b/code/nel/tools/build_gamedata/generators/generate_all.py new file mode 100644 index 000000000..f6af77bc2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_all.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_all.log"): + os.remove("generate_all.log") +log = open("generate_all.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate all") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_simple_max_exporters.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_tagged_max_exporters.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_ecosystem_projects.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py new file mode 100644 index 000000000..7802b16f6 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py @@ -0,0 +1,278 @@ +#!/usr/bin/python +# +# \file generate_ecosystem_projects.py +# \brief Run all setup processes +# \date 2010-09-02 10:36GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Generate ecosystem projects +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_ecosystem_projects.log"): + os.remove("generate_ecosystem_projects.log") +log = open("generate_ecosystem_projects.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate ecosystem projects") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +templateDir = os.getcwd().replace("\\", "/") + "/ecosystem_project_template" +mkPath(log, templateDir) + +os.chdir("..") + + +# Scroll down to add an ecosystem. + + + +DefaultShapeExportOptExportLighting = "true" +DefaultShapeExportOptShadow = "true" +DefaultShapeExportOptLightingLimit = "1" +DefaultShapeExportOptLumelSize = "0.25" +DefaultShapeExportOptOversampling = "1" +DefaultShapeExportOpt8BitsLightmap = "true" +DefaultShapeExportOptLightmapLog = "true" +DefaultTextureMulSizeValue = "1.5" +DefaultSeasonSuffixes = [ "sp" ] + [ "su" ] + [ "au" ] + [ "wi" ] +DefaultMapSubdirectories = [ ] +DefaultTileDirectories = [ ] + + +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = DefaultShapeExportOpt8BitsLightmap +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = DefaultMapSubdirectories +TileDirectories = DefaultTileDirectories + + +PreGenDateTimeStamp = None +PreGenEcosystemName = None +PreGenDatabaseRootName = None +PreGenCoarseMeshTextureNames = None +PreGenMultipleTilesPostfix = None +PreGenMapSubdirectories = None +PreGenTileSourceDirectories = None + + +def transformLine(line): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", PreGenDateTimeStamp) + + newline = newline.replace("%PreGenEcosystemName%", PreGenEcosystemName) + newline = newline.replace("%PreGenDatabaseRootName%", PreGenDatabaseRootName) + + newline = newline.replace("%PreGenCoarseMeshTextureNames%", PreGenCoarseMeshTextureNames) + newline = newline.replace("%PreGenMultipleTilesPostfix%", PreGenMultipleTilesPostfix) + newline = newline.replace("%PreGenMapSubdirectories%", PreGenMapSubdirectories) + newline = newline.replace("%PreGenTileSourceDirectories%", PreGenTileSourceDirectories) + + newline = newline.replace("%PreGenShapeExportOptExportLighting%", ShapeExportOptExportLighting) + newline = newline.replace("%PreGenShapeExportOptShadow%", ShapeExportOptShadow) + newline = newline.replace("%PreGenShapeExportOptLightingLimit%", ShapeExportOptLightingLimit) + newline = newline.replace("%PreGenShapeExportOptLumelSize%", ShapeExportOptLumelSize) + newline = newline.replace("%PreGenShapeExportOptOversampling%", ShapeExportOptOversampling) + newline = newline.replace("%PreGenShapeExportOpt8BitsLightmap%", ShapeExportOpt8BitsLightmap) + newline = newline.replace("%PreGenShapeExportOptLightmapLog%", ShapeExportOptLightmapLog) + newline = newline.replace("%PreGenTextureMulSizeValue%", TextureMulSizeValue) + newline = newline.replace("%PreGenTileSourceDirectories%", PreGenTileSourceDirectories) + + return newline + +def generateFile(sourceFile, destFile): + srcf = open(sourceFile, "r") + dstf = open(destFile, "w") + printLog(log, "WRITE " + destFile) + for line in srcf: + dstf.write(transformLine(line)) + dstf.close() + srcf.close() + +def generateEcosystem(ecosystemName, databaseRootName): + global PreGenEcosystemName + PreGenEcosystemName = ecosystemName + global PreGenDatabaseRootName + PreGenDatabaseRootName = databaseRootName + global PreGenDateTimeStamp + PreGenDateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + + global PreGenMultipleTilesPostfix + PreGenMultipleTilesPostfix = "" + global PreGenCoarseMeshTextureNames + PreGenCoarseMeshTextureNames = "" + global PreGenTileSourceDirectories + PreGenTileSourceDirectories = "" + for suffix in SeasonSuffixes: + PreGenMultipleTilesPostfix += "MultipleTilesPostfix += [ \"_" + suffix + "\" ]\n" + PreGenCoarseMeshTextureNames += "CoarseMeshTextureNames += [ \"nel_coarse_mesh_\" + EcosystemName + \"_" + suffix + "\" ]\n" + for tiledir in TileDirectories: + PreGenTileSourceDirectories += "TilesSourceDirectories += [ \"landscape/_texture_tiles/\" + EcosystemName + \"_" + suffix + "/" + tiledir + "\" ]\n" + global PreGenMapSubdirectories + PreGenMapSubdirectories = "" + for subdir in MapSubdirectories: + PreGenMapSubdirectories += "MapSourceDirectories += [ DatabaseRootPath + \"/decors/_textures/" + subdir + "\" ]\n" + + destDir = WorkspaceDirectory + "/ecosystems/" + ecosystemName + mkPath(log, destDir) + + generateFile(templateDir + "/process.py", destDir + "/process.py") + generateFile(templateDir + "/directories.py", destDir + "/directories.py") + + return + + + +# Add new ecosystems below this line. + + + +# DESERT +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = DefaultShapeExportOpt8BitsLightmap +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "1.5-marecage_profond" ] +TileDirectories += [ "1-marecages" ] +TileDirectories += [ "2-citees" ] +TileDirectories += [ "3-fond_canyon" ] +TileDirectories += [ "4.2-boisbandeclair" ] +TileDirectories += [ "4.5-desert2boisbande" ] +TileDirectories += [ "4-falaise_bois_bande" ] +TileDirectories += [ "5-falaise_normales" ] +TileDirectories += [ "6.5-desertalternatif" ] +TileDirectories += [ "6-desert" ] +TileDirectories += [ "7-routes" ] +TileDirectories += [ "8-foretbrule" ] +generateEcosystem("desert", "fyros") + + +# JUNGLE +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "10-crevassejungle" ] +TileDirectories += [ "11-paroisjungle" ] +TileDirectories += [ "12-vasejungle" ] +TileDirectories += [ "1-junglemousse" ] +TileDirectories += [ "2-junglefeuilles" ] +TileDirectories += [ "3-jungleherbesseche" ] +TileDirectories += [ "4-jungleherbevieille" ] +TileDirectories += [ "5-jungleterreaux" ] +TileDirectories += [ "6-junglegoo" ] +TileDirectories += [ "7-sciurejungle" ] +TileDirectories += [ "8-terrejungle" ] +TileDirectories += [ "9-falaisejungle" ] +TileDirectories += [ "Transitions" ] +generateEcosystem("jungle", "jungle") + + +# PRIMES RACINES +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +MapSubdirectories += [ "batiments" ] +TileDirectories = [ ] +TileDirectories += [ "PR-creux" ] +TileDirectories += [ "PR-dome-moussu" ] +TileDirectories += [ "PR-kitiniere" ] +TileDirectories += [ "PR-mousse-licken" ] +TileDirectories += [ "PR-mousse-spongieus" ] +TileDirectories += [ "PR-parois" ] +TileDirectories += [ "PR-sol-mousse" ] +TileDirectories += [ "PR-souche" ] +TileDirectories += [ "PR-stalagmite" ] +TileDirectories += [ "PR-terre" ] +TileDirectories += [ "aditif" ] +generateEcosystem("primes_racines", "primes_racines") + + +# LACUSTRE +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = "0" +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = "8" +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "1a-sable-marin" ] +TileDirectories += [ "1-plages" ] +TileDirectories += [ "2-iles" ] +TileDirectories += [ "2-ilesa" ] +TileDirectories += [ "2-iles-marines" ] +TileDirectories += [ "3-fondmarin2plage" ] +TileDirectories += [ "4-marecages" ] +TileDirectories += [ "5-marecages" ] +TileDirectories += [ "5-parois-marine" ] +TileDirectories += [ "6-fond_marin" ] +TileDirectories += [ "7-bassesiles" ] +TileDirectories += [ "7-mousseter" ] +TileDirectories += [ "7-racines" ] +TileDirectories += [ "8-mousse_marine" ] +TileDirectories += [ "constructible" ] +generateEcosystem("lacustre", "tryker") + + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py new file mode 100644 index 000000000..d6d65d689 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_simple_max_exporters.log"): + os.remove("generate_simple_max_exporters.log") +log = open("generate_simple_max_exporters.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate simple max exporters") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +def processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", dateTimeStamp) + newline = newline.replace("%PreGenProcessName%", processName) + newline = newline.replace("%PreGenFileExtension%", fileExtension) + newline = newline.replace("%PreGenSourceDirectoriesVariable%", sourceDirectoriesVariable) + newline = newline.replace("%PreGenExportDirectoryVariable%", exportDirectoryVariable) + newline = newline.replace("%PreGenClientDirectoryVariable%", clientDirectoryVariable) + return newline + +def generateSimpleMaxExporterFile(sourceFile, destFile, writeMode, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + srcf = open(sourceFile, "r") + dstf = open(destFile, writeMode) + printLog(log, "WRITE " + destFile + " " + writeMode) + for line in srcf: + dstf.write(processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp)) + dstf.close() + srcf.close() + +def generateSimpleMaxExporter(processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + maxscriptDir = processDir + "/maxscript" + mkPath(log, maxscriptDir) + templateDir = os.getcwd().replace("\\", "/") + "/simple_max_exporter_template" + mkPath(log, templateDir) + scriptDir = os.getcwd().replace("\\", "/") + "/max_exporter_scripts" + mkPath(log, scriptDir) + + if not os.path.isfile(processDir + "/0_setup.py"): + generateSimpleMaxExporterFile(templateDir + "/0_setup.py", processDir + "/0_setup.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateSimpleMaxExporterFile(templateDir + "/1_export_header.py", processDir + "/1_export.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(scriptDir + "/" + fileExtension + ".py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(templateDir + "/1_export_footer.py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + if not os.path.isfile(processDir + "/2_build.py"): + generateSimpleMaxExporterFile(templateDir + "/2_build.py", processDir + "/2_build.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + if not os.path.isfile(processDir + "/3_install.py"): + generateSimpleMaxExporterFile(templateDir + "/3_install.py", processDir + "/3_install.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateSimpleMaxExporterFile(templateDir + "/export_header.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(scriptDir + "/" + fileExtension + ".ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(templateDir + "/export_footer.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + + +generateSimpleMaxExporter("pacs_prim", "pacs_prim", "PacsPrimSourceDirectories", "PacsPrimExportDirectory", "PacsPrimClientDirectory") + +generateSimpleMaxExporter("anim", "anim", "AnimSourceDirectories", "AnimExportDirectory", "AnimClientDirectory") + +generateSimpleMaxExporter("skel", "skel", "SkelSourceDirectories", "SkelExportDirectory", "SkelClientDirectory") + +generateSimpleMaxExporter("swt", "swt", "SwtSourceDirectories", "SwtExportDirectory", "SwtClientDirectory") + +generateSimpleMaxExporter("zone", "zone", "ZoneSourceDirectory", "ZoneExportDirectory", "ZoneClientDirectory") + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py new file mode 100644 index 000000000..d7a62a478 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py @@ -0,0 +1,114 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_tagged_max_exporters.log"): + os.remove("generate_tagged_max_exporters.log") +log = open("generate_tagged_max_exporters.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate tagged max exporters") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +templateDir = os.getcwd().replace("\\", "/") + "/tagged_max_exporter_template" +mkPath(log, templateDir) +scriptDir = os.getcwd().replace("\\", "/") + "/max_exporter_scripts" +mkPath(log, scriptDir) + +def processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", dateTimeStamp) + newline = newline.replace("%PreGenProcessName%", processName) + newline = newline.replace("%PreGenFileExtension%", fileExtension) + newline = newline.replace("%PreGenSourceDirectoriesVariable%", sourceDirectoriesVariable) + newline = newline.replace("%PreGenExportDirectoryVariable%", exportDirectoryVariable) + newline = newline.replace("%PreGenTagExportDirectoryVariable%", tagExportDirectoryVariable) + newline = newline.replace("%PreGenClientDirectoryVariable%", clientDirectoryVariable) + return newline + +def generateTaggedMaxExporterFile(sourceFile, destFile, writeMode, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + srcf = open(sourceFile, "r") + dstf = open(destFile, writeMode) + printLog(log, "WRITE " + destFile + " " + writeMode) + for line in srcf: + dstf.write(processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp)) + dstf.close() + srcf.close() + +def generateTaggedMaxScriptFile(processDir, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + maxscriptDir = processDir + "/maxscript" + mkPath(log, maxscriptDir) + generateTaggedMaxExporterFile(templateDir + "/export_header.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(scriptDir + "/" + fileExtension + ".ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(templateDir + "/export_footer.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + +def generateTaggedMaxScript(processName, fileExtension): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + + generateTaggedMaxScriptFile(processDir, processName, fileExtension, "_invalid", "_invalid", "_invalid", "_invalid", dateTimeStamp) + +def generateTaggedMaxExporter(processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + + if not os.path.isfile(processDir + "/0_setup.py"): + generateTaggedMaxExporterFile(templateDir + "/0_setup.py", processDir + "/0_setup.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateTaggedMaxExporterFile(templateDir + "/1_export_header.py", processDir + "/1_export.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(scriptDir + "/" + fileExtension + ".py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(templateDir + "/1_export_footer.py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + if not os.path.isfile(processDir + "/2_build.py"): + generateTaggedMaxExporterFile(templateDir + "/2_build.py", processDir + "/2_build.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + if not os.path.isfile(processDir + "/3_install.py"): + generateTaggedMaxExporterFile(templateDir + "/3_install.py", processDir + "/3_install.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateTaggedMaxScriptFile(processDir, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + + +generateTaggedMaxExporter("clodbank", "clod", "ClodSourceDirectories", "ClodExportDirectory", "ClodTagExportDirectory", "ClodClientDirectory") + +generateTaggedMaxScript("ig", "ig") + +generateTaggedMaxExporter("rbank", "cmb", "RBankCmbSourceDirectories", "RBankCmbExportDirectory", "RBankCmbTagExportDirectory", "PacsClientDirectory") + +generateTaggedMaxExporter("veget", "veget", "VegetSourceDirectories", "VegetExportDirectory", "VegetTagExportDirectory", "VegetClientDirectory") + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms new file mode 100644 index 000000000..c189e71f8 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms @@ -0,0 +1,69 @@ + + +NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + select $Bip01 + + -- Always uncheck triangle pelvis + if (classof $Bip01) == Biped_Object then + ( + $Bip01.controller.figureMode = true + $Bip01.controller.trianglepelvis = false + $Bip01.controller.figureMode = false + ) + ) + + -- For each node + for node in objects do + ( + exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION + if (exportNodeAnmation != undefined) then + ( + if (exportNodeAnmation == "1") then + ( + selectmore node + + -- Is it a biped ? + if (classof node.controller) == Vertical_Horizontal_Turn then + ( + -- Always uncheck triangle pelvis + node.controller.trianglepelvis = false + ) + ) + ) + ) + + if ((selection as array).count != 0) then + ( + -- Export the animation + if (NelExportAnimation (selection as array) outputNelFile false) == false then + ( + nlerror("ERROR exporting animation " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting animation: no node animated to export in file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms new file mode 100644 index 000000000..29744c7d1 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms @@ -0,0 +1,123 @@ + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me +NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + + +-- Must export this node ? +fn isToBeExported node = +( + if ((classof node) == RklPatch) then + return false + + if ((classof node) == nel_ps) then + return false + + if ((classof node) == nel_pacs_cylinder) then + return false + + if ((classof node) == nel_pacs_box) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + return true +) + + +-- is this node flagged as a LodCharacter ?? +fn isLodCharacter node = +( + isCLod = getappdata node NEL3D_APPDATA_CHARACTER_LOD + if (isCLod == undefined) then + return false + if (isCLod == "1") then + return true + return false +) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Is a Lod character? + if ((isLodCharacter node) == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".clod") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the shape + if (NelExportLodCharacter node outputNelFile false) == true then + ( + nlerror("OK " + outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if (exported == 0) then + ( + -- Error + nlerror ("WARNING no .clod exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms new file mode 100644 index 000000000..2a7492c29 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms @@ -0,0 +1,59 @@ + + +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 + + +-- Must export this node ? +fn isToBeExported node = +( + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + return false +) + +fn runNelMaxExport inputMaxFile = +( + outputNelDir = "%OutputDirectory%" + + -- Tag this file ? + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Select all collision mesh + max select none + for m in geometry do + ( + if (isToBeExported m) == true then + selectmore m + ) + + -- Export the collision + if (NelExportCollision ($selection as array) outputNelDir) == false then + ( + nlerror("ERROR exporting collision " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK collision in folder " + outputNelDir) + ) + + return tagThisFile +) + + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms new file mode 100644 index 000000000..7c9563088 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms @@ -0,0 +1,172 @@ + + +-- Some globals + +NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized + -- "0" = is not an accelerator and IS NOT clusterized (always visible) + -- "1" = is an accelerator type PORTAL + -- "2" = is an accelerator type CLUSTER + -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE + -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER + -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER + -- "17" = is an accelerator type PORTAL DYNAMIC + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 +NEL3D_APPDATA_LOD = 1423062537 +NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD +NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 +NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX +NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 +NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 + +NEL_OBJECT_NAME_DATA = 1970 + + +-- This node is n accelerator ? +fn isAccelerator node = +( + accel = getappdata node NEL3D_APPDATA_ACCEL + if (accel != undefined) then + ( + if (accel == "0") or (accel == "32") then + return false + else + return true + ) + return false +) + +-- Get the ig name of this object +fn getIg node = +( + return (getappdata node NEL3D_APPDATA_IGNAME) +) + + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Ig array + ig_array = #() + + -- Scan all the ig in this project + for node in objects do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") ) then + ( + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + exit + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + -- Have some ig ? + if (ig_array.count != 0) then + ( + -- For each ig + for ig = 1 to ig_array.count do + ( + -- Output filename + outputNelFile = ("%OutputDirectory%/" + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Select none + max select none + + -- Select all node in this ig + for node in geometry do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in lights do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in helpers do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + + -- Check export + try + ( + -- Export the ig + instancegroup2export = $selection as array + if (NelExportInstanceGroup instancegroup2export outputNelFile) == true then + ( + nlerror("OK " + outputNelFile) + ) + else + ( + -- Error + nlerror("ERROR exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + nlerror("SKIPPED " + outputNelFile) + ) + ) + ) + else + ( + -- Error + nlerror("WARNING nothing exported from ig max file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms new file mode 100644 index 000000000..93e94de19 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms @@ -0,0 +1,47 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Select all PACS primitives + for i in geometry do + ( + if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then + selectmore i + ) + + -- Array of node + arrayNode = selection as array + + -- Something to export ? + if (arrayNode.count != 0) then + ( + -- Export the collision + if (NelExportPACSPrimitives arrayNode outputNelFile) == false then + ( + nlerror("ERROR exporting PACS primitives in file " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + ) + else + ( + nlerror("WARNING no PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py new file mode 100644 index 000000000..b1c3e5966 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py @@ -0,0 +1,16 @@ + + +printLog(log, ">>> List %PreGenFileExtension% <<<") +outDirPacsPrim = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, outDirPacsPrim) +listPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + "/landscape_col_prim_pacs_list.txt" +if os.path.isfile(listPath): + os.remove(listPath) +if WantLandscapeColPrimPacsList: + exportedPacsPrims = findFiles(log, outDirPacsPrim, "", ".%PreGenFileExtension%") + printLog(log, "WRITE " + listPath) + listFile = open(listPath, "w") + for exported in exportedPacsPrims: + listFile.write(exported + "\n") + listFile.close() + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms new file mode 100644 index 000000000..b86e10c75 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms @@ -0,0 +1,53 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + -- Select Bip01 + select $Bip01 + + if ($ != undefined) then + ( + -- Set figure mode on + if ((classof $) == Biped_Object) then + ( + $.controller.figureMode = true + ) + + -- Export the skeleton template + if (NelExportSkeleton $ outputNelFile) == false then + ( + nlerror("ERROR exporting skeleton " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py new file mode 100644 index 000000000..884e11db3 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py @@ -0,0 +1,8 @@ + + +printLog(log, ">>> Export skel directly <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + SkelExportDirectory, ".skel") + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms new file mode 100644 index 000000000..d6330b611 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms @@ -0,0 +1,28 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select all the nodes + max select all + + -- Export the skeleton template + if NelExportSkeletonWeight ($selection as array) outputNelFile == false then + ( + nlerror("ERROR exporting skeleton weight " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms new file mode 100644 index 000000000..f0d5cd584 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms @@ -0,0 +1,113 @@ + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable + -- "0" = not vegetable + -- "1" = vegetable + + +-- Must export this node ? +fn isToBeExported node = +( + if (classof node == nel_ps) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + vegetable = getappdata node NEL3D_APPDATA_VEGETABLE + if (vegetable != undefined) then + if (vegetable == "1") then + return true + + -- Do not export + return false +) + + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".veget") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the veget + if (NelExportVegetable node outputNelFile false) == true then + ( + nlerror("OK "+outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fata error exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror("WARNING no veget exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms new file mode 100644 index 000000000..d4ecbe275 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms @@ -0,0 +1,86 @@ + + +-- Find id +Fn findID node = +( + local + + -- Const + alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + NameTab = filterString node.name "_" + Z_ID = -1 + alpha_letter1 = NameTab[2][1] + alpha_letter2 = NameTab[2][2] + alpha_letter1_value = findstring alphabet alpha_letter1 + alpha_letter2_value = findstring alphabet alpha_letter2 + + -- Decompose theh name in an array array[1]=numeric string value array[2]=alpha string value + -- The index of the engine start at 0 but the script one at 1 so we sub 1 each time + alpha_sub_id = (((alpha_letter1_value as integer - 1) * 26 + (alpha_letter2_value as integer)))-1 + num_sub_id = (NameTab[1] as integer)-1 + + -- Array of 256 per 256 + --------------------------- + -- 0 1 2 3 ... 255 + -- 256 257 258 259 ... 511 + -- 512 513 514 515 ... 767 + -- ... + + Z_ID = num_sub_id*256 + alpha_sub_id + return Z_ID +) + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Found it ? + find = false + + -- For each object in the priject + for i in geometry do + ( + -- Look for a NeL patch mesh + if (classof i) == RklPatch then + ( + -- Error catching + try + ( + if (ExportRykolZone i outputNelFile (findID i)) == false then + ( + nlerror("ERROR exporting zone " + i.name + " in file " + inputMaxFile) + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + find = true + exit + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting zone " + i.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + ) + + -- Not found ? + if (find == false) then + ( + -- Error + nlerror("WARNING no zone found in project " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py new file mode 100644 index 000000000..d6e821879 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py @@ -0,0 +1,8 @@ + + +printLog(log, ">>> Try to copy ligo zone if any <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +printLog(log, "") + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py new file mode 100644 index 000000000..a2c6ef2b2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + %PreGenClientDirectoryVariable%) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py new file mode 100644 index 000000000..f4d6f4950 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py @@ -0,0 +1,7 @@ + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py new file mode 100644 index 000000000..5b79ed18e --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file 1_export.py +# \brief Export %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +# ... + +# Export %PreGenProcessName% 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export %PreGenProcessName% 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%, ".%PreGenFileExtension%")): + scriptSrc = "maxscript/%PreGenFileExtension%_export.ms" + scriptDst = MaxUserDirectory + "/scripts/%PreGenFileExtension%_export.ms" + outputLogfile = ScriptDirectory + "/processes/%PreGenProcessName%/log.log" + outputDirectory = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".%PreGenFileExtension%") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "%PreGenFileExtension%_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".%PreGenFileExtension%") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .%PreGenFileExtension% files!") + os.remove(scriptDst) + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py new file mode 100644 index 000000000..6278c85cd --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py new file mode 100644 index 000000000..c9486b77f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install %PreGenProcessName% <<<") +exportPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, exportPath) +clientPath = ClientDataDirectory + "/" + %PreGenClientDirectoryVariable% +mkPath(log, clientPath) +copyFilesExtNoSubdirIfNeeded(log, exportPath, clientPath, ".%PreGenFileExtension%") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms new file mode 100644 index 000000000..2c6e99bd3 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms @@ -0,0 +1,74 @@ + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting '%PreGenFileExtension%' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms new file mode 100644 index 000000000..2d5e5434f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms @@ -0,0 +1,63 @@ + + +-- ################################################################# +-- ## %PreGenWarning% +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py new file mode 100644 index 000000000..d572c1f43 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) +mkPath(log, ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + %PreGenClientDirectoryVariable%) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py new file mode 100644 index 000000000..f4d6f4950 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py @@ -0,0 +1,7 @@ + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py new file mode 100644 index 000000000..e48b44648 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file 1_export.py +# \brief Export %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +# Find tools +# ... + +# Export %PreGenProcessName% 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export %PreGenProcessName% 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + mkPath(log, ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%) + for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%, ".max.tag")): + scriptSrc = "maxscript/%PreGenFileExtension%_export.ms" + scriptDst = MaxUserDirectory + "/scripts/%PreGenFileExtension%_export.ms" + outputLogfile = ScriptDirectory + "/processes/%PreGenProcessName%/log.log" + outputDirectory = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + tagDirectory = ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable% + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "%PreGenFileExtension%_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py new file mode 100644 index 000000000..6278c85cd --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py new file mode 100644 index 000000000..f3dde5aa2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install %PreGenProcessName% <<<") +exportPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, exportPath) +clientPath = ClientDataDirectory + "/" + %PreGenClientDirectoryVariable% +mkPath(log, clientPath) +copyFilesNoTreeIfNeeded(log, exportPath, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms new file mode 100644 index 000000000..42f9a51fa --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms @@ -0,0 +1,89 @@ + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting '%PreGenFileExtension%' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms new file mode 100644 index 000000000..2d5e5434f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms @@ -0,0 +1,63 @@ + + +-- ################################################################# +-- ## %PreGenWarning% +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py index 5ab68c730..0958d9643 100644 --- a/code/nel/tools/build_gamedata/processes/anim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export anim -# \date 2009-03-10 13:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export anim @@ -44,46 +48,51 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each anim directory -printLog(log, ">>> Export anim 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) -for dir in AnimSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, AnimSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + AnimExportDirectory, ".anim")): - scriptSrc = "maxscript/anim_export.ms" - scriptDst = MaxUserDirectory + "/scripts/anim_export.ms" - logFile = ScriptDirectory + "/processes/anim/log.log" - outDirAnim = ExportBuildDirectory + "/" + AnimExportDirectory - animSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirAnim, "", ".anim") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export anim 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export anim 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) + for dir in AnimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + AnimExportDirectory, ".anim")): + scriptSrc = "maxscript/anim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/anim_export.ms" + outputLogfile = ScriptDirectory + "/processes/anim/log.log" + outputDirectory = ExportBuildDirectory + "/" + AnimExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".anim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "anim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".anim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .anim files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("anim_source_directory", animSourceDir) - newline = newline.replace("output_directory", outDirAnim) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "anim_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirAnim, "", ".anim") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .anim files!") - os.remove(scriptDst) + + printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms index ce7c83405..05878c1cd 100644 --- a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms +++ b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms @@ -1,10 +1,14 @@ -NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -57,129 +61,146 @@ fn nlerror message = print message ) + + +NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".anim") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + select $Bip01 + + -- Always uncheck triangle pelvis + if (classof $Bip01) == Biped_Object then + ( + $Bip01.controller.figureMode = true + $Bip01.controller.trianglepelvis = false + $Bip01.controller.figureMode = false + ) + ) + + -- For each node + for node in objects do + ( + exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION + if (exportNodeAnmation != undefined) then + ( + if (exportNodeAnmation == "1") then + ( + selectmore node + + -- Is it a biped ? + if (classof node.controller) == Vertical_Horizontal_Turn then + ( + -- Always uncheck triangle pelvis + node.controller.trianglepelvis = false + ) + ) + ) + ) + + if ((selection as array).count != 0) then + ( + -- Export the animation + if (NelExportAnimation (selection as array) outputNelFile false) == false then + ( + nlerror("ERROR exporting animation " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting animation: no node animated to export in file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the anim_source_directory - files = getFiles "anim_source_directory/*.max" - gc () - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - gc () - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( - nlerror ("Scanning file "+files[i]+" ...") - + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".anim") + try ( - -- Output file - output = ("output_directory/"+(getFilenameFile files[i])+".anim") - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () + gc() heapfree - + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select Bip01, not very smart - if $Bip01 != undefined then - ( - select $Bip01 - - -- Always uncheck triangle pelvis - if (classof $Bip01) == Biped_Object then - ( - $Bip01.controller.figureMode = true - $Bip01.controller.trianglepelvis = false - $Bip01.controller.figureMode = false - ) - ) - - -- For each node - for node in objects do - ( - exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION - if (exportNodeAnmation != undefined) then - ( - if (exportNodeAnmation == "1") then - ( - selectmore node - - -- Is it a biped ? - if (classof node.controller) == Vertical_Horizontal_Turn then - ( - -- Always uncheck triangle pelvis - node.controller.trianglepelvis = false - ) - ) - ) - ) - - if ((selection as array).count != 0) then - ( - -- Export the animation - if (NelExportAnimation (selection as array) output false) == false then - ( - nlerror ("ERROR exporting animation "+files[i]) - ) - else - ( - nlerror ("OK "+output) - ) - ) - else - ( - -- Error - nlerror ("ERROR exporting animation: no node animated to export in file "+files[i]) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting animation: can't open the file "+files[i]) + nlerror("ERROR exporting 'anim': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting animation in files " + files[i]) + nlerror("ERROR error exporting 'anim' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no animation file in folder anim_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting animation in folder anim_source_directory") + nlerror("ERROR fatal error exporting 'anim' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py index d4da536fb..92ba0a1b9 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export clodbank -# \date 2009-03-10 13:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export clodbank @@ -43,50 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each clodbank directory -printLog(log, ">>> Export clodbank 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) -mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) -for dir in ClodSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, ClodSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ClodTagExportDirectory, ".tag")): - scriptSrc = "maxscript/clod_export.ms" - scriptDst = MaxUserDirectory + "/scripts/clod_export.ms" - logFile = ScriptDirectory + "/processes/clodbank/log.log" - outDirClod = ExportBuildDirectory + "/" + ClodExportDirectory - outDirTag = ExportBuildDirectory + "/" + ClodTagExportDirectory - maxSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirTag, "", ".tag") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export clodbank 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export clodbank 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) + for dir in ClodSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ClodTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/clod_export.ms" + scriptDst = MaxUserDirectory + "/scripts/clod_export.ms" + outputLogfile = ScriptDirectory + "/processes/clodbank/log.log" + outputDirectory = ExportBuildDirectory + "/" + ClodExportDirectory + tagDirectory = ExportBuildDirectory + "/" + ClodTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "clod_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("shape_source_directory", maxSourceDir) - newline = newline.replace("output_directory_clod", outDirClod) - newline = newline.replace("output_directory_tag", outDirTag) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "clod_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirTag, "", ".tag") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .max files!") - os.remove(scriptDst) + + printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms index 17c7aeb9c..0c0d78fe0 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -1,15 +1,14 @@ --- Some globals -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -62,21 +61,31 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me +NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + + -- Must export this node ? -fn isToBeExported node = +fn isToBeExported node = ( if ((classof node) == RklPatch) then return false - + if ((classof node) == nel_ps) then return false - + if ((classof node) == nel_pacs_cylinder) then return false - + if ((classof node) == nel_pacs_box) then return false - + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT if (doNotExport != undefined) then ( @@ -86,8 +95,9 @@ fn isToBeExported node = return true ) + -- is this node flagged as a LodCharacter ?? -fn isLodCharacter node = +fn isLodCharacter node = ( isCLod = getappdata node NEL3D_APPDATA_CHARACTER_LOD if (isCLod == undefined) then @@ -97,173 +107,169 @@ fn isLodCharacter node = return false ) -fn goClodExport = +fn runNelMaxExport inputMaxFile = ( - try + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do ( - -- Get files in the shape_source_directory - files = getFiles "shape_source_directory/*.max" - - -- Sort files - sort files - - -- No file ? - if files.count != 0 then + -- It is root ? + if (node.parent == undefined) then ( - -- For each files - for i = 1 to files.count do + -- Can be exported ? + if (isToBeExported node == true) then ( - try + -- Is a Lod character? + if ((isLodCharacter node) == true) then ( - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".clod") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( - -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + try ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- For each node - for node in geometry do + -- Export the shape + if (NelExportLodCharacter node outputNelFile false) == true then ( - -- It is root ? - if (node.parent == undefined) then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Is a Lod character? - if ((isLodCharacter node) == true) then - ( - -- Output directory - output = ("output_directory_clod/"+(node.name)+".clod") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the shape - if (NelExportLodCharacter node output false) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting .clod "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting .clod "+node.name+" in file "+files[i]) - tagThisFile = false - return 0 - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) + nlerror("OK " + outputNelFile) + exported = exported+1 ) - - -- Something exported - if (exported == 0) then + else ( -- Error - nlerror ("WARNING no .clod exported from the file "+files[i]) - ) - - -- Write a tag file - if tagThisFile == true then - ( - tagFile = createFile tag - if tagFile == undefined then - ( - nlerror ("WARNING can't create tag file "+tag) - ) - else - ( - print "toto" to: tagFile - close tagFile - ) + nlerror("ERROR exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) - else + catch ( -- Error - nlerror ("ERROR exporting .clod: can't open the file "+files[i]) + nlerror("ERROR fatal error exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) else ( -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 ) - - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting .clod in file " + files[i]) - -- break ) ) ) - else - ( - nlerror ("WARNING no max file in folder shape_source_directory") - ) ) - catch + + -- Something exported + if (exported == 0) then ( -- Error - nlerror ("ERROR fatal error exporting .clod in folder shape_source_directory") - return 0 + nlerror ("WARNING no .clod exported from the file " + inputMaxFile) ) + + return tagThisFile ) -goClodExport() -nlerror ("BYE") +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting 'clod': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'clod' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'clod' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/ig/1_export.py b/code/nel/tools/build_gamedata/processes/ig/1_export.py index c8eb2d363..06fe7050d 100644 --- a/code/nel/tools/build_gamedata/processes/ig/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ig/1_export.py @@ -46,15 +46,15 @@ printLog(log, "") Max = "" #find later -def igExport(all_source_base, all_source_dir, sourceDir, targetDir): +def igExport(sourceDir, targetDir): scriptSrc = "maxscript/ig_export.ms" scriptDst = MaxUserDirectory + "/scripts/ig_export.ms" - logFile = ScriptDirectory + "/processes/ig/log.log" - outDirTag = ExportBuildDirectory + "/" + IgStaticTagExportDirectory - outDirIg = ExportBuildDirectory + "/" + targetDir - igSourceDir = DatabaseDirectory + "/" + sourceDir - if (needUpdateDirNoSubdirLogExtMultidir(log, all_source_base, all_source_dir, igSourceDir, ".max", outDirTag, ".max.tag")): - tagList = findFiles(log, outDirTag, "", ".tag") + outputLogfile = ScriptDirectory + "/processes/ig/log.log" + tagDirectory = ExportBuildDirectory + "/" + IgStaticTagExportDirectory + outputDirectory = ExportBuildDirectory + "/" + targetDir + maxSourceDir = DatabaseDirectory + "/" + sourceDir + if (needUpdateDirByTagLog(log, maxSourceDir, ".max", tagDirectory, ".max.tag")): + tagList = findFiles(log, tagDirectory, "", ".tag") tagLen = len(tagList) if os.path.isfile(scriptDst): os.remove(scriptDst) @@ -62,17 +62,17 @@ def igExport(all_source_base, all_source_dir, sourceDir, targetDir): sSrc = open(scriptSrc, "r") sDst = open(scriptDst, "w") for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("ig_source_directory", igSourceDir) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("output_directory_ig", outDirIg) + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) sDst.write(newline) sSrc.close() sDst.close() while tagDiff > 0: printLog(log, "MAXSCRIPT " + scriptDst) subprocess.call([ Max, "-U", "MAXScript", "ig_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirTag, "", ".tag") + tagList = findFiles(log, tagDirectory, "", ".tag") newTagLen = len(tagList) tagDiff = newTagLen - tagLen tagLen = newTagLen @@ -94,14 +94,14 @@ if MaxAvailable: mkPath(log, ExportBuildDirectory + "/" + IgStaticLandExportDirectory) for dir in IgLandSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) - igExport(DatabaseDirectory, IgLandSourceDirectories, dir, IgStaticLandExportDirectory) + igExport(dir, IgStaticLandExportDirectory) # Export ig other 3dsmax printLog(log, ">>> Export ig other 3dsmax <<<") mkPath(log, ExportBuildDirectory + "/" + IgStaticOtherExportDirectory) for dir in IgOtherSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) - igExport(DatabaseDirectory, IgOtherSourceDirectories, dir, IgStaticOtherExportDirectory) + igExport(dir, IgStaticOtherExportDirectory) printLog(log, "") diff --git a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms index de1853994..d7be706a8 100644 --- a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms +++ b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms @@ -1,34 +1,14 @@ --- Some globals -NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized - -- "0" = is not an accelerator and IS NOT clusterized (always visible) - -- "1" = is an accelerator type PORTAL - -- "2" = is an accelerator type CLUSTER - -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE - -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER - -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER - -- "17" = is an accelerator type PORTAL DYNAMIC - -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 -NEL3D_APPDATA_LOD = 1423062537 -NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD -NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 -NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX -NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 -NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 - -NEL_OBJECT_NAME_DATA = 1970 -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -81,6 +61,36 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized + -- "0" = is not an accelerator and IS NOT clusterized (always visible) + -- "1" = is an accelerator type PORTAL + -- "2" = is an accelerator type CLUSTER + -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE + -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER + -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER + -- "17" = is an accelerator type PORTAL DYNAMIC + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 +NEL3D_APPDATA_LOD = 1423062537 +NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD +NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 +NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX +NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 +NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 + +NEL_OBJECT_NAME_DATA = 1970 + + -- This node is n accelerator ? fn isAccelerator node = ( @@ -101,204 +111,214 @@ fn getIg node = return (getappdata node NEL3D_APPDATA_IGNAME) ) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Ig array + ig_array = #() + + -- Scan all the ig in this project + for node in objects do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") ) then + ( + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + exit + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + -- Have some ig ? + if (ig_array.count != 0) then + ( + -- For each ig + for ig = 1 to ig_array.count do + ( + -- Output filename + outputNelFile = ("%OutputDirectory%/" + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Select none + max select none + + -- Select all node in this ig + for node in geometry do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in lights do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in helpers do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + + -- Check export + try + ( + -- Export the ig + instancegroup2export = $selection as array + if (NelExportInstanceGroup instancegroup2export outputNelFile) == true then + ( + nlerror("OK " + outputNelFile) + ) + else + ( + -- Error + nlerror("ERROR exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + nlerror("SKIPPED " + outputNelFile) + ) + ) + ) + else + ( + -- Error + nlerror("WARNING nothing exported from ig max file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the ig_source_directory - files = getFiles "ig_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + try ( - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (mergeMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- Ig array - ig_array = #() - - -- Scan all the ig in this project - for node in objects do - ( - ig = getIg node - if ( (ig != undefined) and (ig != "") ) then - ( - -- Found ? - found = false - - -- Already found ? - for j = 1 to ig_array.count do - ( - if (ig_array[j]==ig) then - ( - found = true - exit - ) - ) - - -- Found ? - if (found == false) then - ( - append ig_array ig - ) - ) - ) - - -- Have some ig ? - if (ig_array.count != 0) then - ( - -- For each ig - for ig = 1 to ig_array.count do - ( - -- Output filename - output = ("output_directory_ig/"+ig_array[ig]+".ig") - - -- Check date - if (NeLTestFileDate output files[i]) == true then - ( - -- Select none - max select none - - -- Select all node in this ig - for node in geometry do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - -- Select all lights in this ig - for node in lights do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - -- Select all lights in this ig - for node in helpers do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - - -- Check export - try - ( - -- Export the ig - instancegroup2export = $selection as array - if (NelExportInstanceGroup instancegroup2export output) == true then - ( - nlerror ("OK "+output) - ) - else - ( - -- Error - nlerror ("ERROR exporting ig "+ig_array[ig]+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting ig "+ig_array[ig]+" in file "+files[i]) - tagThisFile = false - ) - ) - else - ( - nlerror ("SKIPPED "+output) - ) - ) - ) - else - ( - -- Error - nlerror ("WARNING nothing exported from ig max file "+files[i]) - ) - + tagThisFile = runNelMaxExport(inputMaxFile) + -- Write a tag file if tagThisFile == true then ( - tagFile = createFile tag + tagFile = createFile outputTagFile if tagFile == undefined then ( - nlerror ("WARNING can't create tag file "+tag) + nlerror("WARNING can't create tag file " + outputTagFile) ) else ( - print "toto" to: tagFile + print "mukyu" to: tagFile close tagFile ) ) - - resetMAXFile #noprompt ) else ( -- Error - nlerror ("ERROR exporting ig: can't open the file "+files[i]) + nlerror("ERROR exporting 'ig': can't open the file " + inputMaxFile) ) ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) - ) + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) ) catch ( -- Error - nlerror ("ERROR error exporting ig in files " + files[i]) + nlerror("ERROR error exporting 'ig' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no max file in folder ig_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting ig in folder ig_source_directory") + nlerror("ERROR fatal error exporting 'ig' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py index 344f88422..269effd25 100644 --- a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py @@ -47,7 +47,7 @@ printLog(log, "") printLog(log, ">>> Setup source directories <<<") mkPath(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory) mkPath(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory) -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) # Setup export directories printLog(log, ">>> Setup export directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index ea111fa2a..dbf28109d 100644 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -60,15 +60,15 @@ if LigoExportLand == "" or LigoExportOnePass == 1: mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory) mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory) mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) - mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) - if (needUpdateDirNoSubdirLogExt(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoTagExportDirectory, ".max.tag")): + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoTagExportDirectory, ".max.tag")): printLog(log, "WRITE " + ligoIniPath) ligoIni = open(ligoIniPath, "w") ligoIni.write("[LigoConfig]\n") ligoIni.write("LigoPath=" + DatabaseDirectory + "/" + LigoMaxSourceDirectory + "/\n") ligoIni.write("LigoExportPath=" + DatabaseDirectory + "/" + LigoDatabaseExportDirectory + "/\n") - ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory + "/\n") + ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory[0] + "/\n") ligoIni.close() outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py index 819f6700d..d28e30670 100644 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export pacs_prim -# \date 2010-08-31 16:50GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export pacs_prim @@ -44,43 +48,49 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each pacs_prim directory -printLog(log, ">>> Export pacs_prim 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) -for dir in PacsPrimSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, PacsPrimSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimExportDirectory, ".pacs_prim")): - scriptSrc = "maxscript/pacs_prim_export.ms" - scriptDst = MaxUserDirectory + "/scripts/pacs_prim_export.ms" - logFile = ScriptDirectory + "/processes/pacs_prim/log.log" - outDirPacsPrim = ExportBuildDirectory + "/" + PacsPrimExportDirectory - pacs_primSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirPacsPrim, "", ".pacs_prim") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export pacs_prim 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export pacs_prim 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) + for dir in PacsPrimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimExportDirectory, ".pacs_prim")): + scriptSrc = "maxscript/pacs_prim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/pacs_prim_export.ms" + outputLogfile = ScriptDirectory + "/processes/pacs_prim/log.log" + outputDirectory = ExportBuildDirectory + "/" + PacsPrimExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".pacs_prim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "pacs_prim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".pacs_prim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .pacs_prim files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("pacs_prim_source_directory", pacs_primSourceDir) - newline = newline.replace("output_directory", outDirPacsPrim) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "pacs_prim_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirPacsPrim, "", ".pacs_prim") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .pacs_prim files!") - os.remove(scriptDst) + + printLog(log, ">>> List pacs_prim <<<") outDirPacsPrim = ExportBuildDirectory + "/" + PacsPrimExportDirectory @@ -96,8 +106,9 @@ if WantLandscapeColPrimPacsList: listFile.write(exported + "\n") listFile.close() -printLog(log, "") + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms index 0c8e5b8e0..21bdcdd4c 100644 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms @@ -1,8 +1,14 @@ + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -55,107 +61,124 @@ fn nlerror message = print message ) + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".pacs_prim") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Select all PACS primitives + for i in geometry do + ( + if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then + selectmore i + ) + + -- Array of node + arrayNode = selection as array + + -- Something to export ? + if (arrayNode.count != 0) then + ( + -- Export the collision + if (NelExportPACSPrimitives arrayNode outputNelFile) == false then + ( + nlerror("ERROR exporting PACS primitives in file " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + ) + else + ( + nlerror("WARNING no PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + + + try ( - -- Get files in the "pacs_prim_source_directory" directory - files = getFiles "pacs_prim_source_directory/*.max" - gc () - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - gc () - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".pacs_prim") + try ( - -- Output file - output = "output_directory/" + (getFilenameFile files[i]) + ".pacs_prim" - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () + gc() heapfree - + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select none - max select none - - -- Select all PACS primitives - for i in geometry do - ( - if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then - selectmore i - ) - - -- Array of node - arrayNode = selection as array - - -- Something to export ? - if (arrayNode.count != 0) then - ( - -- Export the collision - if (NelExportPACSPrimitives arrayNode output) == false then - ( - nlerror ("ERROR exporting PACS primitives in file "+files[i]) - ) - else - ( - nlerror ("OK PACS primitives in file "+files[i]) - ) - ) - else - ( - nlerror ("WARNING no PACS primitives in file "+files[i]) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting collision: can't open the file "+files[i]) + nlerror("ERROR exporting 'pacs_prim': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting collision in files " + files[i]) + nlerror("ERROR error exporting 'pacs_prim' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no collision file in folder pacs_prim_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting collision in folder pacs_prim_source_directory") + nlerror("ERROR fatal error exporting 'pacs_prim' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py index e2accccf3..555f921f3 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py @@ -45,10 +45,14 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") +for dir in RBankCmbSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) mkPath(log, LeveldesignWorldDirectory) # Setup export directories printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + RBankCmbTagExportDirectory) mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) # Setup build directories diff --git a/code/nel/tools/build_gamedata/processes/rbank/1_export.py b/code/nel/tools/build_gamedata/processes/rbank/1_export.py index 89b38beac..90922c0c3 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/rbank/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export rbank -# \date 2009-03-10-22-43-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export rbank @@ -43,17 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + # Find tools -printLog(log, "") +# ... + +# Export rbank 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export rbank 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + RBankCmbTagExportDirectory) + for dir in RBankCmbSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + RBankCmbTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/cmb_export.ms" + scriptDst = MaxUserDirectory + "/scripts/cmb_export.ms" + outputLogfile = ScriptDirectory + "/processes/rbank/log.log" + outputDirectory = ExportBuildDirectory + "/" + RBankCmbExportDirectory + tagDirectory = ExportBuildDirectory + "/" + RBankCmbTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "cmb_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + -# For each rbank directory -printLog(log, ">>> Export rbank 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms new file mode 100644 index 000000000..73f1605f9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms @@ -0,0 +1,211 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 + + +-- Must export this node ? +fn isToBeExported node = +( + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + return false +) + +fn runNelMaxExport inputMaxFile = +( + outputNelDir = "%OutputDirectory%" + + -- Tag this file ? + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Select all collision mesh + max select none + for m in geometry do + ( + if (isToBeExported m) == true then + selectmore m + ) + + -- Export the collision + if (NelExportCollision ($selection as array) outputNelDir) == false then + ( + nlerror("ERROR exporting collision " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK collision in folder " + outputNelDir) + ) + + return tagThisFile +) + + + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting 'cmb': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'cmb' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'cmb' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py index be3fb93e7..9d3cb67e5 100644 --- a/code/nel/tools/build_gamedata/processes/shape/1_export.py +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -121,13 +121,19 @@ if MaxAvailable: while retriesLeft > 0: printLog(log, "MAXSCRIPT " + scriptDst + "; " + maxFilePath) subprocess.call([ ExecTimeout, str(MaxShapeExportTimeout), Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) - lSrc = open(logFile, "r") - for line in lSrc: - lineStrip = line.strip() - if (len(lineStrip) > 0): - printLog(log, lineStrip) - lSrc.close() - os.remove(logFile) + if os.path.exists(logFile): + try: + lSrc = open(logFile, "r") + for line in lSrc: + lineStrip = line.strip() + if (len(lineStrip) > 0): + printLog(log, lineStrip) + lSrc.close() + os.remove(logFile) + except Exception: + printLog(log, "ERROR Failed to read 3dsmax log") + else: + printLog(log, "WARNING No 3dsmax log") if (os.path.exists(tagFilePath)): printLog(log, "OK " + maxFilePath) retriesLeft = 0 diff --git a/code/nel/tools/build_gamedata/processes/skel/1_export.py b/code/nel/tools/build_gamedata/processes/skel/1_export.py index aad402658..340a0957e 100644 --- a/code/nel/tools/build_gamedata/processes/skel/1_export.py +++ b/code/nel/tools/build_gamedata/processes/skel/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export skel -# \date 2009-03-10-20-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export skel @@ -44,43 +48,49 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each skel directory -printLog(log, ">>> Export skel 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) -for dir in SkelSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, SkelSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SkelExportDirectory, ".skel")): - scriptSrc = "maxscript/skel_export.ms" - scriptDst = MaxUserDirectory + "/scripts/skel_export.ms" - logFile = ScriptDirectory + "/processes/skel/log.log" - outDirSkel = ExportBuildDirectory + "/" + SkelExportDirectory - skelSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirSkel, "", ".skel") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export skel 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export skel 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) + for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SkelExportDirectory, ".skel")): + scriptSrc = "maxscript/skel_export.ms" + scriptDst = MaxUserDirectory + "/scripts/skel_export.ms" + outputLogfile = ScriptDirectory + "/processes/skel/log.log" + outputDirectory = ExportBuildDirectory + "/" + SkelExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".skel") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "skel_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".skel") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .skel files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("skel_source_directory", skelSourceDir) - newline = newline.replace("output_directory", outDirSkel) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "skel_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirSkel, "", ".skel") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .skel files!") - os.remove(scriptDst) + + printLog(log, ">>> Export skel directly <<<") mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) @@ -88,6 +98,8 @@ for dir in SkelSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + SkelExportDirectory, ".skel") + + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms index 02cdcac38..7fd2af0fb 100644 --- a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms +++ b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms @@ -1,24 +1,18 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename --- Log a message -fn nlerror message = -( - if nlErrorStream != undefined then - ( - format "%\n" message to:nlErrorStream - flush nlErrorStream - ) - - -- To the console - print message -) - -- Unhide category fn unhidecategory = ( @@ -54,109 +48,143 @@ fn unhidecategory = ) ) +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".skel") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + -- Select Bip01 + select $Bip01 + + if ($ != undefined) then + ( + -- Set figure mode on + if ((classof $) == Biped_Object) then + ( + $.controller.figureMode = true + ) + + -- Export the skeleton template + if (NelExportSkeleton $ outputNelFile) == false then + ( + nlerror("ERROR exporting skeleton " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + + return tagThisFile +) + + + try ( - -- Get files in the skel_source_directory - files = getFiles "skel_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".skel") + try ( - -- Output file - output = ("output_directory/"+(getFilenameFile files[i])+".skel") - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () - + gc() + heapfree + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select Bip01, not very smart - if $Bip01 != undefined then - ( - -- Select Bip01 - select $Bip01 - - if ($ != undefined) then - ( - -- Set figure mode on - if ((classof $) == Biped_Object) then - ( - $.controller.figureMode = true - ) - - -- Export the skeleton template - if (NelExportSkeleton $ output) == false then - ( - nlerror ("ERROR exporting skeleton "+files[i]) - ) - else - ( - nlerror ("OK "+output) - ) - ) - else - ( - -- Error - nlerror ("ERROR exporting skeleton: no Bip01 node in file "+files[i]) - ) - ) - else - ( - -- Error - nlerror ("ERROR exporting skeleton: no Bip01 node in file "+files[i]) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting skeleton: can't open the file "+files[i]) + nlerror("ERROR exporting 'skel': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton in files " + files[i]) + nlerror("ERROR error exporting 'skel' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no skeleton file in folder skel_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting skeleton in folder skel_source_directory") + nlerror("ERROR fatal error exporting 'skel' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/swt/1_export.py b/code/nel/tools/build_gamedata/processes/swt/1_export.py index c65e6f793..a50f6e5a7 100644 --- a/code/nel/tools/build_gamedata/processes/swt/1_export.py +++ b/code/nel/tools/build_gamedata/processes/swt/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export swt -# \date 2009-03-10-20-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export swt @@ -38,49 +42,55 @@ from directories import * printLog(log, "") printLog(log, "-------") -printLog(log, "--- Export skeleton weigths") +printLog(log, "--- Export swt") printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each swt directory -printLog(log, ">>> Export skeleton weigths 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) -for dir in SwtSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, SwtSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SwtExportDirectory, ".swt")): - scriptSrc = "maxscript/swt_export.ms" - scriptDst = MaxUserDirectory + "/scripts/swt_export.ms" - logFile = ScriptDirectory + "/processes/swt/log.log" - outDirSwt = ExportBuildDirectory + "/" + SwtExportDirectory - swtSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirSwt, "", ".swt") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export swt 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export swt 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) + for dir in SwtSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SwtExportDirectory, ".swt")): + scriptSrc = "maxscript/swt_export.ms" + scriptDst = MaxUserDirectory + "/scripts/swt_export.ms" + outputLogfile = ScriptDirectory + "/processes/swt/log.log" + outputDirectory = ExportBuildDirectory + "/" + SwtExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".swt") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "swt_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".swt") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .swt files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("swt_source_directory", swtSourceDir) - newline = newline.replace("output_directory", outDirSwt) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "swt_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirSwt, "", ".swt") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .swt files!") - os.remove(scriptDst) + + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms index 87517c831..ea6ff95c3 100644 --- a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms +++ b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms @@ -1,24 +1,18 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename --- Log a message -fn nlerror message = -( - if nlErrorStream != undefined then - ( - format "%\n" message to:nlErrorStream - flush nlErrorStream - ) - - -- To the console - print message -) - -- Unhide category fn unhidecategory = ( @@ -54,86 +48,118 @@ fn unhidecategory = ) ) +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".swt") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select all the nodes + max select all + + -- Export the skeleton template + if NelExportSkeletonWeight ($selection as array) outputNelFile == false then + ( + nlerror("ERROR exporting skeleton weight " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + + return tagThisFile +) + + + try ( - -- Get files in the swt_source_directory - files = getFiles "swt_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".swt") + try ( - -- Output file - output = ("output_directory/"+(getFilenameFile files[i])+".swt") - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () - + gc() + heapfree + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select all the nodes - max select all - - -- Export the skeleton template - if NelExportSkeletonWeight ($selection as array) output == false then - ( - nlerror ("ERROR exporting skeleton weight "+files[i]) - ) - else - ( - nlerror ("OK "+output) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting skeleton weight: can't open the file "+files[i]) + nlerror("ERROR exporting 'swt': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton weight in files " + files[i]) + nlerror("ERROR error exporting 'swt' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no skeleton weight file in folder swt_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton weight in folder swt_source_directory") + nlerror("ERROR fatal error exporting 'swt' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/veget/0_setup.py b/code/nel/tools/build_gamedata/processes/veget/0_setup.py index 84ae97c7d..5c41088e8 100644 --- a/code/nel/tools/build_gamedata/processes/veget/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/veget/0_setup.py @@ -2,7 +2,7 @@ # # \file 0_setup.py # \brief setup veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Setup veget diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py index ce9179dd5..d73362d45 100644 --- a/code/nel/tools/build_gamedata/processes/veget/1_export.py +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export veget @@ -43,49 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + +# Find tools +# ... + +# Export veget 3dsmax if MaxAvailable: # Find tools Max = findMax(log, MaxDirectory, MaxExecutable) - ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) printLog(log, "") - # Export veget 3dsmax printLog(log, ">>> Export veget 3dsmax <<<") - - # Build paths - scriptSrc = "maxscript/veget_export.ms" - # scriptDst = MaxDirectory + "/scripts/veget_export.ms" - scriptDst = MaxUserDirectory + "/scripts/veget_export.ms" - logFile = ScriptDirectory + "/processes/veget/log.log" - outputDirVeget = ExportBuildDirectory + "/" + VegetExportDirectory - mkPath(log, outputDirVeget) - outputDirTag = ExportBuildDirectory + "/" + VegetTagExportDirectory - mkPath(log, outputDirTag) - - # For each directoy mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) - if os.path.isfile(scriptDst): - os.remove(scriptDst) + mkPath(log, ExportBuildDirectory + "/" + VegetTagExportDirectory) for dir in VegetSourceDirectories: - vegetSourceDir = DatabaseDirectory + "/" + dir - mkPath(log, vegetSourceDir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, VegetSourceDirectories, vegetSourceDir, ".max", outputDirTag, ".max.tag")): + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + VegetTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/veget_export.ms" + scriptDst = MaxUserDirectory + "/scripts/veget_export.ms" + outputLogfile = ScriptDirectory + "/processes/veget/log.log" + outputDirectory = ExportBuildDirectory + "/" + VegetExportDirectory + tagDirectory = ExportBuildDirectory + "/" + VegetTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 sSrc = open(scriptSrc, "r") sDst = open(scriptDst, "w") for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("veget_source_directory", vegetSourceDir) - newline = newline.replace("output_directory_veget", outputDirVeget) - newline = newline.replace("output_directory_tag", outputDirTag) + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) sDst.write(newline) sSrc.close() sDst.close() - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") os.remove(scriptDst) -printLog(log, "") + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/veget/2_build.py b/code/nel/tools/build_gamedata/processes/veget/2_build.py index c08502eaa..856e87082 100644 --- a/code/nel/tools/build_gamedata/processes/veget/2_build.py +++ b/code/nel/tools/build_gamedata/processes/veget/2_build.py @@ -2,7 +2,7 @@ # # \file 2_build.py # \brief Build veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Build veget diff --git a/code/nel/tools/build_gamedata/processes/veget/3_install.py b/code/nel/tools/build_gamedata/processes/veget/3_install.py index 4be5ffc18..69a2ec539 100644 --- a/code/nel/tools/build_gamedata/processes/veget/3_install.py +++ b/code/nel/tools/build_gamedata/processes/veget/3_install.py @@ -2,7 +2,7 @@ # # \file 3_install.py # \brief Install veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Install veget @@ -43,12 +43,12 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +printLog(log, ">>> Install veget <<<") +exportPath = ExportBuildDirectory + "/" + VegetExportDirectory +mkPath(log, exportPath) clientPath = ClientDataDirectory + "/" + VegetClientDirectory mkPath(log, clientPath) - -printLog(log, ">>> Install veget <<<") -mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + VegetExportDirectory, clientPath, ".veget") +copyFilesNoTreeIfNeeded(log, exportPath, clientPath) printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms index 404f6e2ed..097a37609 100644 --- a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms +++ b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms @@ -1,17 +1,14 @@ --- Some globals -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable - -- "0" = not vegetable - -- "1" = vegetable +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -64,6 +61,19 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable + -- "0" = not vegetable + -- "1" = vegetable + + -- Must export this node ? fn isToBeExported node = ( @@ -86,127 +96,134 @@ fn isToBeExported node = return false ) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".veget") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the veget + if (NelExportVegetable node outputNelFile false) == true then + ( + nlerror("OK "+outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fata error exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror("WARNING no veget exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the veget_source_directory - files = getFiles "veget_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + try ( - -- Delete lod files - lod_array = #() - - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] quiet:true == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- For each node - for node in geometry do - ( - -- It is root ? - if (node.parent == undefined) then - ( - -- Is not a skeleton ? - if (node.name != "Bip01") then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Output directory - output = ("output_directory_veget/"+(node.name)+".veget") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the veget - if (NelExportVegetable node output false) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting veget "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fata error exporting veget "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) - ) - - -- Something exported - if exported == 0 then - ( - -- Error - nlerror ("WARNING no veget exported from the file "+files[i]) - ) - + tagThisFile = runNelMaxExport(inputMaxFile) + -- Write a tag file if tagThisFile == true then ( - tagFile = createFile tag + tagFile = createFile outputTagFile if tagFile == undefined then ( - nlerror ("WARNING can't create tag file "+tag) + nlerror("WARNING can't create tag file " + outputTagFile) ) else ( - print "toto" to: tagFile + print "mukyu" to: tagFile close tagFile ) ) @@ -214,36 +231,35 @@ try else ( -- Error - nlerror ("ERROR exporting veget: can't open the file "+files[i]) + nlerror("ERROR exporting 'veget': can't open the file " + inputMaxFile) ) ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + nlerror("SKIPPED BY TAG " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting veget in files " + files[i]) + nlerror("ERROR error exporting 'veget' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no max file in folder veget_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting veget in folder veget_source_directory") + nlerror("ERROR fatal error exporting 'veget' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/zone/0_setup.py b/code/nel/tools/build_gamedata/processes/zone/0_setup.py index 8f1acdab9..e6dc014d9 100644 --- a/code/nel/tools/build_gamedata/processes/zone/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone/0_setup.py @@ -45,7 +45,7 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) # Setup export directories printLog(log, ">>> Setup export directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/zone/1_export.py b/code/nel/tools/build_gamedata/processes/zone/1_export.py index 19308e1d1..10e085024 100644 --- a/code/nel/tools/build_gamedata/processes/zone/1_export.py +++ b/code/nel/tools/build_gamedata/processes/zone/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export zone -# \date 2009-03-10-22-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export zone @@ -44,25 +48,59 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) -printLog(log, "") +# ... -# For each zone directory -printLog(log, ">>> Export zone 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") -mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) -printLog(log, "") +# Export zone 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export zone 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + for dir in ZoneSourceDirectory: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ZoneExportDirectory, ".zone")): + scriptSrc = "maxscript/zone_export.ms" + scriptDst = MaxUserDirectory + "/scripts/zone_export.ms" + outputLogfile = ScriptDirectory + "/processes/zone/log.log" + outputDirectory = ExportBuildDirectory + "/" + ZoneExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".zone") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "zone_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".zone") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .zone files!") + os.remove(scriptDst) -printLog(log, ">>> Export zone ligo <<<") + + +printLog(log, ">>> Try to copy ligo zone if any <<<") printLog(log, "********************************") printLog(log, "******** TODO ********") printLog(log, "********************************") printLog(log, "") + + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms new file mode 100644 index 000000000..71f63e45b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms @@ -0,0 +1,223 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +-- Find id +Fn findID node = +( + local + + -- Const + alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + NameTab = filterString node.name "_" + Z_ID = -1 + alpha_letter1 = NameTab[2][1] + alpha_letter2 = NameTab[2][2] + alpha_letter1_value = findstring alphabet alpha_letter1 + alpha_letter2_value = findstring alphabet alpha_letter2 + + -- Decompose theh name in an array array[1]=numeric string value array[2]=alpha string value + -- The index of the engine start at 0 but the script one at 1 so we sub 1 each time + alpha_sub_id = (((alpha_letter1_value as integer - 1) * 26 + (alpha_letter2_value as integer)))-1 + num_sub_id = (NameTab[1] as integer)-1 + + -- Array of 256 per 256 + --------------------------- + -- 0 1 2 3 ... 255 + -- 256 257 258 259 ... 511 + -- 512 513 514 515 ... 767 + -- ... + + Z_ID = num_sub_id*256 + alpha_sub_id + return Z_ID +) + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".zone") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Found it ? + find = false + + -- For each object in the priject + for i in geometry do + ( + -- Look for a NeL patch mesh + if (classof i) == RklPatch then + ( + -- Error catching + try + ( + if (ExportRykolZone i outputNelFile (findID i)) == false then + ( + nlerror("ERROR exporting zone " + i.name + " in file " + inputMaxFile) + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + find = true + exit + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting zone " + i.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + ) + + -- Not found ? + if (find == false) then + ( + -- Error + nlerror("WARNING no zone found in project " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".zone") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting 'zone': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'zone' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'zone' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py index 112a3c9c7..7ce53d05c 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py @@ -55,6 +55,7 @@ mkPath(log, ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirect # Setup build directories printLog(log, ">>> Setup build directories <<<") mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneDependBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory) diff --git a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py index a96f4e94e..f06e7f72c 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py @@ -60,14 +60,14 @@ else: mkPath(log, srcDir) destDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory mkPath(log, destDir) - dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + dependDir = ExportBuildDirectory + "/" + ZoneDependBuildDirectory mkPath(log, dependDir) files = findFiles(log, srcDir, "", ".zonew") for file in files: srcFile = srcDir + "/" + file destFile = destDir + "/" + file[0:-len(".zonew")] + ".zonel" if (needUpdateLogRemoveDest(log, srcFile, destFile)): - dependFile = destDir + "/" + file[0:-len(".zonew")] + ".depend" + dependFile = dependDir + "/" + file[0:-len(".zonew")] + ".depend" subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") @@ -84,7 +84,7 @@ else: mkPath(log, igsrcDir) destDir = ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory mkPath(log, destDir) - dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + dependDir = ExportBuildDirectory + "/" + ZoneDependBuildDirectory mkPath(log, dependDir) files = findFiles(log, srcDir, "", ".zonel") for file in files: @@ -93,7 +93,7 @@ else: if (os.path.isfile(igsrcFile)): if (needUpdateLogRemoveDest(log, igsrcFile, destFile)): srcFile = srcDir + "/" + file - dependFile = destDir + "/" + file[0:-len(".zonel")] + ".depend" + dependFile = dependDir + "/" + file[0:-len(".zonel")] + ".depend" subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py index 381f6be4b..3c0e4663a 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py @@ -36,6 +36,7 @@ ContinentPath = "continents/" + ContinentName CommonName = ContinentName CommonPath = ContinentPath + # *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** ContinentLeveldesignWorldDirectory = ContinentName @@ -57,7 +58,10 @@ LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" # Zone directories -ZoneSourceDirectory = "landscape/zones/" + EcosystemName +ZoneSourceDirectory = [ "landscape/zones/" + ContinentName ] # For old snowballs style landscape when not using ligo + +# RBank directories +RBankCmbSourceDirectories = [ ] # Ig directories IgLandSourceDirectories = [ ] @@ -99,6 +103,10 @@ LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" ZoneExportDirectory = ContinentPath + "/zone" WaterMapSourceDirectories = [ ] +# RBank directories +RBankCmbExportDirectory = CommonPath + "/rbank_cmb_export" +RBankCmbTagExportDirectory = CommonPath + "/rbank_cmb_tag_export" + # Smallbank directories SmallbankExportDirectory = EcosystemPath + "/smallbank" diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py index b13dcfc78..356670e32 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py @@ -32,18 +32,23 @@ ProcessToComplete = [ ] ProcessToComplete += [ "properties" ] ProcessToComplete += [ "map" ] ProcessToComplete += [ "shape" ] -ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process (not yet), but does not export max files -ProcessToComplete += [ "zone" ] # works, need to check completeness +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "zone" ] ProcessToComplete += [ "ig" ] # fully implemented ProcessToComplete += [ "zone_light" ] # works, need to check completeness -ProcessToComplete += [ "rbank" ] # works, need to check completeness +ProcessToComplete += [ "rbank" ] ProcessToComplete += [ "ig_light" ] # fully implemented ProcessToComplete += [ "ps" ] # *** ECOSYSTEM AND CONTINENT NAMES *** + EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName ContinentName = "newbieland" +ContinentPath = "continents/" + ContinentName +CommonName = ContinentName +CommonPath = ContinentPath # *** LANDSCAPE NAME *** diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py new file mode 100644 index 000000000..9cc03f2b9 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py @@ -0,0 +1,245 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'desert' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "desert" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "fyros" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-foretbrule" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py new file mode 100644 index 000000000..12104fead --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'desert' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "desert" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 1 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "true" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py index c6fbe35cf..1916e5013 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py @@ -1,13 +1,17 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file directories.py # \brief Directories configuration -# \date 2010-05-24 06:34GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # \date 2001-2005 # \author Nevrax # Python port of game data build pipeline. -# Directories configuration. +# Directories configuration for 'jungle' ecosystem. # # NeL - MMORPG Framework # Copyright (C) 2010 Winch Gate Property Limited @@ -27,22 +31,28 @@ # -# *** ECOSYSTEM NAME *** +# *** ECOSYSTEM AND CONTINENT NAMES *** + EcosystemName = "jungle" EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName CommonPath = EcosystemPath +DatabaseRootName = "jungle" +DatabaseRootPath = "stuff/" + DatabaseRootName + # *** SOURCE DIRECTORIES IN THE DATABASE *** # Shape directories ShapeSourceDirectories = [ ] -ShapeSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] # Maps directories MapSourceDirectories = [ ] -MapSourceDirectories += [ "stuff/" + EcosystemName + "/decors/_textures/Vegetations" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] @@ -50,7 +60,9 @@ MapUncompressedSourceDirectories = [ ] # Tiles directories TilesSourceDirectories = [ ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-jungleherbesseche" ] @@ -60,11 +72,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-jungleherbesseche" ] @@ -74,11 +85,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-jungleherbesseche" ] @@ -88,11 +98,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-jungleherbesseche" ] @@ -102,9 +111,6 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/Transitions" ] # Tiles root directory @@ -133,7 +139,7 @@ LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" # Zone directories -ZoneSourceDirectory = "landscape/zones/" + EcosystemName +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo # Ig landscape directories IgLandSourceDirectory = "_invalid" @@ -143,7 +149,7 @@ IgOtherSourceDirectory = "_invalid" # PACS primitives directories PacsPrimSourceDirectories = [ ] -PacsPrimSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] # *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** @@ -156,20 +162,20 @@ ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_opt ShapeAnimExportDirectory = CommonPath + "/shape_anim" # Smallbank directories -SmallbankExportDirectory = "ecosystems/" + EcosystemName + "/smallbank" +SmallbankExportDirectory = CommonPath + "/smallbank" # Tiles directories -TilesExportDirectory = "ecosystems/" + EcosystemName + "/tiles" +TilesExportDirectory = CommonPath + "/tiles" # Tiles directories -DisplaceExportDirectory = "ecosystems/" + EcosystemName + "/diplace" +DisplaceExportDirectory = CommonPath + "/diplace" # Veget directories -VegetExportDirectory = "ecosystems/" + EcosystemName + "/veget" -VegetTagExportDirectory = "ecosystems/" + EcosystemName + "/veget_tag" +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" # Veget Set directories -VegetSetExportDirectory = "ecosystems/" + EcosystemName + "/veget_set" +VegetSetExportDirectory = CommonPath + "/veget_set" # Ligo directories LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName @@ -177,13 +183,13 @@ LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" -LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" +LigoTagExportDirectory = CommonPath + "/ligo_tag" # Zone directories -ZoneExportDirectory = "ecosystems/" + EcosystemName + "/zone" +ZoneExportDirectory = CommonPath + "/zone" # PACS primitives directories -PacsPrimExportDirectory = "ecosystems/" + EcosystemName + "/pacs_prim" +PacsPrimExportDirectory = CommonPath + "/pacs_prim" # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** @@ -199,7 +205,7 @@ ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" # Farbank directories -FarbankBuildDirectory = "ecosystems/" + EcosystemName + "/farbank" +FarbankBuildDirectory = CommonPath + "/farbank" # Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** IgLandBuildDirectory = "_invalid" @@ -214,44 +220,30 @@ RbankMeshBuildDirectory = "_invalid" # *** INSTALL DIRECTORIES IN THE CLIENT DATA *** -# Client directories -ClientSetupDirectories = [ ] -ClientSetupDirectories += [ "jungle_shapes" ] -ClientSetupDirectories += [ "jungle_maps" ] -ClientSetupDirectories += [ "jungle_tiles" ] -ClientSetupDirectories += [ "jungle_displaces" ] -ClientSetupDirectories += [ "jungle_bank" ] -ClientSetupDirectories += [ "jungle_vegetables" ] -ClientSetupDirectories += [ "jungle_vegetable_sets" ] -ClientSetupDirectories += [ "jungle_pacs_prim" ] -ClientSetupDirectories += [ "jungle_lightmaps" ] - -# Map directory -MapClientDirectory = "jungle_maps" - # Map directory +MapClientDirectory = CommonName + "_maps" BitmapClientDirectory = MapClientDirectory # Shape directory -ShapeClientDirectory = "jungle_shapes" +ShapeClientDirectory = CommonName + "_shapes" # Lightmap directory -LightmapClientDirectory = "jungle_lightmaps" +LightmapClientDirectory = CommonName + "_lightmaps" # Tile directory -TilesClientDirectory = "jungle_tiles" +TilesClientDirectory = CommonName + "_tiles" # Displace directory -DisplaceClientDirectory = "jungle_displaces" +DisplaceClientDirectory = CommonName + "_displaces" # Bank directory -BankClientDirectory = "jungle_bank" +BankClientDirectory = CommonName + "_bank" # Vegetable set directory -VegetSetClientDirectory = "jungle_vegetable_sets" +VegetSetClientDirectory = CommonName + "_vegetable_sets" # Vegetable shape directory -VegetClientDirectory = "jungle_vegetables" +VegetClientDirectory = CommonName + "_vegetables" # PACS primitives directories -PacsPrimClientDirectory = "jungle_pacs_prim" +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py index babdec16f..ca70a8a59 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py @@ -1,11 +1,15 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file config.py # \brief Process configuration -# \date 2010-05-24 06:30GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. -# Process configuration. +# Process configuration for 'jungle' ecosystem. # # NeL - MMORPG Framework # Copyright (C) 2010 Winch Gate Property Limited @@ -28,17 +32,26 @@ # *** PROCESS CONFIG *** ProcessToComplete = [ ] -ProcessToComplete += [ "shape" ] # not fully implemented, but works for this process -ProcessToComplete += [ "map" ] # not fully implemented, but works for this process -ProcessToComplete += [ "smallbank" ] # OK -ProcessToComplete += [ "farbank" ] # OK -ProcessToComplete += [ "tiles" ] # OK -ProcessToComplete += [ "displace" ] # OK -ProcessToComplete += [ "veget" ] # OK -ProcessToComplete += [ "vegetset" ] # OK -ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process, but does not export max files +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] ProcessToComplete += [ "pacs_prim" ] + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + # *** MAP EXPORT OPTIONS *** PanoplyFileList = [ ] HlsBankFileName = "" @@ -52,7 +65,7 @@ ShapeExportOptExportLighting = "true" ShapeExportOptShadow = "true" # Lighting limits. 0 : normal, 1 : soft shadows -ShapeExportOptLightingLimit = 0 +ShapeExportOptLightingLimit = 1 # Lightmap lumel size ShapeExportOptLumelSize = "0.25" @@ -64,7 +77,7 @@ ShapeExportOptOversampling = 1 ShapeExportOpt8BitsLightmap = "false" # Does the lightmaps export must generate logs ? -ShapeExportOptLightmapLog = "false" +ShapeExportOptLightmapLog = "true" # Coarse mesh texture mul size TextureMulSizeValue = "1.5" @@ -75,10 +88,10 @@ ClodConfigFile = "" # *** COARSE MESH TEXTURE NAME *** CoarseMeshTextureNames = [ ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_sp" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_su" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_au" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_wi" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] # *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** MultipleTilesPostfix = [ ] @@ -90,7 +103,7 @@ MultipleTilesPostfix += [ "_wi" ] # *** BANK EXPORT OPTIONS *** # Name of the tilebank to use -BankTileBankName = "jungle" +BankTileBankName = EcosystemName # *** RBANK EXPORT OPTIONS *** diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py new file mode 100644 index 000000000..e48979a8c --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py @@ -0,0 +1,257 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'lacustre' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "lacustre" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "tryker" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/constructible" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py new file mode 100644 index 000000000..93817c333 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'lacustre' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "lacustre" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 8 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py new file mode 100644 index 000000000..cebc4857a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py @@ -0,0 +1,242 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'primes_racines' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "primes_racines" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "primes_racines" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/batiments" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/aditif" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py new file mode 100644 index 000000000..b49eec027 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'primes_racines' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "primes_racines" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 1 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py index e04f683f6..a83f27f3b 100644 --- a/code/ryzom/tools/build_gamedata/workspace/projects.py +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -35,7 +35,10 @@ ProjectsToProcess += [ "common/sfx" ] ProjectsToProcess += [ "common/fauna" ] # Ecosystem projects +ProjectsToProcess += [ "ecosystems/desert" ] ProjectsToProcess += [ "ecosystems/jungle" ] +ProjectsToProcess += [ "ecosystems/primes_racines" ] +ProjectsToProcess += [ "ecosystems/lacustre" ] # Continent projects ProjectsToProcess += [ "continents/newbieland" ] @@ -49,9 +52,7 @@ ProjectsToProcess += [ "common/sky" ] # Depends on jungle/newbieland due to ig_l #ProjectsToProcess += [ "common/characters" ] # TODO #ProjectsToProcess += [ "common/characters_maps_hr" ] # TODO #ProjectsToProcess += [ "common/characters_maps_lr" ] # TODO -#ProjectsToProcess += [ "ecosystems/desert" ] # TODO -#ProjectsToProcess += [ "ecosystems/lacustre" ] # TODO -#ProjectsToProcess += [ "ecosystems/primes_racines" ] # TODO +#ProjectsToProcess += [ "continents/indoors" ] # TODO # end of file