Monthly Archives: November 2013

Some Nuke snippets

Extract with mask


def extract_with_mask():
	node = nuke.selectedNode()
	maskNode = nuke.selectedNode().input(node.optionalInput())
	nodeChild = nuke.selectedNode().dependent()
	nodeParent = nuke.selectedNode().input(0)
	cpt = 0
	while cpt <= node.minInputs():
		node.setInput(cpt, None)
		cpt = cpt + 1
	for n in nodeChild:
		if n.Class() in ["Merge2", "DeepRecolor", "Shuffle", "Dissolve"]:
			if n.input(0) == node:
				n.setInput(0, nodeParent)
				n.setInput(1, nodeParent)
			n.setInput(0, nodeParent)
	#mask connexion
	node.setInput(node.optionalInput(), maskNode)
	node['ypos'].setValue(node.ypos()+15)"Nuke").addCommand("Custom/Extract node with mask", "extract_with_mask()", "ctrl+shift+e")

Continue reading

How to render a position pass in Blender Cycles and Internal?

The position pass is a representation of the 3D space where the value of every pixels in the RGB channel represents the position XYZ in the scene. It’s a really useful pass to have in the process of compositing to create volumetric mask, gradient, or even low fog.


Blender haven’t render layer called position pass, but it is easy to create it by a simple shader.

Continue reading

PTools v0.1 for Blender – create volumetric mask using the position pass

I’m proud to present my first addon for Blender. It creates volumetric mask from the position pass like the Volume Mask of Fusion or the P_Matte gizmo for Nuke.

To use the node, there is a “P Mask Picker” in the property panel of the Image Editor which produce better results than the basic color sampler. Look at the video for an example.

More features will come with the next release, I have some ideas but need time to do it.
Feel free to give me any feedback!

Download PTools v0.1
How to render a position pass in Blender Cycles and Internal?