Skip to content

Instantly share code, notes, and snippets.

# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'''
BEGIN GPL LICENSE BLOCK
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@tako2
tako2 / theta360.py
Created December 1, 2013 14:13
Controlls RICOH THETA 360 (Python).
#!/usr/bin/env python
# coding: UTF-8
import socket
import struct
DEBUG = True
DEBUG2 = False
PTP_OC_GetDeviceInfo = 0x1001
@cwebber314
cwebber314 / reportlab_hello.py
Created January 20, 2014 04:34
Reportlab hello world with an image, bulleted list, and enumerated list.
"""
Reportlab sandbox.
"""
from reportlab.lib.enums import TA_JUSTIFY
from reportlab.lib.pagesizes import letter, landscape
from reportlab.lib.enums import TA_JUSTIFY
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
@zeffii
zeffii / view3d_idx_view.py
Last active October 4, 2023 11:12 — forked from anonymous/view3d_idx_view.py
Vertex Face Edge Index Visualizer
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@fredrikaverpil
fredrikaverpil / get_set_values.py
Last active November 26, 2022 22:27
Get and set knob values #nuke
# Get all nodes of type Read
readnodes = nuke.allNodes('Read')
for readnode in readnodes:
print readnode
# List all knobs for selected node
print( nuke.toNode('Read1') )
# List all knobs for specific node
print( nuke.selectedNode() )
@julik
julik / unpremult.jsx
Created December 7, 2014 12:31
Unpremultiply the selected Photoshop layer
/*
Will unpremultiply the currently selected Photoshop layer
*/
var doc = app.activeDocument;
// Duplicate this layer
var premultLayer = app.activeDocument.activeLayer.duplicate();
premultLayer.blendMode = BlendMode.NORMAL;
# assumes the values of the first indices add up to 100.
import bpy
import random
mats = bpy.data.materials
nodes = mats['Material'].node_tree.nodes
elements = nodes['ColorRamp'].color_ramp.elements
RAN = random.random
import bpy
import random
from mathutils import Vector
'''
text should be something like this (int or float, should add up to 100)
- either provide three color components (rgb)
- provide one, automatic greyscale is made
- provide none, random color is returned.
@pink-vertex
pink-vertex / convert_anim.py
Created September 25, 2015 05:51
Applies parent inverse matrix to the child's local matrix.
import bpy
import mathutils
class Converter:
def __init__(self, ob, logging=False):
self.ob = ob
self.action = ob.animation_data.action
self.rot_mode = ob.rotation_mode
self.logging = logging