This commit is contained in:
Skye Terran 2021-08-23 16:19:59 -07:00
parent c52fd22b9b
commit c25cf1a70d
2 changed files with 33 additions and 24 deletions

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 86,
"execution_count": 89,
"source": [
"import json\r\n",
"\r\n",
@ -50,9 +50,10 @@
" return key\r\n",
"\r\n",
"# add an asset to the graph\r\n",
"def add_asset(data, name):\r\n",
"def add_asset(data, name, path):\r\n",
" asset_data = {\r\n",
" \"name\": (\"name\", name)\r\n",
" \"name\": (\"name\", name),\r\n",
" \"file\": (\"path\", path)\r\n",
" }\r\n",
" \r\n",
" # add the asset to the graph\r\n",
@ -79,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 87,
"execution_count": 90,
"source": [
"# cache the scene\r\n",
"def cache_scene(data):\r\n",
@ -148,7 +149,7 @@
},
{
"cell_type": "code",
"execution_count": 88,
"execution_count": 91,
"source": [
"# just returns a random string\r\n",
"import random\r\n",
@ -163,7 +164,7 @@
"asset_names = []\r\n",
"for i in range(3):\r\n",
" name = random_string(8)\r\n",
" add_asset(test_scene, name)\r\n",
" add_asset(test_scene, name, \"Assets/TestAsset.obj\")\r\n",
" asset_names.append(name)\r\n",
"\r\n",
"# populate objects in scene\r\n",

View File

@ -20,7 +20,7 @@
{
"name": [
"name",
"F0O8L98N"
"8KF4IW7J"
],
"asset": "#0x9",
"trans": "#0xa"
@ -31,11 +31,11 @@
{
"name": [
"name",
"PMG7JNPR"
"6IIDHIMN"
],
"asset": [
"asset",
"2YGVO7W4"
"L3T5A6RD"
],
"trans": "#0xa"
}
@ -45,7 +45,7 @@
{
"name": [
"name",
"RW53IYCM"
"S7FS45HQ"
],
"asset": "#0x9",
"trans": "#0xa"
@ -56,12 +56,9 @@
{
"name": [
"name",
"6SS003XM"
],
"asset": [
"asset",
"7YRERZGM"
"LVAWTY6W"
],
"asset": "#0xb",
"trans": "#0xa"
}
],
@ -70,9 +67,9 @@
{
"name": [
"name",
"8L4JU4I1"
"OADE7KQG"
],
"asset": "#0x9",
"asset": "#0xb",
"trans": "#0xa"
}
]
@ -83,8 +80,9 @@
{
"name": [
"name",
"QCR0823N"
]
"QT5Z6AA9"
],
"file": "#0xc"
}
],
"0x2": [
@ -92,8 +90,9 @@
{
"name": [
"name",
"7YRERZGM"
]
"L3T5A6RD"
],
"file": "#0xc"
}
],
"0x3": [
@ -101,8 +100,9 @@
{
"name": [
"name",
"2YGVO7W4"
]
"7OAGNOGS"
],
"file": "#0xc"
}
]
}
@ -110,7 +110,7 @@
"cache": {
"#0x9": [
"asset",
"QCR0823N"
"7OAGNOGS"
],
"#0xa": [
"trans",
@ -131,6 +131,14 @@
1.0
]
]
],
"#0xb": [
"asset",
"QT5Z6AA9"
],
"#0xc": [
"path",
"Assets/TestAsset.obj"
]
}
}