예제 #1
0
def cnew():
    import sys, os, popen2
    import cdebug
    import subprocess
    from nukescripts import pyQtAppUtils, utils
    mdebug = cdebug.cdebug()
    mdebug(sys.path)
    sys.path.append('/usr/pipeline/lib')
    #import nasset
    import pipe, filesys
    proc = subprocess.Popen(
        'nasset -m nuke',
        shell=True,
        stdout=subprocess.PIPE,
    )
    result = proc.communicate()[0]
    #result = nasset.browse('nuke')
    if result == 'cancel': return
    obj = filesys.get_options(result, 'm:t:d:c:')
    file_path = obj[1][0]
    proj_name = obj[1][1]
    tmp_path_file = os.path.join(filesys.USER_HOME, file_path)

    nuke.scriptSave(tmp_path_file)

    descr = obj[0]['-d']
    tags = obj[0]['-t']
    modes = obj[0]['-m'].split(',')

    type_name = modes[0]
    seq_name = modes[1]
    shot_name = modes[2]
    #print proj_name,tmp_path_file,descr,tags

    new_obj = pipe.Pipe().AddAsset(proj_name,
                                   tmp_path_file,
                                   descr,
                                   tags,
                                   filesys.COMP,
                                   sname=seq_name,
                                   shname=shot_name)
    script_path = new_obj.CheckOut('l')

    if len(modes) == 4:
        new_obj.setDependency(modes[3])

    if os.path.exists(script_path):
        os.system('sync')
        nuke.scriptOpen(script_path)
예제 #2
0
파일: cvco.py 프로젝트: mitrakhov/pipeline
def cvco():
    import sys, cdebug
    from nukescripts import pyQtAppUtils, utils, pyWxAppUtils
    import subprocess

    sys.path.append("/usr/pipeline/lib")

    mdebug = cdebug.cdebug()
    import pipe
    import popen2

    name_node = "__PIPE__"

    nscript = nuke.scriptSaveAs("/tmp/_nktmp.nk", True)

    proc = subprocess.Popen("browser -m nuke", shell=True, stdout=subprocess.PIPE)
    stdout_value = proc.communicate()[0]

    proc2 = subprocess.Popen("vco " + stdout_value, shell=True, stdout=subprocess.PIPE)

    script_name = proc2.communicate()[0]
    mdebug(script_name)
    nuke.scriptOpen(script_name)

    nuke.scriptClose(nscript)
    nuke.fromScript()
    m = nuke.toNode(name_node)
    if not m:
        m = nuke.createNode("StickyNote", inpanel=False)
        m.setName(name_node)
    asset_obj = pipe.Projects().GetAssetByInfo(script_name)
    seq = asset_obj.GetSequence()
    shot = asset_obj.GetShot()

    label = ""
    if seq:
        label = "Sequence: %s" % seq.name
    if shot:
        label += "\nShot: %s" % shot.name

    m.knob("label").setValue(label)
    m.knob("note_font").setValue("Helvetica Bold")
    m.knob("note_font_size").setValue((18,))
예제 #3
0
파일: cnew.py 프로젝트: horitin/pipeline
def cnew():
	import sys,os,popen2
	import cdebug	
	import  subprocess
	from nukescripts import pyQtAppUtils, utils
	mdebug = cdebug.cdebug()
	mdebug(sys.path)
	sys.path.append('/usr/pipeline/lib')
	#import nasset
	import pipe, filesys
	proc = subprocess.Popen('nasset -m nuke',  shell=True, stdout=subprocess.PIPE, )
	result = proc.communicate()[0]
	#result = nasset.browse('nuke')
	if result == 'cancel': return
	obj = filesys.get_options(result,'m:t:d:c:')
	file_path = obj[1][0]
	proj_name = obj[1][1]
	tmp_path_file = os.path.join(filesys.USER_HOME,file_path)
	
	nuke.scriptSave(tmp_path_file)
	
	descr =  obj[0]['-d']
	tags = obj[0]['-t']
	modes =  obj[0]['-m'].split(',')
	
	type_name = modes[0]
	seq_name = modes[1]
	shot_name = modes[2]
	#print proj_name,tmp_path_file,descr,tags
	
	new_obj = pipe.Pipe().AddAsset(proj_name,tmp_path_file,descr,tags,filesys.COMP,sname=seq_name,shname=shot_name)
	script_path = new_obj.CheckOut('l')
	
	if len(modes) == 4:
		new_obj.setDependency(modes[3])
	
	if os.path.exists(script_path):
		os.system('sync')
		nuke.scriptOpen(script_path)
예제 #4
0
import nuke,os,re
from cexceptions import *
import filesys
import cdebug
mdebug = cdebug.cdebug()

def condensing_is(folder_path,name):
	"""Return dictionary
	@todo: do over re.pattern. Get together ones
	"""
	dct = {}	
	imseqs = filesys.ImageSequences(folder_path).get_sequences()
	for imseq in imseqs:
		range = imseq.getRange()
		user_text = '%s%s%s%s%%0%sd.%s %s-%s'%(imseq.getPath(),os.sep,imseq.getFileName(),imseq.getSep(),imseq.getLengthOfPadding(),imseq.getExt(),range[0],range[1])
		name_sq = imseq.getFileName() + "_"		
		dct[name_sq] = user_text
	
	lst = os.listdir(folder_path)
	lst_d = filter(lambda x: os.path.isdir(folder_path + os.sep + x), lst)
	for o in lst_d:
		dct.update(condensing_is(folder_path + os.sep + o,name+'_'+o))
	return dct
	
	
	lst = os.listdir(folder_path)
	lst_f = filter(lambda x: not os.path.isdir(folder_path + os.sep + x), lst)
	if lst_f: 
		num_src = 1
		while lst_f:
			name_sq = str('__' + name + '_' + str(num_src) + '__').upper()
예제 #5
0
import nuke, os, re
from cexceptions import *
import filesys
import cdebug
mdebug = cdebug.cdebug()


def condensing_is(folder_path, name):
    """Return dictionary
	@todo: do over re.pattern. Get together ones
	"""
    dct = {}
    imseqs = filesys.ImageSequences(folder_path).get_sequences()
    for imseq in imseqs:
        range = imseq.getRange()
        user_text = '%s%s%s%s%%0%sd.%s %s-%s' % (
            imseq.getPath(), os.sep, imseq.getFileName(), imseq.getSep(),
            imseq.getLengthOfPadding(), imseq.getExt(), range[0], range[1])
        name_sq = imseq.getFileName() + "_"
        dct[name_sq] = user_text

    lst = os.listdir(folder_path)
    lst_d = filter(lambda x: os.path.isdir(folder_path + os.sep + x), lst)
    for o in lst_d:
        dct.update(condensing_is(folder_path + os.sep + o, name + '_' + o))
    return dct

    lst = os.listdir(folder_path)
    lst_f = filter(lambda x: not os.path.isdir(folder_path + os.sep + x), lst)
    if lst_f:
        num_src = 1