Jump to content

OTL & Expressions


hoknamahn

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?

Link to comment
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.

Link to comment
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>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...