feat: add isolated Liam square540 head-chest build preset
This commit is contained in:
@@ -39,7 +39,7 @@ int main(int argc,char **v) {
|
||||
glActiveTexture(GL_TEXTURE1);texture(ids[1],pw,ph,v[4]);glUniform1i(glGetUniformLocation(p,"uPatch"),1);
|
||||
glUniform2f(glGetUniformLocation(p,"uBodySize"),bw,bh);
|
||||
float zoom=argc==18?atof(v[16]):1,centerY=argc==18?atof(v[17]):.5f;
|
||||
assert(isfinite(zoom)&&zoom>=1&&zoom<=2&&isfinite(centerY)&¢erY>=.4f&¢erY<=.6f);
|
||||
assert((isfinite(zoom)&&zoom>=1&&zoom<=2&&isfinite(centerY)&¢erY>=.4f&¢erY<=.6f) || (fabsf(zoom-32.f/9.f)<.000001f && centerY==.128125f && bw*16==bh*9));
|
||||
float scale=fminf((float)w/bw,(float)h/bh)*zoom,mw=bw*scale,mh=bh*scale,left=(w-mw)/2,top=h/2.f-mh*centerY;
|
||||
GLfloat pos[]={left/w*2-1,1-(top+mh)/h*2,(left+mw)/w*2-1,1-(top+mh)/h*2,left/w*2-1,1-top/h*2,(left+mw)/w*2-1,1-top/h*2};
|
||||
GLfloat uv[]={0,0,1,0,0,1,1,1};
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
package com.gorios.lanvoice
|
||||
object BuildConfig { const val AVATAR_USER_ASSET_CANDIDATE=false;const val STARTUP_POSTER_RES_ID=1;const val AVATAR_FRAME_ZOOM=1f;const val AVATAR_FRAME_CENTER_Y=0.5f }
|
||||
object BuildConfig { const val AVATAR_FRAMING_PRESET="legacy"; const val AVATAR_USER_ASSET_CANDIDATE=false;const val STARTUP_POSTER_RES_ID=1;const val AVATAR_FRAME_ZOOM=1f;const val AVATAR_FRAME_CENTER_Y=0.5f }
|
||||
|
||||
@@ -129,6 +129,18 @@ fun dynamicBodyCheck() {
|
||||
val sourceX=(displayX-zoomed.left)*720/zoomed.width
|
||||
check(near(sourceX,patch.x+patch.width/2f))
|
||||
}
|
||||
val square=bodyFit(540,540,720,1280,32f/9f,.128125f,"square540-headchest")
|
||||
fun squareNear(a: Float,b: Float)=kotlin.math.abs(a-b)<.001f
|
||||
check(squareNear(square.left,-270f) && squareNear(square.top,24f))
|
||||
check(squareNear(square.width,1080f) && squareNear(square.height,1920f))
|
||||
// ROI corners and own-mouth source pixels undergo the same single transform.
|
||||
check(squareNear((0-square.left)*720/square.width,180f))
|
||||
check(squareNear((0-square.top)*1280/square.height,-16f))
|
||||
check(squareNear((540-square.top)*1280/square.height,344f))
|
||||
check(runCatching { bodyFit(540,540,720,1280,32f/9f,.128125f) }.isFailure)
|
||||
check(runCatching { bodyFit(540,540,720,1280,3.6f,.128125f,"square540-headchest") }.isFailure)
|
||||
check(runCatching { bodyFit(540,540,480,848,32f/9f,.128125f,"square540-headchest") }.isFailure)
|
||||
check(runCatching { bodyFit(540,540,720,1280,1f,.5f,"unknown") }.isFailure)
|
||||
for(zoom in listOf(Float.NaN,Float.POSITIVE_INFINITY,.9f,2.1f))check(runCatching { bodyFit(720,1280,720,1280,zoom) }.isFailure)
|
||||
for(center in listOf(Float.NaN,.39f,.61f))check(runCatching { bodyFit(720,1280,720,1280,1.45f,center) }.isFailure)
|
||||
fun render(codecW: Int,codecH: Int): Pair<List<ComposedBodyFrame>,List<String>> {
|
||||
|
||||
@@ -220,3 +220,57 @@ class WaitingPackTests(unittest.TestCase):
|
||||
self.assertEqual(provenance['sourceInventoryMismatches'],['HANDOFF.md'])
|
||||
self.assertEqual(len(provenance['sourceInventoryOmissions']),7)
|
||||
self.assertFalse(provenance['runtimeReadyOverridden'])
|
||||
|
||||
|
||||
class Square540Tests(unittest.TestCase):
|
||||
def test_same_exact_media_separate_identity_and_output(self):
|
||||
media=select.catalog()['mediaBundles']['char-waiting-poses-r01']
|
||||
def get(profile):
|
||||
return select.selection(ASSETS,profile,emotion_sha=media['indexSha256'],user_assets=True,mouth=True,startup=True,media_bundle='char-waiting-poses-r01')
|
||||
old,new=get('liam-test'),get('liam-test-square540')
|
||||
self.assertEqual(old['files'],new['files']);self.assertEqual(new['file_count'],3192)
|
||||
self.assertEqual(new['persona'],'liam');self.assertEqual(new['application_id'],'com.gorios.lanvoice.liamtest.square540')
|
||||
self.assertEqual(new['framing_preset'],'square540-headchest');self.assertEqual(old['framing_preset'],'legacy')
|
||||
self.assertEqual(select.build_directory('liam-test'),ROOT/'app/build/characters/liam-test')
|
||||
self.assertEqual(select.build_directory('liam-test-square540'),ROOT/'app/build/characters/liam-test-square540/framing/square540-headchest')
|
||||
with self.assertRaises(ValueError):select.stage(ASSETS,select.build_directory('liam-test')/'generated/packagedAssets',new)
|
||||
self.assertFalse(select.catalog()['profiles']['liam-test-square540']['allowBackup'])
|
||||
self.assertFalse(select.catalog()['profiles']['liam-test-square540']['permissionConnectionRetention'])
|
||||
|
||||
def test_controlled_preset_cannot_bleed_into_legacy_or_different_media(self):
|
||||
for profile in ('main','lvbu-test','liam-test'):
|
||||
with self.assertRaises(ValueError):select.framing(profile,'char-waiting-poses-r01','square540-headchest')
|
||||
for media in ('white-full04','black-correct03','char-expressions-r02',None):
|
||||
with self.assertRaises(ValueError):select.framing('liam-test-square540',media)
|
||||
with self.assertRaises(ValueError):select.build_directory('liam-test-square540','legacy')
|
||||
with self.assertRaises(ValueError):select.framing('liam-test-square540','char-waiting-poses-r01','legacy')
|
||||
p=select.framing('liam-test-square540','char-waiting-poses-r01')
|
||||
self.assertEqual(p['sourceRect'],[180,-16,540,344]);self.assertAlmostEqual(p['zoom'],1280/360)
|
||||
self.assertAlmostEqual(p['centerY'],164/1280)
|
||||
text=(ROOT/'app/build.gradle').read_text()
|
||||
self.assertIn('Controlled preset cannot be overridden',text)
|
||||
self.assertIn("avatarFrameZoom > 2f",text);self.assertIn("avatarFrameCenterY < 0.4f",text)
|
||||
|
||||
def test_independent_entry_keeps_old_wrapper_and_names(self):
|
||||
spec=importlib.util.spec_from_file_location('pack',ROOT/'scripts/package-character-test.py');pack=importlib.util.module_from_spec(spec);spec.loader.exec_module(pack)
|
||||
self.assertEqual(pack.artifact_name('liam-test-square540',42),'lan-voice-v0714-liam-test-square540-code42-arm64-debug.apk')
|
||||
flags=pack.flags('liam-test-square540',42,'char-waiting-poses-r01')
|
||||
self.assertIn('-PavatarUserNetworkActions=true',flags)
|
||||
self.assertTrue(any(f.startswith('--project-cache-dir=') and 'liam-test-square540/square540-headchest' in f for f in flags))
|
||||
self.assertFalse(any(f.startswith('--project-cache-dir=') for f in pack.flags('liam-test',41,'char-waiting-poses-r01')))
|
||||
yangmi=(ROOT/'scripts/package-avatar-framing.py').read_text()
|
||||
self.assertIn("'-PavatarFrameZoom=1.45','-PavatarFrameCenterY=0.489'",yangmi)
|
||||
|
||||
def test_actual_dex_float_bits_preserve_existing_framing(self):
|
||||
import struct
|
||||
spec=importlib.util.spec_from_file_location('pack',ROOT/'scripts/package-character-test.py');pack=importlib.util.module_from_spec(spec);spec.loader.exec_module(pack)
|
||||
# Known immutable prior APK: ensure exact float bits, independent of dexdump text rounding.
|
||||
with zipfile.ZipFile(ROOT/'artifacts/lan-voice-v0714-yangmi-framing145-code39-arm64-debug.apk') as z:
|
||||
values=None
|
||||
for name in z.namelist():
|
||||
if name.startswith('classes') and name.endswith('.dex'):
|
||||
try:values=pack.dex_float_fields(z.read(name));break
|
||||
except ValueError:pass
|
||||
self.assertIsNotNone(values)
|
||||
for field,value in [('AVATAR_FRAME_ZOOM',1.45),('AVATAR_FRAME_CENTER_Y',.489)]:
|
||||
self.assertEqual(values[field],struct.unpack('<f',struct.pack('<f',value))[0])
|
||||
|
||||
Reference in New Issue
Block a user