Skip to content

Commit 7a06abe

Browse files
authored
Merge pull request #4307 from secondlife/revert-4306-geenz/develop-to-gltf-mesh
Revert "Merge develop into glTF mesh import"
2 parents f48fe44 + b0c951f commit 7a06abe

38 files changed

+772
-2544
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,8 @@ jobs:
218218
prefix=${ba[0]}
219219
if [ "$prefix" == "project" ]; then
220220
IFS='_' read -ra prj <<< "${ba[1]}"
221-
prj_str="${prj[*]}"
222221
# uppercase first letter of each word
223-
capitalized=$(echo "$prj_str" | awk '{for (i=1; i<=NF; i++) $i = toupper(substr($i,1,1)) substr($i,2); print}')
224-
export viewer_channel="Second Life Project $capitalized"
222+
export viewer_channel="Second Life Project ${prj[*]^}"
225223
elif [[ "$prefix" == "release" || "$prefix" == "main" ]];
226224
then
227225
export viewer_channel="Second Life Release"
@@ -457,6 +455,7 @@ jobs:
457455
prerelease: true
458456
generate_release_notes: true
459457
target_commitish: ${{ github.sha }}
458+
previous_tag: release
460459
append_body: true
461460
fail_on_unmatched_files: true
462461
files: |

indra/llappearance/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ set(llappearance_SOURCE_FILES
1414
llavatarjoint.cpp
1515
llavatarjointmesh.cpp
1616
lldriverparam.cpp
17-
lljointdata.h
1817
lllocaltextureobject.cpp
1918
llpolyskeletaldistortion.cpp
2019
llpolymesh.cpp

indra/llappearance/llavatarappearance.cpp

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@
2929
#include "llavatarappearance.h"
3030
#include "llavatarappearancedefines.h"
3131
#include "llavatarjointmesh.h"
32-
#include "lljointdata.h"
3332
#include "llstl.h"
3433
#include "lldir.h"
3534
#include "llpolymorph.h"
3635
#include "llpolymesh.h"
3736
#include "llpolyskeletaldistortion.h"
37+
#include "llstl.h"
3838
#include "lltexglobalcolor.h"
3939
#include "llwearabledata.h"
4040
#include "boost/bind.hpp"
4141
#include "boost/tokenizer.hpp"
42-
#include "v4math.h"
4342

4443
using namespace LLAvatarAppearanceDefines;
4544

@@ -72,13 +71,11 @@ class LLAvatarBoneInfo
7271
mChildren.clear();
7372
}
7473
bool parseXml(LLXmlTreeNode* node);
75-
glm::mat4 getJointMatrix();
7674

7775
private:
7876
std::string mName;
7977
std::string mSupport;
8078
std::string mAliases;
81-
std::string mGroup;
8279
bool mIsJoint;
8380
LLVector3 mPos;
8481
LLVector3 mEnd;
@@ -108,17 +105,11 @@ class LLAvatarSkeletonInfo
108105
S32 getNumBones() const { return mNumBones; }
109106
S32 getNumCollisionVolumes() const { return mNumCollisionVolumes; }
110107

111-
private:
112-
typedef std::vector<LLAvatarBoneInfo*> bone_info_list_t;
113-
static void getJointMatricesAndHierarhy(
114-
LLAvatarBoneInfo* bone_info,
115-
LLJointData& data,
116-
const glm::mat4& parent_mat);
117-
118108
private:
119109
S32 mNumBones;
120110
S32 mNumCollisionVolumes;
121111
LLAvatarAppearance::joint_alias_map_t mJointAliasMap;
112+
typedef std::vector<LLAvatarBoneInfo*> bone_info_list_t;
122113
bone_info_list_t mBoneInfoList;
123114
};
124115

@@ -1607,15 +1598,6 @@ bool LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
16071598
mSupport = "base";
16081599
}
16091600

1610-
// Skeleton has 133 bones, but shader only allows 110 (LL_MAX_JOINTS_PER_MESH_OBJECT)
1611-
// Groups can be used by importer to cut out unused groups of joints
1612-
static LLStdStringHandle group_string = LLXmlTree::addAttributeString("group");
1613-
if (!node->getFastAttributeString(group_string, mGroup))
1614-
{
1615-
LL_WARNS() << "Bone without group " << mName << LL_ENDL;
1616-
mGroup = "global";
1617-
}
1618-
16191601
if (mIsJoint)
16201602
{
16211603
static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot");
@@ -1641,21 +1623,6 @@ bool LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
16411623
return true;
16421624
}
16431625

1644-
1645-
glm::mat4 LLAvatarBoneInfo::getJointMatrix()
1646-
{
1647-
glm::mat4 mat(1.0f);
1648-
// 1. Scaling
1649-
mat = glm::scale(mat, glm::vec3(mScale[0], mScale[1], mScale[2]));
1650-
// 2. Rotation (Euler angles rad)
1651-
mat = glm::rotate(mat, mRot[0], glm::vec3(1, 0, 0));
1652-
mat = glm::rotate(mat, mRot[1], glm::vec3(0, 1, 0));
1653-
mat = glm::rotate(mat, mRot[2], glm::vec3(0, 0, 1));
1654-
// 3. Position
1655-
mat = glm::translate(mat, glm::vec3(mPos[0], mPos[1], mPos[2]));
1656-
return mat;
1657-
}
1658-
16591626
//-----------------------------------------------------------------------------
16601627
// LLAvatarSkeletonInfo::parseXml()
16611628
//-----------------------------------------------------------------------------
@@ -1686,25 +1653,6 @@ bool LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
16861653
return true;
16871654
}
16881655

1689-
void LLAvatarSkeletonInfo::getJointMatricesAndHierarhy(
1690-
LLAvatarBoneInfo* bone_info,
1691-
LLJointData& data,
1692-
const glm::mat4& parent_mat)
1693-
{
1694-
data.mName = bone_info->mName;
1695-
data.mJointMatrix = bone_info->getJointMatrix();
1696-
data.mScale = glm::vec3(bone_info->mScale[0], bone_info->mScale[1], bone_info->mScale[2]);
1697-
data.mRotation = bone_info->mRot;
1698-
data.mRestMatrix = parent_mat * data.mJointMatrix;
1699-
data.mIsJoint = bone_info->mIsJoint;
1700-
data.mGroup = bone_info->mGroup;
1701-
for (LLAvatarBoneInfo* child_info : bone_info->mChildren)
1702-
{
1703-
LLJointData& child_data = data.mChildren.emplace_back();
1704-
getJointMatricesAndHierarhy(child_info, child_data, data.mRestMatrix);
1705-
}
1706-
}
1707-
17081656
//Make aliases for joint and push to map.
17091657
void LLAvatarAppearance::makeJointAliases(LLAvatarBoneInfo *bone_info)
17101658
{
@@ -1766,16 +1714,6 @@ const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases
17661714
return mJointAliasMap;
17671715
}
17681716

1769-
void LLAvatarAppearance::getJointMatricesAndHierarhy(std::vector<LLJointData> &data) const
1770-
{
1771-
glm::mat4 identity(1.f);
1772-
for (LLAvatarBoneInfo* bone_info : sAvatarSkeletonInfo->mBoneInfoList)
1773-
{
1774-
LLJointData& child_data = data.emplace_back();
1775-
LLAvatarSkeletonInfo::getJointMatricesAndHierarhy(bone_info, child_data, identity);
1776-
}
1777-
}
1778-
17791717

17801718
//-----------------------------------------------------------------------------
17811719
// parseXmlSkeletonNode(): parses <skeleton> nodes from XML tree

indra/llappearance/llavatarappearance.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@
3434
#include "lltexlayer.h"
3535
#include "llviewervisualparam.h"
3636
#include "llxmltree.h"
37-
#include "v4math.h"
3837

3938
class LLTexLayerSet;
4039
class LLTexGlobalColor;
4140
class LLTexGlobalColorInfo;
4241
class LLWearableData;
4342
class LLAvatarBoneInfo;
4443
class LLAvatarSkeletonInfo;
45-
class LLJointData;
4644

4745
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4846
// LLAvatarAppearance
@@ -140,7 +138,7 @@ class LLAvatarAppearance : public LLCharacter
140138
LLVector3 mHeadOffset{}; // current head position
141139
LLAvatarJoint* mRoot{ nullptr };
142140

143-
typedef std::map<std::string, LLJoint*> joint_map_t;
141+
typedef std::map<std::string, LLJoint*, std::less<>> joint_map_t;
144142
joint_map_t mJointMap;
145143

146144
typedef std::map<std::string, LLVector3> joint_state_map_t;
@@ -153,11 +151,9 @@ class LLAvatarAppearance : public LLCharacter
153151
public:
154152
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
155153
const avatar_joint_list_t& getSkeleton() { return mSkeleton; }
156-
typedef std::map<std::string, std::string> joint_alias_map_t;
154+
typedef std::map<std::string, std::string, std::less<>> joint_alias_map_t;
157155
const joint_alias_map_t& getJointAliases();
158-
typedef std::map<std::string, std::string> joint_parent_map_t; // matrix plus parent
159-
typedef std::map<std::string, glm::mat4> joint_rest_map_t;
160-
void getJointMatricesAndHierarhy(std::vector<LLJointData> &data) const;
156+
161157

162158
protected:
163159
static bool parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree);

indra/llappearance/lljointdata.h

Lines changed: 0 additions & 66 deletions
This file was deleted.

indra/llcharacter/llbvhloader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ LLQuaternion::Order bvhStringToOrder( char *str )
131131
// LLBVHLoader()
132132
//-----------------------------------------------------------------------------
133133

134-
LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& joint_alias_map )
134+
LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string, std::less<>>& joint_alias_map )
135135
{
136136
reset();
137137
errorLine = 0;
@@ -156,9 +156,9 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
156156
}
157157

158158
// Recognize all names we've been told are legal.
159-
for (std::map<std::string, std::string>::value_type& alias_pair : joint_alias_map)
159+
for (const auto& [alias, joint] : joint_alias_map)
160160
{
161-
makeTranslation( alias_pair.first , alias_pair.second );
161+
makeTranslation(alias, joint);
162162
}
163163

164164
char error_text[128]; /* Flawfinder: ignore */

indra/llcharacter/llbvhloader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class LLBVHLoader
227227
friend class LLKeyframeMotion;
228228
public:
229229
// Constructor
230-
LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& joint_alias_map );
230+
LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string, std::less<>>& joint_alias_map );
231231
~LLBVHLoader();
232232

233233
/*

indra/llcharacter/llcharacter.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ LLCharacter::~LLCharacter()
7777
//-----------------------------------------------------------------------------
7878
// getJoint()
7979
//-----------------------------------------------------------------------------
80-
LLJoint *LLCharacter::getJoint( const std::string &name )
80+
LLJoint* LLCharacter::getJoint(std::string_view name)
8181
{
82-
LLJoint* joint = NULL;
82+
LLJoint* joint = nullptr;
8383

84-
LLJoint *root = getRootJoint();
85-
if (root)
84+
if (LLJoint* root = getRootJoint())
8685
{
8786
joint = root->findJoint(name);
8887
}

indra/llcharacter/llcharacter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class LLCharacter
7676
// get the specified joint
7777
// default implementation does recursive search,
7878
// subclasses may optimize/cache results.
79-
virtual LLJoint *getJoint( const std::string &name );
79+
virtual LLJoint* getJoint(std::string_view name);
8080

8181
// get the position of the character
8282
virtual LLVector3 getCharacterPosition() = 0;

indra/llprimitive/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ include(TinyGLTF)
1212

1313
set(llprimitive_SOURCE_FILES
1414
lldaeloader.cpp
15+
llgltfloader.cpp
1516
llgltfmaterial.cpp
1617
llmaterialid.cpp
1718
llmaterial.cpp
@@ -31,6 +32,7 @@ set(llprimitive_SOURCE_FILES
3132
set(llprimitive_HEADER_FILES
3233
CMakeLists.txt
3334
lldaeloader.h
35+
llgltfloader.h
3436
llgltfmaterial.h
3537
llgltfmaterial_templates.h
3638
legacy_object_types.h

0 commit comments

Comments
 (0)