diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3739010e77..f695b9bbde 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -510,7 +510,7 @@ namespace LLError mPrintLocation(false), mDefaultLevel(LLError::LEVEL_DEBUG), mLogAlwaysFlush(true), - mEnabledLogTypesMask(0xFFFFFFFF), + mEnabledLogTypesMask(255), mFunctionLevelMap(), mClassLevelMap(), mFileLevelMap(), diff --git a/indra/mac_crash_logger/CMakeLists.txt b/indra/mac_crash_logger/CMakeLists.txt index ab20388261..f6c4dfb59d 100644 --- a/indra/mac_crash_logger/CMakeLists.txt +++ b/indra/mac_crash_logger/CMakeLists.txt @@ -85,7 +85,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} ARGS -E - copy_directory + copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/CrashReporter.nib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-crash-logger.app/Contents/Resources/CrashReporter.nib ) diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 41294f6d91..99276119ca 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -17,7 +17,7 @@ For example, value of 10 = 2|8 would enable logging only to SecondLife.log and the viewer debug console. Note: RecordToFile is always enabled in release builds. --> - enabled-log-types-mask 0xFFFFFFFF + enabled-log-types-mask 255 settings diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b5524f3609..d1e7b6c036 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3825,6 +3825,39 @@ Value 0 + AnimatedObjectsGlobalScale + + Comment + Temporary testing: allow an extra scale factor to be forced on animated objects. + Persist + 1 + Type + F32 + Value + 1.00 + + AnimatedObjectsMaxLegalOffset + + Comment + Max visual offset between object position and rendered position + Persist + 1 + Type + F32 + Value + 3.0 + + AnimatedObjectsMaxLegalSize + + Comment + Max bounding box size for animated object's rendered position + Persist + 1 + Type + F32 + Value + 64.0 + AvatarBoundingBoxComplexity Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 723f4122bb..1f0b9c069d 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1037,6 +1037,16 @@ void LLAgent::setRegion(LLViewerRegion *regionp) { gSky.mVOGroundp->setRegion(regionp); } + + if (regionp->capabilitiesReceived()) + { + regionp->requestSimulatorFeatures(); + } + else + { + regionp->setCapabilitiesReceivedCallback(boost::bind(&LLViewerRegion::requestSimulatorFeatures, regionp)); + } + } else { diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 83d42f6ccf..96cdb7f01d 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -35,12 +35,16 @@ #include "llviewerregion.h" #include "llskinningutil.h" +const F32 LLControlAvatar::MAX_LEGAL_OFFSET = 3.0f; +const F32 LLControlAvatar::MAX_LEGAL_SIZE = 64.0f; + LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : LLVOAvatar(id, pcode, regionp), mPlaying(false), mGlobalScale(1.0f), mMarkedForDeath(false), - mRootVolp(NULL) + mRootVolp(NULL), + mScaleConstraintFixup(1.0) { mIsDummy = TRUE; mIsControlAvatar = true; @@ -68,6 +72,64 @@ void LLControlAvatar::initInstance() mInitFlags |= 1<<4; } +void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_scale_fixup) const +{ + + F32 max_legal_offset = MAX_LEGAL_OFFSET; + if (gSavedSettings.getControl("AnimatedObjectsMaxLegalOffset")) + { + max_legal_offset = gSavedSettings.getF32("AnimatedObjectsMaxLegalOffset"); + } + F32 max_legal_size = MAX_LEGAL_SIZE; + if (gSavedSettings.getControl("AnimatedObjectsMaxLegalSize")) + { + max_legal_size = gSavedSettings.getF32("AnimatedObjectsMaxLegalSize"); + } + + new_pos_fixup = LLVector3(); + new_scale_fixup = 1.0f; + LLVector3 vol_pos = mRootVolp->getRenderPosition(); + + // Fix up position if needed to prevent visual encroachment + if (box_valid_and_non_zero(getLastAnimExtents())) // wait for state to settle down + { + // The goal here is to ensure that the extent of the avatar's + // bounding box does not wander too far from the + // official position of the corresponding volume. We + // do this by tracking the distance and applying a + // correction to the control avatar position if + // needed. + const LLVector3 *extents = getLastAnimExtents(); + LLVector3 box_dims = extents[1]-extents[0]; + F32 max_size = llmax(box_dims[0],box_dims[1],box_dims[2]); + LLVector3 pos_box_offset = point_to_box_offset(vol_pos, extents); + F32 offset_dist = pos_box_offset.length(); + if (offset_dist > max_legal_offset) + { + F32 target_dist = (offset_dist - max_legal_offset); + new_pos_fixup = mPositionConstraintFixup + (target_dist/offset_dist)*pos_box_offset; + LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup " + << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL; + } + else if (offset_dist < max_legal_offset-1 && mPositionConstraintFixup.length()>0.01f) + { + new_pos_fixup = mPositionConstraintFixup * 0.9; + LL_DEBUGS("ConstraintFix") << getFullname() << " pos fixup reduced " + << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL; + } + else + { + new_pos_fixup = mPositionConstraintFixup; + } + if (max_size/mScaleConstraintFixup > max_legal_size) + { + new_scale_fixup = mScaleConstraintFixup*max_legal_size/max_size; + LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, max_size " << max_size << " fixup " + << mScaleConstraintFixup << " -> " << new_scale_fixup << LL_ENDL; + } + } +} + void LLControlAvatar::matchVolumeTransform() { if (mRootVolp) @@ -96,37 +158,16 @@ void LLControlAvatar::matchVolumeTransform() } else { - LLVector3 vol_pos = mRootVolp->getRenderPosition(); - LLVector3 pos_box_offset; - LLVector3 box_offset; - // Fix up position if needed to prevent visual encroachment - if (box_valid_and_non_zero(getLastAnimExtents())) // wait for state to settle down - { - const F32 MAX_LEGAL_OFFSET = 3.0; - - // The goal here is to ensure that the extent of the avatar's - // bounding box does not wander too far from the - // official position of the corresponding volume. We - // do this by tracking the distance and applying a - // correction to the control avatar position if - // needed. - LLVector3 uncorrected_extents[2]; - uncorrected_extents[0] = getLastAnimExtents()[0] - mPositionConstraintFixup; - uncorrected_extents[1] = getLastAnimExtents()[1] - mPositionConstraintFixup; - pos_box_offset = point_to_box_offset(vol_pos, uncorrected_extents); - F32 offset_dist = pos_box_offset.length(); - if (offset_dist > MAX_LEGAL_OFFSET) - { - F32 target_dist = (offset_dist - MAX_LEGAL_OFFSET); - box_offset = (target_dist/offset_dist)*pos_box_offset; - } - } + LLVector3 new_pos_fixup; + F32 new_scale_fixup; + getNewConstraintFixups(new_pos_fixup, new_scale_fixup); - mPositionConstraintFixup = box_offset; - - // Currently if you're doing something like playing an + mPositionConstraintFixup = new_pos_fixup; + mScaleConstraintFixup = new_scale_fixup; + + // FIXME: Currently if you're doing something like playing an // animation that moves the pelvis (on an avatar or // animated object), the name tag and debug text will be // left behind. Ideally setPosition() would follow the @@ -152,6 +193,9 @@ void LLControlAvatar::matchVolumeTransform() mRoot->setWorldRotation(bind_rot*obj_rot); setPositionAgent(vol_pos); mRoot->setPosition(vol_pos + mPositionConstraintFixup); + + F32 global_scale = gSavedSettings.getF32("AnimatedObjectsGlobalScale"); + setGlobalScale(global_scale * mScaleConstraintFixup); } } } @@ -371,10 +415,13 @@ void LLControlAvatar::updateDebugText() addDebugText(llformat("tris %d (est %.1f, streaming %.1f), verts %d", total_tris, est_tris, est_streaming_tris, total_verts)); addDebugText(llformat("pxarea %s rank %d", LLStringOps::getReadableNumber(getPixelArea()).c_str(), getVisibilityRank())); addDebugText(llformat("lod_radius %s dists %s", LLStringOps::getReadableNumber(lod_radius).c_str(),cam_dist_string.c_str())); - if (mPositionConstraintFixup.length() > 0.0f) + if (mPositionConstraintFixup.length() > 0.0f || mScaleConstraintFixup != 1.0f) { - addDebugText(llformat("pos fix (%.1f %.1f %.1f)", - mPositionConstraintFixup[0], mPositionConstraintFixup[1], mPositionConstraintFixup[2])); + addDebugText(llformat("pos fix (%.1f %.1f %.1f) scale %f", + mPositionConstraintFixup[0], + mPositionConstraintFixup[1], + mPositionConstraintFixup[2], + mScaleConstraintFixup)); } #if 0 diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h index c72dc03efc..9924697938 100644 --- a/indra/newview/llcontrolavatar.h +++ b/indra/newview/llcontrolavatar.h @@ -40,9 +40,10 @@ public: virtual void initInstance(); // Called after construction to initialize the class. virtual ~LLControlAvatar(); + void getNewConstraintFixups(LLVector3& new_pos_constraint, F32& new_scale_constraint) const; void matchVolumeTransform(); void updateVolumeGeom(); - + void setGlobalScale(F32 scale); void recursiveScaleJoint(LLJoint *joint, F32 factor); static LLControlAvatar *createControlAvatar(LLVOVolume *obj); @@ -81,7 +82,11 @@ public: bool mMarkedForDeath; LLVector3 mPositionConstraintFixup; + F32 mScaleConstraintFixup; + static const F32 MAX_LEGAL_OFFSET; + static const F32 MAX_LEGAL_SIZE; + }; typedef std::map signaled_animation_map_t; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 358200a0b4..332b4c265a 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -913,12 +913,14 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) LLVector3 cam_region_pos = LLVector3(cam_pos - volume->getRegion()->getOriginGlobal()); LLVector3 cam_to_box_offset = point_to_box_offset(cam_region_pos, av_box); - //LL_DEBUGS("DynamicBox") << volume->getAvatar()->getFullname() - // << " pos (ignored) " << pos - // << " cam pos " << cam_pos - // << " cam region pos " << cam_region_pos - // << " box " << av_box[0] << "," << av_box[1] << LL_ENDL; - mDistanceWRTCamera = ll_round(cam_to_box_offset.magVec(), 0.01f); + mDistanceWRTCamera = llmax(0.01f, ll_round(cam_to_box_offset.magVec(), 0.01f)); + LL_DEBUGS("DynamicBox") << volume->getAvatar()->getFullname() + << " pos (ignored) " << pos + << " cam pos " << cam_pos + << " cam region pos " << cam_region_pos + << " box " << av_box[0] << "," << av_box[1] + << " -> dist " << mDistanceWRTCamera + << LL_ENDL; mVObjp->updateLOD(); return; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 03957885bb..c76f4191d1 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2307,6 +2307,8 @@ void LLViewerRegion::getInfo(LLSD& info) void LLViewerRegion::requestSimulatorFeatures() { + LL_DEBUGS("SimulatorFeatures") << "region " << getName() << " ptr " << this + << " trying to request SimulatorFeatures" << LL_ENDL; // kick off a request for simulator features std::string url = getCapability("SimulatorFeatures"); if (!url.empty()) @@ -2353,7 +2355,7 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) std::stringstream str; LLSDSerialize::toPrettyXML(sim_features, str); - LL_INFOS() << "Region ID " << getRegionID().asString() << ": " << str.str() << LL_ENDL; + LL_INFOS() << "region " << getName() << " " << str.str() << LL_ENDL; mSimulatorFeatures = sim_features; setSimulatorFeaturesReceived(true); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 49ed4b90de..866d9f0f9e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1493,24 +1493,22 @@ BOOL LLVOVolume::calcLOD() const LLVector3* box = avatar->getLastAnimExtents(); LLVector3 diag = box[1] - box[0]; radius = diag.magVec() * 0.5f; - //LL_DEBUGS("DynamicBox") << avatar->getFullname() << " diag " << diag << " radius " << radius << LL_ENDL; + LL_DEBUGS("DynamicBox") << avatar->getFullname() << " diag " << diag << " radius " << radius << LL_ENDL; } else { // Volume in a rigged mesh attached to a regular avatar. -#if 0 // Note this isn't really a radius, so distance calcs are off by factor of 2 - radius = avatar->getBinRadius(); -#else + //radius = avatar->getBinRadius(); // SL-937: add dynamic box handling for rigged mesh on regular avatars. const LLVector3* box = avatar->getLastAnimExtents(); LLVector3 diag = box[1] - box[0]; radius = diag.magVec(); // preserve old BinRadius behavior - 2x off -#endif + LL_DEBUGS("DynamicBox") << avatar->getFullname() << " diag " << diag << " radius " << radius << LL_ENDL; } if (distance <= 0.f || radius <= 0.f) { - LL_DEBUGS("CalcLOD") << "avatar distance/radius uninitialized, skipping" << LL_ENDL; + LL_DEBUGS("DynamicBox","CalcLOD") << "avatar distance/radius uninitialized, skipping" << LL_ENDL; return FALSE; } } @@ -1520,7 +1518,7 @@ BOOL LLVOVolume::calcLOD() radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); if (distance <= 0.f || radius <= 0.f) { - LL_DEBUGS("CalcLOD") << "non-avatar distance/radius uninitialized, skipping" << LL_ENDL; + LL_DEBUGS("DynamicBox","CalcLOD") << "non-avatar distance/radius uninitialized, skipping" << LL_ENDL; return FALSE; } } @@ -1563,7 +1561,15 @@ BOOL LLVOVolume::calcLOD() mLODAdjustedDistance = distance; - cur_detail = computeLODDetail(ll_round(distance, 0.01f), ll_round(radius, 0.01f), lod_factor); + if (isHUDAttachment()) + { + // HUDs always show at highest detail + cur_detail = 3; + } + else + { + cur_detail = computeLODDetail(ll_round(distance, 0.01f), ll_round(radius, 0.01f), lod_factor); + } if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TRIANGLE_COUNT) && mDrawable->getFace(0)) { @@ -1590,7 +1596,7 @@ BOOL LLVOVolume::calcLOD() if (cur_detail != mLOD) { - LL_DEBUGS("CalcLOD") << "new LOD " << cur_detail << " change from " << mLOD + LL_DEBUGS("DynamicBox","CalcLOD") << "new LOD " << cur_detail << " change from " << mLOD << " distance " << distance << " radius " << radius << " rampDist " << rampDist << " drawable rigged? " << (mDrawable ? (S32) mDrawable->isState(LLDrawable::RIGGED) : (S32) -1) << " mRiggedVolume " << (void*)getRiggedVolume() diff --git a/scripts/content_tools/anim_tool.py b/scripts/content_tools/anim_tool.py index 77bf731ae6..b7585112c5 100644 --- a/scripts/content_tools/anim_tool.py +++ b/scripts/content_tools/anim_tool.py @@ -524,11 +524,14 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description="process SL animations") parser.add_argument("--verbose", help="verbose flag", action="store_true") - parser.add_argument("--dump", help="dump to specified file") + parser.add_argument("--dump", help="dump to stdout", action="store_true") parser.add_argument("--rot", help="specify sequence of rotations", type=float_triple, nargs="+") - parser.add_argument("--rand_pos", help="request random positions", action="store_true") + parser.add_argument("--rand_pos", help="request random positions within specified scale", type=float) parser.add_argument("--reset_pos", help="request original positions", action="store_true") parser.add_argument("--pos", help="specify sequence of positions", type=float_triple, nargs="+") + parser.add_argument("--duration", help="specify duration", type=float) + parser.add_argument("--loop_in", help="specify loop in time", type=float) + parser.add_argument("--loop_out", help="specify loop out time", type=float) parser.add_argument("--num_pos", help="number of positions to create", type=int, default=2) parser.add_argument("--delete_joints", help="specify joints to be deleted", nargs="+") parser.add_argument("--joints", help="specify joints to be added or modified", nargs="+") @@ -572,15 +575,21 @@ if __name__ == "__main__": for name in joints: anim.add_joint(name,0) if args.delete_joints: - for name in args.delete_joints: + del_joints = resolve_joints(args.delete_joints, skel_tree, lad_tree) + if args.verbose: + print "delete_joints resolved to",del_joints + for name in del_joints: anim.delete_joint(name) + joints.remove(name) if joints and args.rot: anim.add_rot(joints, args.rot) if joints and args.pos: anim.add_pos(joints, args.pos) - if joints and args.rand_pos: + print "joints ",joints,"rand_pos",args.rand_pos,"num_pos",args.num_pos + if joints and args.rand_pos is not None: + print "rand_pos",args.rand_pos for joint in joints: - pos_array = list(tuple(random.uniform(-1,1) for i in xrange(3)) for j in xrange(args.num_pos)) + pos_array = list(tuple(random.uniform(-args.rand_pos,args.rand_pos) for i in xrange(3)) for j in xrange(args.num_pos)) pos_array.append(pos_array[0]) anim.add_pos([joint], pos_array) if joints and args.reset_pos: @@ -605,8 +614,17 @@ if __name__ == "__main__": print "set joint priority",args.joint_priority for joint in anim.joints: joint.joint_priority = args.joint_priority + if args.duration is not None: + print "set duration",args.duration + anim.duration = args.duration + if args.loop_in is not None: + print "set loop_in",args.loop_in + anim.loop_in_point = args.loop_in + if args.loop_out is not None: + print "set loop_out",args.loop_out + anim.loop_out_point = args.loop_out if args.dump: - anim.dump(args.dump) + anim.dump("-") if args.summary: anim.summary() if args.outfilename: