How to devide RGB mask by name in Nuke with python - string

I am making an autocomp solution for my projects in Nuke and I want to be able to rename my RGB masks with their intended name.
So say these are my three RGB mask shuffle nodes stored in a list:
['RGB_boxes_01_-Box_red-Box_green-Box_blue', 'RGB_boxes_02_-Box_red-Box_green-Box_blue',
'RGB_boxes_03_-Box_red-Box_green-Box_blue']
Thay each contain red green and blue channels that I want to split an rename "Box_red", "Box_green" and "Box_blue"
Now splitting the channels are easy, but renaming them to their intended name is harder. Anyone nows a good way to do this?
I thought it was a good idea to put "-" in front of every channel so that I can have a specific pattern when I am dividing, but so far I cant figure out how to do this.
Thanks!

I don't have much experience with python & channels, however I know that nuke layers/channels are immutable and permanent in a script - once they're created, they can't be destroyed without possibly editing the script manually.
Check out this API page around layers, it should give you the syntax you need for your code:
https://learn.foundry.com/nuke/developers/105/pythonreference/nuke.Layer-class.html

Thanks!
But its not actually a question about channels in nuke, but more a about how do I split these strings in this list based on a pattern.
So how do I make this
['RGB_boxes_01_-Box_red-Box_green-Box_blue', 'RGB_boxes_02_-Box_red-Box_green-Box_blue',
'RGB_boxes_03_-Box_red-Box_green-Box_blue']
spit out this:
['Box_red', 'Box_green', 'Box_Blue']
['Box_red', 'Box_green', 'Box_Blue']
['Box_red', 'Box_green', 'Box_Blue']

Related

how to create timelines that have multiple streams that merge and fork off each other?

I found this image / solution online. the source is included. it's a template that uses draw.io to create multiple timelines that look like merged code.
we have many projects that look like this. does anyone know how to do this programmatically in Excel.
The goal is to be able to manipuale the a program with data to generate this timeline.
any help is awesome.
ok - so after reaching out to couple of folks / reading online - I am going with using excel line graph with really large markers
and so, I get the following type. I am going to play with style and see if I can make the straight lines into curve lines
I can now overlay text as key markers.
thanks

make changes to {apacite}?

I would like to make certain adoptions to the apacite format. For example I would like to remove the commas between authour and year of publication. Is that possible and if so how?
I couldn't yet find any advice or work around.

How can I edit a DXF in node.js?

I'd like to make a custom lasered label from a user's input on a website. I have a template dxf file and I'd like to replace placeholder text with the user input. My problem is the dxf file format is very unreadable in its text format. Is there any way to make sense of the numeric data? If not are there any other formats (svg, etc) that would be easier to work with?
EDIT: The reason I've found it unreadable in terms of text is that the program (Solidworks) converted the text to curves.) At this point I'm trying to figure out how to prevent that.
AutoDesk was nice enough to document DXF syntax in great detail. Spend a couple hours understanding the documentation from the link below, and I think you will find it quite easy to parse and edit using code.
To just replace some placeholder text, it should be just as simple as reading the DXF file into a string (a dxf file is no different than a txt file), performing a text replace operation and saving it back to file. Just make sure that your placeholder text is very unique and is not contained in any of the key words in the document below (otherwise your DXF file will get corrupted). Something like "PlaceHolderText" will do the trick.
http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
Edit: More Info
I do a lot of work with AutoDesk Inventor which is in direct competition with SolidWorks, so they are effectively the same tool. We were faced with a similar problem of needing to place text onto sheet metal flat pattern DXFs that came out of Inventor in order to identify the part, but Inventor simply could not do it (see, exactly the same!). One of our developers had the idea to place a very precise geometry punch onto the flat pattern. After the DXF was generated he wrote some code that parsed the DXF file and replaced the geometry with a text entity. More specifically we used a triangle with sides having each length defined to something like the 7th decimal place. You can then use one of the vertices of the triangle to position the text, including rotation. This process would be automatic, so once you write the code with the help of the document above (which won't take the long), it will just work. If your engraver can handle text the way you want it, I'd say this is a very good solution. We generate hundreds of parts every day using this code. Hope this helps.

beamer includegraphics with screenshots

I'm using the LaTeX-Beamer class for making presentations. Every once in a while I need to include screenshots. Those graphics are pixel-based, of course. I use includegraphics like this:
\begin{figure}
\includegraphics[width= \paperwidth]{img/analyzer.png}
\end{figure}
or usually something like this:
\begin{figure}
\includegraphics[width= 0.8\linewidth]{img/analyzer.png}
\end{figure}
This leads to pretty bad readibility of the contained text, so I'm asking for your best practices: How would you include screenshots containing text considering, that I will do the output PDF with pdflatex?
EDIT: I suppose I'm looking for something like an 1:1 presetation of the image within beamer. However, [scale = 1.0] doesn't achieve what I'm looking for.
Your best bet is to scale the image outside of Latex for inclusion, and include it in 1:1 ratio. The scaling done by graphics packages in Latex isn't going to be anywhere near as good as possible from other tools. Latex (Tex) has limited floating-point arithmetic capabilities, whereas an external tool can use sophisticated algorithms to get the scaling better.
Another option is to use only a part of the screenshot, the one you want to concentrate on.
Edit: If you can change the font size before taking the screenshot, that's another option—just increase the font size for the screenshots.
Of course, you can combine the two methods.
I have done exactly what you do and e.g defined
\newcommand{\screenshot}[1]{\centerline{%
\includegraphics[height=7.8cm,transparent]{#1}}} % 7.8in
which worked with whatever style I was using at the time. The files included with this macro were all PNGs created with one the usual Linux screen capture tools.
Edit: You may have to play with the size (height and width) of your input files. It came out rather nice for me (and this was from a presentation in 2006).
How about scaling it as follows:
\includegraphics[scale=0.5]{images/myimage.jpg}
This works for me.
Have you tried to convert the image to .eps or .pdf file and use this file in LaTeX?
Maybe try also latex, dvips and ps2pdf.
Problem might be in used viewer, in Linux I use Document viewer or ePDFViewer and output is much worse than in Adobe Reader or Acrobat, which I use in Windows...

panoramic text visualization with seadragon (or other)?

i'm working on a visualization of a text file with 100k lines, max 1k characters/line, as one large, navigable image.
similar to the bleak house example in blaise's ted talk demo of seadragon, but even simpler -- basically just the view from cat filename.txt, but with a view that's zoomed out so that the whole file is initially visible (each line fitting on the page width, without wordwrap) and can then be zoomed in on.
is this currently possible with seadragon? if not, any ideas on how i can attempt it?
(oh, and including hyperlinks would be great -- but i don't expect that'll be possible.)
Not sure you'll be able to go up to 100k lines but the OpenZoom SDK with the Flash Text Engine could get you pretty far.
Example
http://gasi.ch/go/openzoom-fte/
Source Code
http://github.com/openzoom/sdk/raw/be50b3f1062e68d88dcf20f412e6fdb9b7320ed3/examples/flex/flash-text-engine/src/FlashTextEngine.mxml
A second vote for the answer to this question... I'd like to use seadragon or other technology to achieve a similar effect.

Resources