pythontextnukeblackmagic-fusion

A way to extrude 2d text in The Foundry Nuke via Python


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.


Solution

  • 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