import hou
from PIL import Image
im = Image.open("C:/Data/maxscript/sugi_scrips/sDotImageMaker/11baby02.jpg")
def createNode(type):
geo = hou.node("/obj").createNode("geo")
geo.node('file1').destroy()
node = geo.createNode(type)
geo.moveToGoodPosition()
return geo
MyGrid = createNode("grid")
MyBox =MyGrid.createNode("box")
MyBox.moveToGoodPosition()
print im.size[0]
2009年8月28日金曜日
2009年8月18日火曜日
I'm back home.
This is my first dialy in a while.I'm back from New Orleans siggraph.
I could get a great motivation to study Houdini,python and English!!
Finally I could know little bit about python of Houdini.
This is my first code by using PIL lib.
import PIL.Image
import PIL.ImageDraw
WIDTH = 8
HEIGHT = 8
BLOCK = 2
image = PIL.Image.new('RGB', (WIDTH, HEIGHT)) #'1': binary, 'L': gray scale, 'RGB': RGB color
d = PIL.ImageDraw.Draw(image)
colDic = {(0, 0): (175, 89, 13), (0, 1): (50, 65, 60), (1, 0): (165, 123, 46), (1, 1): (45, 100, 115)}
for y in range(HEIGHT):
for x in range(WIDTH):
d.point((x, y), colDic[((x + y) / BLOCK % 2, (x - y) / BLOCK % 2)])
image.save('c:/check.png', 'PNG')
I could get a great motivation to study Houdini,python and English!!
Finally I could know little bit about python of Houdini.
This is my first code by using PIL lib.
import PIL.Image
import PIL.ImageDraw
WIDTH = 8
HEIGHT = 8
BLOCK = 2
image = PIL.Image.new('RGB', (WIDTH, HEIGHT)) #'1': binary, 'L': gray scale, 'RGB': RGB color
d = PIL.ImageDraw.Draw(image)
colDic = {(0, 0): (175, 89, 13), (0, 1): (50, 65, 60), (1, 0): (165, 123, 46), (1, 1): (45, 100, 115)}
for y in range(HEIGHT):
for x in range(WIDTH):
d.point((x, y), colDic[((x + y) / BLOCK % 2, (x - y) / BLOCK % 2)])
image.save('c:/check.png', 'PNG')
登録:
投稿
(
Atom
)