MoI discussion forum
MoI discussion forum

Full Version: Majik Primer: MoI's Lighting Options and You!

Show messages:  1-6  7-26  27-46  47-66  67-69

From: Michael Gibson
29 Jun 2012   [#7] In reply to [#6]
Hi Mike,

> Future modes and UI settings, now I'm really excited! :-) We may yet get Zebras!

Yup, at least I think that is a good plan for where Zebra could go.

Also I'd like for each mode to be able to override more than just the lighting, like be able to temporarily override style colors so that you could switch everything to a "Shiny blue" mode for just a minute to look at things and then back to regular display again.

- Michael
From: BurrMan
29 Jun 2012   [#8] In reply to [#7]
Nice Mike.

Michael, is there a script option that can be tucked into those scripts Mike just made that would have them "toggle"... So a return to default?
From: Michael Gibson
29 Jun 2012   [#9] In reply to [#8]
Hi Burr,

> Michael, is there a script option that can be tucked into those scripts Mike just made
> that would have them "toggle"... So a return to default?

Yup, that's possible, here's a script that will do that:

script: /* Toggle lighting options */ var settings = { lightingStyle: 'Default', specularHighlights: true, specularBrightness: 0.5, specularFocusSize: 0.5, metallicLighting: true, fixedLightPositions: false }; for ( var propname in settings ) { var val = ''; try { val = moi.command.getOption( 'ls_' + propname ); } catch(e) {} if ( val !== '' ) { moi.view[propname] = val; val = ''; } else { val = moi.view[propname]; moi.view[propname] = settings[propname]; } moi.command.setOption( 'ls_' + propname, val ); }


The settings come from the chunk that says: var settings = { lightingStyle: 'Default', specularHighlights: true, ... } To make a new batch of settings change just the value to the right of the : like if you want it to have no specular highlights make that part say specularHighlights: false

This will only toggle things within the same program session - don't exit MoI with it set to the alternate state or else that will get saved as your new default at exit time and so you won't be able to toggle it back to the old default when you launch next time.

- Michael
From: Mike K4ICY (MAJIKMIKE)
29 Jun 2012   [#10]
That's convenient Michael,

The approach I used was to take all 12 custom settings above, and I programmed them as Alt+F1 - Alt+F12, since I had no designation for any Alt keys using the 'F' keys.

Now, I've been having a little fun selecting each lighting mode like a buffet.

F1 would be my 'good ol' trusty'.


I may implement a portion to my scripts that tells me at the bottom, what custom mode it is. As I kind of forgot what each was.
Your proposed quick button thingies will certainly allow for easier selection.
From: Mike K4ICY (MAJIKMIKE)
30 Jun 2012   [#11]
Thanks Phlatt5th!

Download here:


http://moi3d.com/forum/get_attachment.php?webtag=MOI&hash=8a6a02426a8fd81b41eda15ea9a6f97e&filename=Moi3D_Lighting%20options_Scripts.pdf


for a handy .PDF reference containing the above Lighting Options examples.
From: Frenchy Pilou (PILOU)
30 Jun 2012   [#12]
Just a trivial question :)
On what key press for "Toggle" the Michael Script above, the key of the Shortcut choosen?
From: Michael Gibson
30 Jun 2012   [#13] In reply to [#12]
Hi Pilou,

> On what key press for "Toggle" the Michael Script above, the key of the Shortcut choosen?

Yup, it's whatever key you set the shortcut to be on (the key you put in the left-hand "Key" column for the shortcut).

Then when you push the shortcut one time it will change to that particular lighting style, when you push the same shortcut key a second time it will switch back to the default lighting.

- Michael
From: Frenchy Pilou (PILOU)
30 Jun 2012   [#14] In reply to [#13]
Ok

This script take only one more than the default ?
Or the 12 above by mike ?
From: Michael Gibson
30 Jun 2012   [#15] In reply to [#14]
Hi Pilou,

> This script take only one more than the default ?
> Or the 12 above by mike ?

The script that I posted above just takes one particular group of settings, you can set it to any one of the 12 that Mike has shown above. Then when you trigger it, it will switch between that mode and back to the default mode again when you trigger it a second time.

- Michael
From: Frenchy Pilou (PILOU)
30 Jun 2012   [#16] In reply to [#15]
No possibility to chain the 12 in one line?
From: Michael Gibson
30 Jun 2012   [#17] In reply to [#16]
Hi Pilou,

> No possibility to chain the 12 in one line?

It would be possible - it would need a bigger script with all the various settings in it of course.

Instead of investing the time writing a big script like that I'd rather wait until I can focus more properly on making a UI based control for switching different modes, a single enormous script is kind of hacky.

It would be generally similar to that existing one if you wanted to work on coding one though!

- Michael
From: Frenchy Pilou (PILOU)
30 Jun 2012   [#18] In reply to [#17]
No problem
It was just by curiosity :)
From: Denis (SPACELAND)
30 Jun 2012   [#19]
Thank you Majik.

Very handy indeed.
From: Mike K4ICY (MAJIKMIKE)
30 Jun 2012   [#20] In reply to [#19]
;-)
From: Mike K4ICY (MAJIKMIKE)
1 Jul 2012   [#21]
A small render for a Mason jar model:



For that extra bit of inspiration, I modeled it while my lighting options were set for the "Glass" presets.


From: bigseb
1 Jul 2012   [#22]
Awesome thread!!

+1
From: WillBellJr
2 Jul 2012   [#23]
Thanks so much Mike for this - this is awesome!

Makes me wish there was a dropdown comboxbox in the lighting config section where you can save each setting with a name that adds to the combobox list. This way you could enter all those params, click a save button and enter a name, later you can recall those settings by selecting the name in the dropdown list!

Either way, great tips - I like the fact the settings are right in the images as well!

-Will
From: Mike K4ICY (MAJIKMIKE)
2 Jul 2012   [#24] In reply to [#23]
Well, you're quite welcome Will!

Michael has stated plans to consider some sort of enhancement like that in the future. ....maybe with Zebras. ;-)

For now, programming a custom keyboard shortcut for your favorite setup is quite effective.

This primer was also intended to give MoI users the knowledge to customize their own favorite lighting schemes as well.

And if anyone reading this post in the future comes up with a nice one, feel free to post a pic with settings as well.
From: dinos
9 Nov 2012   [#25]
Hi Mike.

Reading your excellent Detergent Bottle tutorial reminded me of this thread.
I've always wanted a way to use the lighting settings you created here, preferably through a nice dropdown list.



This is the result. Its called Lighting Themes, for lack of a better name.
It was tested on the latest Moi beta, and it works fine. It should work on anything over V2.0, but it wasn't tested.

To use it you will need to copy the LightingTheme.htm file from the zip to your ui folder.
BEFORE you try the script please take a minute to change the first set of settings in the LightingTheme.htm file called: Default to your current lighting settings.
Otherwise your current settings will be lost.

Here is the relevant part:

code:
Default: {
	lightingStyle: 'Default',
	specularHighlights: true,
	specularBrightness: 0.28,
	specularFocusSize: 2.00,
	metallicLighting: false,
	fixedLightPositions: true,
	customKeyLightLevel: 0.0,
	customFillLightLevel: 0.0
},




Then add a shortcut:
code:
script:moi.ui.createDialog( 'moi://ui/LightingTheme.htm' );


Thats it.

You can define as many themes/lighting settings as you like. It should be fairly easy if you study the LightingTheme.htm file for a bit.


Enjoy :-)

Attachments:
LightingTheme.zip

Image Attachments:
screenshot.jpg 


From: Mike K4ICY (MAJIKMIKE)
9 Nov 2012   [#26] In reply to [#25]
You're amazing Dinos!! :-)

I can't wait to try it out.
This means I can try more out and not have to remember shortcut keys.


Michael,

I believe that you were considering some kind of quick buttons or some UI setting tool that would stream line our UI tweaks, along with maybe zebras and such. I can't wait.

Show messages:  1-6  7-26  27-46  47-66  67-69