replace an empty cell...

I use a select to import data from an other table. This table is used to import path incise an object created by a replicator. Sometime, it happens that the cell of the table is empty.

I want to replace it with a general path when the cell is empty.

I have manage a way to do it, but it really heavy and slow a lot the frame rate. I have attached image of the node. I think it slow down because it checks each frame if the path haves change

do you know a simple way to do it

You could use a switch DAT to swap between tables depending on a logic state.

You could also use a DAT execute to check when a table has changed rather than to check every frame.

Thanks for the advise.

base_default_table_contents.tox (1.38 KB)

In the attached example you’ll see the following dat execute:

[code]def tableChange(dat):

target = op( 'table2' )
default = op( 'table_default' )

if dat[ 0, 0 ] != '':
	target[ 0, 0 ] = dat[ 0, 0 ]

else:
	target[ 0, 0 ] = default[ 0, 0 ]

return[/code]

The idea here is that the contents of the changing cell are copied into the target table unless it’s empty, if the contents are empty then the default value is copied into the target. The execute costs about 0.04ms,. and only cooks when the table changes.