prthm11 commited on
Commit
3148054
·
verified ·
1 Parent(s): eba287b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -2234,8 +2234,15 @@ def similarity_matching(sprites_data: str, project_folder: str) -> str:
2234
  # then backdrop as the Stage
2235
  if backdrop_data:
2236
  all_costumes, sounds = [], []
 
2237
  for i, bd in enumerate(backdrop_data):
2238
- all_costumes.extend(bd.get("costumes", []))
 
 
 
 
 
 
2239
  if i == 0:
2240
  sounds = bd.get("sounds", [])
2241
  stage_obj={
 
2234
  # then backdrop as the Stage
2235
  if backdrop_data:
2236
  all_costumes, sounds = [], []
2237
+ seen_costumes = set()
2238
  for i, bd in enumerate(backdrop_data):
2239
+ for costume in bd.get("costumes", []):
2240
+ # Create a unique key for the costume
2241
+ key = (costume.get("name"), costume.get("assetId"))
2242
+ if key not in seen_costumes:
2243
+ seen_costumes.add(key)
2244
+ all_costumes.append(costume)
2245
+
2246
  if i == 0:
2247
  sounds = bd.get("sounds", [])
2248
  stage_obj={