Nodebundle for playing with nodes
 1-9  …  750-769  770-789  790-809  810-829  830-849  …  1850-1859
Thread Split: Some posts in this thread have been moved here

Previous
Next
 From:  bemfarmer
7777.790 In reply to 7777.789 
Hi Barry,

(precision)Bounding box would give an estimate of the size of the objects, and how far to "nudge" one or both, in some direction.
If the intersect factory, via factory.calculate(), has its intersect curves or points sent to an objectlist, and the length is zero, there is no intersection. (?)
(I'll await Michael response :-)
- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Barry-H
7777.791 In reply to 7777.790 
Hi Brian,
I used the bounding box in my original trials but wanted to use the intersect node to give a more accurate layout (allowing for nesting within the bounding box). My problem is to find away of using the output of intersect node as a true or false or 0 or 1 so I can then trigger the movement.
I looked at the JS code of the intersect node to see if the output could be changed to give a 0 or 1 and then create a new node but my limited JS knowledge is a problem hence my post.
Cheers
Barry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7777.792 In reply to 7777.791 
Instead of factory.commit(), putting the intersecting lines/curves/points in the geometry database,
objList = factory.calculate() would put the curves & points in an objectlist, which could be counted/ checked for length.
I'll defer to the professional programmers, due to my very limited knowledge, and limited time :-)
- B
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7777.793 In reply to 7777.791 
Hi Barry, it looks like you'd need to do 2 things - you'd need to change the output type of the node which is defined by this line in objIntersect():

this.addOutput("Out","objectlist");

It sounds like you want it to output a boolean value, it looks like you can put in "boolean" for that, so change that to:

this.addOutput("Out","boolean");


Then to actually make the boolean value you will need to change the onExecute function for objIntersect, the last line currently looks like this:

this.setOutputData(0, output);

To change that to a boolean value instead of outputting the object list try this:

this.setOutputData(0, output.length > 0);

So that should then output true if anything was generated from the intersection or false if nothing was generated.

Does that maybe do what you need?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Barry-H
7777.794 In reply to 7777.793 
Hi Michael,
yes that’s what I need to achieve a node that indicates a collision.
Thanks a lot.
Barry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Barry-H
7777.795 In reply to 7777.793 
Hi Michael,
I modified Max's node as your suggestions but cannot find anyway to connect it to the maths node.
Is the output a numeric number ?
Thanks
Barry

EDITED: 30 Jan 2021 by BARRY-H

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7777.796 In reply to 7777.795 
Hi Barry, the output for that case is a boolean value, not a number value. But if you want a number to be output instead, try switching the output type to:

this.addOutput("Out","number");

Then in onExecute, try this:

this.setOutputData(0, output.length == 0 ? 0 : 1);

The "output.length == 0 ? 0 : 1" part is a compact way of saying: "if output length is 0 output 0 else output 1".

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Barry-H
7777.797 In reply to 7777.796 
Hi Michael,
changed code as your reply only thing had to change was "number" to "numarray".
works just as I needed so again many thanks for sorting it for me.
Cheers
Barry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Barry-H
7777.798 In reply to 7777.796 
Hi Michael,
I was a little premature thinking by altering the this.addOutput(“Out”,”number”);
to this.addOutput(“Out”,”numarray”); worked, it only allowed connection to maths node but the maths node does not recognise the input. So back to square one.
Any more ideas gratefully received.
Barry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  r2d3
7777.799 
Animate going easy..



Just take the 3 axes from the 3dm file -> place it over the axes points of your favourit piston > name the parts like in the 3dm file -> open nodeeditor with the nod file -> press play and enjoy...

runs fine on nodeeditor @'y'@ 0.99 without any special extensions....





Ralf:)
looking for moments of inspiration...

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7777.800 In reply to 7777.798 
Hi Barry, well I'd guess numarray would need an array of numbers to be returned instead of just a single individual number.

In Javascript you can make an array by using [], like [ 'a', 'b', 'c' ] . So try changing the onExecute part to this:

this.setOutputData(0, output.length == 0 ? [0] : [1]);

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7777.801 In reply to 7777.799 
<< Animate going easy..

...easy to use your tricky Nodeling ...but maybe not so easy to create it from zero! ! ;)
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7777.802 
There is a (minor) difference in the behavior of the concat2 node in MoI4beta.
It is a failure to release the mouse attachment to the node, under certain circumstances.

By clicking RMB on top of the concat2 node, one of three input configurations may be selected,
called Numbers, (numarray), Points, (pointarray), or Objects.
This should be done before attempting to wire the input with the wrong type.
In MoI4beta, "Dragging" a gold wire for Objects to the wrong input, Numbers or Points, and then pushing RMB and selecting Objects,
results in the proper input being changed to, and the wire attaches, but the mouse is then locked onto the node box.
The only way I've found to release the lock is to press ESC, and reload the file.

This does not happen in MoI3. Clicking the RMB releases the attempt to wrongly attach the wire.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Barry-H
7777.803 In reply to 7777.800 
Hi Michael,
that’s seem’s to be the answer.
Many thanks.
Barry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  r2d3
7777.804 In reply to 7777.801 
<< ...easy to use your tricky Nodeling ...but maybe not so easy to create it from zero! ! ;)

EASY!

1. reinvent the cosinus
2. discover javascript
3. enjoy nodeling
4. keep nodeling

There is still a more EASY version:



Ralf:)
looking for moments of inspiration...

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7777.805 In reply to 7777.804 
>>2: Discover Javascript
Step 2 is maybe the pitfall hurdle obstacle stumbling block! :)

PS Nodes used are all native nodes renamed ?
As I have yet translated all native nodes in French that will be cool if you have a version with only native ones! :)
For example I don't see "CrankL" in my native list!



I follow this guy every day, day after day, but only for the pleasure of the show! ;)
(and i put Speed 2 : because we have only one life (not like cats who have nine! :D

EDITED: 5 Dec 2017 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  r2d3
7777.806 In reply to 7777.804 
Uuuuups..
same picture different file.. ;-)


Ralf:)
looking for moments of inspiration...
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7777.807 
With the Animator 10 in French native
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7777.808 
Animator 11 works very fine!
As you can see i must translate all! :)
Here just translated the "-Limit"!
Look "- Limite" and "+ Limit"

in fact i was too speedy I must translate in French like this "Limite -" :)



Can we have a look of the code of the macro is ?

So a very big metaphysic problem for me : must i translated all nodes or only nodes that please to me! :D

EDITED: 5 Dec 2017 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  r2d3
7777.809 In reply to 7777.805 
<<<(and i put Speed 2 : because we have only one life (not like cats who have nine! :D

var LengthOfLive=moi.GetDistance(birth,death)/speed;
if(speed<=Math.PI/2){break;}else{return;}


PS translating the nodenames makes only sense for the nodelist... if you have a LOT of nodes you have to give them relating names......
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-9  …  730-749  750-769  770-789  790-809  810-829  830-849  850-869  …  1850-1859