Phython keyer
Posted in: Nuke Plugins & ScriptsI’m experimenting with creating a basic python based keyer but am not fluent enough in python just yet to figure out how to do this…
any help would be super helpful 😀
I’m experimenting with creating a basic python based keyer but am not fluent enough in python just yet to figure out how to do this…
any help would be super helpful 😀
1.-Autoset its name sequentially: TAKE_000, TAKE_001 (3 or variable digits padding)
2.-Autoset the knob ‘file’ setValue to a constant and variables folders, for example:
Z:/PROJECT/Material/SCENE_002/TAKE_014/CHARACTERS/char/%vCam/Sce02_Take14_%03d.exr’)
The red characters should be taken from the node name, and increase with this. So, it shol look like this:
for Read named TAKE_011
Z:/PROJECT/Material/SCENE_002/TAKE_011/CHARACTERS/char/%vCam/Sce02_Take11_%03d.exr’)
I’m reading the nuke PDF…, but I think it’s not enough..
r=nuke.createNode(‘Read’)
r.setXYpos(0,0)
r.setName(‘TAKE_000’,uncollide=True)
nuke.toNode(‘TAKE_000’).knob(‘file’).setValue(‘Z:/PROJECT/Material/SCENE_002/TAKE_014/CHARACTERS/char/%vCam/Sce02_Take14_%03d.exr’)
because when I create the next node, the number change to one digit…
In few words, what I need is a number sequencer python command… and a character catcher like:
[lindex [split [lindex [split [metadata input/filename] /] 8] ._] 1]
Or something like that…
Is it possible? or just need sleep much? 😀
Thank you in advance…
I don’t want you resolve my life, i’m not a coder…, but i’m interested in learn python. Just show me the way, please!:p
I am trying to solve a seemingly simple python problem:
I am having two lists.
L1 = ["b","a","b","a"]
L2 = ["1","2"]
now I want to connect the two lists in a way that L1[0] = L2[0] and L1[1] = L2[1]
so in the end i get for every item in L1 the proper value out of L2.
b = 1 and a = 2
the best would be a dict where the values are connected.
dict = {"b" : "1" , "a" :"2" ,"b" : "1" , "a" : "2"}
but i am open to any way to get this done…
jaden
linear(val,inMin,inMax,outMin,outMax)
I found a python methodology:
def remap(val,inmin,inmax,outmin,outmax):
diffin=inmax-inmin
diffout=outmax-outmin
diffval=val-inmin
newval=outmin+((diffout/diffin)*diffval)
return newval
I can then use the remap() function within an expression on a value to use this. The only issue is that I have to define the remap() function every time the script opens. I know I can add it to my menu.py or some other file – but what if I want to make the script totally portable and render-farm friendly?
Is there a way to embed the "def remap()" code into the script so that it is auto-executed every time the script is opened?
thanks in advance!
Having some trouble creating a pulldown menu on a custom write node that I have created. The code that I have come up with so far is:
shots = ['010100', '010500', '010340', '010200']
shots.sort()
shotKnob = nuke.Pulldown_Knob("shotSelector","Load Shot")
shotList = []
for shot in shots:
shotOp = "%s" % (shot)
shotList.append((shot, shotOp))
shotKnob.setValues(shotList)
os.environ['ELEM'] = shotOp
The problem that I have, is that the menu comes up, but it doesn’t display the option that has been selected, and then when working with the output, it displays all of the options rather than just the one that was selected.
I’ve used ‘addEnumerationPulldown’ for other project panels, but this seems to be the best code for this so far.
Thanks for any help in advance.
when we launched it we gave us an issue with python25.dll
would I be correct in assuming that all our scripts need to be recompiled in a higher version of python?
I looked into the Iop example codes /blocky.c ;checkerboard2/ and i managed to build them ,but it seems that they don’t work correctly.
I tried some logging in the validate function, it’s ok , but logging to console in the engine part is not working ..it seems that the plugin does not enter this part.The node itself updates in viewport but for the example the checkerboard2 stays black, the blocky plugin didn’t change the image also.
Also noticed that these plugins are included in Nuke and they/the built-in ones/ works fine as expected, / i built the examples with other names also ,removing the built-in plugs/.
I tried some other plugins also with pixelIop with pixel_engine and they works well not as Iop./the logging in pixel_engine also works/.
I’m on win7x64 Nuke 6.1v2x64 2 core machine.
Are they for older Api or does anything changed ?Or am i missed something?
thanks in advance,
Asi
the bit Im a bit stuck on is getting python to read the sizes of the files on the server.
im not sure how to go about doing this
any body can u plz help me how to create a set matte using NUke software
thanks in advance….