Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

working with table DATs , and generating instances

General discussion about anything TouchDesigner

working with table DATs , and generating instances

Postby Usha » Thu Aug 08, 2019 8:19 am

Hello everyone

I'm looking to assign some JSON parsed data, to run a simple animation, as cubes on a grid, rising and falling based on the data values.
I have parsed the data, but not sure how to assign the data into proper CHOPs, to then use for instancing.

Can you point me to some tutorials where I can get further info?
All the existing tutorials I have seen from Matthew or others are either just directly CHOPs, or text DATs and replicators.

I can also post my working file here if you can give me some of your time.

Thanks very much.
Last edited by Usha on Thu Aug 08, 2019 8:36 pm, edited 1 time in total.
Usha
 
Posts: 3
Joined: Fri Feb 10, 2017 12:19 am

Re: working with table DATs , and generating instances

Postby raganmd » Thu Aug 08, 2019 5:36 pm

Hey Usha,

Matthew here. If you post an example of where you are I’d be happy to give you a nudge.

As a heads up, DATs are the least efficient approach for instancing (at least in my experience) since they’re treated as strings and have to be cast as their appropriate types. This can be very reasonable if you’re only updating intermittently, but might become a bottleneck suddenly.
raganmd
 
Posts: 1383
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: working with table DATs , and generating instances

Postby Usha » Thu Aug 08, 2019 8:52 pm

Hey Matthew,

thanks for getting back. It might be that instancing is not the way to go in this instance!
I will be happy to hear your thoughts on that.
at the moment, I'm not updating, but this might change as I will apply the data directly from the API soon. Would be great to learn the most optimized approach(es).

Idea is to run each asset(1000), on a cube where the height of the cube is the energy and this value will be affected by the power value, at every occurrence of a sampling event (which is not a fixed number, between 28 and 32 samples I believe). the samples have timestamps next to them.

p.s. I am not sure if the JSON file is cooked into the patch or needs to be uploaded.

Thanks
Attachments
JSON_TO_CUBES.toe
(492.92 KiB) Downloaded 48 times
Usha
 
Posts: 3
Joined: Fri Feb 10, 2017 12:19 am

Re: working with table DATs , and generating instances

Postby raganmd » Fri Aug 09, 2019 2:45 am

Just saw this. I’m traveling today and at a show this evening. So it might be tomorrow before I can really dig in - I’ll post some thoughts once I can look at this.
raganmd
 
Posts: 1383
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: working with table DATs , and generating instances

Postby raganmd » Fri Aug 09, 2019 7:29 pm

Okay here you'll find some examples of working with instances in DATs. Initial big picture ideas to hold onto are that your column headers are how you match values from a DAT to an instance.

The first couple of examples show how you can drive instances from a DAT, then there's a look at how you can manipulate those / update those values directly in a table. Following are some exploratory ideas about other ways to drive your instances with updating json data. Everything from putting in a point attribute to pulling it from storage with a script CHOP.

900 instances still runs smoothly for me on a little ultra-book's processor on battery power, but your mileage will vary. My general advice is to imagine that you need to reserve at least 20% of your project time for optimization. If you're doing something for you, or for a lower-stakes situation you can likely skip this. If, this is client work or something that's mission critical for success, I would make sure you reserved more time than you expect for optimization and edge case handling - what happens when you get a json blob with no data, or if the keys have changed; what are your upper and lower limits for data throughput, if your maxing out, do you need to break this into another touch process and how do you want to handle the data exchange; and so so many other considerations.

I'm going to look at your project specifically next, but I wanted to make sure that you had some solid examples that weren't domain specific so you could explore the concepts.
Attachments
dat-instancing.toe
(24.58 KiB) Downloaded 48 times
raganmd
 
Posts: 1383
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: working with table DATs , and generating instances

Postby Usha » Sun Aug 18, 2019 8:06 pm

Thanks very much, Matthew.
I'm still exploring the different approaches.
It is very helpful the way you have put the information together in various stages.
Usha
 
Posts: 3
Joined: Fri Feb 10, 2017 12:19 am

Re: working with table DATs , and generating instances

Postby raganmd » Mon Aug 19, 2019 8:45 am

Hey hey,

I made sure to update the examples in the instancing repo with these as well - makes me think there should be an updated series about instancing ;)

https://github.com/raganmd/touchdesigne ... g_examples
raganmd
 
Posts: 1383
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA


Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: Bing [Bot] and 17 guests