Question about plugins #903
-
Hi I've written a small plugin and I've come into a problem where I have to split the output into two since one of the maps multiplies onto the other. Is there any way to check whether any input is applied to node? I've tried various ways to check is the input value different from the default one but I couldn't make it work properly. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Good afternoon, Lyubos! I subscribe to the question. Can you tell us if it is possible to check if something is included in the input channel. I tried to use the same comparison method as @MrAdrianPl did, but it didn’t lead to any results. |
Beta Was this translation helpful? Give feedback.
-
Taking the hello_node.js as example, here is how to check the scale socket: if (scale != "1") {
// Non-default value
}
if (isNaN(parseFloat(scale))) {
// Link is connected to this socket
} |
Beta Was this translation helpful? Give feedback.
-
Thanks you)
вт, 4 мая 2021 г., 16:52 Lubos Lenco ***@***.***>:
… Taking the hello_node.js
<https://github.com/armory3d/armorpaint/blob/master/Assets/plugins/hello_node.js>
as example, here is how to check the scale socket:
if (scale != "1") {
// Non-default value}if (isNaN(parseFloat(scale))) {
// Link is connected to this socket}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#903 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APRY3VNYI4W2HQ6KHKJJ7HDTL732FANCNFSM44CYFN3Q>
.
|
Beta Was this translation helpful? Give feedback.
-
I've tried that methods but i didn't get the expected result
this for e.g returns always true |
Beta Was this translation helpful? Give feedback.
-
For vector: // ...
{
id: 0,
node_id: 0,
name: "Vector",
type: "VECTOR",
color: 0xff6363c7,
default_value: new Float32Array([0.0, 0.0, 0.0])
}
// ...
let vec = arm.MaterialParser.parse_vector_input(node.inputs[0]);
if (vec != 'vec3(0, 0, 0)') {
// Link is connected to this socket
} |
Beta Was this translation helpful? Give feedback.
For vector: