GithubHelp home page GithubHelp logo

kirpal / keyboard-layout-editor-for-blender Goto Github PK

View Code? Open in Web Editor NEW
333.0 13.0 38.0 23.03 MB

Allows you to import keyboard layouts into blender and render them in 3d

Python 100.00%
blender keyboard-layout addon dsa keyboard mechanical-keyboard keyboard-layout-editor render

keyboard-layout-editor-for-blender's Introduction

Keyboard-Layout-Editor-for-Blender

Allows you to import keyboard layouts into blender and render them in 3d

Examples:

Example 1

Courtesy of /u/jacopods

 

Example 2

Courtesy of /u/zzubnik

 

Example 3

Courtesy of /u/zzubnik

 

Example 4

Courtesy of @kirpal

Please open a pull request if you'd like to add more examples

How to install Addon:

  1. Download the zip (releases)
  2. Open Blender
  3. Go to Edit > Preferences
  4. Select the "Add-ons" tab on the left.
  5. Click Install... in the top right corner
  6. Select the zip archive that you downloaded and click Install Add-on
  7. Check the checkbox next to Import-Export: Import: KLE Raw JSON format (.json)
  8. Cose the preferences window. It should auto-save, but you may have to save preferences manually if auto-save is off.
  9. Now the addon is ready to use

How to use Addon:

  1. Open Blender
  2. Go to File > Import > KLE Raw Data (.json)
  3. Select the json file that you downloaded from Keyboard Layout Editor and click Import KLE Raw JSON
  4. All Done!

Note: Do not use keycap_parts.blend as it will not work! Use example below if you want a starting point

How to add LEDs:

  • Add the following lines to the keyboard "Notes" section

    led_color: #RRGGBB
    led_brightness: 1
    
    • Where led_brightness is any number from 0 to 1 and led_color is a hex color
  • To make the keycap legends backlit, make the legend color the same as the LED color.

Blender scene file

A basic scene for blender can be found in this gist. Open the scene in blender before importing. Please note that lighting, camera and render setup will most probably require some tweaking to fit with your specific layout.

Special Thanks To:

@zslane on Deskthority for the SA models

@Kaporkle on Geekhack for the DSA models

@wilderjds for implementing SA support

keyboard-layout-editor-for-blender's People

Contributors

kirpal avatar leifniem avatar sipkode avatar wilderjds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keyboard-layout-editor-for-blender's Issues

Cherry profile models

Hi there!

I downloaded and started playing around with KLE-for-Blender yesterday and noticed the lack of support for Cherry profile keycaps. I went looking around and there appears to be a repo (Kieeboard) with .STLs of the Cherry profile keycaps based off a Cherry datasheet. I could import the keys one by one to Blender but that would be horribly inefficient to do compared to the nice import workflow in KLE-for-Blender.

If anything, I'm new to Blender but I'm pretty familiar with Python myself. It would be great if KLE-for-Blender is extended to support Cherry profile (and if I have time I might even take it on or help out where possible).

Edit: previewed some of the .STL files and something looks off about them for some reason: the top surface of the keycaps seem to be too large for Cherry profile I think.

Error on json import

After File>import KLE Raw Data I receive this error:

Traceback (most recent call last):
File "/home/thewithz/.config/blender/2.90/scripts/addons/Keyboard-Layout-Editor-for-Blender/init.py", line 30, in execute
return import_keyboard.load_json(self, self.filepath)
File "/home/thewithz/.config/blender/2.90/scripts/addons/Keyboard-Layout-Editor-for-Blender/import_keyboard.py", line 373, in > load_json
read(filepath)
File "/home/thewithz/.config/blender/2.90/scripts/addons/Keyboard-Layout-Editor-for-Blender/import_keyboard.py", line 89, in read
scn.display_settings.display_device = "None"
TypeError: bpy_struct: item.attr = val: enum "None" not found in ('sRGB')
location: :-1

I am using the .blend file recommended from the gist in the README.
Blender version 2.90.1 on Gentoo Linux 5.9.1

Serious performance issues when importing KLE json file

Windows 10 Pro, Blender v2.80, v3.0 KLE for Blender

Importing a simple json file for something such a planck or ergodox takes 2+ minutes to import. I monitored resources during this time, and I also noticed a utilization of up to 17GB of memory during the json import. This seems very very high, and certainly 2+ minutes for a single import is a problem.

I have not tested with 2.79, but will attempt to do that with the current version of this plugin.

Blender freezing and crashing when trying to import json

Blender completely freezes and crashes when trying to import json after updating to v.3.0 and Blender 2.80. Previously 2.79 was working just fine for me with the exception of arrow keys which is why I tried updating now it doesn't work at all. Please help thank you for your time.

DCS Profile only one row

When I load up a DCS json with different rows, it loads a keyboard with one row only. The space bar on both DCS and DSA are indented instead of convex as well.

incorrectspacebar
onlyonerow

Issue loading in text sizes

Required Information

Describe the bug
Not sure if it's a bug or intentional but the text size is not being imported. Is this a known issue or is it intentional?

Screenshots
Blender version
JokerTheme

Straight from KLE
keyboard-layout (3)

The text size is not the same, some keys in blender turn out correct like arrows and brackets but more often than not it fails to replicate the sizes from KLE

Help -- Addon Install

I've been trying to get this install to work for a couple hours now -- and cannot get this addon to install properly on a mac osx 10.13.4

Installing through the zip puts the addon in a different location under user rather than with the rest of the addons -- it seems to be installed but doesn't show up in the list.

Closest I've gotten it to work is to first install through the zip and then move the folder to the other location -- this at least forced the addon to show up in the list and let me enable it.

But these were the result upon import...

Any advice?
screenshot 2018-04-13 01 04 26

Google Fonts not fully working

I have the following in my KLE custom style

`@font-face {
font-family: 'Hannari';
font-style: normal;
font-weight: 600;
src: url(//fonts.gstatic.com/ea/hannari/v1/Hannari-Regular.eot);
src: url(//fonts.gstatic.com/ea/hannari/v1/Hannari-Regular.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/hannari/v1/Hannari-Regular.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/hannari/v1/Hannari-Regular.woff) format('woff'),
url(//fonts.gstatic.com/ea/hannari/v1/Hannari-Regular.ttf) format('truetype');
}

  • { font-family: 'Hannari'; }
    `

And I get the error:

Trackback (most recent call last):
File "/Users/bmmcwhirt/Library/Application Support/Blender/2.79/scripts/addons/Keyboard-Layout-Editor-for-Blender-master/init.py", line 32, in execute import_keyboard.read(self.filepath)
File "/Users/bmmcwhirt/Library/Application Support/Blender/2.79/scripts/addons/Keyboard-Layout-Editor-for-Blender-master/import_keyboard.py", line 462, in read if selector is not None and fontProps[idx] is None: IndexError: list index out of range

location: :-1

My layout: https://gist.github.com/bmmcwhirt/84deb68f41b55c171bd6ace6f6ce4e09

Import option for KLE Raw Data (.json)

Windows 10, 64-bit. Blender version 2.80.75.

I performed the installation steps and can currently see "Import-Export: KLE Raw JSON format (.json)" in my Add-ons menu. It is checked, though it has a note about "upgrade to 2.8x required."

However, KLE Raw Data (.json) does not currently appear as an option in the File - Import menu.

"None" is not a supported option for display device

Required Information

  • [2.92]
  • [3.3]
  • [Layout not the problem]

Describe the bug
When attempting to import a layout, this error is returned:

It appears to be because the addon is expecting "None" to be an option, but not finding it. I worked around it by going into the file mentioned in the error message and changing the value from "none" to "sRGB"

image

Can't install into Blender 2.79

I may be messing it up somehow, but I've downloaded v2.6 and v2.5 zips and tried to install add-on from file but it just drops back to the add-on list with no addition of the import-export plugin.

Using Blender 2.79 on Windows 10.

Keyboard Layout Incorrect

Hi, whenever I load in any keyboard, whether is was the sample layouts or my own layout, I am given the image in the attached picture. I am not sure if there is something I am doing wrong or not.

Capture

Vertically stacked legends possible or not?

Hey guys just wanted to point this out, not sure if its an available feature or if this is a glitch

stacked enter/return on 1x2u key

It would appear that stacking the numpad return key so that the letters are vertical makes the text box outline (the triangles above and below the text) visible in all renders.

I've tried adjusting the legend size to maybe eliminate the problem, but it would appear that it doesn't matter.

legend size comparison

Is this a possible feature that I'm simply having problems with or is this a feature not yet added to this plugin?

Thanks!

just dose not work!

2020-09-26 (1)
please fix. i used to do this all the time but now it just doesn't seem to work :(

Can't activate, doesn't show up in Addon List

This looks really sweet! Unfortunately, I tried to install it into Blender 2.79 and it doesn't show up in the user preferences list to activate. I've tried importing both the whole zip file and just the "keyboard_importer.py" file. If I uncheck "overwrite" while importing it shows that something is installed already. I'm running on Windows, with the 64bit version of blender (installed, not from a zip). Any help would be appreciated.

Row profile

Thank you for this amazing plugin. However I am still missing the row profiles for it to be of use to me. If you ever have time to add this then that would be so amazing. Thank you again and keep up the good work!

Font issues for DSA keycaps with multiple size legends.

Hey this tool is awesome. I noticed a couple issues importing a DSA layout: default font is not importing (though the font it's using looks pretty good), keycaps with multiple font sizes are importing as the same size; bottom legends are getting cut off below the baseline.

Thanks!

screen shot 2018-07-14 at 11 36 55 am

screen shot 2018-07-14 at 11 39 16 am

Cherry MX Switch model too small

the switches that kle-to-blender creates along the keycaps seem to be about 80% of the actual size and float in their respective holes on any plate that's created with the correct dimensions.
grafik

Atreus layout does not import properly

I tried both the Atreus preset in KLE and the Atreus62 KLE file made by jowe over on geekhack here

I'm also using the Blender Scene from the README.

The Atreus preset in KLE turns out better than the Atreus62, but neither appear to import correctly. Perhaps it is related to #36 somehow?

The Atreus preset seems mostly fine on the left-hand side, but the right-hand explodes out. A lot of the left-hand side also goes behind the backdrop.
image

Here's the User Perspective preview pane rotated upward to show behind the backdrop.
image

The Atreus62 one however appears to be straight up missing most keys. I'm not sure if that's a configuration issue in KLE or not truthfully.

image


Thanks for this tool, by the way! Despite not being able to render an Atreus62 as I wanted, I was able to successfully render out a regular 60% board to get an idea of the colors I'm looking at for the keycaps. Being able to see a "real world" example of the colors side-by-side was very helpful 😃

Weird lines appearing on keys

Hello. I have loaded the model, shaded it to smooth and turned on auto-smooth but there are lines going down the middle of each key and the sides of larger keys.

image

Is there a way I can fix this? Thanks

Import leaves behind template objects

When running the import script, it crashes during the cleanup step with the following output:

Exception has occurred: RuntimeError
Error: Object 'led' can't be selected because it is not in View Layer 'RenderLayer'!
  File "c:\Users\Admin\Dev\GitHub\Keyboard-Layout-Editor-for-Blender\helpers.py", line 4, in select_object
    object.select_set(select)
  File "c:\Users\Admin\Dev\GitHub\Keyboard-Layout-Editor-for-Blender\import_keyboard.py", line 864, in read
    helpers.select_object(bpy.data.objects[object])
  File "c:\Users\Admin\Dev\GitHub\Keyboard-Layout-Editor-for-Blender\__init__.py", line 29, in execute
    import_keyboard.read(self.filepath)

As a result, it aborts before deleting the template objects, leaving them in the scene.

Wrong key rotation

First, congrats for your amazing work !

Key rotation is not handled the same way as KLE. See :

Ergodox (pinkified but layout is still default one) in KLE:
kle

Result after import in Blender:
overlap

I suspect rotation center is "key unit center" in Blender, while it is "key unit top left" in KLE.

KLE json:

[{x:3.5,c:"#ffadce",t:"#2b2c2e",p:"DSA"},"#\n3",{x:10.5},"*\n8"],
[{x:3.5,c:"#ffadce",t:"#2b2c2e",p:"DSA"},"#\n3",{x:10.5},"*\n8"],
[{y:-0.875,x:2.5},"@\n2",{x:1},"$\n4",{x:8.5},"&\n7",{x:1},"(\n9"],
[{y:-0.875,x:5.5},"%\n5",{a:7},"",{x:4.5},"",{a:4},"^\n6"],
[{y:-0.875,c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},"",{c:"#ffadce",t:"#2b2c2e",a:4},"!\n1",{x:14.5},")\n0",{c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},""],
[{y:-0.375,x:3.5,c:"#ffadce",t:"#2b2c2e",a:4},"E",{x:10.5},"I"],
[{y:-0.875,x:2.5},"W",{x:1},"R",{x:8.5},"U",{x:1},"O"],
[{y:-0.875,x:5.5},"T",{a:7,h:1.5},"",{x:4.5,h:1.5},"",{a:4},"Y"],
[{y:-0.875,c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},"",{c:"#ffadce",t:"#2b2c2e",a:4},"Q",{x:14.5},"P",{c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},""],
[{y:-0.375,x:3.5,c:"#ffadce",t:"#2b2c2e",a:4},"D",{x:10.5},"K"],
[{y:-0.875,x:2.5},"S",{x:1},"F",{x:8.5},"J",{x:1},"L"],
[{y:-0.875,x:5.5},"G",{x:6.5},"H"],
[{y:-0.875,c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},"",{c:"#ffadce",t:"#2b2c2e",a:4},"A",{x:14.5},":\n;",{c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},""],
[{y:-0.625,x:6.5,c:"#ffadce",t:"#2b2c2e",h:1.5},"",{x:4.5,h:1.5},""],
[{y:-0.75,x:3.5,a:4},"C",{x:10.5},"<\n,"],
[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."],
[{y:-0.875,x:5.5},"B",{x:6.5},"N"],
[{y:-0.875,c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},"",{c:"#ffadce",t:"#2b2c2e",a:4},"Z",{x:14.5},"?\n/",{c:"#9b6482",t:"#0d0d0b",a:7,w:1.5},""],
[{y:-0.375,x:3.5,c:"#ffadce",t:"#2b2c2e"},"",{x:10.5},""],
[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""],
[{y:-0.75,x:0.5},"","",{x:14.5},"",""],
[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#9b6482",t:"#0d0d0b"},"",""],
[{c:"#2b2c2e",t:"#ffadce",h:2},"",{c:"#ffadce",t:"#2b2c2e",h:2},"",{c:"#9b6482",t:"#0d0d0b"},""],
[{x:2},""],
[{r:-30,rx:13,y:-1,x:-3},"",""],
[{x:-3},"",{c:"#ffadce",t:"#2b2c2e",h:2},"",{h:2},""],
[{x:-3,c:"#9b6482",t:"#0d0d0b"},""]

Does not work in Blender 2.8

Not sure what is going wrong here, given that I am not an expert on Blender, but it's pretty weird. It works on 2.7.9, but not 2.8.

Here's the error message.
screen shot 2018-03-01 at 5 35 42 pm

HTMLParser object has no attribute 'unescape'

Required Information

  • Blender 2.91.0
  • Python 3.9.1
  • Add on: Current Master, just downloaded
  • Any layout, also the default one.
  • OS: Arch Linux

Describe the bug

  • Install Blender 2.91.0
  • Install Add-on
  • Import any file
  • Blender returns: 'HTMLParser' object has no attribute 'unescape'

Screenshots
2020-12-23_10-57

Error on importing json (v3.0)

Hey,

I've tried to import json file using new version of the file but I'm getting this error
Annotation 2019-11-04 160908

Any idea how to fix that?

Blender on Mac

Nothing happens after installing the add-on - no error etc. but nothing shows up in the import-export add ons. :/

Exception thrown when no key color is ever specified on kle

I guess the key["c"] element is not populated for some reason. Just try with the default json from kle.com; keys colors are default (#cccccc) and do not appear in the json. This triggers the exception for me

(cannot attach json files to github issues?)

Location Issue

I downloaded this last night and followed the instructions with only slight variations since Blender has changed some menu options since the instructional was made. I went to import the .json file of my KLE design and blender fired a location error, "struct rna type of vector font has been removed." I didn't change anything actual files or locations, so I'm not sure what's happening.
I also don't really work with Blender often, so if it's something obvious then I apologize.

StructRNA of type VectorFont has been removed

I encountered this issue when trying to import a DSA Layout in 2.82 with the 3.0 plugin.

  File "/Volumes/Files/Users/leif/Library/Application Support/Blender/2.82/scripts/addons/keyboard-layout-editor-for-blender/__init__.py", line 29, in execute
    import_keyboard.read(self.filepath)
  File "/Volumes/Files/Users/leif/Library/Application Support/Blender/2.82/scripts/addons/keyboard-layout-editor-for-blender/import_keyboard.py", line 674, in read
    new_obj_tl)
  File "/Volumes/Files/Users/leif/Library/Application Support/Blender/2.82/scripts/addons/keyboard-layout-editor-for-blender/add_label.py", line 60, in add
    new_label.data.font = font
ReferenceError: StructRNA of type VectorFont has been removed

location: <unknown location>:-1

Sorry if this is a tad vague, i can try providing more data if it helps.

Broken sculpt issues (SA R1,2)

I've found some issues with rendering row 1 and 2 in SA profile. There's lines through the profile, as you can see here:
sa oblivion

Not sure what the issue is, and I'm pretty new to blender.

Front Legends Causes Error on Import

If you try to import a .json that has keys with front legends, it fails to import. I'll attach a file that cause it, though any file with front legends should replicate the issue.
error.zip

Blender permanently freezes v2.90.1 Alpha

Hello all,

I'm not sure if this is related to #51 or #53 but it could be because support has not been added for blender v2.90 (latest release v3.0 just added support for 2.80, so...). Also, my blender doesn't seem to crash, it just doesn't respond, ever.

Anyways, I was just wondering if this is because there is no support for 2.90 or if it is the same thing as the two aforementioned reasons. Thanks!

Happy Hacking, Bobbbay

ReferenceError: StructRNA of type VectorFont has been removed

trying

Python: Traceback (most recent call last):
  File "/home/drFaustroll/.config/blender/2.91/scripts/addons/Keyboard-Layout-Editor-for-Blender/__init__.py", line 30, in execute
    return import_keyboard.load_json(self, self.filepath)
  File "/home/drFaustroll/.config/blender/2.91/scripts/addons/Keyboard-Layout-Editor-for-Blender/src/import_keyboard.py", line 373, in load_json
    read(filepath)
  File "/home/drFaustroll/.config/blender/2.91/scripts/addons/Keyboard-Layout-Editor-for-Blender/src/import_keyboard.py", line 231, in read
    labels.add(
  File "/home/drFaustroll/.config/blender/2.91/scripts/addons/Keyboard-Layout-Editor-for-Blender/src/labels.py", line 208, in add
    curve = add_text(key_label.text, label_size, font, label_position, box)
  File "/home/drFaustroll/.config/blender/2.91/scripts/addons/Keyboard-Layout-Editor-for-Blender/src/labels.py", line 156, in add_text
    new_label.data.font = font
ReferenceError: StructRNA of type VectorFont has been removed

location: <unknown location>:-1

attached the keymap

http://www.keyboard-layout-editor.com/#/gists/60d3c7dc61893e1403a3548a93ce08cc
this is using latest release of addon

Help? :-)

Hi

Followed instructions, am able to import KLE json file, but all I get on screen is a row of different sized buttons and a big cube. Tried two different json files.

When I was installing your addon Blender complained about some "cycles" (IIRC) file being missing.

Am a total noob with Blender, installed it today just to use your tool.

Installed versions: 2.79

Any ideas?

Thanks, Ian

Traceback error when trying to load .json file (keylabels)

I used the below layout I created on KLE and got the error (see screenshot attached). Anything I can try? Thanks a lot!
kle-blender-error

[
{
"name": "1960",
"author": "netzverweigerer@GitHub",
"notes": "\n\n\n _ ___ __ ___ \n/ |/ _ \ / /_ / _ \ \n| | () | ' \| | | |\n| |\, | () | || |\n|| // \/ \_/ \n \n",
"radii": "12px 12px 12px 12px",
"css": "@import url(http://fonts.googleapis.com/css?family=Roboto);\n@import url(http://fonts.googleapis.com/css?family=Lato);\n@import url(http://fonts.googleapis.com/css?family=Gamja+Flower);\n.keylabel0 { font-family: 'Gamja Flower'; font-size:0.7em; }\n.keylabel1 { font-family: 'Lato'; }\n.keylabel4 { font-family: 'Roboto'; font-size: 1.5em;}\n.keylabel8 { font-family: 'Roboto'; font-size: 0.65em;}\n\n\n\n\n\n"
},
[
{
"c": "#db2121",
"a": 7
},
"",
{
"c": "#cccccc",
"a": 4
},
"!\n\n\n\n\n\n\n\n\n1",
""\n\n\n²\n\n\n\n\n\n2",
"§\n\n\n³\n\n\n\n\n\n3",
"$\n\n\n\n\n\n\n\n\n4",
"%\n\n\n\n\n\n\n\n\n5",
"&\n\n\n\n\n\n\n\n\n6",
"/\n\n\n{\n\n\n\n\n\n7",
"(\n\n\n[\n\n\n\n\n\n8",
")\n\n\n]\n\n\n\n\n\n9",
"=\n\n\n}\n\n\n\n\n\n0",
"?\n\n\n\\n\n\n\n\n\nß",
"`\n\n\n\n\n\n\n\n\n´",
{
"c": "#333333",
"t": "#cccc22",
"a": 7,
"w": 2
},
""
],
[
{
"w": 1.5,
"n": true
},
"",
{
"c": "#cccccc",
"t": "#000000",
"a": 4
},
"\n\n\n@\n\n\n\n\n\nQ",
{
"a": 7
},
"W",
"E",
"R",
"T",
"Z",
"U",
"I",
"O",
"P",
"Ü",
{
"a": 4
},
"*\n\n\n~\n\n\n\n\n\n+",
{
"x": 0.25,
"c": "#333333",
"t": "#ff6600",
"a": 7,
"w": 1.25,
"h": 2,
"w2": 1.5,
"h2": 1,
"x2": -0.25
},
""
],
[
{
"w": 1.75
},
"",
{
"c": "#cccccc",
"t": "#000000"
},
"A",
"S",
"D",
{
"n": true
},
"F",
"G",
{
"a": 4
},
"\n\n\n\n\n\n\n\n\nH",
{
"n": true
},
"\n\n\n\n\n\n\n\n\nJ",
"\n\n\n\n\n\n\n\n\nK",
"\n\n\n\n\n\n\n\n\nL",
{
"a": 7
},
"Ö",
"Ä",
{
"a": 4
},
"'\n\n\n\n\n\n\n\n\n#"
],
[
{
"c": "#333333",
"t": "#cccc22",
"a": 7,
"w": 1.25
},
"",
{
"c": "#cccccc",
"t": "#000000",
"a": 4
},
"\n<\n\n|\n\n\n\n\n\n>",
{
"a": 7
},
"Y",
"X",
"C",
"V",
"B",
"N",
{
"a": 4
},
"\n\n\nµ\n\n\n\n\n\nM",
"\n,\n\n\n\n\n\n\n\n:",
"\n.\n\n\n\n\n\n\n\n:",
"\n
\n\n\n\n\n\n\n\n-",
{
"c": "#333333",
"t": "#cccc22",
"a": 7,
"w": 2.75
},
""
],
[
{
"t": "#ee55cc",
"w": 1.25
},
"",
{
"t": "#ff3322"
},
"",
{
"t": "#44eecc",
"w": 1.25
},
"",
{
"t": "#55ee55",
"w": 1.25
},
"",
{
"c": "#cccccc",
"t": "#000000",
"w": 2
},
"",
{
"w": 2.25
},
"",
{
"c": "#333333",
"t": "#55ee55",
"w": 1.25
},
"",
{
"t": "#44eecc",
"w": 1.25
},
"",
{
"t": "#ff3322"
},
"",
{
"t": "#cccc22",
"w": 1.25
},
"",
{
"t": "#ee55cc",
"w": 1.25
},
""
]
]

AttributeError at line 992

Just tried using this plugin, and when importing a json file from KLE, I get the following error:

AttributeError: 'TextCurve' object has no attribute 'align_x'

An exception is called, but the handling of that exception causes the same attribute error, except it's on lines 32 of init.py, and 1038 of import_keyboard.py

Add error handling for invalid key colors

Hello!
I'm not able to import the .json file that I download from http://www.keyboard-layout-editor.com/
I've tried reading how to use this three times now and I hope I'm not making a simple mistake.
I'm running

  • Blender version 2.80

  • Python version 3.7.0

  • KLE-plugin version 3.1

I also opened the blender scene you recommended template.blend before importing.

Here's the error I receive upon importing the .json-file:

Traceback (most recent call last):
  File "C:\Users\xx\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\Keyboard-Layout-Editor-for-Blender-master\__init__.py", line 30, in execute
    return import_keyboard.load_json(self, self.filepath)
  File "C:\Users\xx\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\Keyboard-Layout-Editor-for-Blender-master\import_keyboard.py", line 373, in load_json
    read(filepath)
  File "C:\Users\xx\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\Keyboard-Layout-Editor-for-Blender-master\import_keyboard.py", line 236, in read
    key_obj)
  File "C:\Users\xx\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\Keyboard-Layout-Editor-for-Blender-master\labels.py", line 217, in add
    curve = add_text(key_label.text, label_size, font, label_position, box)
  File "C:\Users\xx\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\Keyboard-Layout-Editor-for-Blender-master\labels.py", line 165, in add_text
    new_label.data.font = font
ReferenceError: StructRNA of type VectorFont has been removed

location: <unknown location>:-1

By the way, the first thing that threw me off was that under "File" I cannot find "User Preferences". I had to go through Edit > Preferences in order to find my Add-ons tab. Just thought I'd point it out and perhaps that's a clue to why importing doesn't work? I know that previous versions of blender had this but I believe they changed this with the 2.80 update.

I could try rolling back to an earlier version of blender, but I hope I do not have to do so :)

Wrong installation path on blender-2.79-windows64.zip

I am using blender-2.79-windows64.zip, which is a portable version. When the addon is installed, as explained in the README, it is copied to C:\Users\<USER>\AppData.... However, it should be copied to a path relative to where the binary is located: ...\blender-2.79-windows64\2.79\scripts\addons. These are the steps I followed to have it installed:

  1. Create a new subdir in ...\blender-2.79-windows64\2.79\scripts\addons named io_kle.
  2. Extract the content of the release zip file (v2.4.zip) to the created subdir.
  3. Follow steps 6-9 of the README.
  4. Remove C:\Users\<USER>\AppData\Roaming\Blender Foundation.

I get the following error when this layout is loaded:

kirpal_kle_error

But the preset layouts work as expected. Might it be relatd to (CSS) styles? Am I missing some other dependency?

fonts rendered inconsistent

Required Information

  • [Blender version]
    2.91.0 linux
  • [Add-on version]
    3.3
  • [Link to the layout]

perm

http://www.keyboard-layout-editor.com/#/gists/60d3c7dc61893e1403a3548a93ce08cc

Describe the bug

fonts seem to be inconsistently rendered. some are missing see the layout.

Screenshots

m65

this is blender output when the scene and then the json is loaded

Read prefs: /home/drFaustroll/.config/blender/2.91/config/userpref.blend
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
Warning: class IMPORT_MESH_OT_json contains a property which should be an annotation!
/home/drFaustroll/.config/blender/2.91/scripts/addons/Keyboard-Layout-Editor-for-Blender/__init__.py:44
    assign as a type annotation: IMPORT_MESH_OT_json.filter_glob
Read blend: /home/drFaustroll/playground/keyboard/m65/blender/m65.blend
Color management: scene view "No View" not found, setting default "Standard".
Color management: sequencer colorspace "sRGB EOTF" not found, will use default instead.
Info: Saved "m65.blend"

Info: Removed 5 vertice(s)
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Info: Removed 5 vertice(s)
Info: Removed 5 vertice(s)
Info: Removed 5 vertice(s)
Warning: No mesh data to join
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 25 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Removed 39 vertice(s)
Info: Deleted 1 object(s)
Info: Deleted 26 object(s)

Add Support for Blender 2.8

Hiya guys, I saw a similar issue and it was closed. I figured it was in there as a bug but I'm wondering if we could have it here as a feature request? If not, thanks for reading!

I'll try to figure it out by googling around but if anyone could point me toward the specific broken bits and any blender 2.8 API docs I can start looking into it. I'm new to Python but have coded as3/c#/c++ at work and use Maya/ZB/Painter/Unity etc.

Failed to install the addon

Hi,

I follow the instructions and try to install the addon to blender, but run into a problem:

  1. Select the zip archive that you downloaded and click Install from File… at the top right
  2. Check the checkbox next to Import-Export: Import: KLE Raw JSON format (.json)

After 6 is done, there is no such item(and no such checkbox) in Import-Export. Does it mean the addon is not installed properly? Or any other thing is wrong? I used Blender v2.79b and addon v2.9.

Add tags

First of all, thank you for this add-on.
I knew I had this project on my starred repositories so I searched for keyboard and later for blender but it didn't work.
GitHub allows you to add tags for your project next to the description and I suggest you do since tags are useful in many ways.

Addon not installing

I perform all the steps listed. But after I click Install on the top right there isn't any import: KLE option to click a checkbox at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.