Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: ce89 on 2015-03-03, 22:32:17

Title: Maxscript question
Post by: ce89 on 2015-03-03, 22:32:17
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.
Title: Re: Maxscript question
Post by: Ondra on 2015-03-03, 22:57:10
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.
Title: Re: Maxscript question
Post by: racoonart on 2015-03-03, 22:58:42
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 + "()"))
)
)
Title: Re: Maxscript question
Post by: ce89 on 2015-03-03, 23:20:38
DeadClown,

Many thanks, Much appreciated.
Title: Re: Maxscript question
Post by: romullus on 2015-03-15, 20:10:42
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.
Title: Re: Maxscript question
Post by: ecximer on 2015-03-15, 20:28:03
parameters to taste
Code: [Select]
macroscript Corona_Sun_and_Sky category:"corona" tooltip:"Create Sun&Sky" (
coronasun isstandalone:true
environmentmap = coronasky name:"CoronaEnvSky"
)
Title: Re: Maxscript question
Post by: romullus on 2015-03-15, 23:15:47
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.
Title: Re: Maxscript question
Post by: oncire on 2015-03-16, 10:11:32
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
Title: Re: Maxscript question
Post by: romullus on 2015-03-16, 11:31:24
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?
Title: Re: Maxscript question
Post by: oncire on 2015-03-16, 13:09:40
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
Title: Re: Maxscript question
Post by: romullus on 2015-03-16, 13:17:25
That's it! Thank you very much!
Title: Re: Maxscript question
Post by: naikku on 2015-03-16, 15:00:54
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 :)
Title: Re: Maxscript question
Post by: romullus on 2015-03-16, 15:20:52
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.
Title: Re: Maxscript question
Post by: oncire on 2015-03-16, 16:04:06
That's it! Thank you very much!
glad to be of help...
Title: Re: Maxscript question
Post by: ce89 on 2015-03-26, 21:50:28
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
Title: Re: Maxscript question
Post by: Stan_But on 2015-03-26, 23:54:10
Code: [Select]
CoronaRenderer.CoronaFp.startInteractive()
Title: Re: Maxscript question
Post by: ce89 on 2015-03-27, 08:22:06
Thanks Headoff, much appreciated!