This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_basic_curve(): | |
crv = bpy.data.curves.new("crv", type="CURVE") | |
crv_ob = bpy.data.objects.new("crv_ob", crv) | |
return crv, crv_ob | |
scnobs = bpy.context.scene.objects | |
pencil = bpy.data.grease_pencil[0] | |
for i, stroke in enumerate(pencil.layers[0].active_frame.strokes): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reddit_test.py | |
import urllib.request | |
import json | |
from pdb import set_trace | |
from time import sleep, time | |
def timeit( func2wrap ): | |
def wrapped_func(*args): | |
start_time = time() | |
res = func2wrap(*args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#top_200_pony_entries.py | |
import urllib | |
from pdb import set_trace | |
import time | |
import MySQLdb | |
import json | |
import pickle | |
mysql = MySQLdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
# lamps_on_verts.py | |
# desc: throws a point lamp on every vert of a selected object. | |
class LampVertOperator(bpy.types.Operator): | |
'''Tooltip''' | |
bl_idname = "object.lamp_vert_operator" | |
bl_label = "Lamp on Verts Operator" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bmesh | |
import bpy | |
from mathutils import Quaternion, Vector | |
bm = bmesh.new() | |
axis = (0,0,-1) | |
quats = [Quaternion(axis,x) for x in range(1,11)] | |
vecs = [quat * Vector((1,0,0)) for quat in quats] | |
for vec in vecs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ##### 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
matrix_op.py | |
A simple experimental operator for messing with matrix basics. | |
""" | |
import bpy | |
from bpy.props import FloatProperty | |
from math import pi | |
class MatrixOp(bpy.types.Operator): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hn_screen_scraper.py | |
# A screen scraper for the front page of hacker news done out of a fit of boredom. | |
from urllib import request | |
import re | |
# read in the data and split it into a raw list of entries | |
url_path = "http://news.ycombinator.com" | |
sock = request.urlopen(url_path) | |
raw_data = str(sock.read()) | |
data_set = re.split("arrow\.gif", raw_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
post_test.py | |
An example script that shows how to send data by post-method from | |
command-line to a web application. | |
""" | |
import urllib.request as request | |
import urllib.response as response | |
import urllib.parse as parse | |
url_string = "http://localhost:8085/A_WebApp/targetservlet" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
image_collector.py | |
A script to screen scrape an image archive and then download those images | |
one by one to a local folder. Interesting example usage of BeautifulSoup. | |
Modify as needed for the site you intend to scrape. | |
Use only with permission of site owner!!! | |
Geeky Note: |
OlderNewer