diff --git a/assignment-client/src/assets/AssetServer.cpp b/assignment-client/src/assets/AssetServer.cpp index 9c03bdd3bb..e7d86c824e 100644 --- a/assignment-client/src/assets/AssetServer.cpp +++ b/assignment-client/src/assets/AssetServer.cpp @@ -235,7 +235,8 @@ void updateConsumedCores() { AssetServer::AssetServer(ReceivedMessage& message) : ThreadedAssignment(message), _transferTaskPool(this), - _bakingTaskPool(this) + _bakingTaskPool(this), + _filesizeLimit(MAX_UPLOAD_SIZE) { // store the current state of image compression so we can reset it when this assignment is complete _wasColorTextureCompressionEnabled = image::isColorTexturesCompressionEnabled(); @@ -343,8 +344,8 @@ void AssetServer::completeSetup() { auto maxBandwidthValue = assetServerObject[MAX_BANDWIDTH_OPTION]; auto maxBandwidthFloat = maxBandwidthValue.toDouble(-1); + const int BITS_PER_MEGABITS = 1000 * 1000; if (maxBandwidthFloat > 0.0) { - const int BITS_PER_MEGABITS = 1000 * 1000; int maxBandwidth = maxBandwidthFloat * BITS_PER_MEGABITS; nodeList->setConnectionMaxBandwidth(maxBandwidth); qCInfo(asset_server) << "Set maximum bandwith per connection to" << maxBandwidthFloat << "Mb/s." @@ -406,6 +407,15 @@ void AssetServer::completeSetup() { qCCritical(asset_server) << "Asset Server assignment will not continue because mapping file could not be loaded."; setFinished(true); } + + // get file size limit for an asset + static const QString ASSETS_FILESIZE_LIMIT_OPTION = "assets_filesize_limit"; + auto assetsFilesizeLimitJSONValue = assetServerObject[ASSETS_FILESIZE_LIMIT_OPTION]; + auto assetsFilesizeLimit = (uint64_t)assetsFilesizeLimitJSONValue.toInt(MAX_UPLOAD_SIZE); + + if (assetsFilesizeLimit != 0 && assetsFilesizeLimit < MAX_UPLOAD_SIZE) { + _filesizeLimit = assetsFilesizeLimit * BITS_PER_MEGABITS; + } } void AssetServer::cleanupUnmappedFiles() { @@ -730,7 +740,7 @@ void AssetServer::handleAssetUpload(QSharedPointer message, Sha if (senderNode->getCanWriteToAssetServer()) { qCDebug(asset_server) << "Starting an UploadAssetTask for upload from" << uuidStringWithoutCurlyBraces(senderNode->getUUID()); - auto task = new UploadAssetTask(message, senderNode, _filesDirectory); + auto task = new UploadAssetTask(message, senderNode, _filesDirectory, _filesizeLimit); _transferTaskPool.start(task); } else { // this is a node the domain told us is not allowed to rez entities diff --git a/assignment-client/src/assets/AssetServer.h b/assignment-client/src/assets/AssetServer.h index aeb40a416f..e6393e6a98 100644 --- a/assignment-client/src/assets/AssetServer.h +++ b/assignment-client/src/assets/AssetServer.h @@ -127,6 +127,8 @@ private: bool _wasGrayscaleTextureCompressionEnabled { false }; bool _wasNormalTextureCompressionEnabled { false }; bool _wasCubeTextureCompressionEnabled { false }; + + uint64_t _filesizeLimit; }; #endif diff --git a/assignment-client/src/assets/UploadAssetTask.cpp b/assignment-client/src/assets/UploadAssetTask.cpp index 7e8e94c34d..5e6d59d032 100644 --- a/assignment-client/src/assets/UploadAssetTask.cpp +++ b/assignment-client/src/assets/UploadAssetTask.cpp @@ -22,10 +22,11 @@ UploadAssetTask::UploadAssetTask(QSharedPointer receivedMessage, SharedNodePointer senderNode, - const QDir& resourcesDir) : + const QDir& resourcesDir, uint64_t filesizeLimit) : _receivedMessage(receivedMessage), _senderNode(senderNode), - _resourcesDir(resourcesDir) + _resourcesDir(resourcesDir), + _filesizeLimit(filesizeLimit) { } @@ -48,7 +49,7 @@ void UploadAssetTask::run() { auto replyPacket = NLPacket::create(PacketType::AssetUploadReply, -1, true); replyPacket->writePrimitive(messageID); - if (fileSize > MAX_UPLOAD_SIZE) { + if (fileSize > _filesizeLimit) { replyPacket->writePrimitive(AssetServerError::AssetTooLarge); } else { QByteArray fileData = buffer.read(fileSize); diff --git a/assignment-client/src/assets/UploadAssetTask.h b/assignment-client/src/assets/UploadAssetTask.h index 700eecbf9a..8c9e0d234a 100644 --- a/assignment-client/src/assets/UploadAssetTask.h +++ b/assignment-client/src/assets/UploadAssetTask.h @@ -26,7 +26,8 @@ class Node; class UploadAssetTask : public QRunnable { public: - UploadAssetTask(QSharedPointer message, QSharedPointer senderNode, const QDir& resourcesDir); + UploadAssetTask(QSharedPointer message, QSharedPointer senderNode, + const QDir& resourcesDir, uint64_t filesizeLimit); void run() override; @@ -34,6 +35,7 @@ private: QSharedPointer _receivedMessage; QSharedPointer _senderNode; QDir _resourcesDir; + uint64_t _filesizeLimit; }; #endif // hifi_UploadAssetTask_h diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 8d0e949ff3..19f1718370 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -858,6 +858,14 @@ "help": "The path to the directory assets are stored in.
If this path is relative, it will be relative to the application data directory.
If you change this path you will need to manually copy any existing assets from the previous directory.", "default": "", "advanced": true + }, + { + "name": "assets_filesize_limit", + "type": "int", + "label": "File Size Limit", + "help": "The file size limit of an asset that can be imported into the asset server in MBytes. 0 (default) means no limit on file size.", + "default": 0, + "advanced": true } ] }, diff --git a/interface/resources/meshes/defaultAvatar_full.fst b/interface/resources/meshes/defaultAvatar_full.fst index eb8e356196..aa1c17fc40 100644 --- a/interface/resources/meshes/defaultAvatar_full.fst +++ b/interface/resources/meshes/defaultAvatar_full.fst @@ -2,14 +2,14 @@ name = mannequin type = body+head scale = 1 filename = mannequin/mannequin.baked.fbx -joint = jointEyeLeft = LeftEye -joint = jointRightHand = RightHand -joint = jointHead = Head -joint = jointEyeRight = RightEye -joint = jointLean = Spine -joint = jointNeck = Neck -joint = jointLeftHand = LeftHand joint = jointRoot = Hips +joint = jointLean = Spine +joint = jointLeftHand = LeftHand +joint = jointHead = Head +joint = jointEyeLeft = LeftEye +joint = jointEyeRight = RightEye +joint = jointRightHand = RightHand +joint = jointNeck = Neck freeJoint = LeftArm freeJoint = LeftForeArm freeJoint = RightArm @@ -18,72 +18,72 @@ bs = EyeBlink_L = blink = 1 bs = JawOpen = mouth_Open = 1 bs = LipsFunnel = Oo = 1 bs = BrowsU_L = brow_Up = 1 -jointIndex = RightHandIndex2 = 27 -jointIndex = LeftHandIndex2 = 51 -jointIndex = RightUpLeg = 6 -jointIndex = RightToe_End = 10 -jointIndex = RightEye = 65 -jointIndex = LeftHandPinky1 = 42 -jointIndex = RightHandRing1 = 22 -jointIndex = face = 67 -jointIndex = LeftUpLeg = 1 -jointIndex = LeftHand = 41 -jointIndex = LeftHandMiddle1 = 58 -jointIndex = LeftHandIndex1 = 50 -jointIndex = LeftEye = 64 -jointIndex = RightHandIndex1 = 26 -jointIndex = LeftHandPinky4 = 45 -jointIndex = RightArm = 15 -jointIndex = LeftShoulder = 38 jointIndex = RightHandPinky2 = 19 -jointIndex = RightHandThumb1 = 30 -jointIndex = RightForeArm = 16 -jointIndex = LeftHandMiddle3 = 60 -jointIndex = Neck = 62 -jointIndex = LeftHandThumb1 = 54 -jointIndex = RightHandMiddle2 = 35 jointIndex = LeftHandMiddle4 = 61 -jointIndex = mannequin = 68 -jointIndex = Spine1 = 12 +jointIndex = LeftHand = 41 +jointIndex = LeftHandRing4 = 49 +jointIndex = RightHandMiddle3 = 36 +jointIndex = LeftHandThumb4 = 57 +jointIndex = RightToe_End = 10 +jointIndex = LeftHandRing1 = 46 +jointIndex = LeftForeArm = 40 +jointIndex = RightHandIndex4 = 29 +jointIndex = LeftShoulder = 38 +jointIndex = RightHandMiddle4 = 37 +jointIndex = RightShoulder = 14 +jointIndex = LeftLeg = 2 +jointIndex = LeftToe_End = 5 +jointIndex = Hips = 0 jointIndex = RightFoot = 8 +jointIndex = RightHandThumb2 = 31 +jointIndex = LeftHandMiddle3 = 60 +jointIndex = RightHandThumb1 = 30 +jointIndex = Neck = 62 +jointIndex = Spine = 11 +jointIndex = RightHandThumb4 = 33 +jointIndex = RightHandMiddle1 = 34 +jointIndex = LeftHandIndex4 = 53 +jointIndex = face = 68 +jointIndex = RightHandRing3 = 24 +jointIndex = LeftHandPinky4 = 45 +jointIndex = LeftHandMiddle2 = 59 +jointIndex = RightHandThumb3 = 32 +jointIndex = LeftHandPinky3 = 44 +jointIndex = HeadTop_End = 66 +jointIndex = Spine1 = 12 +jointIndex = LeftHandRing3 = 48 +jointIndex = mannequin1 = 67 +jointIndex = RightEye = 65 +jointIndex = RightHandRing4 = 25 +jointIndex = RightHandPinky4 = 21 +jointIndex = LeftHandRing2 = 47 +jointIndex = RightHandIndex3 = 28 +jointIndex = RightUpLeg = 6 +jointIndex = LeftArm = 39 +jointIndex = LeftHandThumb3 = 56 +jointIndex = RightHandIndex2 = 27 +jointIndex = RightForeArm = 16 +jointIndex = RightArm = 15 +jointIndex = RightHandRing2 = 23 +jointIndex = LeftHandMiddle1 = 58 +jointIndex = Spine2 = 13 +jointIndex = LeftHandThumb2 = 55 +jointIndex = RightHandMiddle2 = 35 +jointIndex = RightHandPinky1 = 18 +jointIndex = LeftUpLeg = 1 +jointIndex = RightLeg = 7 +jointIndex = LeftHandIndex2 = 51 jointIndex = RightHand = 17 jointIndex = LeftHandIndex3 = 52 -jointIndex = RightHandIndex3 = 28 -jointIndex = RightHandMiddle4 = 37 -jointIndex = LeftLeg = 2 -jointIndex = RightHandMiddle1 = 34 -jointIndex = Spine2 = 13 -jointIndex = LeftHandMiddle2 = 59 -jointIndex = LeftHandPinky3 = 44 -jointIndex = LeftHandThumb3 = 56 -jointIndex = LeftHandRing4 = 49 -jointIndex = RightHandThumb2 = 31 -jointIndex = LeftHandRing3 = 48 -jointIndex = HeadTop_End = 66 -jointIndex = LeftHandThumb4 = 57 -jointIndex = RightHandThumb3 = 32 -jointIndex = RightHandPinky1 = 18 -jointIndex = RightLeg = 7 -jointIndex = RightHandMiddle3 = 36 -jointIndex = RightHandPinky3 = 20 -jointIndex = LeftToeBase = 4 -jointIndex = LeftForeArm = 40 -jointIndex = RightShoulder = 14 -jointIndex = LeftHandRing2 = 47 -jointIndex = LeftHandThumb2 = 55 -jointIndex = Head = 63 -jointIndex = RightHandRing4 = 25 -jointIndex = LeftHandRing1 = 46 jointIndex = LeftFoot = 3 -jointIndex = RightHandRing3 = 24 -jointIndex = RightHandThumb4 = 33 -jointIndex = LeftArm = 39 -jointIndex = LeftToe_End = 5 +jointIndex = RightHandPinky3 = 20 +jointIndex = RightHandIndex1 = 26 +jointIndex = LeftHandPinky1 = 42 jointIndex = RightToeBase = 9 -jointIndex = RightHandPinky4 = 21 -jointIndex = Spine = 11 -jointIndex = LeftHandIndex4 = 53 +jointIndex = LeftHandIndex1 = 50 +jointIndex = LeftToeBase = 4 jointIndex = LeftHandPinky2 = 43 -jointIndex = RightHandIndex4 = 29 -jointIndex = Hips = 0 -jointIndex = RightHandRing2 = 23 +jointIndex = RightHandRing1 = 22 +jointIndex = LeftHandThumb1 = 54 +jointIndex = LeftEye = 64 +jointIndex = Head = 63 diff --git a/interface/resources/meshes/mannequin/Eyes.ktx b/interface/resources/meshes/mannequin/Eyes.ktx old mode 100755 new mode 100644 index 4da922936b..ada45776a0 Binary files a/interface/resources/meshes/mannequin/Eyes.ktx and b/interface/resources/meshes/mannequin/Eyes.ktx differ diff --git a/interface/resources/meshes/mannequin/lambert1_Base_Color.ktx b/interface/resources/meshes/mannequin/lambert1_Base_Color.ktx old mode 100755 new mode 100644 index fcca382445..f151352592 Binary files a/interface/resources/meshes/mannequin/lambert1_Base_Color.ktx and b/interface/resources/meshes/mannequin/lambert1_Base_Color.ktx differ diff --git a/interface/resources/meshes/mannequin/lambert1_Normal_OpenGL.ktx b/interface/resources/meshes/mannequin/lambert1_Normal_OpenGL.ktx old mode 100755 new mode 100644 index 3ae717c5d7..fb738063ae Binary files a/interface/resources/meshes/mannequin/lambert1_Normal_OpenGL.ktx and b/interface/resources/meshes/mannequin/lambert1_Normal_OpenGL.ktx differ diff --git a/interface/resources/meshes/mannequin/lambert1_Roughness.ktx b/interface/resources/meshes/mannequin/lambert1_Roughness.ktx old mode 100755 new mode 100644 index fe9b42a54b..afe96d1631 Binary files a/interface/resources/meshes/mannequin/lambert1_Roughness.ktx and b/interface/resources/meshes/mannequin/lambert1_Roughness.ktx differ diff --git a/interface/resources/meshes/mannequin/mannequin.baked.fbx b/interface/resources/meshes/mannequin/mannequin.baked.fbx old mode 100755 new mode 100644 index b405b4cfbb..2b0e1cf04b Binary files a/interface/resources/meshes/mannequin/mannequin.baked.fbx and b/interface/resources/meshes/mannequin/mannequin.baked.fbx differ diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 9e700b0efe..85916baf60 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -237,19 +237,7 @@ void EntityTreeRenderer::update(bool simulate) { EntityTreePointer tree = std::static_pointer_cast(_tree); tree->update(simulate); - if (simulate) { - // Handle enter/leave entity logic - checkEnterLeaveEntities(); - - // Even if we're not moving the mouse, if we started clicking on an entity and we have - // not yet released the hold then this is still considered a holdingClickOnEntity event - // and we want to simulate this message here as well as in mouse move - if (_lastPointerEventValid && !_currentClickingOnEntityID.isInvalidID()) { - emit holdingClickOnEntity(_currentClickingOnEntityID, _lastPointerEvent); - _entitiesScriptEngine->callEntityScriptMethod(_currentClickingOnEntityID, "holdingClickOnEntity", _lastPointerEvent); - } - } - + // Update the rendereable entities as needed { PerformanceTimer sceneTimer("scene"); auto scene = _viewState->getMain3DScene(); @@ -269,6 +257,20 @@ void EntityTreeRenderer::update(bool simulate) { } } } + + if (simulate) { + // Handle enter/leave entity logic + checkEnterLeaveEntities(); + + // Even if we're not moving the mouse, if we started clicking on an entity and we have + // not yet released the hold then this is still considered a holdingClickOnEntity event + // and we want to simulate this message here as well as in mouse move + if (_lastPointerEventValid && !_currentClickingOnEntityID.isInvalidID()) { + emit holdingClickOnEntity(_currentClickingOnEntityID, _lastPointerEvent); + _entitiesScriptEngine->callEntityScriptMethod(_currentClickingOnEntityID, "holdingClickOnEntity", _lastPointerEvent); + } + } + } } diff --git a/libraries/networking/src/udt/PacketHeaders.cpp b/libraries/networking/src/udt/PacketHeaders.cpp index e5004e575e..a07d016078 100644 --- a/libraries/networking/src/udt/PacketHeaders.cpp +++ b/libraries/networking/src/udt/PacketHeaders.cpp @@ -37,7 +37,7 @@ PacketVersion versionForPacketType(PacketType packetType) { case PacketType::AvatarData: case PacketType::BulkAvatarData: case PacketType::KillAvatar: - return static_cast(AvatarMixerPacketVersion::AvatarIdentityLookAtSnapping); + return static_cast(AvatarMixerPacketVersion::UpdatedMannequinDefaultAvatar); case PacketType::MessagesData: return static_cast(MessageDataVersion::TextOrBinaryData); case PacketType::ICEServerHeartbeat: diff --git a/libraries/networking/src/udt/PacketHeaders.h b/libraries/networking/src/udt/PacketHeaders.h index 906500d062..5d170f8d3f 100644 --- a/libraries/networking/src/udt/PacketHeaders.h +++ b/libraries/networking/src/udt/PacketHeaders.h @@ -301,6 +301,7 @@ enum class AvatarMixerPacketVersion : PacketVersion { AvatarIdentitySequenceFront, IsReplicatedInAvatarIdentity, AvatarIdentityLookAtSnapping, + UpdatedMannequinDefaultAvatar }; enum class DomainConnectRequestVersion : PacketVersion {