0

I'd like to know if there's a way to turn Nuke's text (contained in Text node) into polygonal object and then extrude it along Z axis? It's possible in Blackmagic Fusion, it's even possible in Apple Motion 5. Who knows how to do it in Nuke via Python?

enter image description here

logoPlate = nuke.nodes.Text(name="forExtrusion") 
logoPlate['font'].setValue("~/Library/Fonts/Cuprum-Bold.ttf") 
logoPlate['xjustify'].setValue("center")
logoPlate['yjustify'].setValue("center")
logoPlate['box'].setValue([0,0,512,256])
logoPlate['translate'].setValue([-20, 50])
logoPlate['size'].setValue(48)
logoPlate['message'].setValue("TV Channel logo")
logoPlate.setInput(0,nuke.selectedNode())

I am not interested in using exported obj, fbx or abc from 3D packages or any third party plugins.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220

2 Answers2

1

The only method to extrude a text at the moment (in NUKE version 10.5) is to trace a text logo with Polygon shape tool using ModelBuilder node.

modelBuilder = nuke.createNode('ModelBuilder')
camera = nuke.createNode('Camera2')
nuke.toNode('ModelBuilder1').setSelected(True)
nuke.toNode('Camera1').setSelected(True)
nuke.connectNodes(2, camera)
nukescripts.connect_selected_to_viewer(0)
n = nuke.toNode('ModelBuilder1')
k = n.knob('shape').setValue(6)   #'Polygon' tool in dropdown 'shape' menu
k.execute()

After tracing the logo I used Extrude from ModelBuilder's context menu and then baked out a geometry. But you can use only straight lines due to nature of polygonal modeling in NUKE.

No NURBS geometry.

script = nuke.thisNode()['bakeMenu'].value() 
eval(script)

enter image description here enter image description here

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
0

Typically you would use a 3D modelling program like Modo, Maya, Cinema 4D, etc. Create and output your text as a model and import it into Nuke. To create 3D text directly in Nuke, you need the Geometry Tools plugin. Then simply use the PolyText node.

Documentation on PolyText

Download site for Geometry Tools

PolyText example

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Matt
  • 1,792
  • 5
  • 21
  • 33
  • I know that Maya, Modo, Cinema 4D, Houdini, 3dsMax exist and their ability to export OBJ, FBX, ABC, etc. The question is: "A way to extrude 2d text in The Foundry Nuke via Python". – Andy Jazz Oct 30 '16 at 08:14
  • Geometry Tools is obsolete plugin for v6 and v7 Nuke versions. It's not working with current version Nuke 10. – Andy Jazz Oct 30 '16 at 08:30
  • If there isn't a way to do it within nuke manually, you won't be able to do it with python. – Matt Oct 30 '16 at 16:34
  • 1
    The only thing you could do is look at the old plugin and see the code for the PolyText node and what it was doing. If it uses some built in nuke features, you could replicate that code in a script yourself. – Matt Oct 30 '16 at 16:44
  • About your comment: "If there isn't a way to do it within nuke manually, you won't be able to do it with python". According to Nuke development team, you can do "everything from snippets to quickly altering the contents of multiple nodes' control panels, right up to integrating with external tools such as asset management software" except for "low level data manipulation, due to lack of fine grained memory allocation control and poor threading" and restrictions of Nuke scanline rendering engine. – Andy Jazz Oct 30 '16 at 18:26
  • Well, I looked at the code for Geometry Tools, at least what is readable. Looks like most of the functionality is in the GT_PolyText.dll. I tried decompiling it, but was unsuccessful. You might find better answers from the nuke python forum on the Foundry's site. Sorry I couldn't help more. – Matt Oct 30 '16 at 19:38