[FEATURE]Vision Template Expose Read-Only Custom Internal Properties (Outputs)

It would be great if I could essentially create a Custom Property Template so I could reuse the same custom props/customizer all over the place.

Why can you not use a normal template property? Those are specifically for exposure to containers. :man_shrugging:

What do you mean? The options for a custom template property are template parameter or internal property.

image

Sorry, parameter == property in practice. What is it about template parameters that doesn't suit your purpose? That they aren't bindable within the template? (They are writable within the template.)

1 Like

I guess not being able to bind the parameters to other properties is essentially the issue. I can script it with property change to update the parameter's value, but that ends up being too many scripts when there's multiple properties and animation involved.

It has to be that way in order for parameters to be bindable on the outside. Perhaps you should rephrase your feature request to have explicit output parameters. Bindable only on the inside, exposed to the container. The existing template parameters are functionally "In/Out", quite deliberately so. Writes from inside the template can drive a bidirectional binding on the outside. And bidirectional bindings to template properties inside the template can drive values back to the container.

3 Likes

That makes sense. Yes, output parameters/properties is essentially what I'm looking for I just didn't call it that.

1 Like

I think I had made a request like this before, I do see this one but it seems like they only care to do it for perspective now - "template parameters" - Implement INPUTS and OUTPUTS | Voters | Inductive Automation

However this did lead to a old post from @pturmel I would imagine this is still a relevant solution Template output parameters

1 Like

Yes, though I often open-code it like so, on an internal property:

objectScript(
	"args[0]\nbinding.target.someParameterName = args[0]",
	..someNestedExpression..
)

Both the internal property and the template parameter get the value of the nested expression.

The docs for objectScript() mention using additional code in expr.

1 Like

Yes, still a relevant solution, but that's alot of extra scripts running. Also, somewhat complex and confuses me a little bit... but that's more a me issue.

Also the comment from mkarnick on your original feature post is still relevant.

1 Like