UTM's shared directory implementation relies on SPICE WebDAV, which is slow.
Use Samba for faster shared directories. Samba is ~5x faster, see benchmarks at the end.
If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.
module.exports = { | |
h5: { | |
miniCssExtractPluginOption: { | |
filename: 'css/[name].[hash].css', | |
chunkFilename: 'css/[id].[chunkhash].css' | |
}, | |
enableDll: false, | |
webpackChain(chain, webpack) { | |
const hashRule = (type) => { | |
chain.module.rules.get(type).uses.get("urlLoader").get("options").name = |
import sys | |
from PIL import Image | |
from math import pi,sin,cos,tan,atan2,hypot,floor | |
from numpy import clip | |
# get x,y,z coords from out image pixels coords | |
# i,j are pixel coords | |
# face is face number | |
# edge is edge length | |
def outImgToXYZ(i,j,face,edge): |
from oscar.apps.catalogue.abstract_models import AbstractProduct, | |
from parler.models import TranslatableModel, TranslatedFields | |
class Product(AbstractProduct, TranslatableModel): | |
""" | |
Add translations to the product model. | |
""" | |
# Provide translated fields. |
''' | |
texture image path are relative to the blend file directory. run from command line like this: | |
texture=img/2012720989_c.jpg blender -b mug.blend --python texture_change.py -F PNG -s 1 -e 1 -j 1 -t 0 -a | |
'''' | |
import os | |
image_file = os.getenv('texture') | |
if not image_file: | |
image_file="img/2012720989_c.jpg" |
In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.
All the examples use demical types, except for the original value, which is automatically casted as a float.
To set the context of what we are working with, let's start with an original value.
# coding=utf8 | |
import PIL | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200): | |
REPLACEMENT_CHARACTER = u'\uFFFD' | |
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' ' |
""" | |
jQuery templates use constructs like: | |
{{if condition}} print something{{/if}} | |
Or like: | |
{% if condition %} print {%=object.something %}{% endif %} | |
This, of course, completely screws up Django templates, |