feat: add isolated Liam square540 head-chest build preset
This commit is contained in:
@@ -12,6 +12,7 @@ parser.add_argument('--startup-loader',action='store_true',help='Production back
|
||||
parser.add_argument('--waiting-session',action='store_true',help='Actual APK + production session/protocol/View/renderer, synthetic transport/audio/native APIs; finite waiting/TALK/dance replay')
|
||||
parser.add_argument('--user-asset-candidate',action='store_true',help='Exact user-authorized correct03 APK; this offline replay uses local media callback doubles and does not assert network admission')
|
||||
parser.add_argument('--media-bundle',default='black-correct03',help='Trusted user-debug bundle, when --user-asset-candidate is set')
|
||||
parser.add_argument('--framing-preset',choices=['legacy','square540-headchest'],default='legacy')
|
||||
parser.add_argument('--framing-zoom',type=float,default=1)
|
||||
parser.add_argument('--framing-center-y',type=float,default=.5)
|
||||
args=parser.parse_args()
|
||||
@@ -113,8 +114,8 @@ object BuildConfig { const val STARTUP_POSTER_RES_ID=1;const val AVATAR_STARTUP_
|
||||
const val EMOTION_MANIFEST_SHA="987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887"
|
||||
const val NATURAL_MANIFEST_SHA="0a3c4918ba746019cf1df885bec66e5858a8950997dac4f64e7d37094be64dad"
|
||||
}'''
|
||||
assert 1<=args.framing_zoom<=2 and .4<=args.framing_center_y<=.6
|
||||
build=build.replace('object BuildConfig {','object BuildConfig { const val AVATAR_FRAME_ZOOM='+str(args.framing_zoom)+'f;const val AVATAR_FRAME_CENTER_Y='+str(args.framing_center_y)+'f;')
|
||||
assert (args.framing_preset=='legacy' and 1<=args.framing_zoom<=2 and .4<=args.framing_center_y<=.6) or (args.framing_preset=='square540-headchest' and abs(args.framing_zoom-32/9)<1e-7 and args.framing_center_y==.128125)
|
||||
build=build.replace('object BuildConfig {','object BuildConfig { const val AVATAR_FRAMING_PRESET="'+args.framing_preset+'";const val AVATAR_FRAME_ZOOM='+str(args.framing_zoom)+'f;const val AVATAR_FRAME_CENTER_Y='+str(args.framing_center_y)+'f;')
|
||||
if args.user_asset_candidate:
|
||||
import importlib.util
|
||||
spec=importlib.util.spec_from_file_location('user_startup',ROOT/'scripts/prepare-user-avatar-startup.py');asset_config=importlib.util.module_from_spec(spec);spec.loader.exec_module(asset_config)
|
||||
@@ -241,16 +242,16 @@ fun main(args: Array<String>) {
|
||||
StartupAvatarRepository.request(context,{base=it},{pack=it.getOrThrow()});waitReady()
|
||||
if(base!!.body.width==720) {
|
||||
val poster=FramedAvatarPoster(context)
|
||||
for((w,h) in listOf(720 to 1280,360 to 800,800 to 480)) {
|
||||
for((w,h) in listOf(720 to 1280,360 to 800,800 to 480,540 to 540)) {
|
||||
poster.onSizeChanged(w,h,0,0)
|
||||
val zoom=com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_ZOOM
|
||||
val center=com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_CENTER_Y
|
||||
val fitted=bodyFit(w,h,180,320)
|
||||
val composed=bodyFit(w,h,720,1280,zoom,center)
|
||||
val composed=bodyFit(w,h,720,1280,zoom,center,com.gorios.lanvoice.BuildConfig.AVATAR_FRAMING_PRESET)
|
||||
val displayedTop=h/2f+(fitted.top-h/2f)*poster.scaleY+poster.translationY
|
||||
check(poster.scaleX==zoom && poster.scaleY==zoom && kotlin.math.abs(displayedTop-composed.top)<.001f)
|
||||
}
|
||||
println("POSTER_FRAMING|viewports=3|matches_compositor=true|zoom=${com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_ZOOM}|center_y=${com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_CENTER_Y}|device=false")
|
||||
println("POSTER_FRAMING|viewports=4|matches_compositor=true|zoom=${com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_ZOOM}|center_y=${com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_CENTER_Y}|device=false")
|
||||
}
|
||||
check(base!!.body.frameCount==97 && base!!.patches.isEmpty() && base!!.curves.isEmpty())
|
||||
check(pack!!.emotionAdmission=="accepted" && pack!!.emotionAction!!.packages.size==5)
|
||||
@@ -313,7 +314,10 @@ if args.user_asset_candidate and index.get('waiting'):
|
||||
with tempfile.TemporaryDirectory(prefix='baji-runtime-audit-') as td:
|
||||
tmp=Path(td);files=[]
|
||||
for path in (ROOT/'tests/avatar').glob('*.kt'):
|
||||
if path.name not in ('Pack.kt','Context.kt','Graphics.kt','BuildConfig.kt') and not((args.startup_loader or args.waiting_session) and path.name=='Clock.kt') and not(args.waiting_session and path.name=='AndroidLog.kt'):files.append(path)
|
||||
if path.name not in ('Pack.kt','Context.kt','Graphics.kt','BuildConfig.kt') and not(args.framing_preset=='square540-headchest' and path.name=='View.kt') and not((args.startup_loader or args.waiting_session) and path.name=='Clock.kt') and not(args.waiting_session and path.name=='AndroidLog.kt'):files.append(path)
|
||||
if args.framing_preset=='square540-headchest':
|
||||
square_view=(ROOT/'tests/avatar/View.kt').read_text().replace('val width = 480; val height = 848','val width = 540; val height = 540')
|
||||
p=tmp/'View.kt';p.write_text(square_view);files.append(p)
|
||||
if args.startup_loader:
|
||||
clock=(ROOT/'tests/avatar/Clock.kt').read_text().replace('fun getMainLooper() = main','private val owner=Thread.currentThread();fun myLooper(): Looper?=if(Thread.currentThread()===owner) main else null;fun getMainLooper() = main')
|
||||
clock=clock.replace(' fun add(', ' @Synchronized fun add(').replace(' fun remove(', ' @Synchronized fun remove(').replace(' fun advanceBy(', ' @Synchronized fun advanceBy(')
|
||||
|
||||
Reference in New Issue
Block a user