Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
FORUMS: listlist (w/ descriptions)archivetagssearchhall of famerecent posts

Changing project settings with python script

Cow Forums : Nuke

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Changing project settings with python script
by Sasha Marks on Oct 2, 2009 at 12:23:58 am

Hello people, I was wondering if anyone knows how to access the Nuke project settings from within a python script? I specifically want to change the frame start and end settings, based on the available frames in the read node.

Any ideas?

Also does anyone have (or know where to get) any good reference for the Nuke API's available to python scripts?

Thanks in advance,
Sasha.

Respond to this post   •   Return to posts index

Re: Changing project settings with python script
by Peter O'Connell on Oct 2, 2009 at 3:59:44 am

Hi, you could make an expression between a Read node's frame range values and the settings tab's frame range values. eg. root.Read1.first

Pete

Rogue Keyframe
Feature Film Compositing

Respond to this post   •   Return to posts index

Re: Changing project settings with python script
by Sasha Marks on Oct 2, 2009 at 4:18:47 am

Thanks for the tip Pete, I'll give that a go. Do you know if there is anywhere where I can find a list of all the parameters for different objects? e.g. settings tab name and its values etc? Is there an online resource for this or pdf or something?

Cheers,
Sasha.

Respond to this post   •   Return to posts index


Re: Changing project settings with python script
by Peter O'Connell on Oct 2, 2009 at 1:35:39 pm

Hi Sasha, the are a couple good pdfs in Help>Documentation at the top of the Nuke GUI.
Pete

Rogue Keyframe
Feature Film Compositing

Respond to this post   •   Return to posts index

Re: Changing project settings with python script
by Sasha Marks on Oct 4, 2009 at 1:44:39 pm

Hi Pete, found those documents, cheers.

I can't seem to find any reference to the Project Settings->Root->Frame Range settings though, and how to change them.

This is my first attempt at nuke scripting, so sorry if i'm missing something obvious...

I've got this so far to extract the frame range from read node

readLEFT = nuke.toNode('ReadLEFT')
frameFirst = readLEFT['first'].value()
frameLast = readLEFT['last'].value()


But having trouble figuring out how to copy these values to root frame range...should I be using nuke.Root.firstFrame()? or am I barking up wrong tree?

Thanks again,

Sasha.




Respond to this post   •   Return to posts index

Re: Changing project settings with python script
by Peter O'Connell on Oct 5, 2009 at 3:02:35 pm

Hi, but can't you just make an expression between a Read node's "frame range" values and the settings tab's "frame range" values. eg. root.Read1.first

Rogue Keyframe
Feature Film Compositing

Respond to this post   •   Return to posts index


Re: Changing project settings with python script
by Sasha Marks on Oct 5, 2009 at 10:33:35 pm

Thats what I'm trying to do, but cant work out how to access the settings tab's "frame range" values. What command do I use to access the setting tab?

Respond to this post   •   Return to posts index

Re: Changing project settings with python script
by Sasha Marks on Oct 5, 2009 at 11:31:00 pm

Hi - figured it out! Have to use:

nuke.root().knob('first_frame').setValue(123)

Cheers,
Sasha.

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]