Nodebundle for playing with nodes
 1-12  …  1573-1592  1593-1612  1613-1632  1633-1652  1653-1672  …  1853-1859
Thread Split: Some posts in this thread have been moved here

Previous
Next
 From:  bemfarmer
7777.1613 In reply to 7777.1612 
For function loadDefaultNodes(), see lines 21 through 26 of the file init.js, located in core subdirectory of nodeeditor.

function loadDefaultNodes()
{
var node_output = LiteGraph.createNode("Basic/Output");
node_output.pos = [800,100];
graph.add(node_output);
}

- 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:  Frenchy Pilou (PILOU)
7777.1614 In reply to 7777.1613 
Many thanks!
Cool : works like a charm! Will added in few times http://moiscript.weebly.com/node.html#addanodeselected

function loadDefaultNodes()
{
var node_output = LiteGraph.createNode("Basic/Output");
node_output.pos = [800,100];
graph.add(node_output);
var node_selected = LiteGraph.createNode("Objects/Selected");
node_selected.pos = [400,100];
graph.add(node_selected);
}

EDITED: 6 Oct 2019 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:  Frenchy Pilou (PILOU)
7777.1615 
Ok i haved finished the Section Not Native Construct2 all English ;) Next will be Curve2
http://moiscript.weebly.com/construct2.html

...except these 2 little things where i am sucked! :(

if you have some ideas ?

---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel 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:  James (JFH)
7777.1616 
Hi All,

I am getting an error message when using curveLength node. (see below)

code:
TypeError: undefined is not an object (evaluating 'this.outputs[1].label = len[0].toFixed(2)')

moi://appdata/nodeeditor/nodes/extensions/infonodes.js   line 74

70:               out.addObject(inObj.item(i).clone());
71:               } 
72:             }
73:             this.setOutputData(0, out);
74: >>          if(len.length>0) this.outputs[1].label = len[0].toFixed(2);
75:             this.setOutputData(1, len);
76:         }
77:         crv_length.prototype.onPropertyChange = function ()
78:         {


I have attached a simple .nod file. Can someone please run it to see if problem is universal or specific to my setup. I have already tried reloading both my v4beta & nodeEditor folder without fixing this issue.

I would greatly appreciate any assistance
Have a great weekend
James
https://www.instagram.com/nodeology/
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.1617 
You ask a curve's length of a Point ?

  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.1618 In reply to 7777.1616 
Hi James,
How did you get a gold output to connect to a green input?
Once detached, I cannot get this incorrect connection to reconnect.

The green output hooked to the green input shows the length as 57.38.

Gold output to an Output node draws the curve.
Its MoI length with unwrap curve script is 57.3800598.

- Brian

EDITED: 19 Oct 2019 by BEMFARMER

  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:  James (JFH)
7777.1619 In reply to 7777.1618 
Thanks Brian & Pilou,

Is is apparent now that my fiddling with the code is the issue.
I will overwrite with original code.

Thanks again
James

James
https://www.instagram.com/nodeology/

  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.1620 In reply to 7777.1619 
Hi James, also the new v4 beta has the arrowheads that rotate towards the viewer that you were asking about a while ago for showing directions.

They can be created like this:

code:
	var startpt = moi.vectorMath.createPoint(5,5,5);
	var endpt = moi.vectorMath.createPoint(10,10,10);
	var f = moi.command.createFactory( 'arrow3d' );
	f.setInput( 0, startpt );
	f.setInput( 1, endpt );
	var arrow = f.calculate().item(0);
	moi.geometryDatabase.addObject( arrow );
	f.cancel();


That creates a Leader with its plane perpendicular to the arrow direction and sets the .rotateArrowheadPlaneTowardsViewer property on it.

- 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:  wayne hill (WAYNEHILL5202)
7777.1621 In reply to 7777.1619 
@James,

Create a test directory for the Node Editor and call it with a shortcut. This way you keep the original directory and have a test area for playing with nodes.

moi.ui.createDialog( 'moi://appdata/nodeeditortest/index.html?scheme=Light', 'resizeable,defaultWidth:1000,defaultHeight:1000', moi.ui.mainWindow );

The original and test area node editor use the same MOI instance so the nodes are viewable in both the original and test area editors.

You can cut and paste nodes between the node editors and run them separately. How cool is that?

Wayne

EDITED: 2 Oct 2020 by WAYNEHILL5202

  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:  James (JFH)
7777.1622 In reply to 7777.1620 
Michael

Yes, thank you for the code to address new arrowheads. This will be a real boon for future development of vector nodes.



Wayne

Thanks for the tip of parallel NE for testing coding. This is indeed a "cool" technique.



Thanks again,
James
https://www.instagram.com/nodeology/
  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.1623 
Question about writing a new node.

The scripts in MoI often have Functions{} in their code.

The node programs do not seem to use such Functions{} very much.
Instead they use ...prototype...function().
So to use a function from a script, in a node, should they be written as ...prototype...function()?

Or,
I see that in the Lib folder under nodeeditor\nodes\extensions, there is a file called basicFunctions.js,
which is full of miscellaneous functions.

So when writing a node which uses a MoI script with functions, can or should I put the needed functions in a new lib file called, for example, basicFunctions2.js?

- Brian

It seems that the functions in basicFunctions.js can be (re-)used in any new node?
  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:  Karsten (KMRQUS)
7777.1624 In reply to 7777.1623 
Hello, Brian,

the prototype function gives the objects created by using the nodeeditor a uniform interface for the processing. Same method names for the various
Knots. So every code of the node creates a type. Later by using the node editor you create objects of these types with a uniform interface of functions.
You can of course use the functions in basicFunctions.js and also create a basicFunctions2.js. You can also write your functions to the same file as your nodes.
For more frequently used functions, it makes sense to store them in a library.

Have a nice day
Karsten
  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.1625 In reply to 7777.1624 
Thank you Karsten.

Two additional related questions:
1. Where would a function go in a node? Inside the .prototype.onExecute = function (), or
just before it?
I have not found any examples, as far as I know.

2. Is it necessary to "link" say basicFunctions2.js somewhere? Or is this already set up?
(I have not searched for an example useage of basicFunctions.js yet.)

- 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:  Karsten (KMRQUS)
7777.1626 In reply to 7777.1625 
Hello Brian,

you can find examples where to place "normal" functions in vector.js. If you want to create a lib of functions you can place it in the libs folder under extensions. Max has made an autoload for files placed in that folder. So no link.

Have a nice day
Karsten
  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.1627 In reply to 7777.1626 
That information is very helpful.
Thank you Karsten.

- 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:  Frenchy Pilou (PILOU)
7777.1628 
Maybe this can interest you! :)

https://nodevember.io
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel 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:  James (JFH)
7777.1629 
Hi All,

Surface Tweening Animations: interpolating z values between 2 point Arrays with randomised z values.

Have a great weekend
James
https://www.instagram.com/nodeology/

EDITED: 8 Aug 2020 by JFH

  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.1630 In reply to 7777.1629 
Cool!
Does exist a trick for see if the are Macros or not ?
And i see (1-a)*b how do you enter (1-a) ?
  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:  James (JFH)
7777.1631 In reply to 7777.1630 
Pilou,

>> Does exist a trick for see if the are Macros or not ? <<

Yes, the macros are darker, but there are no macros used in example above.

>> And i see (1-a)*b how do you enter (1-a) ? <<

As well as preset functions, you can type custom functions into Math node's F field.
See image below

>> Cool <<

Cheers
James
https://www.instagram.com/nodeology/

EDITED: 9 Nov 2019 by JFH

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.1632 In reply to 7777.1631 
I must retry because this F case return me nothing! :)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel 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
 

Reply to All Reply to All

 

 
Show messages:  1-12  …  1553-1572  1573-1592  1593-1612  1613-1632  1633-1652  1653-1672  1673-1692  …  1853-1859