-
-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
…into ir-2543-create-prefab
…into ir-2543-create-prefab
@@ -80,7 +80,8 @@ export const ModelComponent = defineComponent({ | |||
convertToVRM: false, | |||
scene: null as Group | null, | |||
asset: null as VRM | GLTF | null, | |||
dereference: false | |||
dereference: false, | |||
save: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't add this "save" attribute, this should be handled through just calling "exportModelGLTF" explicitly
@@ -120,6 +140,13 @@ export const ModelNodeEditor: EditorComponentType = (props) => { | |||
) | |||
}, [modelComponent.asset]) | |||
|
|||
useEffect(() => { | |||
if (modelComponent.save.value) { | |||
onExportPrefabModel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's just call this function rather than using a reactor to set it off
try { | ||
exportRelativeGLTF(entity, srcProject, fileName) | ||
//pass static resource | ||
const resources = await Engine.instance.api.service(staticResourcePath).find({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will always fail because the file doesn't exist yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should remove this call, and construct a static resource object to pass for upload
throw new Error('User not found') | ||
} | ||
const resource = resources.data[0] | ||
await Engine.instance.api.service(staticResourcePath).patch(resource.id, { tags: prefabTag }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a "create" call instead of "patch"
const entity = node?.entity as Entity | ||
const [defaultPrefabFolder, setDefaultPrefabFolder] = useState<string>('/assets/custom-prefabs') | ||
const [prefabName, setPrefabName] = useState<string>('prefab') | ||
const [prefabTag, setPrefabTag] = useState<string[]>([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change these to Hookstate objects instead of normal react state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting close. We need to fix the export of .bin + texture files in .gltf export mode. I tried making a prefab out of the portal frame in the default project and ran into this issue:
Screencast from 06-17-2024 03:06:49 PM.webm
The 'model-resources' folder is getting saved into the wrong location. When saving the .gtlf into the assets/custom-prefabs
folder, the model resources are getting saved into assets/assets/custom-prefabs/model-resources/...
:
Screencast from 06-17-2024 03:09:12 PM.webm
…into ir-2543-create-prefab
…gine/etherealengine into ir-2543-create-prefab
fix cross-project export image references
…into ir-2543-create-prefab
…into ir-2543-create-prefab
…into ir-2543-create-prefab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
* dev: (34 commits) ir 2253 fix project zip archiver (#10437) IR-2721: Zendesk integration (#10416) clearer delete scene argument id (#10440) fix editor tests (#10439) fix material removal errors due to missing source component (#10433) studio: ui feedback for loading a scene (#10404) fix material ParameterInput (#10429) update visibility to authoring layer (#10428) IR-2711: update default scene (#10399) clean up console log fix resources.json sorting not happening when it is regenerated fix styling for key value project settings (#10432) Added VITE_FEATHERS_STORE_KEY to Docker builds (#10426) IR 2148 Material Entities for All Meshes, Improved hashing logic, Plugin Components (#10209) Ir 2543 create prefab (#10384) feat(tooltip): make title from string to ReactNode to accept custom title (#10424) Update branch-build.yml (#10430) fix frustum culling calculation (#10418) show no results for unmatching query in hierarchy tree (#10415) Remove react-is hackfix install (#10425) ...
Summary
Subtasks Checklist
Breaking Changes
References
closes #insert number here
QA Steps