MoI discussion forum
MoI discussion forum

Full Version: Node Editor • Random Move Scale Rotate

Show messages:  1-20  21-25

From: Whiteman Dynamic (TIM_WHITEMAN)
26 Apr 2020   [#1]
Hi MoI friends! I hope you’re all keeping safe and healthy?

I was wondering if there are any smart node editor users who know of a way of moving, scaling and rotating a selection of objects randomly using a seed value. I’m guessing it’s a pretty simple node tree, but I’ve been unable to achieve anything.

Ideally I would like to move, scale and rotate a selection of blocks to make random building shapes, so they wouldn’t necessarily have to move very far from each other.

Thank you for kindly reading, I hope someone can help me with my noob question?

Kind regards,

Tim
From: James (JFH)
26 Apr 2020   [#2] In reply to [#1]
Tim,

I replied to you on instagram before reading your post here.
It would be helpful to post an image of ab example of the result your looking to achieve.
If you can model it manually, it is likely that it may be reproduced parametrically.

James
https://www.instagram.com/nodeology/
From: BurrMan
26 Apr 2020   [#3] In reply to [#1]
Did it need to be "Node Editor" or was that just a thought.

There is a command made to "randomize" like that....


From: Michael Gibson
26 Apr 2020   [#4] In reply to [#3]
Randomize script is here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=5416.5

- Michael
From: Frenchy Pilou (PILOU)
26 Apr 2020   [#5]
And if you persist in Node Editor you will find here the Elephant Repository! ;)

http://moiscript.weebly.com/biblio-elephant.html
From: Whiteman Dynamic (TIM_WHITEMAN)
27 Apr 2020   [#6]
Exactly what I like the most about the MoI community, super friendly and helpful! Thank you all for taking the time to read and respond.

@James (JFH)
You did reply on Instagram, thank you! I am grateful for your kind response. It's actually a really simple result that I'm trying to achieve. So the end product I was trying to achieve is pretty much exactly what BurrMan has shown in his video example, just with fewer objects, say 10 max. The reason I mentioned the Node Editor, is because I was hoping that with a single click, I could randomize the formation again, then again, etc. So each button click would create a different formation of the objects. I'm guessing that the button click would equal a different random seed number. Also, the rotation would ideally have to be in 90° increments, e.g. 90°, 180°, 270°. It's a really simple idea and I'm sure that there is a node tree that could achieve it quite simply.

@BurrMan
Many thanks! That's such a great and useful example! Pretty much exactly what I'm trying to achieve. The only reason that I mentioned the Node Editor was as I mentioned to James, because I was hoping that with a single click, I could randomize the formation again, then again, etc. Also, the rotation to move in 90° increments, e.g. 90°, 180°, 270°, which would probably mean adjusting the code of the script a tiny bit?

@Michael Gibson
Thank you Michael! I really appreciate the link to the script. As I mentioned to James earlier, there are some things unachievable by this particular script, namely the random seed click, so a different formation with each click of the button and an option for rotation to be in 90° increments. Other than that, the script is exactly what I was looking for!

@Frenchy Pilou (PILOU)
Merci beaucoup! I have the Node Editor that you mentioned already installed! ;)
From: Frenchy Pilou (PILOU)
27 Apr 2020   [#7] In reply to [#6]
It was more for the all nodes commented that i have not yet finished! ;)
From: Frenchy Pilou (PILOU)
27 Apr 2020   [#8]
There is also Random Selection and Random Color ;)
Just change the variables if needing...

script: /* Random selection of objects from a selection */ var percent = 30; var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { if ( Math.random() * 100> percent ) objs.item(i).selected = false; }

script: /* Assigns existing Random Styles to selected faces and sides */ var styles = moi.geometryDatabase.getObjectStyles(); var breps = moi.geometryDatabase.getObjects().getBReps(); for ( var i = 0; i < breps.length; ++i ) { var brep = breps.item(i); var edges = brep.getEdges(); for ( var j = 0; j < edges.length; ++j ) { edges.item(j).styleIndex = Math.floor(Math.random() * styles.length); } var faces = brep.getFaces(); for ( var j = 0; j < faces.length; ++j ) { faces.item(j).styleIndex = Math.floor(Math.random() * styles.length); } }





From: James (JFH)
27 Apr 2020   [#9] In reply to [#6]
Tim,

Here is a node circuit to do what I think you're asking for.
Once you have adjusted parameters to your liking, you can
click switch node, labelled "ClickMe" repeatedly until you get
the most desirable composition of elements.

Hope this helps

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

Attachments:
randomBuildings.nod

Image Attachments:
randomBuildings.gif 


From: BurrMan
27 Apr 2020   [#10] In reply to [#9]
As always James.
From: Frenchy Pilou (PILOU)
27 Apr 2020   [#11] In reply to [#9]
I am disapointed there is no rotation on the axes of each objects! ;)

It's a sort of grebble!


From: James (JFH)
27 Apr 2020   [#12] In reply to [#11]
Pilou,

Tim requested "the rotation to move in 90° increments, e.g. 90°, 180°, 270°" which is effectively no rotation at all, as long as width & Breadths are randomised.

Nevertheless, it would be trivially easy to incorporate a rotate2 node.

James
https://www.instagram.com/nodeology/
From: Frenchy Pilou (PILOU)
27 Apr 2020   [#13] In reply to [#12]
That i find not easy in this node system is how exit of a node!
Even I contemplate this image and even follow the colors...:)


From: Whiteman Dynamic (TIM_WHITEMAN)
27 Apr 2020   [#14] In reply to [#9]
Hey James,

You're an absolute genius! Seriously, WOW! Honestly, one of the coolest things I've seen in a long time! Thank you so much for your kind patience and for taking the time to help me out. I very much appreciate your help and expertise.

Now here's the bit where I sound a bit ungrateful (but I am genuinely extremely grateful!)... This node circuit is next level awesome and there is no way I would've figured all of that out for myself this lifetime! :D Please forgive me for asking, I was wondering if there is anyway to achieve the same functionality, but with a number of pre-modelled, selected objects? So instead of randomly created blocks, the "ClickMe" switch would randomly move, scale and rotate the existing selected models? So for example, if I had say 10 different rough building shapes (10 simple building shape solids), the ClickMe switch would move, scale and rotate each solid into a slightly different size and configuration, exactly the same result as what you have with the blocks in your node circuit.

I do completely understand if I am asking too much and really do not want to cause you any further inconvenience. What you have created here is so incredibly awesome as it is! There is already a great deal I can do with randomBuildings.nod!

Thank you so much!

Kind regards,

Tim
From: James (JFH)
27 Apr 2020   [#15] In reply to [#14]
Tim,

Post a .3dm file of example objects and I'll see what I can do.
No rush, I have to go to work now, but I will have a look tonight (your morning)

James
https://www.instagram.com/nodeology/
From: Whiteman Dynamic (TIM_WHITEMAN)
27 Apr 2020   [#16] In reply to [#15]
quote:
Tim,

Post a .3dm file of example objects and I'll see what I can do.
No rush, I have to go to work now, but I will have a look tonight (your morning)

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


Thank you so much James! I am really grateful for your generous time and help.

I have quickly created some rough example building block objects to give a rough idea of what I'm trying to achieve. I would probably spend a bit more time modelling something with a bit more detail, but these should help to start with. Please excuse the amateur look of my building blocks! ;p

Thanks again James, you're a gentleman sir! As you said, there's no rush or urgency, whatever time you have is most appreciated!

I hope your workplace is a safe environment with the current pandemic?!

Kind regards,

Tim

Attachments:
Example_Blocks.3dm


From: James (JFH)
27 Apr 2020   [#17] In reply to [#16]
Tim,

Give this .nod file a go.

You may need to RMB click "select" node (GREEN) & choose "Update"
if you want add new objects on the fly.
It will work with any number of selected objects.

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

Attachments:
Example_Blocks.nod


From: Frenchy Pilou (PILOU)
27 Apr 2020   [#18]
And maybe with this populate a city ;)
http://moiscript.weebly.com/points-e.html#bibeclonetopts


From: pafurijaz
28 Apr 2020   [#19]
there is way to make these working on Linux under WineHQ?
From: Whiteman Dynamic (TIM_WHITEMAN)
28 Apr 2020   [#20] In reply to [#17]
Hello there James,

Thank you! Absolutely incredible! Again, I cannot thank you enough for so kindly sharing your time and expertise to help me out! This node circuit is just mind blowing! The creative possibilities that are achievable with this are pretty much endless! Really great fun and inspiring to use. I duplicated the entire circuit and added a Boolean Difference node at the end just before the Output. So one branch is the base objects and the other is the subtraction objects, great fun and some really interesting results!

I'll post some of the work that I had in mind once I've created some interesting compositions and I'll of course name-drop you for your incredible help.

Thanks again James, you've really made this COVID lock-in far more fun and entertaining! :D

Have a great day|evening!

Kindest regards,

Tim

Attachments:
Building_Generator_Boolean.nod


Show messages:  1-20  21-25