Tumgik
bltasker · 9 years
Photo
Tumblr media
A little comparison of the V-Ray fur system used on Spinmaster’s Paw Patrol Season 2 to create procedural grass throughout the show. Written in Python and leveraged the power of Maya, Nuke and Shotgun to power the creation process.
0 notes
bltasker · 9 years
Text
PyQt DirCompleter
Sometimes you know exactly what you want to build but just have no idea what blocks to use when you start building. When I first looked into replicating the shell experience of stepping through directories it took me a while to track down the right PyQt modules. My first attempts were very complex, so when I discovered how simple the final product was I really couldn’t believe it.
#!/usr/bin/env python import sys from PyQt4 import Qt, QtCore, QtGui import os """ This is a simple example of how to use PyQt's completer with a directory model As you type, the completer finishes off you search with the files in the directory """ class DirModel(QtGui.QWidget): def __init__(self): super(DirModel, self).__init__() self.initUI() def initUI(self): # ---- Title & Line edit self.input_file_title = QtGui.QLabel('Your dir model completer') self.input_file_line = QtGui.QLineEdit() # ========================================== # ---- COMPLETER dir_model = QtGui.QDirModel() self.input_line_completer = QtGui.QCompleter() self.input_line_completer.setModel(dir_model) self.input_file_line.setCompleter(self.input_line_completer) # ============================================== # ---- Fill in your input path with the directory you ran the script from current_dir = os.getcwd() self.input_file_line.setText(current_dir) # ---- Build Layout vbox = QtGui.QVBoxLayout() hbox_input_file = QtGui.QHBoxLayout() hbox_input_file.addWidget(self.input_file_title) hbox_input_file.addWidget(self.input_file_line) vbox.addLayout(hbox_input_file) self.setLayout(vbox) self.resize(400, 100) self.setWindowTitle('PyQt Dir Completer') self.show() def main(): app = QtGui.QApplication(sys.argv) mt = DirModel() sys.exit(app.exec_()) if __name__ == "__main__": main()
0 notes
bltasker · 9 years
Text
Maya Camera Cull
This is a simple script written in python for Maya. It will select the geometry seen through the specified camera and return either the name of the objects or the component information (face or vertex info). 
import maya.cmds as cmds import maya.OpenMaya as om import maya.OpenMayaUI as mui """ Use for doing an in viewport camera cull. Quick way to check what is seen by the camera. ======================================================= cameraCull argv's ----------------- cull_camera = the name of the culling camera (Shape) start_frame = first frame in your frame range end_frame = last frame in your frame range select_by = by what component do you want to check if it is onscreen output = use 'object' if you want to switch to the object at the end of the culling ======================================================= """ def cameraCull(cull_camera, start_frame, end_frame, select_by, output=None): if cmds.objectType(cull_camera) == 'camera': on_screen = [] cmds.select(deselect=True) # ---- Camera looping range for t in range(start_frame, end_frame+1): # ---- forces viewport to look through the camera cmds.lookThru(cull_camera) cmds.currentTime(t) activeView = mui.M3dView.active3dView() cmds.selectPref(useDepth = True) om.MGlobal.selectFromScreen(0,0,activeView.portWidth(),activeView.portHeight(),om.MGlobal.kReplaceList) cmds.selectMode(co = True) # ---- select the objects on screen om.MGlobal.selectFromScreen(0,0,activeView.portWidth(),activeView.portHeight(),om.MGlobal.kReplaceList) if select_by == 'face': cmds.selectType(allObjects = 0, allComponents = 0, polymesh = 1, facet = 1) elif select_by == 'vertex': cmds.selectType(allObjects = 0, allComponents = 0, polymesh = 1, vertex = 1) elif select_by == 'edge': cmds.selectType(allObjects = 0, allComponents = 0, polymesh = 1, edge = 1) new_selection = cmds.ls(sl=True) if new_selection != []: on_screen.extend(new_selection) cmds.select(on_screen) # ----- final output if output == 'object': cmds.selectMode(object=True) object_list = cmds.ls(sl=True) return object_list else: return on_screen else: cmds.warning('CameraShape not entered properly') return None # ---- Example cameraCull('CAMERA', 1, 48, 'face', 'object')
0 notes
bltasker · 9 years
Photo
Tumblr media
Beautiful fall day near Atwater Market
1 note · View note
bltasker · 9 years
Photo
Tumblr media
Montreal at Dusk
0 notes
bltasker · 9 years
Text
First Blog Post!
Hello everyone! This is something I’ve meant to do for a long time and finally the day is here. I have created this website to post work, work-in-progress and anything cool and interesting I have learned along the way. I know how many of these personal blogs have helped me out in the past and here is to hoping I can help someone out in the future.
Hope you enjoy!
-BT
0 notes