Nodebundle for playing with nodes
 1-14  15-34  35-54  55-74  …  1855-1859
Thread Split: Some posts in this thread have been moved here

Previous
Next
 From:  Barry-H
7777.15 
Hi Karsten,
many thanks for your efforts I will enjoy trying them.
I'm trying to do a node of the BoundingBox of selected objects
to output the X,Y & Z sizes (as you get when selected within Moi )
but as I am new to Java Script I'm struggling.
Any chance you could do one or give me some pointers.

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

Message 7777.16 deleted 4 Mar 2016 by JFH

Previous
Next
 From:  Karsten (KMRQUS)
7777.17 In reply to 7777.15 
Hello Barry,

here is a draft for such a node. You can copy/paste the nodedef it into a present file or register the file in index.html like:
<script type="text/javascript" src="nodes/infonodes.js"></script>

Maybe you have to pimp it a little bit:-)

Have nice day
Karsten

p.s.: What do you want to do with it? My curiosity will kill me someday:-)
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:  djordje
7777.18 In reply to 7777.17 
This graphical programming interface is very interesting!!
Nice work Karsten.

Is it only possible to create nodes in javascript?

If somebody would enable writing nodes in python (or ironpython), I think this would open new doors for further development of MoI nodes.
  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.19 
Hi Karsten,
thanks again for your help. I have installed the node as per your instructions and it works.
The reason I wanted it was to automate the array layout of a selected object within a given
rectangular area. (basically what you helped me with before)
With the Maths nodes I can do the calcs based on the given area and the selected item's
bounding box dimensions. The only thing that doesn't happen if I add a rotate node to the item
it does not update the bounding box.(the selected stays where it is but grayed out)
Anyway as it is now you can set your area select an item add a gap and it will automatically
fill the area with rows and columns. I will post the result when I get it working.
Thanks again.

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.20 
Hi Karsten,
attached is the Auto Array file. I sorted the rotate problem out, it's node was needed prior
to the Bounding Box node so now the Bounding Box updates if you rotate the item.
To use the Auto Array select your item prior to loading.
The screen shots shows the adjusters.
Again many thanks for your help & to Max for developing this Plugin.

Barry
Attachments:

Image Attachments:
Size: 80.7 KB, Downloaded: 677 times, Dimensions: 763x288px
Size: 81.1 KB, Downloaded: 388 times, Dimensions: 820x347px
  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:  BurrMan
7777.21 In reply to 7777.18 
"""""If someone would enable python""""""

Dave morrill wrote that awhile back. Actually created an editor, but left the forum before sharing it. I think he had neen working on a shell that aloud him to do it. The VIP shell is located in his facets repository i think (but am not sure)

https://github.com/davidmorrill?tab=repositories

You would have to remake the connections yourself because he didnt leave his initial results here
..
  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:  djordje
7777.22 In reply to 7777.21 
Thank you Burrman.
Is this the project of David Morrill, you are referring to:
http://moi3d.com/forum/lmessages.php?webtag=MOI&msg=3341.1

This does not look like a Nodebundle, but some other custom UI for MoI modelling.
I am actually interested in writing Nodebundle nodes with python.
  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:  BurrMan
7777.23 In reply to 7777.22 
Yes thats one of the examples he was working on.

No, its not part of node editor. It is a shell which can be interfaced with moi. Then you can program moi with python of whatever you want.

But the way dave set it up, it was basically a parametric node system for working in moi. And he was using python to run moi.
  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:  djordje
7777.24 In reply to 7777.23 
Thank you.

It would be nice if at some point in future, somebody would write a custom MoI Nodebundle component which will enable writing python nodes. I am not a programmer and could not do that.
  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.25 In reply to 7777.24 
Hi djordje, it would probably be require a major effort involving a considerable amount of work to do that, it's hard to even estimate what would be involved... maybe many months of focused work, maybe longer even. So it's fairly unlikely to happen anytime soon.

MoI is focused on using JavaScript as its scripting language so if you want to experiment with these things you will probably need to do it in JavaScript and not in Python, sorry.

- 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:  djordje
7777.26 In reply to 7777.25 
Thank you for the informative reply Michael. It helped.
  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.27 
Can Michael's CenterAtOrigin script be converted to a node ?

var objects = moi.geometryDatabase.getSelectedObjects();

var bbox = objects.getHighAccuracyBoundingBox();

var factory = moi.command.createFactory( 'move' );
factory.setInput( 0, objects );
factory.setInput( 1, bbox.center );
factory.setInput( 2, moi.view.getCPlane().origin );

factory.commit();

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

Message 7777.28 deleted 14 May 2019 by JFH

Previous
Next
 From:  Karsten (KMRQUS)
7777.29 In reply to 7777.28 
Hello James,

I had a look at your Problem and as a possible solution, we can make a true/false inputfield in the Infopanel. I did something like that in e.g. subD/simpleBridge. The Loftnode is one of the original nodes written by Max - and these are holy for me - so I won't touch them. Nevertheless I can make a new one based on this in the next days.

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:  Karsten (KMRQUS)
7777.30 In reply to 7777.20 
Hello Barry,

I have tested your arrayfile with the boundingbox-stuff!

Cool Idea!

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:  Barry-H
7777.31 
Hi Karsten
Just to let you know I modified the BoundingBox
Node to "getHighAccuracyBoundingBox" and it works a treat.
I also added an auto position centred within the max X and Y.
This works Ok but if you revolve the object it can move of
Centre. So that's why I posted about Michael's CenterAtOrigin script.
I have tried to modify it but failed so if you can have a look that would
Be great.
(I'm trying to learning JavaScript but more mistake's than success)
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:  Karsten (KMRQUS)
7777.32 In reply to 7777.28 
Hello James,

I made a new loft-node, where you can switch between closed and open by entering true/false in the info panel. A checkbox would be better, so we have to ask Max if it is possible to implement such a feature someday in the core development.

Kind regards
Karsten

EDITED: 6 Mar 2019 by KMRQUS

Image Attachments:
Size: 113.5 KB, Downloaded: 178 times, Dimensions: 888x606px
  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.33 
I have modified Michael's CenterAtOrigin script to make a node.
If I use it as an output it works but it applies as well thus if positional sliders & rotations are altered
it produces another set of objects. I'm not sure what to do to overcome this.
Any pointers would be great.

Barry (JavaScript beginner)

// ############ Centre ############
function Centre()
{
this.addInput("In","objectlist");
this.addOutput("Out","objectlist");
this.properties = { capend:true };
}
Centre.title = "Centre";
Centre.desc = "Centre";

Centre.prototype.onExecute = function()
{
//var objects = moi.geometryDatabase.getSelectedObject();
var objects = this.getInputData(0, moi.geometryDatabase.createObjectList());
var bbox = objects.getHighAccuracyBoundingBox();

var factory = moi.command.createFactory( 'move' );
factory.setInput( 0, objects );
factory.setInput( 1, bbox.center );
factory.setInput( 2, moi.view.getCPlane().origin );
factory.commit();
}


LiteGraph.registerNodeType("Transformations/Centre", Centre);
// ############ End Centre ############
  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.34 In reply to 7777.33 
Hello Barry,
the factory.commit() pushes the created object to Moi s geometry database - finished and allready. That is not what you want. So you should store the geometry in a variable and place it in an output. I donĀ“t have access to a sample at the moment (only my Cellphone), but you can find examples in every node that has a geometry output:-)

If you can't find a solution, please tell me.
Happy programming
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
 

Reply to All Reply to All

 

 
Show messages:  1-14  15-34  35-54  55-74  75-94  …  1855-1859