15 lines
704 B
Python
15 lines
704 B
Python
|
|
from spriteforge.studio.models import Asset
|
||
|
|
from spriteforge.studio.store import ProjectStore
|
||
|
|
|
||
|
|
|
||
|
|
def test_batch_grid_and_asset_settings(tmp_path):
|
||
|
|
store=ProjectStore.create(tmp_path/"studio","ops","Ops")
|
||
|
|
store.add_asset(Asset(id="agent",name="Agent",kind="character",target_width=60,target_height=60))
|
||
|
|
project,created=store.add_shot_grid("agent","walk",8,6)
|
||
|
|
assert len(created)==48 and project.assets[0].directions==8
|
||
|
|
_,again=store.add_shot_grid("agent","walk",8,6)
|
||
|
|
assert not again
|
||
|
|
project=store.update_asset("agent",{"generation_width":768,"fps":10.0,"pivot_y":.92})
|
||
|
|
asset=project.assets[0]
|
||
|
|
assert asset.generation_width==768 and asset.fps==10 and asset.pivot_y==.92
|