From 5cfb51b31359d1d7ade49ffe1afb7e166a729777 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 1 Jun 2021 18:09:57 -0500 Subject: [PATCH] Add Houses (just one). Add Boots (Also 1) --- .vscode/settings.json | 2 +- macrovision.html | 5 +- macrovision.js | 1 + media/attribution.js | 26 + .../buildings/Houses/Shotgun House-Angled.svg | 559 ++++++++++++++++ .../buildings/Houses/Shotgun House-Front.svg | 367 +++++++++++ media/buildings/Houses/Shotgun House-Side.svg | 607 ++++++++++++++++++ media/buildings/Houses/Shotgun House-Top.svg | 83 +++ .../Boots/Military Boot-Back Corner.svg | 1 + media/clothing/Boots/Military Boot-Back.svg | 1 + media/clothing/Boots/Military Boot-Bottom.svg | 1 + .../Boots/Military Boot-Front Corner.svg | 1 + media/clothing/Boots/Military Boot-Front.svg | 1 + media/clothing/Boots/Military Boot-Side.svg | 1 + media/clothing/Boots/Military Boot-Top.svg | 1 + presets/buildings.js | 21 + presets/clothing.js | 36 ++ scripts/blender-freestyle.py | 62 +- 18 files changed, 1764 insertions(+), 12 deletions(-) create mode 100644 media/buildings/Houses/Shotgun House-Angled.svg create mode 100644 media/buildings/Houses/Shotgun House-Front.svg create mode 100644 media/buildings/Houses/Shotgun House-Side.svg create mode 100644 media/buildings/Houses/Shotgun House-Top.svg create mode 100644 media/clothing/Boots/Military Boot-Back Corner.svg create mode 100644 media/clothing/Boots/Military Boot-Back.svg create mode 100644 media/clothing/Boots/Military Boot-Bottom.svg create mode 100644 media/clothing/Boots/Military Boot-Front Corner.svg create mode 100644 media/clothing/Boots/Military Boot-Front.svg create mode 100644 media/clothing/Boots/Military Boot-Side.svg create mode 100644 media/clothing/Boots/Military Boot-Top.svg create mode 100644 presets/clothing.js diff --git a/.vscode/settings.json b/.vscode/settings.json index 3fdb2071..86c94e9c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "minify.minifyExistingOnSave": true, "editor.snippetSuggestions": "top", - "python.pythonPath": "c:\\Users\\hausss\\.pyenv\\pyenv-win\\versions\\3.7.7\\python.exe", + "python.pythonPath": "/snap/blender/current/2.92/python/bin/python3.7m", "python.formatting.provider": "black" } \ No newline at end of file diff --git a/macrovision.html b/macrovision.html index f5766899..3d542911 100644 --- a/macrovision.html +++ b/macrovision.html @@ -9,7 +9,6 @@ - @@ -20,6 +19,8 @@ + + @@ -325,4 +326,4 @@ - \ No newline at end of file + diff --git a/macrovision.js b/macrovision.js index 61091bbb..a9b0baec 100644 --- a/macrovision.js +++ b/macrovision.js @@ -3533,6 +3533,7 @@ const sizeCategories = { function prepareEntities() { availableEntities["buildings"] = makeBuildings(); availableEntities["characters"] = makeCharacters(); + availableEntities["clothing"] = makeClothing(); availableEntities["creatures"] = makeCreatures(); availableEntities["dildos"] = makeDildos(); availableEntities["fiction"] = makeFiction(); diff --git a/media/attribution.js b/media/attribution.js index 461961c4..55694e21 100644 --- a/media/attribution.js +++ b/media/attribution.js @@ -1263,6 +1263,28 @@ const attributionData = { "dimensions-guide" ] }, + { + prefix: "./media/buildings/Houses", + all: null, + authors: [ + "chemicalcrux", + ] + }, + { + prefix: "./media/clothing/Boots/", + files: [ + { name: "Military Boot-Front.svg", source: "https://www.cgtrader.com/free-3d-models/character/clothing/military-boots-09058854e82f1c0cfaa894ff6daedab0" }, + { name: "Military Boot-Front Corner.svg", source: "https://www.cgtrader.com/free-3d-models/character/clothing/military-boots-09058854e82f1c0cfaa894ff6daedab0" }, + { name: "Military Boot-Side.svg", source: "https://www.cgtrader.com/free-3d-models/character/clothing/military-boots-09058854e82f1c0cfaa894ff6daedab0" }, + { name: "Military Boot-Back Corner.svg", source: "https://www.cgtrader.com/free-3d-models/character/clothing/military-boots-09058854e82f1c0cfaa894ff6daedab0" }, + { name: "Military Boot-Back.svg", source: "https://www.cgtrader.com/free-3d-models/character/clothing/military-boots-09058854e82f1c0cfaa894ff6daedab0" }, + { name: "Military Boot-Bottom.svg", source: "https://www.cgtrader.com/free-3d-models/character/clothing/military-boots-09058854e82f1c0cfaa894ff6daedab0" }, + { name: "Military Boot-Top.svg", source: "https://www.cgtrader.com/free-3d-models/character/clothing/military-boots-09058854e82f1c0cfaa894ff6daedab0" }, + ], + authors: [ + "maurizio-barabani" + ] + }, { prefix: "./media/characters/abbott-absol/", files: [ @@ -21291,6 +21313,10 @@ const attributionData = { "name": "Database of Global Administrative Areas", "url": "https://gadm.org/" }, + "maurizio-barabani": { + "name": "Maurizio Barabani", + "url": "https://www.cgtrader.com/maurizio-barabani" + }, } } diff --git a/media/buildings/Houses/Shotgun House-Angled.svg b/media/buildings/Houses/Shotgun House-Angled.svg new file mode 100644 index 00000000..7086a1b1 --- /dev/null +++ b/media/buildings/Houses/Shotgun House-Angled.svg @@ -0,0 +1,559 @@ + + + + +Created by potrace 1.16, written by Peter Selinger 2001-2019 + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/buildings/Houses/Shotgun House-Front.svg b/media/buildings/Houses/Shotgun House-Front.svg new file mode 100644 index 00000000..3b45a4f0 --- /dev/null +++ b/media/buildings/Houses/Shotgun House-Front.svg @@ -0,0 +1,367 @@ + + + + +Created by potrace 1.16, written by Peter Selinger 2001-2019 + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/buildings/Houses/Shotgun House-Side.svg b/media/buildings/Houses/Shotgun House-Side.svg new file mode 100644 index 00000000..b2b78202 --- /dev/null +++ b/media/buildings/Houses/Shotgun House-Side.svg @@ -0,0 +1,607 @@ + + + + +Created by potrace 1.16, written by Peter Selinger 2001-2019 + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/buildings/Houses/Shotgun House-Top.svg b/media/buildings/Houses/Shotgun House-Top.svg new file mode 100644 index 00000000..40e61f71 --- /dev/null +++ b/media/buildings/Houses/Shotgun House-Top.svg @@ -0,0 +1,83 @@ + + + + +Created by potrace 1.16, written by Peter Selinger 2001-2019 + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/clothing/Boots/Military Boot-Back Corner.svg b/media/clothing/Boots/Military Boot-Back Corner.svg new file mode 100644 index 00000000..d81b8fa5 --- /dev/null +++ b/media/clothing/Boots/Military Boot-Back Corner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/clothing/Boots/Military Boot-Back.svg b/media/clothing/Boots/Military Boot-Back.svg new file mode 100644 index 00000000..e813f574 --- /dev/null +++ b/media/clothing/Boots/Military Boot-Back.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/clothing/Boots/Military Boot-Bottom.svg b/media/clothing/Boots/Military Boot-Bottom.svg new file mode 100644 index 00000000..83394751 --- /dev/null +++ b/media/clothing/Boots/Military Boot-Bottom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/clothing/Boots/Military Boot-Front Corner.svg b/media/clothing/Boots/Military Boot-Front Corner.svg new file mode 100644 index 00000000..c31b0a28 --- /dev/null +++ b/media/clothing/Boots/Military Boot-Front Corner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/clothing/Boots/Military Boot-Front.svg b/media/clothing/Boots/Military Boot-Front.svg new file mode 100644 index 00000000..bfd8fdb0 --- /dev/null +++ b/media/clothing/Boots/Military Boot-Front.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/clothing/Boots/Military Boot-Side.svg b/media/clothing/Boots/Military Boot-Side.svg new file mode 100644 index 00000000..a354ba13 --- /dev/null +++ b/media/clothing/Boots/Military Boot-Side.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/clothing/Boots/Military Boot-Top.svg b/media/clothing/Boots/Military Boot-Top.svg new file mode 100644 index 00000000..5c78545c --- /dev/null +++ b/media/clothing/Boots/Military Boot-Top.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/presets/buildings.js b/presets/buildings.js index 2cbdb4f5..286798eb 100644 --- a/presets/buildings.js +++ b/presets/buildings.js @@ -281,6 +281,27 @@ function makeBuildings() { ), ) + const dataHouses = [ + { + name: "Shotgun House", + sides: { + "Front": { height: math.unit(3.968526840209961, "meters") }, + "Side": { height: math.unit(3.968526840209961, "meters") }, + "Top": { height: math.unit(9.709759712219238, "meters") }, + "Angled": { height: math.unit(3.968526840209961, "meters") } + } + } + ] + + results.push({ + name: "Houses", + constructor: () => makeAutoVehicleGroup( + dataHouses, + "Houses", + "buildings" + ) + }) + results.sort((b1, b2) => { e1 = b1.constructor(); e2 = b2.constructor(); diff --git a/presets/clothing.js b/presets/clothing.js new file mode 100644 index 00000000..ff735d2c --- /dev/null +++ b/presets/clothing.js @@ -0,0 +1,36 @@ +function makeClothing() { + const results = []; + + const dataBoots = [ + { + name: "Military Boot", + sides: { + "Front": { height: math.unit(0.36637169122695923, "meters") }, + "Front Corner": { height: math.unit(0.36637169122695923, "meters") }, + "Side": { height: math.unit(0.36637169122695923, "meters") }, + "Back Corner": { height: math.unit(0.36637169122695923, "meters") }, + "Back": { height: math.unit(0.36637169122695923, "meters") }, + "Bottom": { height: math.unit(0.49710506200790405, "meters") }, + "Top": { height: math.unit(0.49710506200790405, "meters") } + } + } + + ] + + results.push({ + name: "Boots", + constructor: () => makeAutoVehicleGroup( + dataBoots, + "Boots", + "clothing" + ) + }) + + results.sort((b1, b2) => { + e1 = b1.constructor(); + e2 = b2.constructor(); + return e1.name.localeCompare(e2.name) + }); + + return results; +} diff --git a/scripts/blender-freestyle.py b/scripts/blender-freestyle.py index 00897f9a..e25472d6 100644 --- a/scripts/blender-freestyle.py +++ b/scripts/blender-freestyle.py @@ -17,16 +17,19 @@ data = {} b = selected FRONT = [0, 1, 2, "Front"] +FRONT_CORNER = [0.5, 1, 2, "Front Corner"] SIDE = [1, 1, 2, "Side"] +BACK_CORNER = [1.5, 1, 2, "Back Corner"] +BACK = [2, 1, 2, "Back"] +BOTTOM = [0, 2, 1, "Bottom"] TOP = [0, 0, 1, "Top"] -ANGLED = [0.5, 1, 2, "Angled"] -sides = [FRONT, SIDE, TOP, ANGLED] +sides = [FRONT, FRONT_CORNER, SIDE, BACK_CORNER, BACK, BOTTOM, TOP] path = "/tmp/macrovision/" media_path = "/home/crux/furry/macrovision/media/" -media_folder = "buildings/Houses/" +media_folder = "clothing/Boots/" os.makedirs(path, exist_ok=True) os.makedirs(os.path.join(media_path, media_folder), exist_ok=True) @@ -74,8 +77,44 @@ for angles in sides: line_xml = ET.parse(output_path + ".svg") fill_xml = ET.parse(output_path + "-fill.svg") - - lines = line_xml.find("./svg:g", namespaces=ns) + + style = None + + for elem in line_xml.findall(".//svg:path", namespaces=ns): + if style is None: + style = {} + for key in elem.attrib: + if not key == "d": + style[key] = elem.attrib[key] + for key in style: + del elem.attrib[key] + parts = elem.attrib["d"].strip().split(" ") + if len(parts) > 6 and parts[1] == parts[3] == parts[5] and parts[2] == parts[4] == parts[6]: + elem.attrib["DELETEME"] = True + + while True: + child = line_xml.find(".//svg:path[@DELETEME]", namespaces=ns) + parent = line_xml.find(".//svg:path[@DELETEME]...", namespaces=ns) + print(parent, child) + if parent is None: + break + parent.remove(child) + + for key in style: + line_xml.find("./svg:g", namespaces=ns).attrib[key] = style[key] + + line_xml.write(output_path + "-cleaned.svg") + + subprocess.check_output([ + "inkscape", + output_path + "-cleaned.svg", + "--batch-process", + "--actions=EditSelectAll;SelectionSimplify;FileSave", + ]) + + optimized = ET.parse(output_path + "-cleaned.svg") + + lines = optimized.find("./svg:g", namespaces=ns) fill_xml.find("svg:g[@fill='#000000']", namespaces=ns).attrib["fill"] = "#1a1a1a" @@ -83,15 +122,20 @@ for angles in sides: fill_xml.write(output_path + "-combined.svg") - subprocess.Popen([ + subprocess.check_output([ "inkscape", - "--without-gui", - "--export-plain-svg=" + os.path.join(media_path, media_folder, f"{b.name}-{angles[3]}.svg"), + "--batch-process", + "--export-plain-svg=" + output_path + "-prepared.svg", "--export-area-drawing", output_path + "-combined.svg" ]) - fill_xml.write(os.path.join(media_path, media_folder, f"{b.name}-{angles[3]}.svg")) + subprocess.check_output([ + "svgo", + output_path + "-prepared.svg", + "-o", + os.path.join(media_path, media_folder, f"{b.name}-{angles[3]}.svg") + ]) lines = [] for key, value in data.items():