From 428f2aa84e4cb33e49e58ef115e88d057be664c1 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 22 Apr 2014 13:57:56 -0700 Subject: Added missing new files --- indra/llprimitive/lldaeloader.h | 103 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 indra/llprimitive/lldaeloader.h (limited to 'indra/llprimitive/lldaeloader.h') diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h new file mode 100644 index 0000000000..e71c407909 --- /dev/null +++ b/indra/llprimitive/lldaeloader.h @@ -0,0 +1,103 @@ +/** + * @file lldaeloader.h + * @brief LLDAELoader class definition + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLDAELOADER_H +#define LL_LLDAELOADER_H + +#include "llmodelloader.h" + +class DAE; +class daeElement; +class domProfile_COMMON; +class domInstance_geometry; +class domNode; +class domTranslate; +class domController; +class domSkin; +class domMesh; + +class LLDAELoader : public LLModelLoader +{ +public: + typedef std::map material_map; + typedef std::map > > dae_model_map; + dae_model_map mModelsMap; + + LLDAELoader( + std::string filename, + S32 lod, + LLModelLoader::load_callback_t load_cb, + LLModelLoader::joint_lookup_func_t joint_lookup_func, + LLModelLoader::texture_load_func_t texture_load_func, + LLModelLoader::state_callback_t state_cb, + void* opaque_userdata, + JointTransformMap& jointMap, + JointSet& jointsFromNodes); + virtual ~LLDAELoader() ; + + virtual bool OpenFile(const std::string& filename); + +protected: + + void processElement(daeElement* element, bool& badElement, DAE* dae); + void processDomModel(LLModel* model, DAE* dae, daeElement* pRoot, domMesh* mesh, domSkin* skin); + + material_map getMaterials(LLModel* model, domInstance_geometry* instance_geo, DAE* dae); + LLImportMaterial profileToMaterial(domProfile_COMMON* material, DAE* dae); + LLColor4 getDaeColor(daeElement* element); + + daeElement* getChildFromElement( daeElement* pElement, std::string const & name ); + + bool isNodeAJoint( domNode* pNode ); + void processJointNode( domNode* pNode, std::map& jointTransforms ); + void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform ); + void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform ); + void extractTranslationViaSID( daeElement* pElement, LLMatrix4& transform ); + void buildJointToNodeMappingFromScene( daeElement* pRoot ); + void processJointToNodeMapping( domNode* pNode ); + void processChildJoints( domNode* pParentNode ); + + bool verifyCount( int expected, int result ); + + //Verify that a controller matches vertex counts + bool verifyController( domController* pController ); + + static bool addVolumeFacesFromDomMesh(LLModel* model, domMesh* mesh); + static bool createVolumeFacesFromDomMesh(LLModel* model, domMesh *mesh); + + static LLModel* loadModelFromDomMesh(domMesh* mesh); + + // Loads a mesh breaking it into one or more models as necessary + // to get around volume face limitations while retaining >8 materials + // + bool loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out); + + static std::string getElementLabel(daeElement *element); + +private: + +}; +#endif // LL_LLDAELLOADER_H -- cgit v1.2.3 From 051052b141ef5c2c3a2f08a9d69b7b982386c8c4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 25 Mar 2015 20:07:21 +0200 Subject: MAINT-4983 Mesh upload of large model ryoma 3d loads indefinitely --- indra/llprimitive/lldaeloader.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llprimitive/lldaeloader.h') diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index e71c407909..cd07ade282 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -55,7 +55,8 @@ public: LLModelLoader::state_callback_t state_cb, void* opaque_userdata, JointTransformMap& jointMap, - JointSet& jointsFromNodes); + JointSet& jointsFromNodes, + U32 modelLimit); virtual ~LLDAELoader() ; virtual bool OpenFile(const std::string& filename); @@ -93,11 +94,12 @@ protected: // Loads a mesh breaking it into one or more models as necessary // to get around volume face limitations while retaining >8 materials // - bool loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out); + bool loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out, U32 submodel_limit); static std::string getElementLabel(daeElement *element); private: + U32 mGeneratedModelLimit; // Attempt to limit amount of generated submodels }; #endif // LL_LLDAELLOADER_H -- cgit v1.2.3 From e712a5230e4f6da7dd750aee2ca8aeb2e4371f72 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 27 Mar 2015 21:22:18 +0200 Subject: MAINT-4982 Naming rules unification --- indra/llprimitive/lldaeloader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llprimitive/lldaeloader.h') diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index cd07ade282..e31b023d22 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -97,6 +97,7 @@ protected: bool loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out, U32 submodel_limit); static std::string getElementLabel(daeElement *element); + static size_t getSuffixPosition(std::string label); private: U32 mGeneratedModelLimit; // Attempt to limit amount of generated submodels -- cgit v1.2.3 From 10e1bb6ea4db3fc84e3834786ab4614d48a7668d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 16 Apr 2015 17:58:50 +0300 Subject: MAINT-5114 FIXED [Project-Importer] LOD files following new naming cannot be uploaded on their own. --- indra/llprimitive/lldaeloader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llprimitive/lldaeloader.h') diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index e31b023d22..7d91a6063b 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -96,8 +96,9 @@ protected: // bool loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out, U32 submodel_limit); - static std::string getElementLabel(daeElement *element); + static std::string getElementLabel(daeElement *element); static size_t getSuffixPosition(std::string label); + static std::string getLodlessLabel(daeElement *element); private: U32 mGeneratedModelLimit; // Attempt to limit amount of generated submodels -- cgit v1.2.3 From ddaa0e186501b77876c9d8afe7e13885c41c76f1 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Mon, 12 Oct 2015 19:35:08 +0300 Subject: MAINT-5678 FIXED Materials with spaces in name import with truncated names --- indra/llprimitive/lldaeloader.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/llprimitive/lldaeloader.h') diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index 7d91a6063b..3ababd3156 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -89,19 +89,22 @@ protected: static bool addVolumeFacesFromDomMesh(LLModel* model, domMesh* mesh); static bool createVolumeFacesFromDomMesh(LLModel* model, domMesh *mesh); - static LLModel* loadModelFromDomMesh(domMesh* mesh); + static LLModel* loadModelFromDomMesh(domMesh* mesh, bool forceIdNaming); + LLModel* loadModelFromDomMesh(domMesh* mesh); // Loads a mesh breaking it into one or more models as necessary // to get around volume face limitations while retaining >8 materials // bool loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out, U32 submodel_limit); - static std::string getElementLabel(daeElement *element); + static std::string getElementLabel(daeElement *element, bool forceIdNaming); + std::string getElementLabel(daeElement *element); static size_t getSuffixPosition(std::string label); - static std::string getLodlessLabel(daeElement *element); + static std::string getLodlessLabel(daeElement *element, bool forceIdNaming = false); private: U32 mGeneratedModelLimit; // Attempt to limit amount of generated submodels + bool mForceIdNaming; }; #endif // LL_LLDAELLOADER_H -- cgit v1.2.3