Skip to content

Commit

Permalink
add ogzeditor_blender_importer.js preset
Browse files Browse the repository at this point in the history
  • Loading branch information
SalatielSauer committed Jan 1, 2025
1 parent 02a7b2c commit f1d6560
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ To make it easier to generate some structures, there are some predefined functio

<hr>

## Blender 3D -> OGZ Editor
If you intend to export objects from [Blender](https://www.blender.org/) to .ogz, you can use [Sauer-Vertex](https://gist.github.com/SalatielSauer/ba1d96e664b7accbeaae3a504acecdc0), an addon for version 2.79 and 2.80+ that exports the vertices and textures of a selected object to a .json that you can import in the OGZ Editor and save as .ogz.
![](https://raw.githubusercontent.com/SalatielSauer/misc/master/sauervertex_8.png)
<hr>

# JSOCTA
JSOCTA powers the OGZ Editor by converting JavaScript objects into valid OGZ files.

Expand Down
2 changes: 1 addition & 1 deletion pwapp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const version = '0.2.4';
const version = '0.2.41';
const cacheName = `ogzeditor-${version}`;
const assetsToCache = [
'/OGZ-Editor/index.html',
Expand Down
23 changes: 23 additions & 0 deletions scripts/examples/ogzeditor_blender_importer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
If you intend to export objects from Blender (blender.org) to .ogz, you can use Sauer-Vertex
( https://gist.github.com/SalatielSauer/ba1d96e664b7accbeaae3a504acecdc0 ),
Sauer-Vertex is an addon for blender 2.79 and 2.80+ that exports the vertices and textures of a
selected object to a .json that you can upload in the OGZ Editor and save as .ogz.
Example: https://raw.githubusercontent.com/SalatielSauer/misc/master/sauervertex_9.png
*/

mapvars({
'maptitle': 'Untitled Map by OGZ Editor',
'mapsize': 1024
});

entities([

]);

geometry(()=>{
let map = [];
// tip: if you have multiple meshes and need to export their .json individually, upload the .json files and reference their indexes in additional map.push
map.push(ogzeditor.asset.json[ogzeditor.asset.json.length-1].geometry); // get the last uploaded json file
return map;
});
6 changes: 6 additions & 0 deletions scripts/ogzeditor_presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const ogzeditor_presets = [
"author": "SalatielSauer",
"url": "https://github.com/SalatielSauer/",
"file": "scripts/examples/ogzeditor_magiceye.js"
},
{
"name": "Blender JSON Importer",
"author": "SalatielSauer",
"url": "https://github.com/SalatielSauer/",
"file": "scripts/examples/ogzeditor_blender_importer.js"
}
]

Expand Down

0 comments on commit f1d6560

Please sign in to comment.