MoI discussion forum
MoI discussion forum

Full Version: Parametric design in MoI?

Show messages:  1-19  …  600-619  620-639  640-659  660-679  680-699  700-719  720-739  …  900-912

From: Max Smirnov (SMIRNOV)
6 Oct 2017   [#660] In reply to [#659]
Hi Marco,

I just forgot how my loadScript function works :)
rename mylib.js to ext.mylib.js and change the line in index.html to loadScripts('core','init, ext.*');
From: mkdm
6 Oct 2017   [#661] In reply to [#660]
Hi Max.

No problem. Thanks for the tip.

I hope in this weekend to start writing the UI plugin based on your example.
I still don't know what kind of style I want to use.
Anyway it will be minimalist and lightweight.

Obviously, before coding the entire plugin, I will try some prototype and I will ask you if it is good also for you, before I go any further.

Bye!
From: Karsten (KMRQUS)
6 Oct 2017   [#662] In reply to [#661]
Hello Max, hello Marco,

some questions about the Icons:

Resolution: 64x64?
Format: png?
Colordepth: 8bit?
Stored in static member e.g.
function Point(){
Point.icon="iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AA....

Will it be excluded from storing in the *.nod file?

Examples for the Icon design - coloured or Grey to get a consistent look?

Thanks in advance
and have a nice day
Karsten

Message 7713.663 was deleted


From: mkdm
6 Oct 2017   [#664] In reply to [#662]
Hi Karsten.

I complete here the previous message.

IF MAX AGREE OF COURSE.

1) 64 x 64 : OK
2) format : Base64 png
3) 8 Bit : OK
4) "function Point() {Point.icon="iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AA...." : OK
5) Style : flat icons



Stay tuned.

Bye.
From: mkdm
6 Oct 2017   [#665] In reply to [#664]
P.S.

Max, if you think that an overall size of 64x64 it too big for the icon we can use 56x56 or 48x48.

All other measures shall be proportionate to what I wrote in my previous message :

56x56 : roud corner : 7, centered icon : 42
48x48 : roud corner : 6, centered icon : 36
From: Max Smirnov (SMIRNOV)
6 Oct 2017   [#666]
Hi Marco, Karsten

1) 64 x 64 : OK
I think 24x24 should be enough for LoDPI displays, and 48x48 or 64x64 for HiDPI.

2) format : Base64 png
OK

3) 8 Bit : OK
8-bit png doesn't support smooth transparency gradients. We can't make nice-looking rounded corners using 8-bit format.
So we should use 24-bit png ( or we can make smooth rounded corners using png8+html5+js )

4) "function Point() {Point.icon="iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AA...." : OK
function Point() { ... }
Point.icon ="iVBO...
OK

5) Style : flat icons
OK

P.S. Wait.. Does MoI support svg/svgz images? It's a best variant. If not, I would like to advise Michael add support of this format in v.4, and create new MoI interface using svgz icons.
In the nearest future all monitors will be 4k, so vector scalable icons will looks great.
..I'll check it today
From: mkdm
6 Oct 2017   [#667] In reply to [#666]
Hi Max.

1) @You : "...I think 24x24 should be enough for LoDPI displays, and 48x48 or 64x64 for HiDPI."

Hmm...I think 24x24 it's too small. Maybe 32x32 is better. For HiDPI let's go for 64x64.
How to check DPI in Moi scripting ?

3) @You : "...we should use 24-bit png..."
Maybe there's a little misunderstanding :)
With 8 Bit I mean 8 bits per channel....so 24 bit.
OK

@You : "...P.S. Wait.. Does MoI support svg/svgz images? It's a best variant..."

Ok I wait.
I think, too, that SVG would be perfect.

Now I ask to Michael.

We'll catch up!

Ciao.

Marco (mkdm)
From: mkdm
6 Oct 2017   [#668] In reply to [#666]
P.s.

Max, about SVG icons I asked to Michael at http://moi3d.com/forum/index.php?webtag=MOI&msg=8613.1

Bye.
From: Max Smirnov (SMIRNOV)
6 Oct 2017   [#669]
Hi Marco,

I updated lib example. Now it can add a nodes.

>>Hmm...I think 24x24 it's too small. Maybe 32x32 is better.
You are free to use any icon size :) We can change it anytime we want.

Unfortunatelly, svg is not supported by MoI, so we should use png.
Maybe later we will make our own vector icon format for NE.
I think it is not bad idea for a plain design icons. We could draw a node icon and convert it to a compact data string.
It will be much smaller than base64 encoded png and can be exported directly from MoI.
From: mkdm
6 Oct 2017   [#670] In reply to [#669]
Hi Max.

Thanks a lot for this new updated lib! Great job!

But...in this way you've taken all the fun to coding on my own from scratch :)

Anyway...I'm going to use you example code as a solid base to build a new UI for that left panel.

Ok. For the icon size I will go for this solution :

1) If you want, during my spare time, I can design all icons for all standard nodes of NE.
I will design using Affinity Designer, a very powerful vector editor, therefore I won't have any problem with scaling and I will be able to export the icons at any resolution and size.

2) I will design the icons in flat style with these dimensions :
Dark grey rounded box 32x32 px round radius 4px color Hex 373737.
Inner icon max 24x24 flat white or bicolor

This is a real size example :



We can always decide to export the icons from Affinity with different sizes if we see that 32x32 is not good.

Is it OK for you ? if yes I can start the creation of icons and js coding.

3) @You : "...I think it is not bad idea for a plain design icons. We could draw a node icon and convert it to a compact data string.
It will be much smaller than base64 encoded png and can be exported directly from MoI."

I'm sorry but I didn't understand what you mean. Could you please be more clear ?

Thanks a lot and have a nice day.

We'll catch up.

Ciao.
From: mkdm
8 Oct 2017   [#671] In reply to [#669]
Hi max.

I's sorry if I ping you again but I'm waiting your response before I go any further with icon designing and JS coding for the new NE ui.

My question is at : http://moi3d.com/forum/index.php?webtag=MOI&msg=7713.670

Please, let me know.

Bye.
From: Max Smirnov (SMIRNOV)
8 Oct 2017   [#672] In reply to [#670]
Hi Marco,

>>But...in this way you've taken all the fun to coding on my own from scratch :)
>>Anyway...I'm going to use you example code as a solid base to build a new UI for that left panel.
It was just an example. :) I tried to show how your script can interact with ne kernel.

>>1) If you want, during my spare time, I can design all icons for all standard nodes of NE.
It will be great.

>> 2) I will design the icons in flat style with these dimensions :
>>Dark grey rounded box 32x32 px round radius 4px color Hex 373737.
How about HiDPI displays support? It will be better to store 64x64 icons in a node files.
You can generate 24x24 or 32x32 from 64x64 on the fly using js/html5. Also using js you can make rounded corners with any radius you want,
so you don't need draw icons with rounded corners.

In my opinion the icons should be: 64x64, straight corners, png8 (not 24).

>>3) I'm sorry but I didn't understand what you mean. Could you please be more clear ?
In the future we can store icons using our own vector format.
A workflow can be like this:
1. Draw icon using MoI
2. Using script convert the icon to string which describes all colors, lines and curves of the icon.
3. Insert string to node script
NE will render each icon every time when you start it.
From: mkdm
8 Oct 2017   [#673] In reply to [#672]
Hello Max.

I'm glad to read your reply.

@You : "...How about HiDPI displays support? It will be better to store 64x64 icons in a node files.
You can generate 24x24 or 32x32 from 64x64 on the fly using js/html5. Also using js you can make rounded corners with any radius you want,
so you don't need draw icons with rounded corners."

Ok Perfect!!

So, before coding a bunch of JS code to create my own UI for NE based on your example,
ASAP, first of all, my first step will be to draw all the icons!

So, to recap :

1) I will draw all the icons in Affinity Designer to build them in vector mode so I can easily modify them without any quality loss.
2) The icons will be exported in 64x64 PNG24 , flat, squared, with background set to Hex 373737
3) Each icons will have a centered glyph, white or two-colors, flat, no shadows, size 48x48
4) I will add the rounded corner radius with js/css to the icons squared background
5) As you said all the icons will be stored in a node files.
I will ask you an example of how do you think this node file should be done.

So, everything is fixed :)

Almost...

Because, Max, again... I think that there is a misunderstanding...

You wrote : "...In my opinion the icons should be: ...png8 (not 24)."

Why png8 ? A PNG8 is limited to 256 palette entries, while a PNG24 can have 16 million different colors.
And PNG24 will be rounded much better with js/css than PNG8 that would be pixelated.

So, I'd like to use PNG24.

I wait your final response about this last point and then I can start this new project.

Please let me know and if all is fine for you, please write "OK. YOU CAN START" at the end of your message.

I stay tuned.

Ciao!
From: Max Smirnov (SMIRNOV)
8 Oct 2017   [#674] In reply to [#673]
Hi Marco

>>A PNG8 is limited to 256 palette entries, while a PNG24 can have 16 million different colors.
Yes, I know :) 256 colors will be enough for a flat design icon, and png8 about 30% smaller than png24.
Each 64x64x24bit icon will be about 2kB in base64.
But at the moment it doesn't matter.
Let's make png24 icons.

:))
OK. YOU CAN START
From: mkdm
8 Oct 2017   [#675] In reply to [#674]
Perfect! Thanks.

I will create the very first icon and for the moment I will put it into your example code, just to see how things go.
Then I will show you the result and if all will be fine I will create all other icons, coded in Base64 and placed into a specific node file.

We'll catch up :)

Ciao!
From: Mike (MGG942)
8 Oct 2017   [#676]
Stuck.

I'm trying to run 0.97 in Windows 10 latest version.

Node Editor comes up OK with all the normal buttons New, Load, Save, Apply Run, Step.

And all is well if I load the attached file strainer 01.nod


But, when I load either strainer 02.nod or strainer 03.nod all the buttons are blanked out except New, and Load.

I suspect that I've created this problem by trying to use the RMB copy and paste function with the Macro feature the wrong way.

Anyway out of this mess outside of starting again?

And is there a specific order order in which the RMB copy/paste/macro system should be used?

Mike.

EDIT.
Tried strianer 03.nod in 0.96 no good.
Tried in 0.95, buttons back so could run and save. Saved with new name but still no good when loaded into 0.97. No Run, no Save.

Attachments:
strainer 01.nod
strainer 02.nod
strainer 03.nod


From: Max Smirnov (SMIRNOV)
9 Oct 2017   [#677] In reply to [#676]
Hi Mike

Nodeeditor blocks Save/Load/Run function when you load nod-file with missed nodes.
02 and 03 contains PatternSelArray node. Install extension file with this node or remove it.
From: Karsten (KMRQUS)
9 Oct 2017   [#678]
Hello Max,

small bug in Logic/Compare a<>b should a!==b.

Thanks in advance!

Have a nice day
Karsten
From: Max Smirnov (SMIRNOV)
9 Oct 2017   [#679] In reply to [#678]
Hi Karsten,

<> is most common sign, so it's OK.

Show messages:  1-19  …  600-619  620-639  640-659  660-679  680-699  700-719  720-739  …  900-912