Jump to content
Sign in to follow this  
hoknamahn

OTL & Expressions

Recommended Posts

How to call an expression function embedded into OTL?

For example I have a custom object... say Foo. And a function (something like float Five() { return 5.0; }) embedded into one of sections (section have a name SomeFunc) of Foo.

If we follow usual syntax, then access to the section, in which is located the function, it must look like

opdef:/Object/Foo?SomeFunc

But this is certainly illogical because the name of function is not indicated and in one section can be (???) several functions.

How to call a function Five() in my example?

Share this post


Link to post
Share on other sites

In the Type Properties of your custom operator type, go to the Events page.

For the Event Handler, "Before First Create", put in the text:

exread  opdef:/Object/Foo?SomeFunc

That will source the definition for your operator type so that it can use the expressions defined in the SomeFunc section. You just refer to the function like what thekenny says.

Share this post


Link to post
Share on other sites

Hi guys! I have a similar question again. I want to share some piece of a VEX code between several shaders and it would be logical to include the header file into the OTL section. Is it possible to make this and if it is possible, then how?

And I don't want to write the same piece of code in each shader.

I like to use #include <header.h>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×