Author Topic: Maxscript question  (Read 7588 times)

2015-03-03, 22:32:17

ce89

  • Active Users
  • **
  • Posts: 11
    • View Profile
How do I gain access to the properties of certain render elements via maxscript. I would like to write a script that adds the render element "CShading_RawComponent" but sets it's component to use "Reflect" instead of the default "Diffuse".

Can anyone point me in the write direction. Is there a maxscript function that can expose all the properties of all the corona elements?

Also I tried to login to the "https://corona-renderer.com/wiki" but it seems like a different login and i cant see where i can actually register?

Thanks.

2015-03-03, 22:57:10
Reply #1

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
its properties can be accessed via maxscript (but I dont know how exactly, there is probably some global variable for it).

There is no need to log in the wiki, you can read everything there is without logging in.
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2015-03-03, 22:58:42
Reply #2

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
You can simply type;
Code: [Select]
show (CShading_RawComponent())This will print out all properties in the listener

To print out all REs you can use this:
Code: [Select]
(
REs = stringstream ""
apropos "*ESSENTIAL*" to:REs
apropos "*CGeometry*" to:REs
apropos "*CMasking*" to:REs
apropos "*CShading*" to:REs
apropos "CTexmap" to:REs

elems = filterstring (REs as string) "\n"
classnames = for i in elems collect (filterstring i " ")[1]
for i in classnames do(
format "----------------------\n"
format (i + "\n")
show (execute (i + "()"))
)
)
Any sufficiently advanced bug is indistinguishable from a feature.

2015-03-03, 23:20:38
Reply #3

ce89

  • Active Users
  • **
  • Posts: 11
    • View Profile
DeadClown,

Many thanks, Much appreciated.

2015-03-15, 20:10:42
Reply #4

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Sorry for bombing this topic, i have a small question that's not worth new topic creation.

I want to make a button that simply creates Corona Sun and Sky. With the help of macrorecorder i managed to achieve Sun object's creation, but Sky isn't catched by macrorecorder unfortunatelly. Should someone kindly provide script code for that, i'd be very thankful.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-03-15, 20:28:03
Reply #5

ecximer

  • Active Users
  • **
  • Posts: 286
  • Scriptobot
    • View Profile
parameters to taste
Code: [Select]
macroscript Corona_Sun_and_Sky category:"corona" tooltip:"Create Sun&Sky" (
coronasun isstandalone:true
environmentmap = coronasky name:"CoronaEnvSky"
)
sorry for my english

2015-03-15, 23:15:47
Reply #6

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Thanks a lot!

If i'm not asking too much, is it possible to add sky to Corona's enviroment and to set global exposure to -4.0.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-03-16, 10:11:32
Reply #7

oncire

  • Active Users
  • **
  • Posts: 59
    • View Profile
Thanks a lot!

If i'm not asking too much, is it possible to add sky to Corona's enviroment and to set global exposure to -4.0.

here...

Code: [Select]
environmentMap = coronasky()
renderers.current.colorMap_simpleExposure = -4

2015-03-16, 11:31:24
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Thank you. Actually i want to add CoronaSky to Corona enviroment. I execute this code:
Code: [Select]
renderers.current.bg_texmapUseMain = on
renderers.current.bg_texmap = coronasky name:"EnvMap"
and it creates Sky map, but do not changes enviroment from max's to Corona's. What i'm doing wrong?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-03-16, 13:09:40
Reply #9

oncire

  • Active Users
  • **
  • Posts: 59
    • View Profile
Thank you. Actually i want to add CoronaSky to Corona enviroment. I execute this code:
Code: [Select]
renderers.current.bg_texmapUseMain = on
renderers.current.bg_texmap = coronasky name:"EnvMap"
and it creates Sky map, but do not changes enviroment from max's to Corona's. What i'm doing wrong?

you miss one line of code...

Code: [Select]
renderers.current.bg_texmapUseMain = on
renderers.current.bg_texmap = coronasky name:"EnvMap"
renderers.current.bg_source = 1

2015-03-16, 13:17:25
Reply #10

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
That's it! Thank you very much!
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-03-16, 15:00:54
Reply #11

naikku

  • Active Users
  • **
  • Posts: 167
    • View Profile
I dont know anything about coding these Scripts, could you save´n´share a script-file containing
the automatic load for Corona Sky, enviroment and why not that EV -4 also :)

2015-03-16, 15:20:52
Reply #12

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8856
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Neither do i, but everything you need is in this topic. Just collect all lines of code into one file and you should be fine :]

Alternatively you can drag&drop attached file to max's viewport and make a button via customize user interface.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2015-03-16, 16:04:06
Reply #13

oncire

  • Active Users
  • **
  • Posts: 59
    • View Profile
That's it! Thank you very much!
glad to be of help...

2015-03-26, 21:50:28
Reply #14

ce89

  • Active Users
  • **
  • Posts: 11
    • View Profile
Again like above i'm not sure if it's worth starting another thread, also keeps a number of maxscript questions together.

Just a quick one really. Is there a function for starting interactive rendering? I would like to create my own dialogue and this is a function I would like to add.

Many thanks