Fixed asset pointer type problem

This commit is contained in:
Skye Terran 2021-08-23 16:30:02 -07:00
parent c25cf1a70d
commit bdd83df783
2 changed files with 32 additions and 51 deletions

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 89, "execution_count": 28,
"source": [ "source": [
"import json\r\n", "import json\r\n",
"\r\n", "\r\n",
@ -63,14 +63,14 @@
"def spawn_object(data, name, asset):\r\n", "def spawn_object(data, name, asset):\r\n",
" object_data = {\r\n", " object_data = {\r\n",
" \"name\": (\"name\", name),\r\n", " \"name\": (\"name\", name),\r\n",
" \"asset\": (\"asset\", asset),\r\n", " \"asset\": \"\",\r\n",
" \"trans\": (\"trans\", [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [1.0, 1.0, 1.0]])\r\n", " \"trans\": (\"trans\", [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [1.0, 1.0, 1.0]])\r\n",
" }\r\n", " }\r\n",
"\r\n", "\r\n",
" # get an asset key by the provided name\r\n", " # get an asset key by the provided name\r\n",
" for key, value in data[\"graph\"][\"assets\"].items():\r\n", " for key, value in data[\"graph\"][\"assets\"].items():\r\n",
" if value[1][\"name\"] == asset:\r\n", " if value[1][\"name\"][1] == asset:\r\n",
" object_data[\"asset\"] = (\"asset\", f\"*{key}\")\r\n", " object_data[\"asset\"] = f\"*{key}\"\r\n",
"\r\n", "\r\n",
" # add the object to the scene\r\n", " # add the object to the scene\r\n",
" data[\"graph\"][\"scene\"][add_key(data)] = (\"object\", object_data)" " data[\"graph\"][\"scene\"][add_key(data)] = (\"object\", object_data)"