Skip to content

Instantly share code, notes, and snippets.

@nicelifeBS
nicelifeBS / k_eval_cel.py
Created November 3, 2017 00:42
Katana - Eval cel with python
prod = NodegraphAPI.GetGeometryProducer()
root = prod.getRootProducer()
cel = root.getAttribute('collections.test.cel').getValue()
node = NodegraphAPI.GetNode('CollectionCreate')
collector = Widget.CollectAndSelectInScenegraph(str(cel), '/root/world/geo')
result = collector.collectAndSelect(select=False, node=node)
@nicelifeBS
nicelifeBS / README.md
Created December 19, 2017 20:11 — forked from mottosso/README.md
Minimal QML SceneGraph

untitled

Usage

python main.py --amount 100
  • Panning by left-click + drag
  • Scale by rotating the mouse wheel
@nicelifeBS
nicelifeBS / double2single.py
Created March 12, 2018 09:13
Replace double quotes with single quotes in string
import re
def replace(obj):
print(obj.groups())
if obj.group(0) == '\'':
return '"'
if obj.group(0) == '"':
return '\''
if obj.group(0) == '"""':
@nicelifeBS
nicelifeBS / timer.py
Created March 28, 2018 05:33 — forked from bradmontgomery/LICENSE.txt
A python decorator that logs execution time.
from functools import wraps
import logging
logger = logging.getLogger(__name__)
def timed(func):
"""This decorator prints the execution time for the decorated function."""
@wraps(func)
def wrapper(*args, **kwargs):
start = time.time()