Problems with a ScriptSOP

Hi everyone,

I’m having a problem with a scriptSOP…

I have 10 moving points and lines that connect each point with the other 9 (45 lines)
All the lines are connected to a scriptSOP that enables/disables every line depending on the distance of the points.
Works perfectly, but when I want to enter to Perform Mode the script stops working and freezes the enable/disable function. The points keep moving and the lines that were enabled keep enabled.

Is there any reason for that?
Please, I need any advice…

Thanks!

I can’t think of any reason why your script would stop working in perform mode, but if your script OP isn’t the one actually being displayed or rendered in perform mode, then your lines may not be enabled/disabled. If you can post a file, it’ll probably be easy to see if there are any issues.

Thanks Selina!

Yes, you must be right… my project isn’t very orthodox.
Please, have a look. You may not get the points moving, but if you play some music you’ll see the lines appearing and disappearing as long as you don’t get in perform mode.

Thanks again.
multitouch lines_VJing.toe (99.9 KB)

You are doing something a little weird with bypassing your inputs. The issue is that when you bypassed a node, it no longer cooks, so your points are not updating. Try copying your valid geometry into your scriptOP instead (which is what it is meant to do - creating geomtry and not enabling/disabling operators).

def cook(scriptOP):
	scriptOP.clear()  # clean out old input
	for n in range(lineas):
		
		a = scriptOP.inputs[n]
		ax = a.par.pax
		ay = a.par.pay
		bx = a.par.pbx
		by = a.par.pby
		if distancia(ax,ay,bx,by) > op('null3')[0]:
			# Copy lines that pass the test
			poly = scriptOP.appendPoly(2, closed=False, addPoints=True)
			poly[0].point.x = ax
			poly[0].point.y = ay
			poly[1].point.x = bx
			poly[1].point.y = by
	return

Hope this helps.

Thank you very much for your enlightenment!

It works perfectly now.

Thanks again