How to get the type of an item
Hi!
A wall I've been banging my head against:
I'd like to make a table cell node that renders a simple cell with certain dimensions and content. I'd like to make it accept both paths and strings as content. It would be easy if I'd only could get the type of an list item that I'm feeding to the cell node. If the type of input would be path, I'd just pass it forward but if type would be string, I'd render it with textPath node first.
I can think of workarounds, but I'd guess someone else has bumped into same problem before...
Best,
Jussi
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by john on 06 Jul, 2023 09:19 PM
Jussi,
Rejoice! There is indeed a simple (if undocumented) solution to this problem.
Use a lookup node, and for the key enter "class.simpleName".
You will get one of seven possible strings in response:
I think that's all the possibilities. I figured this out using the key node. The key node tells you the properties available for any Nodebox object. You can then do a lookup on one of those properties (e.g. class) and feed THAT into a key node to find out what dot (sub) properties are available.
Happy Nodeboxing!
John
2 Posted by Jussi Jokinen on 07 Jul, 2023 06:26 AM
Thank you so much, John!
I should've thought of keys… :D