TextOIIO node - file name and frame number

95 views
Skip to first unread message

superrune

unread,
May 5, 2015, 5:39:47 AM5/5/15
to Natro...@googlegroups.com
Hi,

I'm trying to set up Natron to stamp text info onto renders for editorial. I would like to have a portion of the file name, and the current frame number. Is that possible?

Ole Andre Rodlie

unread,
May 5, 2015, 8:16:49 AM5/5/15
to Natro...@googlegroups.com
Should be possible with v2 and Python(?).

Ole-André

superrune

unread,
May 5, 2015, 8:18:15 AM5/5/15
to Natro...@googlegroups.com
Hei :)

I can't get any Python syntax to work, the v2 text node only gives me blank output. Have you any sample expressions that actually creates output?

Ole Andre Rodlie

unread,
May 5, 2015, 8:32:13 AM5/5/15
to Natro...@googlegroups.com

Ole Andre Rodlie

unread,
May 5, 2015, 9:48:27 AM5/5/15
to Natro...@googlegroups.com
Go to text node, right-click text box, set expr:

thisParam.setValue("Frame:%d"%frame)


The text show current frame, but Natron freezes/crashes after some frames, I'm probably doing something wrong :) (I'm no python guy)


Ole-André

Ole Andre Rodlie

unread,
May 5, 2015, 10:01:06 AM5/5/15
to Natro...@googlegroups.com
The crash was by fault, cache disk was full.

superrune

unread,
May 5, 2015, 4:54:10 PM5/5/15
to Natro...@googlegroups.com
I'm onto something now - thanks!

Sean Kennedy

unread,
May 6, 2015, 4:41:48 PM5/6/15
to Natro...@googlegroups.com
Hey guys, thanks for covering this! Very useful!

However, I found that when using 
thisParam.setValue("Frame:%d"%frame)

it sets the frame number to the frame it is currently on when you activate the expression, but does NOT update it when moving the current time.

However, this small change will have it update as the current time changes.
("Frame:%d"%frame)

Thanks again!

superrune

unread,
May 7, 2015, 12:27:16 PM5/7/15
to Natro...@googlegroups.com

I don't have that much Python experience, but I got something working. I right click the text node in Natron 2 and choose Edit expression, and enter this:

shotname = Read1.filename.get()

ret = str(shotname) + " - " + str(frame)


That gave me a framestamp of the reader filename and the current frame number. Now I need to figure out how to remove the path from the filename, and this is good enough for now :)

Sean Kennedy

unread,
May 7, 2015, 1:50:23 PM5/7/15
to Natro...@googlegroups.com
Very nice, superrune!

What about, instead of the filename of the read node, putting the project name there instead?

Alexandre

unread,
May 7, 2015, 5:03:11 PM5/7/15
to Sean Kennedy, Natro...@googlegroups.com
Project filename is not a parameter so you will not be able to access it unfortunately. 
We could add a function to the app object to retrieve it though 

-- 
You received this message because you are subscribed to the Google Groups "Natron" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Natron-VFX+...@googlegroups.com.
To post to this group, send email to Natro...@googlegroups.com.
Visit this group at http://groups.google.com/group/Natron-VFX.
To view this discussion on the web visit https://groups.google.com/d/msgid/Natron-VFX/83ad4ee0-741e-46b4-87bc-0de6197cf633%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Kennedy

unread,
May 7, 2015, 5:38:34 PM5/7/15
to Natro...@googlegroups.com, mackd...@gmail.com
Yeah, that would be very useful down the line. Being able to slate/stamp a project with all the info for a specific project is essential in a pipeine. It's easy enough to piece together with text files, though. :)

Alexandre

unread,
May 7, 2015, 6:21:56 PM5/7/15
to Sean Kennedy, Natro...@googlegroups.com
Okay I just implemented it. 
The 2 parameters (path + name) of the project are now visible in the “Info” tab of the project settings.
They can be accessed from Python like this:

app.getProjectParam(“projectName”).get()

app.getProjectParam(“projectPath”).get()

On 7 May 2015, at 17:38, Sean Kennedy <mackd...@gmail.com> wrote:

Yeah, that would be very useful down the line. Being able to slate/stamp a project with all the info for a specific project is essential in a pipeine. It's easy enough to piece together with text files, though. :)

--
You received this message because you are subscribed to the Google Groups "Natron" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Natron-VFX+...@googlegroups.com.
To post to this group, send email to Natro...@googlegroups.com.
Visit this group at http://groups.google.com/group/Natron-VFX.

Sean Kennedy

unread,
May 7, 2015, 6:25:53 PM5/7/15
to Natro...@googlegroups.com, mackd...@gmail.com
Holy crap, awesome! Thanks!! I imagine this will be available in tomorrow's daily build?

Started using Natron a bit in the production I'm on. Working great so far!

Gmail

unread,
May 7, 2015, 8:41:43 PM5/7/15
to Sean Kennedy, Natro...@googlegroups.com
Yes but there seem to be an issue with the windows build, I'll take a look at it when I have time 


Reply all
Reply to author
Forward
0 new messages