How to embed images into a component?

Hello,

I am creating a component and I would like it to embed images so that there are automatically found when the component is used in another project.

There is that indication on the wiki (http://www.derivative.ca/wiki077/index.php?title=Components):

I tried it but it is not very clear where the .tox file must be created and so far I didn’t manage to encapsulate any image in the .tox.

Can someone provide the file structure we have to use to be sure images are embeded, please?

Thank you very much

Hi.

If the content is just static images, then you could simply lock the TOPs that reference them.
If you would like to embed arbitrary files into a component, you can use the tscript command: vfs

derivative.ca/wiki088/index. … fs_Command

It allows you to add arbitrary files into a component, and refer to them in any parameter that usually points a disk filename.

We don’t have a python implementation yet as we’re still rethinking the best interface.

Let me know if you have any questions.

Cheers,
Rob

Hi Rob,

Thank you, I managed to embeded the images in the .tox file. The key point is the lock added to the TOPs ops. :slight_smile:

When loading the component in a new project everything is fine: the component is there and its images too. Nevertheless I didn’t manage to get the list of the embeded files with the command you suggested.
When I type it it returns nothing:

touch -> vfs -p /project1/WkMouse -l * label path size timestamp private location date touch -> touch ->

:question: Do you have an idea why?

By the way, a small consideration about the documentation:
You said:

Well, reading this I have the feeling it sounds an obvious thing I could have done. Indeed I could if I knew, but nowhere in the documentation I noticed TOPs had to be locked for their content to be embeded.
That is exactly the kind of information it would be nice to see in the wiki documentation, along with a sample project.
One of my main points in my feedbacks is that some important details, topics and samples are missing in the doc and that’s why I try to suggest what could be added and where to be useful for newbies. I know documentation takes a long time to build but if done regularly with the small appropriate information it can improve significantly and at a small cost.
Unfortunately, in spite of all those suggestions seen on the forum, I don’t see the documentation really evolving. Maybe because it is done only on 088? I don’t know but I find it sad.
I’m sure you have all that in mind. What more can we do to help?

Best regards
ComponentEmbedingImages.toe (64.3 KB)

Hello werwack, thanks for you feedback regarding documentation. You are correct in that the 077 documentation is not changing right now, 077 went Gold back in the fall of 2011 and has only received bug fixes since then. All new documentation has been going into the 088 wiki (which can be found here when you start using 088 derivative.ca/wiki088 ).

The reason that the locking TOPs technique isn’t documented as a way to embed files is because its not really embedding the file at all. All locking an operator does is lock the contents of that OP temporarily until it is unlocked. So if you were to unlock the OP and not have the original file available, you would not be able to get it back. Locking can be done with CHOPs, SOPs, TOPs, (any OP) but generally it is used only for troubleshooting and testing.

The only way to really embed the files into a .toe or .tox file is using the vfs command.

Hello Ben,

Thank you for these clarifications.
What you says about the locked ops seems to explain why the vfs command returns an empty result. I’ll try to use it to really embed the images.

Will there be some improvements on 088 about the embedments?

Regarding the documentation I perfectly understand all the efforts are put on the 088 version. I am still using TD 077 because I have the FTE edition: I learn TD on my free time in the perspective of using it for UI features prototyping (among others, because it is really cool and I really like it). To me the thing is there is a big overhead in the learning curve compared to many other software. I don’t think it is because TD is complicated - it has the complexity of the projects you want to do with it - but because there are some dark points in the learning path, sometime key points.

To minimize these dark points I would suggest to put as much small sample projects, even very basic ones, as possible in the documentation. Ideally there should be one per wiki page. There is an interesting feature in the documentation of Houdini that could maybe used as inspiration: along with the doc they provide basic projects and all are tagged according to their content; if a given page of the documentation the samples with the matching tags are listed at the end of the page.
[url]http://www.sidefx.com/docs/houdini12.5/nodes/chop/blend[/url]

The other thing to improve the doc could be to feed it at the same time answers are provided on the forum. Often when someone rises a question it is because someting is not clear (obviously). When the point has been put clearer and an answer has been provided the thread could be ended by a link to the updated documentation page, where the answer and the sample project would have been reported.
I use this approach as much as possible for the software we are developing in our RnD department because we don’t have time to write an exhaustive doc and it seems to provide good results - at least it allows us to concentrate on what seem to be the most critical points.

Once again thanks a lot for your help and support. I can’t wait to play with 088.

Best regards

Hi Rob, hi Ben,

I now use the vfs as suggested and it does the job.
As the visibility over embeded files is not very clear in a project I made a few improvement suggestions here: [url]Improvements of the vfs command for files embedment - Wishlist and RFEs - TouchDesigner forum

Best regards