There are many reasons why you’d want to lock your projects. Some of those may be artistic reasons and some of them might be business-related. In our last blog post, we talked about how you can use Project-level privacy and how you can use that to keep your whole project work behind a password. Now let’s dive into the next level of privacy you can implement: component-level privacy.
Why use component privacy?
Project-level privacy stops anyone without the password from getting out of perform mode. Component-level privacy allows anyone to browse around your network BUT they can’t go inside of specific components that you lock without a password. This offers a much higher level of control that you can use to not only keep people out of specific areas of your project but allows you to create re-usable components or even sell components safely without having your work stolen. There are a lot of projects that you might be hired to work on where the client gets to keep all of the new IP. If you’re using some of your existing tools, it can sometimes feel less-than-great to have to include those and know the client might just take them and do whatever they want with your work. Component-level privacy can help.
Setting it up
The first thing with component-level privacy is that you’ll need a TouchDesigner Pro license. It’s one of the best reasons to get a Pro license up there with Sync CHOPs. Setting up component-level privacy itself isn’t hard. We can right-click on any component operator, select Privacy, and then we’ll get a similar dialogue to what we saw in the last post:
In this Component Privacy dialogue, we can set a password and enable privacy. When we do this, if we try to go into the component, it will ask for a password before it will actually let you enter it:
We can see in the GIF above, when I try to zoom into the component, it asks me for a password. Until I put in that password, trying to go into the component will just put me back on the same network looking at the component!
Tricks and Tips
Once you lock a component, there are a few things you have to be aware of because people can’t get in or out of your component. This also means you have to do a bit of planning for inputs, outputs, and parameters. There are a few ways you can approach this.
One way you can approach this is with classic in and out operators inside of your private component. For simpler components, effects processors, or content generators these can be more than enough. They’re also incredibly easy to use both for the user and your development purposes.
One of the best things you can do for your private components is to try to add custom parameters for almost anything you think might need editing. The last thing you want to do is lock a component and then have to give someone the password because they need to change a parameter inside of it. Creating custom parameters for everything that needs controlling is the best way to deal with this.
Dynamic Select Operators + Replicators
Here’s where it gets interesting. There aren’t native multi-inputs that we can add to component operators, so it can be difficult to manage scaling systems. What if you wanted to make a compositing tool that could take 2 – 16 inputs? You could make all 16 outputs and just wait till things get plugged in, but this is less than elegant. Two options you can use revolve around select operators and replicators.
For example, instead of adding direct TOP inputs, you can create a DAT input and instruct users to pass a table into your component where each row is the path to one of the operators you’d like to pass as an input. Inside of your component you can then use the Table DAT as the basis for a replicator which can replicate Select TOPs that pull those paths in. You could even take this same system of replication and use it with in and out operators. Another example is that you could have an integer slider that sets the amount of inputs the user wants to have on the component. You can then use this value inside of your private component to replicate the right number of In TOPs dynamically.
These aren’t the only ways you can add dynamic inputs and outputs to your component, they’re just a few examples to show that a little bit of creativity and scripting can go a long way in making your private components more dynamic and manageable for users.
Turning off privacy
Disabling the privacy of a component is easy. Just like we did with our project-level privacy, we can right click on a private component, open the privacy dialogue and enter our password to temporarily unlock it. This allows us to access the inside of the component until the next time we open the project. To completely disable the privacy we can bring up the privacy dialogue one more time and enter our password and click Remove Privacy:
Component-level privacy and project-level privacy are incredibly useful tools to keep in your back pocket. They require a TouchDesigner Pro license to use but that can pay for itself over a handful of projects or a few component sales. It’s quick, easy, and can help you keep your work safe!