Merge branch '3d'

This commit is contained in:
Joshua Goins 2023-04-13 11:46:38 -04:00
commit 7f41367eca
46 changed files with 223 additions and 32 deletions

9
3d/headsculpt.json Normal file
View file

@ -0,0 +1,9 @@
{
"alt_text": "A 3d sculpt of a short, brown haired girl. Its only a bust.",
"date": "2022-12-05",
"description": "I heard about nomadsculpt so I wanted to try it tonight!\nI dont really have any sculpting experience, and this is my second attempt at making a human face. I think it turned out pretty good though (but thats mostly because I chose the angle hehe)\nThis is really good for portable sculpting and well thought out. I miss some of Blenders tools, but it has a lot. Its also not subscription based.",
"mastodon_url": "https://mastodon.art/@redstrate/109459311625828312",
"program": "Nomadsculpt",
"title": "Nomadsculpt test",
"tags": ["3D"]
}

8
3d/lantern.json Normal file
View file

@ -0,0 +1,8 @@
{
"alt_text": "A metal old-looking lantern.",
"date": "2016",
"nsfw": false,
"title": "Lantern",
"tags": ["3D"],
"camera-orbit": "122.3deg 76deg 12.79m"
}

View file

@ -0,0 +1,11 @@
{
"alt_text": "A 3D model of the Planet Express ship from Futurama",
"date": "2022",
"description": "I attempted to make the Planet Express ship!",
"nsfw": false,
"title": "Planet Express Ship",
"tags": ["3D"],
"camera-orbit": "62.37deg 81.2deg 37.12m",
"camera-target": "0.94m 0.32m 0m",
"camera-fov": "19.58deg"
}

14
3d/sakura-avatar.json Normal file
View file

@ -0,0 +1,14 @@
{
"alt_text": "A 3D model of Sakura, with her typical red tanktop and black leggings outfit.",
"characters": [
"Sakura"
],
"date": "2021",
"description": "This is a collage of all of my 2022 art!",
"nsfw": false,
"title": "Sakura",
"tags": ["3D"],
"camera-orbit": "44.17deg 89.29deg 2.778m",
"camera-target": "0.1m 1.34m 0.14m",
"camera-fov": "19.07deg"
}

View file

@ -1,4 +1,5 @@
{ {
"date": "2018", "date": "2018",
"title": "Alley" "title": "Alley",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2018", "date": "2018",
"title": "City Train" "title": "City Train",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2018", "date": "2018",
"title": "Glass" "title": "Glass",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2018", "date": "2018",
"title": "Hallway" "title": "Hallway",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2018", "date": "2018",
"title": "Lemon" "title": "Lemon",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2016", "date": "2016",
"title": "Cool-looking Monitor" "title": "Cool-looking Monitor",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2018", "date": "2018",
"title": "Classroom" "title": "Classroom",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2017", "date": "2017",
"title": "Unfinished Samus Wallpaper" "title": "Unfinished Samus Wallpaper",
"tags": ["3D"]
} }

View file

@ -4,5 +4,6 @@
], ],
"date": "2019", "date": "2019",
"nsfw": false, "nsfw": false,
"title": "Sniper Girl" "title": "Sniper Girl",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2016", "date": "2016",
"title": "Sniper Rifle" "title": "Sniper Rifle",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2016", "date": "2016",
"title": "Spaceship" "title": "Spaceship",
"tags": ["3D"]
} }

View file

@ -1,4 +1,5 @@
{ {
"date": "2018", "date": "2018",
"title": "TV" "title": "TV",
"tags": ["3D"]
} }

BIN
assets/3d/headsculpt.glb Normal file

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

BIN
assets/3d/lantern.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
assets/3d/sakura.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -3,6 +3,12 @@ title: Lantern
date: 2016-01-01 date: 2016-01-01
excludefeed: true excludefeed: true
layout: art-detail layout: art-detail
filename: /art/lantern.webp filename: /3d/lantern.glb
orbit: 122.3deg 76deg 12.79m
alt_text: "A metal old-looking lantern."
slug: lantern slug: lantern
threed: true
arttags:
- 3d
nsfw: false
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/production-monitor.webp filename: /art/production-monitor.webp
slug: production-monitor slug: production-monitor
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/sniper-rifle.webp filename: /art/sniper-rifle.webp
slug: sniper-rifle slug: sniper-rifle
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/space.webp filename: /art/space.webp
slug: space slug: space
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/samus.webp filename: /art/samus.webp
slug: samus slug: samus
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/alley.webp filename: /art/alley.webp
slug: alley slug: alley
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/city-train.webp filename: /art/city-train.webp
slug: city-train slug: city-train
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/glass.webp filename: /art/glass.webp
slug: glass slug: glass
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/hallway.webp filename: /art/hallway.webp
slug: hallway slug: hallway
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/lemon.webp filename: /art/lemon.webp
slug: lemon slug: lemon
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/room.webp filename: /art/room.webp
slug: room slug: room
arttags:
- 3d
--- ---

View file

@ -5,4 +5,6 @@ excludefeed: true
layout: art-detail layout: art-detail
filename: /art/tv.webp filename: /art/tv.webp
slug: tv slug: tv
arttags:
- 3d
--- ---

View file

@ -7,5 +7,7 @@ filename: /art/sniper-girl.webp
slug: sniper-girl slug: sniper-girl
characters: characters:
- Sniper Girl - Sniper Girl
arttags:
- 3d
nsfw: false nsfw: false
--- ---

View file

@ -0,0 +1,19 @@
---
title: Sakura
date: 2021-01-01
excludefeed: true
layout: art-detail
filename: /3d/sakura-avatar.glb
orbit: 44.17deg 89.29deg 2.778m
target: 0.1m 1.34m 0.14m
fov: 19.07deg
alt_text: "A 3D model of Sakura, with her typical red tanktop and black leggings outfit."
slug: sakura-avatar
threed: true
characters:
- Sakura
arttags:
- 3d
nsfw: false
---
This is a collage of all of my 2022 art!

View file

@ -2,9 +2,12 @@
title: Nomadsculpt test title: Nomadsculpt test
date: 2022-12-05 date: 2022-12-05
layout: art-detail layout: art-detail
filename: /art/headsculpt.webp filename: /3d/headsculpt.glb
alt_text: "A 3d sculpt of a short, brown haired girl. Its only a bust." alt_text: "A 3d sculpt of a short, brown haired girl. Its only a bust."
slug: headsculpt slug: headsculpt
threed: true
arttags:
- 3d
mastodon_url: https://mastodon.art/@redstrate/109459311625828312 mastodon_url: https://mastodon.art/@redstrate/109459311625828312
program: Nomadsculpt program: Nomadsculpt
--- ---

View file

@ -0,0 +1,17 @@
---
title: Planet Express Ship
date: 2022-01-01
excludefeed: true
layout: art-detail
filename: /3d/planet-express-ship.glb
orbit: 62.37deg 81.2deg 37.12m
target: 0.94m 0.32m 0m
fov: 19.58deg
alt_text: "A 3D model of the Planet Express ship from Futurama"
slug: planet-express-ship
threed: true
arttags:
- 3d
nsfw: false
---
I attempted to make the Planet Express ship!

View file

@ -2,7 +2,7 @@
title: Art title: Art
layout: art layout: art
summary: My personal art gallery. summary: My personal art gallery.
new_banner: You can now vote on artwork! new_banner: You can now view select 3D pieces in your browser!
commissions: true commissions: true
aliases: aliases:
- /gallery - /gallery

View file

@ -1,21 +1,21 @@
--- ---
title: Stats title: Stats
layout: art-stats layout: art-stats
total: 183 total: 187
years: years:
- year: 2019 - year: 2019
num: 60 num: 60
- year: 2022 - year: 2022
num: 44 num: 46
- year: 2020 - year: 2020
num: 29 num: 29
- year: 2021 - year: 2021
num: 27 num: 28
- year: 2023 - year: 2023
num: 8 num: 8
- year: 2018
num: 7
- year: 2016 - year: 2016
num: 8
- year: 2018
num: 7 num: 7
- year: 2017 - year: 2017
num: 1 num: 1
@ -26,12 +26,12 @@ characters:
num: 9 num: 9
- name: Merume - name: Merume
num: 7 num: 7
- name: Sakura
num: 5
- name: Mari - name: Mari
num: 5 num: 5
- name: Asuka - name: Asuka
num: 5 num: 5
- name: Sakura
num: 4
- name: Mythra - name: Mythra
num: 4 num: 4
- name: Elisanne - name: Elisanne
@ -47,4 +47,6 @@ tags:
num: 7 num: 7
- name: drawpile - name: drawpile
num: 8 num: 8
- name: 3d
num: 16
--- ---

View file

@ -4,6 +4,6 @@
"goinghome", "goinghome",
"orbit-correction" "orbit-correction"
], ],
"new-banner": "You can now vote on artwork!", "new-banner": "You can now view select 3D pieces in your browser!",
"commissions": true "commissions": true
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -7,7 +7,7 @@ def write_field(f, key, value):
f.write(key + ": " + value + "\n") f.write(key + ": " + value + "\n")
def parse_art_json(output_directory, filename, json_file): def parse_art_json(output_directory, filename, json_file, threed = False):
json_data = json.load(json_file) json_data = json.load(json_file)
year = None year = None
@ -36,6 +36,16 @@ def parse_art_json(output_directory, filename, json_file):
write_field(f, 'excludefeed', "true") write_field(f, 'excludefeed', "true")
write_field(f, 'layout', 'art-detail') write_field(f, 'layout', 'art-detail')
if threed:
write_field(f, 'filename', '/3d/' + filename + '.glb')
if "camera-orbit" in json_data:
write_field(f, 'orbit', json_data["camera-orbit"])
if "camera-target" in json_data:
write_field(f, 'target', json_data["camera-target"])
if "camera-fov" in json_data:
write_field(f, 'fov', json_data["camera-fov"])
else:
write_field(f, 'filename', '/art/' + filename + '.webp') write_field(f, 'filename', '/art/' + filename + '.webp')
if "alt_text" in json_data: if "alt_text" in json_data:
@ -44,6 +54,9 @@ def parse_art_json(output_directory, filename, json_file):
write_field(f, 'slug', filename) write_field(f, 'slug', filename)
if threed:
write_field(f, 'threed', 'true')
characters = [] characters = []
if "characters" in json_data: if "characters" in json_data:
f.write("characters:\n") f.write("characters:\n")
@ -83,6 +96,7 @@ def parse_art_json(output_directory, filename, json_file):
art_data_directory = '../art' art_data_directory = '../art'
threed_data_directory = '../3d'
art_output_directory = '../content/art' art_output_directory = '../content/art'
shutil.rmtree(art_output_directory) shutil.rmtree(art_output_directory)
@ -125,6 +139,35 @@ for filename in os.listdir(art_data_directory):
collected_years.add(year) collected_years.add(year)
total_art += 1 total_art += 1
for filename in os.listdir(threed_data_directory):
f = os.path.join(threed_data_directory, filename)
if os.path.isfile(f):
filename_without_ext = os.path.splitext(filename)[0]
with open(f, "r") as file:
year, characters, tags = parse_art_json(art_output_directory, filename_without_ext, file, True)
if year in year_stats:
year_stats[year] += 1
else:
year_stats[year] = 1
for character in characters:
if character in character_stats:
character_stats[character] += 1
else:
character_stats[character] = 1
for tag in tags:
if tag in tag_stats:
tag_stats[tag] += 1
else:
tag_stats[tag] = 1
collected_years.add(year)
total_art += 1
for year in collected_years: for year in collected_years:
with open(os.path.join(art_output_directory, str(year), '_index.md'), 'w') as f: with open(os.path.join(art_output_directory, str(year), '_index.md'), 'w') as f:
f.write('---\n') f.write('---\n')

View file

@ -433,6 +433,8 @@ pre {
} }
model-viewer { model-viewer {
width: 640px; height: 100vh;
height: 480px; width: 100%;
margin-left: auto;
margin-right: auto;
} }

View file

@ -4,8 +4,15 @@
<hr> <hr>
{{ with resources.Get .Params.filename }} {{ with resources.Get .Params.filename }}
{{ if $.Params.threed }}
{{ $cameraorbit := $.Params.orbit }}
{{ $cameratarget := $.Params.target }}
{{ $fov := $.Params.fov }}
<model-viewer src="{{ .RelPermalink }}" shadow-intensity="1" camera-controls touch-action="pan-y" camera-orbit="{{ $cameraorbit }}" camera-target="{{ $cameratarget }}" field-of-view="{{ $fov }}"></model-viewer>
{{ else }}
<img class="article-img" style="display: block; max-height: 1000px; margin-left: auto; margin-right: auto;" alt="{{ $.Params.alt_text }}" title="{{ $.Params.alt_text }}" src="{{ .RelPermalink }}"/> <img class="article-img" style="display: block; max-height: 1000px; margin-left: auto; margin-right: auto;" alt="{{ $.Params.alt_text }}" title="{{ $.Params.alt_text }}" src="{{ .RelPermalink }}"/>
{{ end }} {{ end }}
{{ end }}
<table> <table>
<tr> <tr>
@ -90,5 +97,13 @@
</p> </p>
{{ end }} {{ end }}
{{ if .Params.threed }}
{{ $site := resources.Get "js/model-viewer.min.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | fingerprint | resources.PostProcess }}
{{ end }}
<script type="module" src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
{{ end }}
{{ partial "comments" . }} {{ partial "comments" . }}
{{ end }} {{ end }}

View file

@ -1,4 +1,9 @@
{{ $full := resources.Get (printf "art/%s.webp" .Params.slug) }} {{ $base := "art" }}
{{ if .Params.threed }}
{{ $base = "3d" }}
{{ end }}
{{ $full := resources.Get (printf "%s/%s.webp" $base .Params.slug) }}
{{ if $full }} {{ if $full }}
{{ $filename_without_ext := .Params.slug }} {{ $filename_without_ext := .Params.slug }}
@ -13,9 +18,10 @@
{{ end }} {{ end }}
<a class="no-decoration" href="{{ .Permalink }}"> <a class="no-decoration" href="{{ .Permalink }}">
{{ $path := printf "/art/%d/%.2d/%s" (int $year) (int $month) $filename_without_ext}}
{{ $path := printf "/%s/%d/%.2d/%s" $base (int $year) (int $month) $filename_without_ext}}
{{ $title := .Params.title }} {{ $title := .Params.title }}
{{ $image := (resources.Get (printf "art/%s.webp" .Params.slug)).Resize "400x" }} {{ $image := (resources.Get (printf "%s/%s.webp" $base .Params.slug)).Resize "400x" }}
{{ if .Params.nsfw }} {{ if .Params.nsfw }}
{{ $image = $image | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }} {{ $image = $image | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
@ -32,4 +38,4 @@
<em>CANNOT FIND {{ .Params.slug }}</em> <em>CANNOT FIND {{ .Params.slug }}</em>
{{ end }} {{ end }}
`