Analysis and modification of Hiero_fnnukeshotexporter

Source: Internet
Author: User

Research object: Fnnukeshotexporter script Research in Hiero Objective: To modify the fnnukeshotexporter so that multiple trackitem can be imported into one. NK Fnnukeshotexporter This script controls the Nuke project file output option in exporter, and the methods for Trackitem output to. NK Engineering are stored in this script. The Nukeshotexporter class inherits from the Shottask class in Fnshotexporter, and the output. The core code of the NK project is in the Self.step () method. Reading this code carefully will also find that the method calls the scriptwriter class from hiero.core.nuke.Script.py, which calls multiple Node classes in hiero.core.nuke.Node.py. It's easy to make changes to the functionality after you understand the internal logic relationships. We find that the last part of the Self.step () method has such a line:SCRIPT.WRITETODISK_VHQ (scriptfilename)This is obviously a way to write a script object to a specific. nk file. Locate the method code block as follows:def writetodisk (self, scriptfilename):
Dstdir = Os.path.dirname (scriptfilename)
if not os.path.exists (Dstdir):
Os.makedirs (Dstdir)

if Os.path.lexists (scriptfilename):
Os.remove (Scriptfilename)

filecontents = str (self)

f = open (Scriptfilename, ' W ')
F.write (filecontents)
f.close ()  We found that the 56th line of code would determine the same name. If the NK project exists, it will be deleted if it exists, and then a new. NK project will be created to write, which is contrary to the idea of writing several trackitem to the same. NK Engineering, so just modify this method so that it can be repeated for the same project. The specific modification method is very simple, will not say.

Analysis and modification of Hiero_fnnukeshotexporter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.