summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-23 10:23:37 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-23 10:23:37 -0400
commit8efba1db81fc1294114cea70de0df53f4d4ab9a4 (patch)
tree03e8fc6f44430321fbcf7871737a91b737e6b28b
parent28482f484a69e4c1b3531044ad672e0caccdca9e (diff)
Use Lua command-line args to make frame_profile_quit.lua generic.
Now the location to which to teleport and the camera focus point can both be specified by the caller, in this case the frame_profile bash script.
-rw-r--r--indra/newview/scripts/lua/frame_profile_quit.lua17
-rwxr-xr-xscripts/perf/frame_profile2
2 files changed, 14 insertions, 5 deletions
diff --git a/indra/newview/scripts/lua/frame_profile_quit.lua b/indra/newview/scripts/lua/frame_profile_quit.lua
index e3177a3f67..ad136c86d2 100644
--- a/indra/newview/scripts/lua/frame_profile_quit.lua
+++ b/indra/newview/scripts/lua/frame_profile_quit.lua
@@ -1,5 +1,11 @@
-- Trigger Develop -> Render Tests -> Frame Profile and quit
+assert(arg.n == 3, 'Usage: frame_profile_quit.lua x y z (for camera focus)')
+-- Try coercing string arguments to numbers, using Lua's implicit conversion.
+-- If the args passed as x, y, z won't convert nicely to numbers, better find
+-- out now.
+focus = {arg[1]+0, arg[2]+0, arg[3]+0}
+
LLAgent = require 'LLAgent'
logout = require 'logout'
startup = require 'startup'
@@ -8,11 +14,14 @@ UI = require 'UI'
startup.wait('STATE_STARTED')
--- Assume we logged into http://maps.secondlife.com/secondlife/Bug%20Island/220/224/27
--- (see frame_profile bash script)
+-- Figure out where we are
+camera = LLAgent.getRegionPosition()
+-- assume z is the agent's feet, add 2 meters
+camera[2] += 2
+
Timer(10, 'wait')
-LLAgent.setCamera{camera_pos={220, 224, 26}, camera_locked=true,
- focus_pos ={228, 232, 26}, focus_locked=true}
+LLAgent.setCamera{camera_pos=camera, camera_locked=true,
+ focus_pos=focus, focus_locked=true}
Timer(1, 'wait')
-- This freezes the viewer for perceptible realtime
UI.popup:tip('starting Render Tests -> Frame Profile')
diff --git a/scripts/perf/frame_profile b/scripts/perf/frame_profile
index 0a4e0a74ff..dcbb954536 100755
--- a/scripts/perf/frame_profile
+++ b/scripts/perf/frame_profile
@@ -6,5 +6,5 @@ then
exe="$(ls "$exe/Contents/MacOS/Second Life "*)"
fi
-"$exe" --autologin --luafile frame_profile_quit.lua \
+"$exe" --autologin --luafile 'frame_profile_quit.lua 228 232 26' \
http://maps.secondlife.com/secondlife/Bug%20Island/220/224/27