From 71de5f622a7917f78823a7e7840194e1b0f8f070 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 26 Aug 2010 14:23:12 -0500 Subject: Add missing files from viewer-experimental --- indra/newview/llfloatermodelpreview.h | 275 ++++++++++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 indra/newview/llfloatermodelpreview.h (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h new file mode 100644 index 0000000000..1f9de2e2b9 --- /dev/null +++ b/indra/newview/llfloatermodelpreview.h @@ -0,0 +1,275 @@ +/** + * @file llfloatermodelpreview.h + * @brief LLFloaterModelPreview class definition + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERMODELPREVIEW_H +#define LL_LLFLOATERMODELPREVIEW_H + +#include "llfloaternamedesc.h" + +#include "lldynamictexture.h" +#include "llquaternion.h" +#include "llmeshrepository.h" +#include "llmodel.h" +#include "llthread.h" + +#if LL_MESH_ENABLED +class LLComboBox; +class LLJoint; +class LLViewerJointMesh; +class LLVOAvatar; +class LLTextBox; +class LLVertexBuffer; +class LLModelPreview; +class LLFloaterModelPreview; +class daeElement; +class domProfile_COMMON; +class domInstance_geometry; + +class LLPhysicsDecompFloater : public LLFloater +{ +public: + + LLPhysicsDecompFloater(LLSD& key); + ~LLPhysicsDecompFloater(); +}; + +class LLModelLoader : public LLThread +{ +public: + typedef enum + { + STARTING = 0, + READING_FILE, + CREATING_FACES, + GENERATING_VERTEX_BUFFERS, + GENERATING_LOD, + DONE, + } eLoadState; + + U32 mState; + std::string mFilename; + S32 mLod; + LLModelPreview* mPreview; + LLMatrix4 mTransform; + BOOL mFirstTransform; + LLVector3 mExtents[2]; + + std::map > mModel; + + typedef std::vector > model_list; + model_list mModelList; + + typedef std::vector model_instance_list; + + typedef std::map scene; + + scene mScene; + + LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview); + + virtual void run(); + + void processElement(daeElement* element); + std::vector getMaterials(LLModel* model, domInstance_geometry* instance_geo); + LLImportMaterial profileToMaterial(domProfile_COMMON* material); + std::string getElementLabel(daeElement *element); + LLColor4 getDaeColor(daeElement* element); + + //map of avatar joints as named in COLLADA assets to internal joint names + std::map mJointMap; +}; + +class LLModelPreview : public LLViewerDynamicTexture, public LLMutex +{ + public: + + LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp); + virtual ~LLModelPreview(); + + void setPreviewTarget(F32 distance); + void setTexture(U32 name) { mTextureName = name; } + + BOOL render(); + void genBuffers(S32 lod); + void refresh(); + void rotate(F32 yaw_radians, F32 pitch_radians); + void zoom(F32 zoom_amt); + void pan(F32 right, F32 up); + virtual BOOL needsRender() { return mNeedsUpdate; } + void setPreviewLOD(S32 lod); + void loadModel(std::string filename, S32 lod); + void loadModelCallback(S32 lod); + void genLODs(S32 which_lod = -1); + void smoothNormals(); + void consolidate(); + void scrubMaterials(); + U32 calcResourceCost(); + void rebuildUploadData(); + void clearIncompatible(S32 lod); + void updateStatusMessages(); + + static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); + + protected: + friend class LLFloaterModelPreview; + friend class LLPhysicsDecomp; + + LLFloaterModelPreview* mFMP; + + BOOL mNeedsUpdate; + U32 mTextureName; + F32 mCameraDistance; + F32 mCameraYaw; + F32 mCameraPitch; + F32 mCameraZoom; + LLVector3 mCameraOffset; + LLVector3 mPreviewTarget; + LLVector3 mPreviewScale; + S32 mPreviewLOD; + U32 mResourceCost; + S32 mLODMode[LLModel::NUM_LODS]; + S32 mLimit[LLModel::NUM_LODS]; + + LLModelLoader* mModelLoader; + + + LLModelLoader::scene mScene[LLModel::NUM_LODS]; + LLModelLoader::scene mBaseScene; + + LLModelLoader::model_list mModel[LLModel::NUM_LODS]; + LLModelLoader::model_list mBaseModel; + + std::map mGroup; + std::map mObject; + std::map > mPatch; + + std::map mPercentage; + std::map > > mPhysicsMesh; + + LLMeshUploadThread::instance_list mUploadData; + std::set > mTextureSet; + + //map of vertex buffers to models (one vertex buffer in vector per face in model + std::map > > mVertexBuffer[6]; +}; + +class LLFloaterModelPreview : public LLFloater +{ +public: + static LLFloaterModelPreview* sInstance; + + LLFloaterModelPreview(const LLSD& key); + virtual ~LLFloaterModelPreview(); + + virtual BOOL postBuild(); + + BOOL handleMouseDown(S32 x, S32 y, MASK mask); + BOOL handleMouseUp(S32 x, S32 y, MASK mask); + BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + + static void onMouseCaptureLostModelPreview(LLMouseHandler*); + static void setUploadAmount(S32 amount) { sUploadAmount = amount; } + + static void onBrowseHighLOD(void* data); + static void onBrowseMediumLOD(void* data); + static void onBrowseLowLOD(void* data); + static void onBrowseLowestLOD(void* data); + + static void onUpload(void* data); + + static void onConsolidate(void* data); + static void onScrubMaterials(void* data); + static void onDecompose(void* data); + static void onModelDecompositionComplete(LLModel* model, std::vector >& physics_mesh); + + static void refresh(LLUICtrl* ctrl, void* data); + + void updateResourceCost(); + + void loadModel(S32 lod); + +protected: + friend class LLModelPreview; + friend class LLMeshFilePicker; + friend class LLPhysicsDecomp; + friend class LLPhysicsDecompFloater; + + static void onPreviewLODCommit(LLUICtrl*,void*); + + static void onHighLODCommit(LLUICtrl*,void*); + static void onMediumLODCommit(LLUICtrl*,void*); + static void onLowLODCommit(LLUICtrl*,void*); + static void onLowestLODCommit(LLUICtrl*,void*); + static void onPhysicsLODCommit(LLUICtrl*,void*); + + static void onHighLimitCommit(LLUICtrl*,void*); + static void onMediumLimitCommit(LLUICtrl*,void*); + static void onLowLimitCommit(LLUICtrl*,void*); + static void onLowestLimitCommit(LLUICtrl*,void*); + static void onPhysicsLimitCommit(LLUICtrl*,void*); + + static void onSmoothNormalsCommit(LLUICtrl*,void*); + + static void onAutoFillCommit(LLUICtrl*,void*); + static void onShowEdgesCommit(LLUICtrl*,void*); + + static void onExplodeCommit(LLUICtrl*, void*); + + static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata); + static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata); + static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata); + static void onClosePhysicsFloater(LLUICtrl* ctrl, void* userdata); + + void draw(); + static void setLODMode(S32 lod, void* userdata); + void setLODMode(S32 lod, S32 which_mode); + + static void setLimit(S32 lod, void* userdata); + void setLimit(S32 lod, S32 limit); + + void showDecompFloater(); + + LLModelPreview* mModelPreview; + + LLFloater* mDecompFloater; + + S32 mLastMouseX; + S32 mLastMouseY; + LLRect mPreviewRect; + U32 mGLName; + BOOL mLoading; + static S32 sUploadAmount; +}; + +#endif + +#endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3 From 7399c39a2fef7ffaa232047bf2ea16ebef682506 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 2 Sep 2010 19:13:48 -0500 Subject: Fix for crash when loading models (Don't hit UI from the main thread). Added asserts to LLFastTimer to verify main thread use only. --- indra/newview/llfloatermodelpreview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 1f9de2e2b9..97e681a6a8 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -118,6 +118,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void setTexture(U32 name) { mTextureName = name; } BOOL render(); + void update(); void genBuffers(S32 lod); void refresh(); void rotate(F32 yaw_radians, F32 pitch_radians); @@ -145,6 +146,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex LLFloaterModelPreview* mFMP; BOOL mNeedsUpdate; + bool mDirty; U32 mTextureName; F32 mCameraDistance; F32 mCameraYaw; -- cgit v1.2.3 From 90e3d83a5cb35e98a02a3017dd79ebc272bbfe85 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Sep 2010 13:26:52 -0400 Subject: Fix for build failures - disabling tcmalloc for now --- indra/newview/llfloatermodelpreview.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/llfloatermodelpreview.h (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h old mode 100644 new mode 100755 -- cgit v1.2.3 From cf09d6c58a741263cddcf338c2f79836873475b1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Sep 2010 03:04:21 -0500 Subject: Remove LL_MESH_ENABLED macros (fixes drag and drop). Add mesh stitching type back into tools floater. --- indra/newview/llfloatermodelpreview.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 97e681a6a8..148687aecd 100755 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -40,7 +40,6 @@ #include "llmodel.h" #include "llthread.h" -#if LL_MESH_ENABLED class LLComboBox; class LLJoint; class LLViewerJointMesh; @@ -272,6 +271,4 @@ protected: static S32 sUploadAmount; }; -#endif - #endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3 From 7b44a8ee8de662355c8f5c8091ab25dccce494e5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Sep 2010 15:58:35 -0500 Subject: SH-110 Fix for viewer crash when checking HULL in decomposition window... converted various maps to use smart pointers for keys instead of naked pointers, properly clear maps on various operations. --- indra/newview/llfloatermodelpreview.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 148687aecd..d8f06295ac 100755 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -168,12 +168,12 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex LLModelLoader::model_list mModel[LLModel::NUM_LODS]; LLModelLoader::model_list mBaseModel; - std::map mGroup; - std::map mObject; - std::map > mPatch; + std::map, U32> mGroup; + std::map, U32> mObject; + std::map, std::vector > mPatch; + std::map, F32> mPercentage; - std::map mPercentage; - std::map > > mPhysicsMesh; + std::map, std::vector > > mPhysicsMesh; LLMeshUploadThread::instance_list mUploadData; std::set > mTextureSet; -- cgit v1.2.3 From 40150f31ce9b0af4b58c2bd195c9cf571fb5b549 Mon Sep 17 00:00:00 2001 From: prep linden Date: Fri, 24 Sep 2010 17:19:44 -0400 Subject: Fixed a mesh upload issue where if the asset did not contain a rig the avatar would disappear for the current session. --- indra/newview/llfloatermodelpreview.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index d8f06295ac..5de3ebf5e3 100755 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -135,6 +135,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void rebuildUploadData(); void clearIncompatible(S32 lod); void updateStatusMessages(); + bool containsRiggedAsset( void ); static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); -- cgit v1.2.3 From 613894c8cca25f9fa86da7056da3594fe8771d46 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 28 Sep 2010 13:45:42 -0500 Subject: SH-238 Add check boxes to upload skin weights (or not) and/or joint positions (or not). Remove llfloaterimportcollada Reviewed by Prep. --- indra/newview/llfloatermodelpreview.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 5de3ebf5e3..08ac3873db 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -113,12 +113,14 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp); virtual ~LLModelPreview(); + void resetPreviewTarget(); void setPreviewTarget(F32 distance); void setTexture(U32 name) { mTextureName = name; } BOOL render(); void update(); - void genBuffers(S32 lod); + void genBuffers(S32 lod, bool skinned); + void clearBuffers(); void refresh(); void rotate(F32 yaw_radians, F32 pitch_radians); void zoom(F32 zoom_amt); @@ -225,6 +227,9 @@ protected: friend class LLPhysicsDecomp; friend class LLPhysicsDecompFloater; + static void onUploadJointsCommit(LLUICtrl*,void*); + static void onUploadSkinCommit(LLUICtrl*,void*); + static void onPreviewLODCommit(LLUICtrl*,void*); static void onHighLODCommit(LLUICtrl*,void*); -- cgit v1.2.3 From 0c93da0501ab1debd6fa11af29a215be81f7b803 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 29 Sep 2010 16:09:21 -0500 Subject: SH-224 Add new streaming cost algorithm debug displays to viewer. Add the ability to clear LOD slots. Make triangle count UI more responsive to Generate LOD button. Add triangle count debug display for current selection. Reviewed by Nyx --- indra/newview/llfloatermodelpreview.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 08ac3873db..8409249182 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -127,6 +127,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void pan(F32 right, F32 up); virtual BOOL needsRender() { return mNeedsUpdate; } void setPreviewLOD(S32 lod); + void clearModel(S32 lod); void loadModel(std::string filename, S32 lod); void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1); @@ -182,7 +183,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex std::set > mTextureSet; //map of vertex buffers to models (one vertex buffer in vector per face in model - std::map > > mVertexBuffer[6]; + std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; }; class LLFloaterModelPreview : public LLFloater @@ -227,6 +228,7 @@ protected: friend class LLPhysicsDecomp; friend class LLPhysicsDecompFloater; + static void onDebugScaleCommit(LLUICtrl*, void*); static void onUploadJointsCommit(LLUICtrl*,void*); static void onUploadSkinCommit(LLUICtrl*,void*); -- cgit v1.2.3 From 87a9f475756d54d9d98c8cbb6395f89d6fc4606a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 5 Oct 2010 16:49:05 -0500 Subject: Rewrite LLPhysicsDecomp to have a more generic callback system. Reviewed by prep. --- indra/newview/llfloatermodelpreview.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 8409249182..7be32663f4 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -92,6 +92,11 @@ public: scene mScene; + typedef std::queue > model_queue; + + //queue of models that need a physics rep + model_queue mPhysicsQ; + LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview); virtual void run(); @@ -189,6 +194,18 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex class LLFloaterModelPreview : public LLFloater { public: + + class DecompRequest : public LLPhysicsDecomp::Request + { + public: + S32 mContinue; + LLPointer mModel; + + DecompRequest(const std::string& stage, LLModel* mdl); + virtual S32 statusCallback(const char* status, S32 p1, S32 p2); + virtual void completed(); + + }; static LLFloaterModelPreview* sInstance; LLFloaterModelPreview(const LLSD& key); @@ -270,13 +287,18 @@ protected: LLModelPreview* mModelPreview; LLFloater* mDecompFloater; - + LLPhysicsDecomp::decomp_params mDecompParams; + S32 mLastMouseX; S32 mLastMouseY; LLRect mPreviewRect; U32 mGLName; BOOL mLoading; static S32 sUploadAmount; + + LLPointer mCurRequest; + + }; #endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3 From aa401a3056ab65c5c206b9ba2eefcf2ef83a6d83 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Thu, 7 Oct 2010 18:49:07 -0400 Subject: BUILDFIX: viewer-mesh mac build xcode didn't like the way we were defining inner classes and assuming that if the outer class was a friend that the inner class would be too. Couldn't forward-declare the inner class so had to re-arrange the order of class declaration. Between re-ordering the class declarations, and explicitly making the inner class a friend, this un-sticks the mac build, and makes it happy. Code reviewed by davep. --- indra/newview/llfloatermodelpreview.h | 208 +++++++++++++++++----------------- 1 file changed, 105 insertions(+), 103 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 7be32663f4..417e207368 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -111,134 +111,54 @@ public: std::map mJointMap; }; -class LLModelPreview : public LLViewerDynamicTexture, public LLMutex -{ - public: - - LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp); - virtual ~LLModelPreview(); - - void resetPreviewTarget(); - void setPreviewTarget(F32 distance); - void setTexture(U32 name) { mTextureName = name; } - - BOOL render(); - void update(); - void genBuffers(S32 lod, bool skinned); - void clearBuffers(); - void refresh(); - void rotate(F32 yaw_radians, F32 pitch_radians); - void zoom(F32 zoom_amt); - void pan(F32 right, F32 up); - virtual BOOL needsRender() { return mNeedsUpdate; } - void setPreviewLOD(S32 lod); - void clearModel(S32 lod); - void loadModel(std::string filename, S32 lod); - void loadModelCallback(S32 lod); - void genLODs(S32 which_lod = -1); - void smoothNormals(); - void consolidate(); - void scrubMaterials(); - U32 calcResourceCost(); - void rebuildUploadData(); - void clearIncompatible(S32 lod); - void updateStatusMessages(); - bool containsRiggedAsset( void ); - - static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); - - protected: - friend class LLFloaterModelPreview; - friend class LLPhysicsDecomp; - - LLFloaterModelPreview* mFMP; - - BOOL mNeedsUpdate; - bool mDirty; - U32 mTextureName; - F32 mCameraDistance; - F32 mCameraYaw; - F32 mCameraPitch; - F32 mCameraZoom; - LLVector3 mCameraOffset; - LLVector3 mPreviewTarget; - LLVector3 mPreviewScale; - S32 mPreviewLOD; - U32 mResourceCost; - S32 mLODMode[LLModel::NUM_LODS]; - S32 mLimit[LLModel::NUM_LODS]; - - LLModelLoader* mModelLoader; - - - LLModelLoader::scene mScene[LLModel::NUM_LODS]; - LLModelLoader::scene mBaseScene; - - LLModelLoader::model_list mModel[LLModel::NUM_LODS]; - LLModelLoader::model_list mBaseModel; - - std::map, U32> mGroup; - std::map, U32> mObject; - std::map, std::vector > mPatch; - std::map, F32> mPercentage; - - std::map, std::vector > > mPhysicsMesh; - - LLMeshUploadThread::instance_list mUploadData; - std::set > mTextureSet; - - //map of vertex buffers to models (one vertex buffer in vector per face in model - std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; -}; - class LLFloaterModelPreview : public LLFloater { public: - + class DecompRequest : public LLPhysicsDecomp::Request { public: S32 mContinue; LLPointer mModel; - + DecompRequest(const std::string& stage, LLModel* mdl); virtual S32 statusCallback(const char* status, S32 p1, S32 p2); virtual void completed(); - + }; static LLFloaterModelPreview* sInstance; - + LLFloaterModelPreview(const LLSD& key); virtual ~LLFloaterModelPreview(); - + virtual BOOL postBuild(); BOOL handleMouseDown(S32 x, S32 y, MASK mask); BOOL handleMouseUp(S32 x, S32 y, MASK mask); BOOL handleHover(S32 x, S32 y, MASK mask); BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - + static void onMouseCaptureLostModelPreview(LLMouseHandler*); static void setUploadAmount(S32 amount) { sUploadAmount = amount; } - + static void onBrowseHighLOD(void* data); static void onBrowseMediumLOD(void* data); static void onBrowseLowLOD(void* data); static void onBrowseLowestLOD(void* data); - + static void onUpload(void* data); - + static void onConsolidate(void* data); static void onScrubMaterials(void* data); static void onDecompose(void* data); static void onModelDecompositionComplete(LLModel* model, std::vector >& physics_mesh); - + static void refresh(LLUICtrl* ctrl, void* data); - + void updateResourceCost(); - + void loadModel(S32 lod); - + protected: friend class LLModelPreview; friend class LLMeshFilePicker; @@ -256,7 +176,7 @@ protected: static void onLowLODCommit(LLUICtrl*,void*); static void onLowestLODCommit(LLUICtrl*,void*); static void onPhysicsLODCommit(LLUICtrl*,void*); - + static void onHighLimitCommit(LLUICtrl*,void*); static void onMediumLimitCommit(LLUICtrl*,void*); static void onLowLimitCommit(LLUICtrl*,void*); @@ -264,41 +184,123 @@ protected: static void onPhysicsLimitCommit(LLUICtrl*,void*); static void onSmoothNormalsCommit(LLUICtrl*,void*); - + static void onAutoFillCommit(LLUICtrl*,void*); static void onShowEdgesCommit(LLUICtrl*,void*); - + static void onExplodeCommit(LLUICtrl*, void*); - + static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata); static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata); static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata); static void onClosePhysicsFloater(LLUICtrl* ctrl, void* userdata); - + void draw(); static void setLODMode(S32 lod, void* userdata); void setLODMode(S32 lod, S32 which_mode); - + static void setLimit(S32 lod, void* userdata); void setLimit(S32 lod, S32 limit); - + void showDecompFloater(); LLModelPreview* mModelPreview; - + LLFloater* mDecompFloater; LLPhysicsDecomp::decomp_params mDecompParams; - + S32 mLastMouseX; S32 mLastMouseY; LLRect mPreviewRect; U32 mGLName; BOOL mLoading; static S32 sUploadAmount; - + LLPointer mCurRequest; + +}; + +class LLModelPreview : public LLViewerDynamicTexture, public LLMutex +{ + public: + + LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp); + virtual ~LLModelPreview(); + + void resetPreviewTarget(); + void setPreviewTarget(F32 distance); + void setTexture(U32 name) { mTextureName = name; } + + BOOL render(); + void update(); + void genBuffers(S32 lod, bool skinned); + void clearBuffers(); + void refresh(); + void rotate(F32 yaw_radians, F32 pitch_radians); + void zoom(F32 zoom_amt); + void pan(F32 right, F32 up); + virtual BOOL needsRender() { return mNeedsUpdate; } + void setPreviewLOD(S32 lod); + void clearModel(S32 lod); + void loadModel(std::string filename, S32 lod); + void loadModelCallback(S32 lod); + void genLODs(S32 which_lod = -1); + void smoothNormals(); + void consolidate(); + void scrubMaterials(); + U32 calcResourceCost(); + void rebuildUploadData(); + void clearIncompatible(S32 lod); + void updateStatusMessages(); + bool containsRiggedAsset( void ); + + static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); + + protected: + friend class LLFloaterModelPreview; + friend class LLFloaterModelPreview::DecompRequest; + friend class LLPhysicsDecomp; + + LLFloaterModelPreview* mFMP; + + BOOL mNeedsUpdate; + bool mDirty; + U32 mTextureName; + F32 mCameraDistance; + F32 mCameraYaw; + F32 mCameraPitch; + F32 mCameraZoom; + LLVector3 mCameraOffset; + LLVector3 mPreviewTarget; + LLVector3 mPreviewScale; + S32 mPreviewLOD; + U32 mResourceCost; + S32 mLODMode[LLModel::NUM_LODS]; + S32 mLimit[LLModel::NUM_LODS]; + + LLModelLoader* mModelLoader; + + LLModelLoader::scene mScene[LLModel::NUM_LODS]; + LLModelLoader::scene mBaseScene; + + LLModelLoader::model_list mModel[LLModel::NUM_LODS]; + LLModelLoader::model_list mBaseModel; + + std::map, U32> mGroup; + std::map, U32> mObject; + std::map, std::vector > mPatch; + std::map, F32> mPercentage; + + std::map, std::vector > > mPhysicsMesh; + + LLMeshUploadThread::instance_list mUploadData; + std::set > mTextureSet; + + //map of vertex buffers to models (one vertex buffer in vector per face in model + std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; }; + #endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3 From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/newview/llfloatermodelpreview.h | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 417e207368..a7e87ba9a1 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -2,30 +2,25 @@ * @file llfloatermodelpreview.h * @brief LLFloaterModelPreview class definition * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, 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. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * 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. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * 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 * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 4733f2c4380991865b4b74f519a3a94a99550661 Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 15 Nov 2010 13:22:04 -0500 Subject: Implemented support for getting at the child translational element if the SID fails to resolved. --- indra/newview/llfloatermodelpreview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index a7e87ba9a1..54b2e7561a 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -101,6 +101,8 @@ public: LLImportMaterial profileToMaterial(domProfile_COMMON* material); std::string getElementLabel(daeElement *element); LLColor4 getDaeColor(daeElement* element); + + daeElement* getChildFromElement( daeElement* pElement, std::string const & name ); //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; -- cgit v1.2.3 From 26b3b37e87da0dae46d5e12a9ab4cae809df22de Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 15 Nov 2010 13:25:59 -0500 Subject: Backed out changeset: 1c9c6cdcccde --- indra/newview/llfloatermodelpreview.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 54b2e7561a..a7e87ba9a1 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -101,8 +101,6 @@ public: LLImportMaterial profileToMaterial(domProfile_COMMON* material); std::string getElementLabel(daeElement *element); LLColor4 getDaeColor(daeElement* element); - - daeElement* getChildFromElement( daeElement* pElement, std::string const & name ); //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; -- cgit v1.2.3 From f9a35fc4c622cf5b151900dd4590818d965a506b Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 15 Nov 2010 14:02:03 -0500 Subject: Implemented support for getting at the child translational element if the SID fails to resolved. --- indra/newview/llfloatermodelpreview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index a7e87ba9a1..e58596449b 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -101,6 +101,8 @@ public: LLImportMaterial profileToMaterial(domProfile_COMMON* material); std::string getElementLabel(daeElement *element); LLColor4 getDaeColor(daeElement* element); + + daeElement* getChildFromElement( daeElement* pElement, std::string const & name ); //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; -- cgit v1.2.3 From 47a5f12ce05ed08aa9bc5599dfff9e4cf9b83e44 Mon Sep 17 00:00:00 2001 From: prep linden Date: Wed, 17 Nov 2010 12:41:04 -0500 Subject: Implemented support for parsing bone offsets from a Collada file when no skeletal node is present. --- indra/newview/llfloatermodelpreview.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index e58596449b..65d46e5891 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -46,6 +46,8 @@ class LLFloaterModelPreview; class daeElement; class domProfile_COMMON; class domInstance_geometry; +class domNode; +class domTranslate; class LLPhysicsDecompFloater : public LLFloater { @@ -103,6 +105,11 @@ public: 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 ); + //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; -- cgit v1.2.3 From 3a1fbcab2a745e8e0d85720d6df9c83d7be2c1d8 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 19 Nov 2010 17:07:01 -0600 Subject: SH-448 Initial draft of implementing UI spec for "advanced" importer. --- indra/newview/llfloatermodelpreview.h | 56 ++++++++++++----------------------- 1 file changed, 19 insertions(+), 37 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index a7e87ba9a1..958a8f583a 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -47,14 +47,6 @@ class daeElement; class domProfile_COMMON; class domInstance_geometry; -class LLPhysicsDecompFloater : public LLFloater -{ -public: - - LLPhysicsDecompFloater(LLSD& key); - ~LLPhysicsDecompFloater(); -}; - class LLModelLoader : public LLThread { public: @@ -136,16 +128,12 @@ public: static void onMouseCaptureLostModelPreview(LLMouseHandler*); static void setUploadAmount(S32 amount) { sUploadAmount = amount; } - static void onBrowseHighLOD(void* data); - static void onBrowseMediumLOD(void* data); - static void onBrowseLowLOD(void* data); - static void onBrowseLowestLOD(void* data); + static void onBrowseLOD(void* data); static void onUpload(void* data); static void onConsolidate(void* data); - static void onScrubMaterials(void* data); - static void onDecompose(void* data); + static void onClearMaterials(void* data); static void onModelDecompositionComplete(LLModel* model, std::vector >& physics_mesh); static void refresh(LLUICtrl* ctrl, void* data); @@ -158,27 +146,16 @@ protected: friend class LLModelPreview; friend class LLMeshFilePicker; friend class LLPhysicsDecomp; - friend class LLPhysicsDecompFloater; - static void onDebugScaleCommit(LLUICtrl*, void*); + static void onImportScaleCommit(LLUICtrl*, void*); static void onUploadJointsCommit(LLUICtrl*,void*); static void onUploadSkinCommit(LLUICtrl*,void*); static void onPreviewLODCommit(LLUICtrl*,void*); - static void onHighLODCommit(LLUICtrl*,void*); - static void onMediumLODCommit(LLUICtrl*,void*); - static void onLowLODCommit(LLUICtrl*,void*); - static void onLowestLODCommit(LLUICtrl*,void*); - static void onPhysicsLODCommit(LLUICtrl*,void*); - - static void onHighLimitCommit(LLUICtrl*,void*); - static void onMediumLimitCommit(LLUICtrl*,void*); - static void onLowLimitCommit(LLUICtrl*,void*); - static void onLowestLimitCommit(LLUICtrl*,void*); - static void onPhysicsLimitCommit(LLUICtrl*,void*); + static void onTriangleLimitCommit(LLUICtrl*,void*); - static void onSmoothNormalsCommit(LLUICtrl*,void*); + static void onGenerateNormalsCommit(LLUICtrl*,void*); static void onAutoFillCommit(LLUICtrl*,void*); static void onShowEdgesCommit(LLUICtrl*,void*); @@ -188,20 +165,24 @@ protected: static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata); static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata); static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata); - static void onClosePhysicsFloater(LLUICtrl* ctrl, void* userdata); + + static void onPhysicsBrowse(LLUICtrl* ctrl, void* userdata); + static void onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata); + static void onPhysicsOptimize(LLUICtrl* ctrl, void* userdata); + static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata); + static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata); + + void draw(); - static void setLODMode(S32 lod, void* userdata); - void setLODMode(S32 lod, S32 which_mode); static void setLimit(S32 lod, void* userdata); void setLimit(S32 lod, S32 limit); - void showDecompFloater(); + void initDecompControls(); LLModelPreview* mModelPreview; - LLFloater* mDecompFloater; LLPhysicsDecomp::decomp_params mDecompParams; S32 mLastMouseX; @@ -227,6 +208,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void setPreviewTarget(F32 distance); void setTexture(U32 name) { mTextureName = name; } + void setPhysicsFromLOD(S32 lod); BOOL render(); void update(); void genBuffers(S32 lod, bool skinned); @@ -241,9 +223,9 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void loadModel(std::string filename, S32 lod); void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1); - void smoothNormals(); + void generateNormals(); void consolidate(); - void scrubMaterials(); + void clearMaterials(); U32 calcResourceCost(); void rebuildUploadData(); void clearIncompatible(S32 lod); @@ -271,9 +253,9 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex LLVector3 mPreviewScale; S32 mPreviewLOD; U32 mResourceCost; - S32 mLODMode[LLModel::NUM_LODS]; S32 mLimit[LLModel::NUM_LODS]; - + std::string mLODFile[LLModel::NUM_LODS]; + LLModelLoader* mModelLoader; -- cgit v1.2.3 From 43382f2849d5b2e8a5826a7a7d4f41254ab41735 Mon Sep 17 00:00:00 2001 From: prep linden Date: Mon, 22 Nov 2010 13:16:39 -0500 Subject: merge of earlier code that got stomped from a previous merge --- indra/newview/llfloatermodelpreview.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 7e9978f330..05106644dc 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -97,6 +97,7 @@ public: 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 ); -- cgit v1.2.3 From a1e59112d028469870c7d1b38c8dbb56f556959d Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 8 Dec 2010 14:50:25 -0500 Subject: Fix for SH-424 --- indra/newview/llfloatermodelpreview.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 05106644dc..2e98b8eb18 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -60,6 +60,7 @@ public: GENERATING_VERTEX_BUFFERS, GENERATING_LOD, DONE, + ERROR_PARSING, //basically loading failed } eLoadState; U32 mState; @@ -103,7 +104,9 @@ public: void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform ); void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform ); - + void setLoadState( U32 state ) { mState = state; } + U32 getLoadState( void ) { return mState; } + //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; }; -- cgit v1.2.3 From db1af2445dac667eb24c69d005509b8ff007cc9e Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Thu, 9 Dec 2010 17:30:17 -0800 Subject: Initial code for the upload model wizard - loading model is working, not much else --- indra/newview/llfloatermodelpreview.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 2e98b8eb18..b0317e3d2d 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -34,6 +34,7 @@ #include "llmeshrepository.h" #include "llmodel.h" #include "llthread.h" +#include "llviewermenufile.h" class LLComboBox; class LLJoint; @@ -202,7 +203,6 @@ protected: S32 mLastMouseY; LLRect mPreviewRect; U32 mGLName; - BOOL mLoading; static S32 sUploadAmount; LLPointer mCurRequest; @@ -210,11 +210,23 @@ protected: }; +class LLMeshFilePicker : public LLFilePickerThread +{ +public: + LLMeshFilePicker(LLModelPreview* mp, S32 lod); + virtual void notify(const std::string& filename); + +private: + LLModelPreview* mMP; + S32 mLOD; +}; + + class LLModelPreview : public LLViewerDynamicTexture, public LLMutex { public: - LLModelPreview(S32 width, S32 height, LLFloaterModelPreview* fmp); + LLModelPreview(S32 width, S32 height, LLFloater* fmp); virtual ~LLModelPreview(); void resetPreviewTarget(); @@ -244,15 +256,18 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void clearIncompatible(S32 lod); void updateStatusMessages(); bool containsRiggedAsset( void ); + void setAspect(F32 aspect) { mAspect = aspect; }; + //void setLoading(bool loading) { mLoading = loading; }; static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); protected: friend class LLFloaterModelPreview; + friend class LLFloaterModelWizard; friend class LLFloaterModelPreview::DecompRequest; friend class LLPhysicsDecomp; - LLFloaterModelPreview* mFMP; + LLFloater* mFMP; BOOL mNeedsUpdate; bool mDirty; @@ -268,6 +283,8 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex U32 mResourceCost; S32 mLimit[LLModel::NUM_LODS]; std::string mLODFile[LLModel::NUM_LODS]; + F32 mAspect; + bool mLoading; LLModelLoader* mModelLoader; -- cgit v1.2.3 From 0ae6e2b451e9dc71800740240a615d934c91e581 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Dec 2010 15:18:26 -0600 Subject: Reskin model importer according to latest spec, add extra LoD decimation parameters. --- indra/newview/llfloatermodelpreview.h | 36 ++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 05106644dc..4037a6976c 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -48,6 +48,8 @@ class domProfile_COMMON; class domInstance_geometry; class domNode; class domTranslate; +class LLMenuButton; +class LLToggleableMenu; class LLModelLoader : public LLThread { @@ -142,7 +144,6 @@ public: static void onUpload(void* data); - static void onConsolidate(void* data); static void onClearMaterials(void* data); static void onModelDecompositionComplete(LLModel* model, std::vector >& physics_mesh); @@ -152,6 +153,14 @@ public: void loadModel(S32 lod); + void onViewOptionChecked(const LLSD& userdata); + bool isViewOptionChecked(const LLSD& userdata); + bool isViewOptionEnabled(const LLSD& userdata); + void setViewOptionEnabled(const std::string& option, bool enabled); + void enableViewOption(const std::string& option); + void disableViewOption(const std::string& option); + void setViewOption(const std::string& option, bool value); + protected: friend class LLModelPreview; friend class LLMeshFilePicker; @@ -163,12 +172,10 @@ protected: static void onPreviewLODCommit(LLUICtrl*,void*); - static void onTriangleLimitCommit(LLUICtrl*,void*); - static void onGenerateNormalsCommit(LLUICtrl*,void*); static void onAutoFillCommit(LLUICtrl*,void*); - static void onShowEdgesCommit(LLUICtrl*,void*); + static void onLODParamCommit(LLUICtrl*,void*); static void onExplodeCommit(LLUICtrl*, void*); @@ -186,9 +193,6 @@ protected: void draw(); - static void setLimit(S32 lod, void* userdata); - void setLimit(S32 lod, S32 limit); - void initDecompControls(); LLModelPreview* mModelPreview; @@ -204,6 +208,13 @@ protected: LLPointer mCurRequest; + std::map mViewOption; + + //use "disabled" as false by default + std::map mViewOptionDisabled; + + LLMenuButton* mViewOptionMenuButton; + LLToggleableMenu* mViewOptionMenu; }; @@ -253,6 +264,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex BOOL mNeedsUpdate; bool mDirty; + bool mGenLOD; U32 mTextureName; F32 mCameraDistance; F32 mCameraYaw; @@ -263,9 +275,15 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex LLVector3 mPreviewScale; S32 mPreviewLOD; U32 mResourceCost; - S32 mLimit[LLModel::NUM_LODS]; std::string mLODFile[LLModel::NUM_LODS]; + //GLOD object parameters (must rebuild object if these change) + F32 mBuildShareTolerance; + U32 mBuildQueueMode; + U32 mBuildOperator; + U32 mBuildBorderMode; + + LLModelLoader* mModelLoader; @@ -279,7 +297,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex std::map, U32> mObject; std::map, std::vector > mPatch; std::map, F32> mPercentage; - + U32 mMaxTriangleLimit; std::map, std::vector > > mPhysicsMesh; LLMeshUploadThread::instance_list mUploadData; -- cgit v1.2.3 From 285ba513368c6b692ea2eb5d13b85300c76adbea Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Fri, 10 Dec 2010 17:05:38 -0800 Subject: fixed model uploader aspect not updating, text not following resize, and file name not filling in --- indra/newview/llfloatermodelpreview.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index b0317e3d2d..a7d43a3d53 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -256,8 +256,6 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void clearIncompatible(S32 lod); void updateStatusMessages(); bool containsRiggedAsset( void ); - void setAspect(F32 aspect) { mAspect = aspect; }; - //void setLoading(bool loading) { mLoading = loading; }; static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); @@ -283,7 +281,6 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex U32 mResourceCost; S32 mLimit[LLModel::NUM_LODS]; std::string mLODFile[LLModel::NUM_LODS]; - F32 mAspect; bool mLoading; LLModelLoader* mModelLoader; -- cgit v1.2.3 From 2508bb2d85484a958f6d82ee40346a9c5cfec7ff Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Dec 2010 20:40:28 -0600 Subject: More correct GLOD usage -- one group, many objects. --- indra/newview/llfloatermodelpreview.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index d6cc9ccec6..4a589a6108 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -268,6 +268,8 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void updateStatusMessages(); bool containsRiggedAsset( void ); void setAspect(F32 aspect) { mAspect = aspect; }; + void clearGLODGroup(); + //void setLoading(bool loading) { mLoading = loading; }; static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); @@ -313,10 +315,8 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex LLModelLoader::model_list mModel[LLModel::NUM_LODS]; LLModelLoader::model_list mBaseModel; - std::map, U32> mGroup; + U32 mGroup; std::map, U32> mObject; - std::map, std::vector > mPatch; - std::map, F32> mPercentage; U32 mMaxTriangleLimit; std::map, std::vector > > mPhysicsMesh; -- cgit v1.2.3 From 6a0e8fc13ec246f69e5718ee91a30117ae703c2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 20 Dec 2010 13:52:48 -0500 Subject: thread safety checking --- indra/newview/llfloatermodelpreview.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/llfloatermodelpreview.h (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h old mode 100644 new mode 100755 index e233f3672a..2c89927203 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -278,7 +278,8 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex friend class LLFloaterModelPreview::DecompRequest; friend class LLPhysicsDecomp; - LLFloater* mFMP; + LLFloater* mFMP; + LLFloater* getFMP(); BOOL mNeedsUpdate; bool mDirty; -- cgit v1.2.3 From 4bd6edc6b037195012583467a3e5e754f6a5af77 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 20 Dec 2010 17:11:34 -0500 Subject: SH-682 FIX, SH-594 FIX - removed mFMP wrapper, added thread checking. Moved onIdle functions to llcallbacklist. --- indra/newview/llfloatermodelpreview.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 2c89927203..ae4cf18fee 100755 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -279,7 +279,6 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex friend class LLPhysicsDecomp; LLFloater* mFMP; - LLFloater* getFMP(); BOOL mNeedsUpdate; bool mDirty; -- cgit v1.2.3 From e7f3f3bdbbec310030209e09d389cd434adb7991 Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Mon, 20 Dec 2010 17:32:05 -0800 Subject: model upload wizard - added optimization and state changes --- indra/newview/llfloatermodelpreview.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index ae4cf18fee..64b220d86b 100755 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -52,6 +52,8 @@ class domTranslate; class LLMenuButton; class LLToggleableMenu; +const S32 NUM_LOD = 4; + class LLModelLoader : public LLThread { public: @@ -258,7 +260,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void clearModel(S32 lod); void loadModel(std::string filename, S32 lod); void loadModelCallback(S32 lod); - void genLODs(S32 which_lod = -1); + void genLODs(S32 which_lod = -1, U32 decimation = 3); void generateNormals(); void consolidate(); void clearMaterials(); -- cgit v1.2.3 From e1b1db9575945fa8436b4ebabf55242635b61f38 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Dec 2010 01:05:35 -0600 Subject: SH-636 Update physics tab to new spec, move "completed" physics decomp callbacks to main thread, add object model to decomposition tool, make imported model scales non-uniform. --- indra/newview/llfloatermodelpreview.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index e233f3672a..f7873cddbb 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -199,6 +199,8 @@ protected: void initDecompControls(); + void setStatusMessage(const std::string& msg); + LLModelPreview* mModelPreview; LLPhysicsDecomp::decomp_params mDecompParams; @@ -209,8 +211,9 @@ protected: U32 mGLName; static S32 sUploadAmount; - LLPointer mCurRequest; - + std::set > mCurRequest; + std::string mStatusMessage; + std::map mViewOption; //use "disabled" as false by default @@ -218,7 +221,7 @@ protected: LLMenuButton* mViewOptionMenuButton; LLToggleableMenu* mViewOptionMenu; - + LLMutex* mStatusLock; }; class LLMeshFilePicker : public LLFilePickerThread -- cgit v1.2.3 From 8ba0baa63109d5e45c1f3cfd75c7d230ff99031f Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 22 Dec 2010 10:55:48 -0700 Subject: fix for SH-648: Crash on exit in LLViewerFetchedTexture (ref count error) --- indra/newview/llfloatermodelpreview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 64b220d86b..623cd286fb 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -52,7 +52,7 @@ class domTranslate; class LLMenuButton; class LLToggleableMenu; -const S32 NUM_LOD = 4; +const S32 NUM_LOD = 4; class LLModelLoader : public LLThread { -- cgit v1.2.3 From 07d3480ec35a9a5bade25acb99fc39935bad38a2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Dec 2010 15:18:55 -0600 Subject: SH-658 Preserve LOD mode when switching between preview LoDs. --- indra/newview/llfloatermodelpreview.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 8c7ab39e55..9b908eafee 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -194,9 +194,7 @@ protected: static void onPhysicsOptimize(LLUICtrl* ctrl, void* userdata); static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata); static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata); - - - + void draw(); void initDecompControls(); @@ -220,6 +218,12 @@ protected: //use "disabled" as false by default std::map mViewOptionDisabled; + + //store which lod mode each LOD is using + // 0 - load from file + // 1 - auto generate + // 2 - None + S32 mLODMode[4]; LLMenuButton* mViewOptionMenuButton; LLToggleableMenu* mViewOptionMenu; -- cgit v1.2.3 From d196348d0f4bd542eee3702329dab28952b8a5e5 Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Fri, 31 Dec 2010 12:53:39 -0800 Subject: Physics stage of wizard --- indra/newview/llfloatermodelpreview.h | 668 +++++++++++++++++----------------- 1 file changed, 332 insertions(+), 336 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 48263d493a..df1b06aeaf 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -1,337 +1,333 @@ -/** - * @file llfloatermodelpreview.h - * @brief LLFloaterModelPreview class definition - * - * $LicenseInfo:firstyear=2004&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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_LLFLOATERMODELPREVIEW_H -#define LL_LLFLOATERMODELPREVIEW_H - -#include "llfloaternamedesc.h" - -#include "lldynamictexture.h" -#include "llquaternion.h" -#include "llmeshrepository.h" -#include "llmodel.h" -#include "llthread.h" -#include "llviewermenufile.h" - -class LLComboBox; -class LLJoint; -class LLViewerJointMesh; -class LLVOAvatar; -class LLTextBox; -class LLVertexBuffer; -class LLModelPreview; -class LLFloaterModelPreview; -class daeElement; -class domProfile_COMMON; -class domInstance_geometry; -class domNode; -class domTranslate; -class LLMenuButton; -class LLToggleableMenu; - -const S32 NUM_LOD = 4; - -class LLModelLoader : public LLThread -{ -public: - typedef enum - { - STARTING = 0, - READING_FILE, - CREATING_FACES, - GENERATING_VERTEX_BUFFERS, - GENERATING_LOD, - DONE, - ERROR_PARSING, //basically loading failed - } eLoadState; - - U32 mState; - std::string mFilename; - S32 mLod; - LLModelPreview* mPreview; - LLMatrix4 mTransform; - BOOL mFirstTransform; - LLVector3 mExtents[2]; - - std::map > mModel; - - typedef std::vector > model_list; - model_list mModelList; - - typedef std::vector model_instance_list; - - typedef std::map scene; - - scene mScene; - - typedef std::queue > model_queue; - - //queue of models that need a physics rep - model_queue mPhysicsQ; - - LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview); - - virtual void run(); - - void processElement(daeElement* element); - std::vector getMaterials(LLModel* model, domInstance_geometry* instance_geo); - LLImportMaterial profileToMaterial(domProfile_COMMON* material); - std::string getElementLabel(daeElement *element); - 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 setLoadState( U32 state ) { mState = state; } - U32 getLoadState( void ) { return mState; } - - //map of avatar joints as named in COLLADA assets to internal joint names - std::map mJointMap; -}; - -class LLFloaterModelPreview : public LLFloater -{ -public: - - class DecompRequest : public LLPhysicsDecomp::Request - { - public: - S32 mContinue; - LLPointer mModel; - - DecompRequest(const std::string& stage, LLModel* mdl); - virtual S32 statusCallback(const char* status, S32 p1, S32 p2); - virtual void completed(); - - }; - static LLFloaterModelPreview* sInstance; - - LLFloaterModelPreview(const LLSD& key); - virtual ~LLFloaterModelPreview(); - - virtual BOOL postBuild(); - - BOOL handleMouseDown(S32 x, S32 y, MASK mask); - BOOL handleMouseUp(S32 x, S32 y, MASK mask); - BOOL handleHover(S32 x, S32 y, MASK mask); - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - - static void onMouseCaptureLostModelPreview(LLMouseHandler*); - static void setUploadAmount(S32 amount) { sUploadAmount = amount; } - - static void onBrowseLOD(void* data); - - static void onUpload(void* data); - - static void onClearMaterials(void* data); - static void onModelDecompositionComplete(LLModel* model, std::vector >& physics_mesh); - - static void refresh(LLUICtrl* ctrl, void* data); - - void updateResourceCost(); - - void loadModel(S32 lod); - - void onViewOptionChecked(const LLSD& userdata); - bool isViewOptionChecked(const LLSD& userdata); - bool isViewOptionEnabled(const LLSD& userdata); - void setViewOptionEnabled(const std::string& option, bool enabled); - void enableViewOption(const std::string& option); - void disableViewOption(const std::string& option); - void setViewOption(const std::string& option, bool value); - -protected: - friend class LLModelPreview; - friend class LLMeshFilePicker; - friend class LLPhysicsDecomp; - - static void onImportScaleCommit(LLUICtrl*, void*); - static void onUploadJointsCommit(LLUICtrl*,void*); - static void onUploadSkinCommit(LLUICtrl*,void*); - - static void onPreviewLODCommit(LLUICtrl*,void*); - - static void onGenerateNormalsCommit(LLUICtrl*,void*); - - static void onAutoFillCommit(LLUICtrl*,void*); - static void onLODParamCommit(LLUICtrl*,void*); - - static void onExplodeCommit(LLUICtrl*, void*); - - static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata); - static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata); - static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata); - - static void onPhysicsBrowse(LLUICtrl* ctrl, void* userdata); - static void onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata); - static void onPhysicsOptimize(LLUICtrl* ctrl, void* userdata); - static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata); - static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata); - - void draw(); - - void initDecompControls(); - - void setStatusMessage(const std::string& msg); - - LLModelPreview* mModelPreview; - - LLPhysicsDecomp::decomp_params mDecompParams; - - S32 mLastMouseX; - S32 mLastMouseY; - LLRect mPreviewRect; - U32 mGLName; - static S32 sUploadAmount; - - std::set > mCurRequest; - std::string mStatusMessage; - +/** + * @file llfloatermodelpreview.h + * @brief LLFloaterModelPreview class definition + * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_LLFLOATERMODELPREVIEW_H +#define LL_LLFLOATERMODELPREVIEW_H + +#include "llfloaternamedesc.h" + +#include "lldynamictexture.h" +#include "llquaternion.h" +#include "llmeshrepository.h" +#include "llmodel.h" +#include "llthread.h" +#include "llviewermenufile.h" + +class LLComboBox; +class LLJoint; +class LLViewerJointMesh; +class LLVOAvatar; +class LLTextBox; +class LLVertexBuffer; +class LLModelPreview; +class LLFloaterModelPreview; +class daeElement; +class domProfile_COMMON; +class domInstance_geometry; +class domNode; +class domTranslate; +class LLMenuButton; +class LLToggleableMenu; + +const S32 NUM_LOD = 4; + +class LLModelLoader : public LLThread +{ +public: + typedef enum + { + STARTING = 0, + READING_FILE, + CREATING_FACES, + GENERATING_VERTEX_BUFFERS, + GENERATING_LOD, + DONE, + ERROR_PARSING, //basically loading failed + } eLoadState; + + U32 mState; + std::string mFilename; + S32 mLod; + LLModelPreview* mPreview; + LLMatrix4 mTransform; + BOOL mFirstTransform; + LLVector3 mExtents[2]; + + std::map > mModel; + + typedef std::vector > model_list; + model_list mModelList; + + typedef std::vector model_instance_list; + + typedef std::map scene; + + scene mScene; + + typedef std::queue > model_queue; + + //queue of models that need a physics rep + model_queue mPhysicsQ; + + LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview); + + virtual void run(); + + void processElement(daeElement* element); + std::vector getMaterials(LLModel* model, domInstance_geometry* instance_geo); + LLImportMaterial profileToMaterial(domProfile_COMMON* material); + std::string getElementLabel(daeElement *element); + 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 setLoadState( U32 state ) { mState = state; } + U32 getLoadState( void ) { return mState; } + + //map of avatar joints as named in COLLADA assets to internal joint names + std::map mJointMap; +}; + +class LLFloaterModelPreview : public LLFloater +{ +public: + + class DecompRequest : public LLPhysicsDecomp::Request + { + public: + S32 mContinue; + LLPointer mModel; + + DecompRequest(const std::string& stage, LLModel* mdl); + virtual S32 statusCallback(const char* status, S32 p1, S32 p2); + virtual void completed(); + + }; + static LLFloaterModelPreview* sInstance; + + LLFloaterModelPreview(const LLSD& key); + virtual ~LLFloaterModelPreview(); + + virtual BOOL postBuild(); + + BOOL handleMouseDown(S32 x, S32 y, MASK mask); + BOOL handleMouseUp(S32 x, S32 y, MASK mask); + BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + + static void onMouseCaptureLostModelPreview(LLMouseHandler*); + static void setUploadAmount(S32 amount) { sUploadAmount = amount; } + + static void onBrowseLOD(void* data); + + static void onUpload(void* data); + + static void onClearMaterials(void* data); + + static void refresh(LLUICtrl* ctrl, void* data); + + void updateResourceCost(); + + void loadModel(S32 lod); + + void onViewOptionChecked(const LLSD& userdata); + bool isViewOptionChecked(const LLSD& userdata); + bool isViewOptionEnabled(const LLSD& userdata); + void setViewOptionEnabled(const std::string& option, bool enabled); + void enableViewOption(const std::string& option); + void disableViewOption(const std::string& option); + +protected: + friend class LLModelPreview; + friend class LLMeshFilePicker; + friend class LLPhysicsDecomp; + + static void onImportScaleCommit(LLUICtrl*, void*); + static void onUploadJointsCommit(LLUICtrl*,void*); + static void onUploadSkinCommit(LLUICtrl*,void*); + + static void onPreviewLODCommit(LLUICtrl*,void*); + + static void onGenerateNormalsCommit(LLUICtrl*,void*); + + static void onAutoFillCommit(LLUICtrl*,void*); + static void onLODParamCommit(LLUICtrl*,void*); + + static void onExplodeCommit(LLUICtrl*, void*); + + static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata); + static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata); + static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata); + + static void onPhysicsBrowse(LLUICtrl* ctrl, void* userdata); + static void onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata); + static void onPhysicsOptimize(LLUICtrl* ctrl, void* userdata); + static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata); + static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata); + + void draw(); + + void initDecompControls(); + + void setStatusMessage(const std::string& msg); + + LLModelPreview* mModelPreview; + + LLPhysicsDecomp::decomp_params mDecompParams; + + S32 mLastMouseX; + S32 mLastMouseY; + LLRect mPreviewRect; + U32 mGLName; + static S32 sUploadAmount; + + std::set > mCurRequest; + std::string mStatusMessage; + + //use "disabled" as false by default + std::map mViewOptionDisabled; + + //store which lod mode each LOD is using + // 0 - load from file + // 1 - auto generate + // 2 - None + S32 mLODMode[4]; + + LLMenuButton* mViewOptionMenuButton; + LLToggleableMenu* mViewOptionMenu; + LLMutex* mStatusLock; +}; + +class LLMeshFilePicker : public LLFilePickerThread +{ +public: + LLMeshFilePicker(LLModelPreview* mp, S32 lod); + virtual void notify(const std::string& filename); + +private: + LLModelPreview* mMP; + S32 mLOD; +}; + + +class LLModelPreview : public LLViewerDynamicTexture, public LLMutex +{ + public: + + LLModelPreview(S32 width, S32 height, LLFloater* fmp); + virtual ~LLModelPreview(); + + void resetPreviewTarget(); + void setPreviewTarget(F32 distance); + void setTexture(U32 name) { mTextureName = name; } + + void setPhysicsFromLOD(S32 lod); + BOOL render(); + void update(); + void genBuffers(S32 lod, bool skinned); + void clearBuffers(); + void refresh(); + void rotate(F32 yaw_radians, F32 pitch_radians); + void zoom(F32 zoom_amt); + void pan(F32 right, F32 up); + virtual BOOL needsRender() { return mNeedsUpdate; } + void setPreviewLOD(S32 lod); + void clearModel(S32 lod); + void loadModel(std::string filename, S32 lod); + void loadModelCallback(S32 lod); + void genLODs(S32 which_lod = -1, U32 decimation = 3); + void generateNormals(); + void consolidate(); + void clearMaterials(); + U32 calcResourceCost(); + void rebuildUploadData(); + void clearIncompatible(S32 lod); + void updateStatusMessages(); + bool containsRiggedAsset( void ); + void clearGLODGroup(); + + + static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); + + protected: + friend class LLFloaterModelPreview; + friend class LLFloaterModelWizard; + friend class LLFloaterModelPreview::DecompRequest; + friend class LLPhysicsDecomp; + + LLFloater* mFMP; + + BOOL mNeedsUpdate; + bool mDirty; + bool mGenLOD; + U32 mTextureName; + F32 mCameraDistance; + F32 mCameraYaw; + F32 mCameraPitch; + F32 mCameraZoom; + LLVector3 mCameraOffset; + LLVector3 mPreviewTarget; + LLVector3 mPreviewScale; + S32 mPreviewLOD; + U32 mResourceCost; + std::string mLODFile[LLModel::NUM_LODS]; + bool mLoading; + std::map mViewOption; - - //use "disabled" as false by default - std::map mViewOptionDisabled; - - //store which lod mode each LOD is using - // 0 - load from file - // 1 - auto generate - // 2 - None - S32 mLODMode[4]; - - LLMenuButton* mViewOptionMenuButton; - LLToggleableMenu* mViewOptionMenu; - LLMutex* mStatusLock; -}; - -class LLMeshFilePicker : public LLFilePickerThread -{ -public: - LLMeshFilePicker(LLModelPreview* mp, S32 lod); - virtual void notify(const std::string& filename); - -private: - LLModelPreview* mMP; - S32 mLOD; -}; - - -class LLModelPreview : public LLViewerDynamicTexture, public LLMutex -{ - public: - - LLModelPreview(S32 width, S32 height, LLFloater* fmp); - virtual ~LLModelPreview(); - - void resetPreviewTarget(); - void setPreviewTarget(F32 distance); - void setTexture(U32 name) { mTextureName = name; } - - void setPhysicsFromLOD(S32 lod); - BOOL render(); - void update(); - void genBuffers(S32 lod, bool skinned); - void clearBuffers(); - void refresh(); - void rotate(F32 yaw_radians, F32 pitch_radians); - void zoom(F32 zoom_amt); - void pan(F32 right, F32 up); - virtual BOOL needsRender() { return mNeedsUpdate; } - void setPreviewLOD(S32 lod); - void clearModel(S32 lod); - void loadModel(std::string filename, S32 lod); - void loadModelCallback(S32 lod); - void genLODs(S32 which_lod = -1, U32 decimation = 3); - void generateNormals(); - void consolidate(); - void clearMaterials(); - U32 calcResourceCost(); - void rebuildUploadData(); - void clearIncompatible(S32 lod); - void updateStatusMessages(); - bool containsRiggedAsset( void ); - void clearGLODGroup(); - - - static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); - - protected: - friend class LLFloaterModelPreview; - friend class LLFloaterModelWizard; - friend class LLFloaterModelPreview::DecompRequest; - friend class LLPhysicsDecomp; - - LLFloater* mFMP; - - BOOL mNeedsUpdate; - bool mDirty; - bool mGenLOD; - U32 mTextureName; - F32 mCameraDistance; - F32 mCameraYaw; - F32 mCameraPitch; - F32 mCameraZoom; - LLVector3 mCameraOffset; - LLVector3 mPreviewTarget; - LLVector3 mPreviewScale; - S32 mPreviewLOD; - U32 mResourceCost; - std::string mLODFile[LLModel::NUM_LODS]; - bool mLoading; - - //GLOD object parameters (must rebuild object if these change) - F32 mBuildShareTolerance; - U32 mBuildQueueMode; - U32 mBuildOperator; - U32 mBuildBorderMode; - - - LLModelLoader* mModelLoader; - - - LLModelLoader::scene mScene[LLModel::NUM_LODS]; - LLModelLoader::scene mBaseScene; - - LLModelLoader::model_list mModel[LLModel::NUM_LODS]; - LLModelLoader::model_list mBaseModel; - - U32 mGroup; - std::map, U32> mObject; - U32 mMaxTriangleLimit; - std::map, std::vector > > mPhysicsMesh; - - LLMeshUploadThread::instance_list mUploadData; - std::set > mTextureSet; - - //map of vertex buffers to models (one vertex buffer in vector per face in model - std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; -}; - - -#endif // LL_LLFLOATERMODELPREVIEW_H + + //GLOD object parameters (must rebuild object if these change) + F32 mBuildShareTolerance; + U32 mBuildQueueMode; + U32 mBuildOperator; + U32 mBuildBorderMode; + + LLModelLoader* mModelLoader; + + LLModelLoader::scene mScene[LLModel::NUM_LODS]; + LLModelLoader::scene mBaseScene; + + LLModelLoader::model_list mModel[LLModel::NUM_LODS]; + LLModelLoader::model_list mBaseModel; + + U32 mGroup; + std::map, U32> mObject; + U32 mMaxTriangleLimit; + std::map, std::vector > > mPhysicsMesh; + + LLMeshUploadThread::instance_list mUploadData; + std::set > mTextureSet; + + //map of vertex buffers to models (one vertex buffer in vector per face in model + std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; +}; + + +#endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3 From 33d9b10fbb9d3de79d389174c92e5b852dbbccdc Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 31 Dec 2010 16:48:50 -0600 Subject: SH-727 Working cancel button and cancel buttons for physics decomp stages. --- indra/newview/llfloatermodelpreview.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 48263d493a..32cfd94d66 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -187,6 +187,7 @@ protected: static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata); static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata); + static void onCancel(LLUICtrl* ctrl, void* userdata); static void onPhysicsStageCancel(LLUICtrl* ctrl, void* userdata); static void onPhysicsBrowse(LLUICtrl* ctrl, void* userdata); -- cgit v1.2.3 From 8eda31456a0466cfa7674a881ebc69ea2abbf8a1 Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Tue, 4 Jan 2011 10:18:15 -0800 Subject: fixing mac build error --- indra/newview/llfloatermodelpreview.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index df1b06aeaf..11c2447da5 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -30,6 +30,7 @@ #include "llfloaternamedesc.h" #include "lldynamictexture.h" +#include "llfloatermodelwizard.h" #include "llquaternion.h" #include "llmeshrepository.h" #include "llmodel.h" @@ -281,6 +282,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex friend class LLFloaterModelPreview; friend class LLFloaterModelWizard; friend class LLFloaterModelPreview::DecompRequest; + friend class LLFloaterModelWizard::DecompRequest; friend class LLPhysicsDecomp; LLFloater* mFMP; @@ -301,7 +303,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex std::string mLODFile[LLModel::NUM_LODS]; bool mLoading; - std::map mViewOption; + std::map mViewOption; //GLOD object parameters (must rebuild object if these change) F32 mBuildShareTolerance; -- cgit v1.2.3 From 961e50aab40fe09632e4f3f9aa385abd0fb42735 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 4 Jan 2011 16:22:38 -0700 Subject: clear some LLPointer issues for SH-694: check if there are any other LLPointer issues in the mesh model uploading flow and fix them if exist. --- indra/newview/llfloatermodelpreview.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 48263d493a..46c8a73cf2 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -96,6 +96,7 @@ public: virtual void run(); + void loadTextures() ; //called in the main thread. void processElement(daeElement* element); std::vector getMaterials(LLModel* model, domInstance_geometry* instance_geo); LLImportMaterial profileToMaterial(domProfile_COMMON* material); @@ -327,7 +328,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex std::map, std::vector > > mPhysicsMesh; LLMeshUploadThread::instance_list mUploadData; - std::set > mTextureSet; + std::set mTextureSet; //map of vertex buffers to models (one vertex buffer in vector per face in model std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; -- cgit v1.2.3 From 5b09da5079d576678eb5d66a5518044d1b22664f Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 5 Jan 2011 16:07:16 -0500 Subject: Fix for SH-579 --- indra/newview/llfloatermodelpreview.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 9dceb9c145..04e5b9591c 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -111,11 +111,16 @@ public: void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform ); void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform ); + bool doesJointArrayContainACompleteRig( const std::vector &modelJointList ); + bool checkForCompleteRig( const std::vector &jointListFromModel ); + void setLoadState( U32 state ) { mState = state; } U32 getLoadState( void ) { return mState; } //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; + std::deque mMasterJointList; + bool mResetJoints; }; class LLFloaterModelPreview : public LLFloater -- cgit v1.2.3 From f243f7e550b9dadd26d119bfeb4b215aa809997c Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Thu, 6 Jan 2011 16:42:18 -0800 Subject: added callback for updating wizard dimensions and costs from the model preview properly enabling/disabling wizard buttons xml ui fixes --- indra/newview/llfloatermodelpreview.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 11c2447da5..a791f3c44c 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -146,6 +146,8 @@ public: static void onMouseCaptureLostModelPreview(LLMouseHandler*); static void setUploadAmount(S32 amount) { sUploadAmount = amount; } + + void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); static void onBrowseLOD(void* data); @@ -240,9 +242,10 @@ private: class LLModelPreview : public LLViewerDynamicTexture, public LLMutex -{ - public: - +{ + typedef boost::signals2::signal details_signal_t; + +public: LLModelPreview(S32 width, S32 height, LLFloater* fmp); virtual ~LLModelPreview(); @@ -275,9 +278,10 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex bool containsRiggedAsset( void ); void clearGLODGroup(); - static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); - + + boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){ return mDetailsSignal.connect(cb); } + protected: friend class LLFloaterModelPreview; friend class LLFloaterModelWizard; @@ -329,6 +333,8 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex //map of vertex buffers to models (one vertex buffer in vector per face in model std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; + + details_signal_t mDetailsSignal; }; -- cgit v1.2.3 From 997c0d3924015910b62acaa85e46844fcfb43ec0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 11 Jan 2011 16:39:28 -0500 Subject: SH-742 FIX, SH-743 FIX: now treat requesting a specific triangle limit differently from changing some other LOD parameter, to avoid successive simplification problem --- indra/newview/llfloatermodelpreview.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/llfloatermodelpreview.h (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h old mode 100644 new mode 100755 index 04e5b9591c..0fccc4d765 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -187,6 +187,7 @@ protected: static void onAutoFillCommit(LLUICtrl*,void*); static void onLODParamCommit(LLUICtrl*,void*); + static void onLODParamCommitTriangleLimit(LLUICtrl*,void*); static void onExplodeCommit(LLUICtrl*, void*); @@ -232,6 +233,7 @@ protected: LLMenuButton* mViewOptionMenuButton; LLToggleableMenu* mViewOptionMenu; LLMutex* mStatusLock; + }; class LLMeshFilePicker : public LLFilePickerThread @@ -247,6 +249,7 @@ private: class LLModelPreview : public LLViewerDynamicTexture, public LLMutex + { public: @@ -271,7 +274,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void clearModel(S32 lod); void loadModel(std::string filename, S32 lod); void loadModelCallback(S32 lod); - void genLODs(S32 which_lod = -1, U32 decimation = 3); + void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); void consolidate(); void clearMaterials(); @@ -281,6 +284,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void updateStatusMessages(); bool containsRiggedAsset( void ); void clearGLODGroup(); + void onLODParamCommit(bool enforce_tri_limit); static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); -- cgit v1.2.3 From 3a47555dc27ffa74f5427e0ef44fa25b505f6c16 Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Wed, 12 Jan 2011 13:38:47 -0800 Subject: SH-777 Wizard top buttons need to be clickable and switch between wizard steps --- indra/newview/llfloatermodelpreview.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 63377bb1d6..fbf6ead930 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -251,7 +251,8 @@ private: class LLModelPreview : public LLViewerDynamicTexture, public LLMutex { typedef boost::signals2::signal details_signal_t; - + typedef boost::signals2::signal model_loaded_signal_t; + public: LLModelPreview(S32 width, S32 height, LLFloater* fmp); virtual ~LLModelPreview(); @@ -288,6 +289,7 @@ public: static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){ return mDetailsSignal.connect(cb); } + boost::signals2::connection setModelLoadedCallback( const model_loaded_signal_t::slot_type& cb ){ return mModelLoadedSignal.connect(cb); } protected: friend class LLFloaterModelPreview; @@ -342,6 +344,7 @@ public: std::map > > mVertexBuffer[LLModel::NUM_LODS+1]; details_signal_t mDetailsSignal; + model_loaded_signal_t mModelLoadedSignal; }; -- cgit v1.2.3 From e47ff7bd4748202ff4e6a33bd78b84288d1d1ec8 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 12 Jan 2011 17:35:31 -0500 Subject: SH-717 Viewer crash on exit after Upload model dialog could not be spawned Took out unused function that was seen in crash report from this bug. No functionality change. --- indra/newview/llfloatermodelpreview.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 04e5b9591c..3747abedd1 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -279,7 +279,6 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex void rebuildUploadData(); void clearIncompatible(S32 lod); void updateStatusMessages(); - bool containsRiggedAsset( void ); void clearGLODGroup(); -- cgit v1.2.3 From c690c30ec173faf8d8087ecb38cadbb9dd1adb4e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 22 Feb 2011 18:33:33 -0600 Subject: SH-438 Use node name instead of mesh name for object names when importing meshes. --- indra/newview/llfloatermodelpreview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 8fc85cebb9..e1c520134b 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -279,7 +279,7 @@ public: void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); - void consolidate(); + void clearMaterials(); U32 calcResourceCost(); void rebuildUploadData(); -- cgit v1.2.3 From 4abb8b33fa0c3b5e5f809a783cfc62a9e02af338 Mon Sep 17 00:00:00 2001 From: prep linden Date: Mon, 28 Feb 2011 12:20:31 -0500 Subject: sh-517 Content authors can specify a pivot node (Assetpivot). --- indra/newview/llfloatermodelpreview.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index e1c520134b..8a01f7db2c 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -114,6 +114,9 @@ public: bool doesJointArrayContainACompleteRig( const std::vector &modelJointList ); bool checkForCompleteRig( const std::vector &jointListFromModel ); + void handlePivotPoint( daeElement* pRoot ); + bool isNodeAPivotPoint( domNode* pNode ); + void setLoadState( U32 state ) { mState = state; } U32 getLoadState( void ) { return mState; } @@ -279,7 +282,7 @@ public: void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); - + void alterModelsPivot( void ); void clearMaterials(); U32 calcResourceCost(); void rebuildUploadData(); @@ -287,7 +290,10 @@ public: void updateStatusMessages(); void clearGLODGroup(); void onLODParamCommit(bool enforce_tri_limit); - + const bool getModelPivot( void ) const { return mHasPivot; } + void setHasPivot( bool val ) { mHasPivot = val; } + void setModelPivot( const LLVector3& pivot ) { mModelPivot = pivot; } + static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){ return mDetailsSignal.connect(cb); } @@ -347,6 +353,9 @@ public: details_signal_t mDetailsSignal; model_loaded_signal_t mModelLoadedSignal; + + LLVector3 mModelPivot; + bool mHasPivot; }; -- cgit v1.2.3 From c2bdb9be1455b7e6414b9a7d034b3118f6a07f23 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 9 Mar 2011 18:19:12 -0600 Subject: SH-706 Make triangle limit and error threshold spinners respond to arrow clicks. --- indra/newview/llfloatermodelpreview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 8a01f7db2c..ffda565fef 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -331,6 +331,8 @@ public: U32 mBuildQueueMode; U32 mBuildOperator; U32 mBuildBorderMode; + S32 mRequestedTriangleCount[LLModel::NUM_LODS]; + LLModelLoader* mModelLoader; -- cgit v1.2.3 From bc54afb907e65ab2d73e1f040551c6191a4a7682 Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 14 Mar 2011 16:17:34 -0400 Subject: WIP: manual pelvis offset for rigs that contain bone offsets --- indra/newview/llfloatermodelpreview.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index ffda565fef..aac20244cc 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -183,6 +183,7 @@ protected: friend class LLPhysicsDecomp; static void onImportScaleCommit(LLUICtrl*, void*); + static void onPelvisOffsetCommit(LLUICtrl*, void*); static void onUploadJointsCommit(LLUICtrl*,void*); static void onUploadSkinCommit(LLUICtrl*,void*); -- cgit v1.2.3 From 5a940793e19225c065f1e37c1be32edd936a5246 Mon Sep 17 00:00:00 2001 From: prep linden Date: Wed, 16 Mar 2011 10:15:06 -0400 Subject: WIP:Manual pelvis offset --- indra/newview/llfloatermodelpreview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index aac20244cc..e3b0f7522e 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -359,6 +359,8 @@ public: LLVector3 mModelPivot; bool mHasPivot; + + float mPelvisZOffset; }; -- cgit v1.2.3 From aaaddfe08942ff15bbe0c6549dc82dda95ce3ba1 Mon Sep 17 00:00:00 2001 From: prep linden Date: Wed, 16 Mar 2011 17:09:30 -0400 Subject: Fix for SH-1017. We now disallow malformed rigs to be uploaded (i.e. missing bones, improperly names bones etc...) --- indra/newview/llfloatermodelpreview.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index e3b0f7522e..b3053fe73a 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -294,6 +294,8 @@ public: const bool getModelPivot( void ) const { return mHasPivot; } void setHasPivot( bool val ) { mHasPivot = val; } void setModelPivot( const LLVector3& pivot ) { mModelPivot = pivot; } + const bool isRigValid( void ) const { return mRigValid; } + void setRigValid( bool rigValid ) { mRigValid = rigValid; } static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); @@ -361,6 +363,8 @@ public: bool mHasPivot; float mPelvisZOffset; + + bool mRigValid; }; -- cgit v1.2.3 From 77869c9c1d80998055d35fa099dcb77f45699257 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 17 Mar 2011 17:17:31 -0500 Subject: SH-587 Fix for crash when clicking cancel in model importer. --- indra/newview/llfloatermodelpreview.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index b3053fe73a..910a45f9fe 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -96,7 +96,9 @@ public: LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview); virtual void run(); - + bool doLoadModel(); + void loadModelCallback(); + void loadTextures() ; //called in the main thread. void processElement(daeElement* element); std::vector getMaterials(LLModel* model, domInstance_geometry* instance_geo); @@ -117,9 +119,8 @@ public: void handlePivotPoint( daeElement* pRoot ); bool isNodeAPivotPoint( domNode* pNode ); - void setLoadState( U32 state ) { mState = state; } - U32 getLoadState( void ) { return mState; } - + void setLoadState(U32 state); + //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; std::deque mMasterJointList; @@ -302,7 +303,11 @@ public: boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){ return mDetailsSignal.connect(cb); } boost::signals2::connection setModelLoadedCallback( const model_loaded_signal_t::slot_type& cb ){ return mModelLoadedSignal.connect(cb); } + void setLoadState( U32 state ) { mLoadState = state; } + U32 getLoadState() { return mLoadState; } + protected: + friend class LLModelLoader; friend class LLFloaterModelPreview; friend class LLFloaterModelWizard; friend class LLFloaterModelPreview::DecompRequest; @@ -326,6 +331,7 @@ public: U32 mResourceCost; std::string mLODFile[LLModel::NUM_LODS]; bool mLoading; + U32 mLoadState; std::map mViewOption; -- cgit v1.2.3 From 51a4867ae6bcf0ec71882ba77b1c995d98834126 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 21 Mar 2011 17:31:25 -0500 Subject: SH-1168 Export upload data to disk on upload. --- indra/newview/llfloatermodelpreview.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 910a45f9fe..5efac91ba3 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -288,6 +288,8 @@ public: void clearMaterials(); U32 calcResourceCost(); void rebuildUploadData(); + void saveUploadData(bool save_skinweights, bool save_joint_poisitions); + void saveUploadData(const std::string& filename, bool save_skinweights, bool save_joint_poisitions); void clearIncompatible(S32 lod); void updateStatusMessages(); void clearGLODGroup(); @@ -332,7 +334,7 @@ public: std::string mLODFile[LLModel::NUM_LODS]; bool mLoading; U32 mLoadState; - + std::map mViewOption; //GLOD object parameters (must rebuild object if these change) -- cgit v1.2.3 From 6ff87e2840c585711e2927028a11ba5ce78a192a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 22 Mar 2011 17:23:48 -0500 Subject: SH-1169 Import from slm instead of dae when appropriate. --- indra/newview/llfloatermodelpreview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 5efac91ba3..68fa0fa4c1 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -76,6 +76,7 @@ public: LLMatrix4 mTransform; BOOL mFirstTransform; LLVector3 mExtents[2]; + bool mTrySLM; std::map > mModel; @@ -97,6 +98,7 @@ public: virtual void run(); bool doLoadModel(); + bool loadFromSLM(const std::string& filename); void loadModelCallback(); void loadTextures() ; //called in the main thread. -- cgit v1.2.3 From 719610e68ba8275f08f51d127ab760799cb1d1c3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 29 Mar 2011 11:50:02 -0500 Subject: SH-1225 Import convex hull data from .slm --- indra/newview/llfloatermodelpreview.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 68fa0fa4c1..6542ed4fbe 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -358,8 +358,7 @@ public: U32 mGroup; std::map, U32> mObject; U32 mMaxTriangleLimit; - std::map, std::vector > > mPhysicsMesh; - + LLMeshUploadThread::instance_list mUploadData; std::set mTextureSet; -- cgit v1.2.3 From 69789e40d9df7a13913a88bc02316e8bbc4a4dac Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 30 Mar 2011 16:04:36 -0400 Subject: Moved joint reset flag into model preview --- indra/newview/llfloatermodelpreview.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 6542ed4fbe..3fcc1b3e57 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -126,7 +126,6 @@ public: //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; std::deque mMasterJointList; - bool mResetJoints; }; class LLFloaterModelPreview : public LLFloater @@ -310,6 +309,9 @@ public: void setLoadState( U32 state ) { mLoadState = state; } U32 getLoadState() { return mLoadState; } + void setResetJointFlag( bool state ) { mResetJoints = state; } + bool getResetJointFlag( void ) { return mResetJoints; } + protected: friend class LLModelLoader; friend class LLFloaterModelPreview; @@ -336,7 +338,7 @@ public: std::string mLODFile[LLModel::NUM_LODS]; bool mLoading; U32 mLoadState; - + bool mResetJoints; std::map mViewOption; //GLOD object parameters (must rebuild object if these change) -- cgit v1.2.3 From f0c70a4ee3739c34b1da2ce384bfcf420f8c6c72 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 1 Apr 2011 10:58:34 -0600 Subject: fix for SH-1176: A Mesh That Crashes Client on Upload Attempt (due to triangle number overflowing) --- indra/newview/llfloatermodelpreview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 3fcc1b3e57..dabe3c613d 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -66,7 +66,7 @@ public: GENERATING_VERTEX_BUFFERS, GENERATING_LOD, DONE, - ERROR_PARSING, //basically loading failed + ERROR_PARSING //basically loading failed } eLoadState; U32 mState; -- cgit v1.2.3 From 1ccb583181410ebd0742b0e47047ff74cfadd45c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Apr 2011 16:47:59 -0400 Subject: added defaults button to reset model upload dialog from .dae file --- indra/newview/llfloatermodelpreview.h | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 indra/newview/llfloatermodelpreview.h (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h old mode 100644 new mode 100755 index 3fcc1b3e57..a1f03762e4 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -162,6 +162,8 @@ public: static void onBrowseLOD(void* data); + static void onReset(void* data); + static void onUpload(void* data); static void onClearMaterials(void* data); -- cgit v1.2.3 From c494e5c0d55b2da2f5aa5ea18fbccb670b2f3107 Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 18 Apr 2011 10:41:32 -0400 Subject: WIP for SH-1281. Rigged assets are critiqued differently based upon whether they're avrigs w/wo joint offets and whether the asset contains a subset of the joints in the visual scene --- indra/newview/llfloatermodelpreview.h | 52 +++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 11 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index dc6a33d0ab..186bf114d1 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -53,6 +53,9 @@ class domTranslate; class LLMenuButton; class LLToggleableMenu; +typedef std::map JointTransformMap; +typedef std::map:: iterator JointTransformMapIt; + const S32 NUM_LOD = 4; class LLModelLoader : public LLThread @@ -94,8 +97,8 @@ public: //queue of models that need a physics rep model_queue mPhysicsQ; - LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview); - + LLModelLoader( std::string filename, S32 lod, LLModelPreview* preview, JointTransformMap& jointMap, + std::deque& jointsFromNodes ); virtual void run(); bool doLoadModel(); bool loadFromSLM(const std::string& filename); @@ -115,17 +118,19 @@ public: void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform ); void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform ); - bool doesJointArrayContainACompleteRig( const std::vector &modelJointList ); - bool checkForCompleteRig( const std::vector &jointListFromModel ); - void handlePivotPoint( daeElement* pRoot ); bool isNodeAPivotPoint( domNode* pNode ); void setLoadState(U32 state); + void buildJointToNodeMappingFromScene( daeElement* pRoot ); + void processJointToNodeMapping( domNode* pNode ); + + //map of avatar joints as named in COLLADA assets to internal joint names std::map mJointMap; - std::deque mMasterJointList; + JointTransformMap& mJointList; + std::deque& mJointsFromNode; }; class LLFloaterModelPreview : public LLFloater @@ -297,12 +302,28 @@ public: void updateStatusMessages(); void clearGLODGroup(); void onLODParamCommit(bool enforce_tri_limit); + const bool getModelPivot( void ) const { return mHasPivot; } void setHasPivot( bool val ) { mHasPivot = val; } void setModelPivot( const LLVector3& pivot ) { mModelPivot = pivot; } - const bool isRigValid( void ) const { return mRigValid; } - void setRigValid( bool rigValid ) { mRigValid = rigValid; } - + + //Sets the current avatars joints to new positions + //Makes in world go to shit, however + void changeAvatarsJointPositions( LLModel* pModel ); + //Determines the viability of an asset to be used as an avatar rig (w or w/o joint upload caps) + void critiqueRigForUploadApplicability( const std::vector &jointListFromAsset ); + void critiqueJointToNodeMappingFromScene( void ); + //Is a rig valid so that it can be used as a criteria for allowing for uploading of joint positions + //Accessors for joint position upload friendly rigs + const bool isRigValidForJointPositionUpload( void ) const { return mRigValidJointUpload; } + void setRigValidForJointPositionUpload( bool rigValid ) { mRigValidJointUpload = rigValid; } + bool isRigSuitableForJointPositionUpload( const std::vector &jointListFromAsset ); + //Determines if a rig is a legacy from the joint list + bool isRigLegacy( const std::vector &jointListFromAsset ); + //Accessors for the legacy rigs + const bool isLegacyRigValid( void ) const { return mLegacyRigValid; } + void setLegacyRigValid( bool rigValid ) { mLegacyRigValid = rigValid; } + static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){ return mDetailsSignal.connect(cb); } @@ -314,6 +335,8 @@ public: void setResetJointFlag( bool state ) { mResetJoints = state; } bool getResetJointFlag( void ) { return mResetJoints; } + LLVector3 getTranslationForJointOffset( std::string joint ); + protected: friend class LLModelLoader; friend class LLFloaterModelPreview; @@ -377,8 +400,15 @@ public: float mPelvisZOffset; - bool mRigValid; -}; + bool mRigValidJointUpload; + bool mLegacyRigValid; + bool mLastJointUpdate; + + std::deque mMasterJointList; + std::deque mMasterLegacyJointList; + std::deque mJointsFromNode; + JointTransformMap mJointTransformMap; +}; #endif // LL_LLFLOATERMODELPREVIEW_H -- cgit v1.2.3 From 873bd8ce26798fbea625b2323e7a84229ed92343 Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 28 Apr 2011 14:22:11 -0400 Subject: Fix for SH-718 --- indra/newview/llfloatermodelpreview.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 186bf114d1..837484adb6 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -331,8 +331,8 @@ public: void setLoadState( U32 state ) { mLoadState = state; } U32 getLoadState() { return mLoadState; } - - void setResetJointFlag( bool state ) { mResetJoints = state; } + //setRestJointFlag: If an asset comes through that changes the joints, we want the reset to persist + void setResetJointFlag( bool state ) { if ( !mResetJoints ) mResetJoints = state; } bool getResetJointFlag( void ) { return mResetJoints; } LLVector3 getTranslationForJointOffset( std::string joint ); -- cgit v1.2.3 From d7954ba38f81172f0062ae55479aff0709615bdd Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 29 Apr 2011 15:23:03 -0600 Subject: fix for SH-688: Viewer crash when uploading a large .dae file and clicking the X button in upper right hand corner of the upload model floater on Mac Build --- indra/newview/llfloatermodelpreview.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 186bf114d1..192f84c221 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -80,7 +80,7 @@ public: BOOL mFirstTransform; LLVector3 mExtents[2]; bool mTrySLM; - + std::map > mModel; typedef std::vector > model_list; @@ -99,6 +99,8 @@ public: LLModelLoader( std::string filename, S32 lod, LLModelPreview* preview, JointTransformMap& jointMap, std::deque& jointsFromNodes ); + ~LLModelLoader() ; + virtual void run(); bool doLoadModel(); bool loadFromSLM(const std::string& filename); @@ -131,6 +133,10 @@ public: std::map mJointMap; JointTransformMap& mJointList; std::deque& mJointsFromNode; + +private: + static std::list sActiveLoaderList; + static bool isAlive(LLModelLoader* loader) ; }; class LLFloaterModelPreview : public LLFloater -- cgit v1.2.3 From 91980918f0341bec0145156875d22503e8beea4e Mon Sep 17 00:00:00 2001 From: prep linden Date: Wed, 4 May 2011 17:18:31 -0400 Subject: Fix for Sh-1481 --- indra/newview/llfloatermodelpreview.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 7927edcd36..92104c01f4 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -339,8 +339,10 @@ public: U32 getLoadState() { return mLoadState; } //setRestJointFlag: If an asset comes through that changes the joints, we want the reset to persist void setResetJointFlag( bool state ) { if ( !mResetJoints ) mResetJoints = state; } - bool getResetJointFlag( void ) { return mResetJoints; } - + const bool getResetJointFlag( void ) const { return mResetJoints; } + void setRigWithSceneParity( bool state ) { mRigParityWithScene = state; } + const bool getRigWithSceneParity( void ) const { return mRigParityWithScene; } + LLVector3 getTranslationForJointOffset( std::string joint ); protected: @@ -370,6 +372,8 @@ public: bool mLoading; U32 mLoadState; bool mResetJoints; + bool mRigParityWithScene; + std::map mViewOption; //GLOD object parameters (must rebuild object if these change) -- cgit v1.2.3 From a6a842614722e4cec8628925367dcf77e230ba9f Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 5 May 2011 11:30:22 -0400 Subject: merge --- indra/newview/llfloatermodelpreview.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.h') diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 92104c01f4..4d8b46807f 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -120,9 +120,6 @@ public: void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform ); void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform ); - void handlePivotPoint( daeElement* pRoot ); - bool isNodeAPivotPoint( domNode* pNode ); - void setLoadState(U32 state); void buildJointToNodeMappingFromScene( daeElement* pRoot ); @@ -298,7 +295,6 @@ public: void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); - void alterModelsPivot( void ); void clearMaterials(); U32 calcResourceCost(); void rebuildUploadData(); -- cgit v1.2.3