Go Back   fxForums > Applications > Nuke

Reply
 
Thread Tools Display Modes
  #1  
Old 9th February 2010, 13:20
doubled77 doubled77 is offline
Member
 
Join Date: May 2008
Posts: 10
Default Install ssf_import in Nuke 6 in user

I have been trying to install import_ssf.tcl in Nuke 6 without any luck...
I have to install it in my user since it is not possible for me to modify the toolbars.py neither to write any files to Nuke's "plugins" folder since I'm in a facility...

So I created a folder called tcl inside my user .nuke folder.
Then, I added this command to my init.py in order to have the .tcl source when Nuke launch...:
nuke.pluginAddPath('C:\Documents and Settings\danny\.nuke\tcl')

Anybody know what has to be done next???

thx in advance!

D
Reply With Quote
  #2  
Old 9th February 2010, 14:51
dg dg is offline
Member
 
Join Date: Feb 2004
Posts: 104
Default

if it's inside your .nuke (user) folder and it's a TCL script it should already be sourced by Nuke. TCL files don't need a "install" as Python scripts do, so all you need to do is drop that tcl script in a folder which Nuke is sourcing.

What you need inside that is a menu.py are lines to add the "Import .ssf" entry to your menu.

Code:
import nuke

menu = nuke.menu( 'Nuke' )
m = menu.findItem( 'File' )

def import_ssf():
    files = nuke.getClipname( 'Import ssf (Shake Shape Format)', '*.ssf', multiple=True )
    if files:
        for f in files:
            try:
                ssf = 'import_ssf "%s"' % f
                nuke.tcl( ssf )
            except:
                raise RuntimeError( 'To read ssf file you need the ssf_import.tcl installed\nGet it a www.fxshare.com/nuke' )

m.addCommand( 'Import ssf', 'import_ssf()', index=8 )
Just paste the above into a text editor and save it as a "menu.py" file inside your ".nuke" (user) folder.

Once Nuke is started you should now see a entry "import ssf" on the File menu that if clicked prompts you to select the ssf files you want to import.

Hope this helps.


cheers,
__________________
diogo girondi | ••• | IMDB
Reply With Quote
  #3  
Old 9th February 2010, 15:26
doubled77 doubled77 is offline
Member
 
Join Date: May 2008
Posts: 10
Default

Well, if I do a "nukepluginPath()" in the script editor Nuke tells me it is sourcing:
C:\Documents and Settings\danny\.nuke\tcl\
which contains import_ssf.tcl

If I press X and and type "import_ssf", I get this error message:

import_ssf: Unknown command
while executing
"import_ssf"

Something I don't get right there...
Reply With Quote
  #4  
Old 9th February 2010, 16:26
dg dg is offline
Member
 
Join Date: Feb 2004
Posts: 104
Default

Try moving the import_ssf.tcl to the root of that folder and see if the problem persists.
__________________
diogo girondi | ••• | IMDB
Reply With Quote
  #5  
Old 9th February 2010, 16:57
doubled77 doubled77 is offline
Member
 
Join Date: May 2008
Posts: 10
Default

Ok now I got it to work when it is at the root of my .nuke folder... but I would like to have it to work from the "tcl" folder... I'll show you everything so you understand the current setup and help me further...

here is a screenshot of my Danny menu:


here is my init.py:

nuke.pluginAddPath('.\gizmos')
nuke.pluginAddPath('.\icons')
nuke.pluginAddPath('.\python')
nuke.pluginAddPath('.\tcl')

here is my menu.py:

import autobackdrop
import mocha_import

toolbar = nuke.menu('Nodes')

dannyMenu = toolbar.addMenu('Danny', icon='homefx.png')
toolbar.addCommand('Danny/Auto Backdrop', 'autobackdrop.autoBackdrop()', 'alt+b', icon='Backdrop.png')
toolbar.addCommand('Danny/Bleach Bypass', 'nuke.createNode("bleachbypass")', icon='bleachbypass.png')
toolbar.addCommand('Danny/Boujou Lens Distortion', 'nuke.createNode("boujoulens")', icon='boujoulens.png')
toolbar.addCommand('Danny/CamQuake', 'nuke.createNode("camquake")', icon='camquake.png')
toolbar.addCommand('Danny/Edge Blender', 'nuke.createNode("edgeblender")', icon='Backdrop.png')
toolbar.addCommand('Danny/FieldsKit', 'nuke.createNode("fieldskit")', icon='fieldskit.png')
toolbar.addCommand('Danny/Film Look', 'nuke.createNode("filmlook")', icon='filmlook.png')
toolbar.addCommand('Danny/Fix 4:1:1 Color Sampling', 'nuke.createNode("fix411cs")', icon='fix411cs.png')
toolbar.addCommand('Danny/Guides', 'nuke.createNode("guides")', icon='guides.png')
toolbar.addCommand('Danny/Heat Haze', 'nuke.createNode("heathaze")', icon='Backdrop.png')
toolbar.addCommand('Danny/iFilter', 'nuke.createNode("ifilter")', icon='Backdrop.png')
toolbar.addCommand('Danny/Import ssf', 'import_ssf()', icon='Bezier.png', index=8 )
toolbar.addCommand('Danny/Letterbox', 'nuke.createNode("letterbox")', icon='letterbox.png')
toolbar.addCommand('Danny/Mocha Import', 'mocha_import.mocha_import()', icon='mocha_import.png')
toolbar.addCommand('Danny/Slice Tool', 'nuke.createNode("slicetool")', icon='slicetool.png')
toolbar.addCommand('Danny/Technicolor', 'nuke.createNode("technicolor")', icon='Backdrop.png')

def import_ssf():
files = nuke.getClipname( 'Import ssf (Shake Shape Format)', '*.ssf', multiple=True )
if files:
for f in files:
try:
ssf = 'import_ssf "%s"' % f
nuke.tcl( ssf )
except:
raise RuntimeError( 'To read ssf file you need the ssf_import.tcl installed\nGet it a www.fxshare.com/nuke' )

what do I need to do in order to have it running from that folder???:
C:\Documents and Settings\danny\.nuke\tcl

thx!

D
Reply With Quote
  #6  
Old 9th February 2010, 16:59
doubled77 doubled77 is offline
Member
 
Join Date: May 2008
Posts: 10
Default

Also, if you see something wrong, or something that could be optimized in my currect setup, feel free to let me know...

D
Reply With Quote
  #7  
Old 9th February 2010, 21:13
dg dg is offline
Member
 
Join Date: Feb 2004
Posts: 104
Default

Try changing these lines

Code:
nuke.pluginAddPath('.\gizmos')
nuke.pluginAddPath('.\icons')
nuke.pluginAddPath('.\python')
nuke.pluginAddPath('.\tcl')
to

Code:
nuke.pluginAddPath('./gizmos')
nuke.pluginAddPath('./icons')
nuke.pluginAddPath('./python')
nuke.pluginAddPath('./tcl')
And check if the import_ssf.tcl now works from inside your "tcl" folder.
__________________
diogo girondi | ••• | IMDB
Reply With Quote
  #8  
Old 9th February 2010, 22:01
doubled77 doubled77 is offline
Member
 
Join Date: May 2008
Posts: 10
Default

You nailed it!

An other question... Is it bad to have that code in the menu.py???:

def import_ssf():
files = nuke.getClipname( 'Import ssf (Shake Shape Format)', '*.ssf', multiple=True )
if files:
for f in files:
try:
ssf = 'import_ssf "%s"' % f
nuke.tcl( ssf )
except:
raise RuntimeError( 'To read ssf file you need the ssf_import.tcl installed\nGet it a www.fxshare.com/nuke' )

In one of the new Nuke Python Essentials tutorials on The Foundry's website, Frank Rueter talks about not having anything else other than menus related code in the menu.py... he mention something regarding command line render I think...

Are these lines compliant with command line rendering?

thx!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 22:41.