mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
feat: support alternative vcm models syntax
This commit is contained in:
parent
8f342fe429
commit
4333d9ab06
10 changed files with 155 additions and 28 deletions
3
res/devtools/syntax/vcm.toml
Normal file
3
res/devtools/syntax/vcm.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
language = "VCM"
|
||||
extensions = ["vcm"]
|
||||
line-comment-start = "#"
|
||||
4
res/models/stairs.vcm
Normal file
4
res/models/stairs.vcm
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
@box from (0,0,0) to (1,0.5,1) delete (top,south)
|
||||
@box from (0,0.5,0) to (1,1,0.5) delete (bottom,south)
|
||||
@rect from (0,0.5,0.5) right (1,0,0) up (0,0,0.5) texture "$2"
|
||||
@rect from (0,0,0) right (1,0,0) up (0,1,0) texture "$1"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<model>
|
||||
<box from="0,0,0" to="1,0.5,1" delete="top,south"/>
|
||||
<box from="0,0.5,0" to="1,1,0.5" delete="bottom,south"/>
|
||||
<rect from="0,0.5,0.5" right="1,0,0" up="0,0,0.5" texture="$2"/>
|
||||
<rect from="0,0,0" right="1,0,0" up="0,1,0" texture="$1"/>
|
||||
</model>
|
||||
|
|
@ -55,7 +55,7 @@ local function load_models_list(packs)
|
|||
local registry = export.registry
|
||||
for _, filename in ipairs(file.list("models")) do
|
||||
local ext = file.ext(filename)
|
||||
if ext == "xml" then
|
||||
if ext == "xml" or ext == "vcm" then
|
||||
registry[filename] = {type="model", unit=file.stem(filename)}
|
||||
table.insert(export.filenames, filename)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue