Skip to content

Instantly share code, notes, and snippets.

View shrimo's full-sized avatar

Shri Moo shrimo

View GitHub Profile
import os
import nuke
FILE_TYPES = ['exr', 'png', 'tiff', 'dpx' 'mov', 'mp4', 'jpg']
def get_path():
return nuke.getClipname('Choose Folder', multiple=False)
import numpy as np
import cv2
from collections import namedtuple
import video
import common
from PyQt4 import QtGui, QtCore
FLANN_INDEX_KDTREE = 1
FLANN_INDEX_LSH = 6
flann_params= dict(algorithm = FLANN_INDEX_LSH,
// c++ -fpic -std=c++11 function.cpp -o function
#include<vector>
#include<iostream>
using namespace std;
int main()
{
auto func = [](int m, int x, vector<int> j){for (auto &c : j) cout<<"Y: "<<(m*x)+c<<"\n";};
func(5, 3, {1,2,3,4,5});
#include "/home/shrimo/project/osl/OpenShadingLanguage-master/src/shaders/stdosl.h"
shader osl_triplanar(
string filename = ""
[[ string widget = "filename" ]],
string mapping = "world"
[[ string widget = "popup",
string options = "world|object" ]],
color input = color(0),
vector rotation = vector(0.0,0.0,0.0),
selectedNode = nuke.selectedNode()
nodeName = selectedNode.name()
node = nuke.toNode(nodeName)
if nuke.getNodeClassName(node) != 'Read':
nuke.message('Please select a read Node')
print 'Please select a read Node'
metaData = node.metadata()
DT = metaData['input/mtime']
# nuke channal ranamer
import os
import nuke
def renamer(old_line, new_line):
input_file = nuke.root().knob('name').value() # read nuke script path
if not os.path.isfile(input_file): # checking file availability
print 'no file', input_file
return
@shrimo
shrimo / abc_view_gui.py
Created May 4, 2020 12:55
A tool for viewing the structure of alembic
import sys
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
import alembic
import types
def abc_tree(i_obj):
'''
/*Texture Bombing
The basic idea behind texture bombing is to divide UV space into a regular grid of cells.
We then place an image within each cell at a random location, using a noise or pseudo-random number function.
The final result is the composite of these images over the background.
*/
color blend(
color a,
color b,
color x)
@shrimo
shrimo / multiple_reading.py
Last active May 11, 2020 13:50
Reading multiple image files
"""
Reading multiple image files
import sys
module_path = '/home/shrimo/Desktop/course/vfx_dev/nuke'
if module_path not in sys.path:
sys.path.append(module_path)
import multiple_reading
reload(multiple_reading)
@shrimo
shrimo / menu.py
Last active May 19, 2020 12:52
Rendering version change
# Copy version_change.py file to /home/user/.nuke folder.
import version_change
menubar=nuke.menu("Nuke")
m=menubar.addMenu("&Pipeline")
m.addCommand("&Version change", "version_change.main()")