Ideas for Scripts


#1

For a class I am taking I need to write some python scripts for nuke that do something. I am having trouble thinking of an original idea. What are some repetitive tasks you experience in your work that you wish were automated?


#2

It would be cool to have a script which would compare different nuke “scripts” (I hate this confusion of terms :slight_smile: ) and highlight or/and comment corresponding nodes with different values of parameters as well as unique nodes.

That would be a tremendous help for the projects where many similar shots have to be in development simultaneously.


#3

Work would be easier :applause: , maybe in New Nuke Studio, Python scripts will better.


#4

Wolud be easier to work, maybe Python scripts will better in new version Nuke Studio. :slight_smile:


#5

It would be easier to work, maybe Python scripts will be better in new Nuke Studio, but for me still it’s difficult use scripts, I would like to have a new solutions for make own library. :rolleyes:


#6

There is an echo here . I would like to switch between
two clips every other frame( with the switch node) but
still see all frames from both clips. Frame 1 is 1 from
clipA, frame 2 is 1 from clipB and so on.


#7

Something like this?

set cut_paste_input [stack 0]
version 8.0 v1
ColorWheel {
inputs 0
gamma 0.45
name ColorWheel1
selected true
xpos 152
ypos -214
}
Text2 {
font_size_toolbar 100
font_width_toolbar 100
font_height_toolbar 100
message “[frame]”
box {0 979 107 1080}
hidden_bbox {0 979 107 1080}
transforms {{0 2}
}
cursor_position 6
center {960 540}
cursor_initialised true
initial_cursor_position {{0 1080}
}
group_animations {{0} imported: 0 selected: 0 items: “root transform/”}
animation_layers {{1 11 960 540 0 0 1 1 0 0 0 0}
}
color {1 0.5 0 1}
name Text2
selected true
xpos 152
ypos -142
}
Retime {
input.first_lock true
input.last_lock true
output.first_lock true
output.last 200
output.last_lock true
speed 0.5
time “”
name Retime2
selected true
xpos 152
ypos -118
}
ColorBars {
inputs 0
name ColorBars1
selected true
xpos 24
ypos -156
}
Text2 {
font_size_toolbar 120
font_width_toolbar 100
font_height_toolbar 100
message “[frame]”
box {0 959 135 1080}
hidden_bbox {0 959 135 1080}
transforms {{0 2}
}
font_size_values {{0 120 1 120}
}
cursor_position 2
font {{ Utopia : Bold : UtopiaBold.pfa : 0 }}
font_size 120
scale {1 1}
cursor_initialised true
initial_cursor_position {{0 1080}
}
group_animations {{0} imported: 0 selected: items: “root transform/”}
animation_layers {{1 11 960 540 0 0 1 1 0 0 0 0}
}
color 0
name Text1
selected true
xpos 24
ypos -84
}
Retime {
input.first_lock true
input.last_lock true
output.first_lock true
output.last 200
output.last_lock true
speed 0.5
time “”
name Retime1
selected true
xpos 24
ypos -60
}
Switch {
inputs 2
which {{curve(((frame-1)%(2-1+1))+1) L x1 0 1 0}}
name Switch1
selected true
xpos 152
ypos -60
}

The animation loop can be made via Curve Editor > RMB > Predefined > Loop


#8

I cannot tell, i do not know the first thing about
modern programing languages. I was hoping to add
an expression to “switch.which” field .
I excpected something like
switch.whitch=((framecount)modulo2-1);
in a BS programing language i just invented.
RetimingX2 is easy to be done anyway.
Thank you all the same.


#9

No problem.
I mean, that unless you want to write such a script for educational purposes, you can solve the task by standard nodes and a bit of animation.
Just copy the fragment of code I’ve posted and paste it directly into your Node Graph in Nuke.


#10

Seems that “frame %2” in the switch node
does the autoswitch trick where % stands
for modulo(the residue of division by 2).
Thank you again.