[Closed] 'name' undefined
Hi all,
I am new to scripting. I used the MacroRecorder and listener to record the script of the actions I did and saved it. When I tried to run the script I got the error, ’
unknown property: “name: in undefined’
What does this mean and how do I fix it?
What I was hoping to do was set up a basic MrDaylight system the way I usually do for architecture projects and make it all run from the script instead of always having to manually do it.
Any ideas? Sorry if this is a stupid question…like I said…I am new to scripting.
Hey Andrew I’d be happy to help but there is list of things wrong with the code you posted.
The name is one of a few problems here
$Sun002.name = "Sun001"
macros.run "Render" "Exposure_Control"
SceneExposureControl.exposureControl.preset = 0 -- if you are using Exposure Value you don't need to set the iso, f-stop or the shutter speed do you?
SceneExposureControl.exposureControl.exposure_value = 15
SceneExposureControl.exposureControl.film_isoUI = 100
SceneExposureControl.exposureControl.f_stop = 8
SceneExposureControl.exposureControl.shutter_speed = 512
Why don’t you reset max and make a scene from scratch so you don’t have to rename things like the sun above and send me the file and I’ll write the code for you. petluke@gmail.com
go thru the code you recorded and wherever $ sign is encountered, or wherever there is a specific referecne to an object, replace with the current scene obj or light or whatever it is. Try to understand what it is the nacrorecorder is describing. By the way, learn maxscript raher than copy paste code from the recorder…that’s what you’ll have to do eventually if yu want to do moree tham just rudimentary tasks
Here is the code. I know I need learn writing code from scratch…I’m just at very beginning stage though so I don’t know where to really start. Thanks everybody for the help.
Code for creating daylight system:
$Sun002.name = “Sun001”
$Sky003.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky003.PerezDirectNormalIlluminanceUI = 929.03
$Sky003.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky003.CIEDirectNormalIlluminanceUI = 929.03
$Sky003.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky003.PerezDirectNormalIlluminanceUI = 929.03
$Sky003.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky003.CIEDirectNormalIlluminanceUI = 929.03
$Sky003.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky003.PerezDirectNormalIlluminanceUI = 929.03
$Sky003.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky003.CIEDirectNormalIlluminanceUI = 929.03
$Sky003.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky003.PerezDirectNormalIlluminanceUI = 929.03
$Sky003.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky003.CIEDirectNormalIlluminanceUI = 929.03
$Sky003.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky003.PerezDirectNormalIlluminanceUI = 929.03
$Sky003.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky003.CIEDirectNormalIlluminanceUI = 929.03
$Sky003.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky003.PerezDirectNormalIlluminanceUI = 929.03
$Sky003.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky003.CIEDirectNormalIlluminanceUI = 929.03
$Sky003.name = “Sky002”
select #($Sky002, $Daylight001, $Sun001)
$Sky002.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky002.PerezDirectNormalIlluminanceUI = 929.03
$Sky002.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky002.CIEDirectNormalIlluminanceUI = 929.03
$Sky002.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky002.PerezDirectNormalIlluminanceUI = 929.03
$Sky002.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky002.CIEDirectNormalIlluminanceUI = 929.03
$Daylight001.name = “DAYLIGHTSYSTEM”
select $Compass001
$.name = “COMPASS”
clearSelection()
select #($Sun001, $DAYLIGHTSYSTEM, $Sky002)
$Sky002.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky002.PerezDirectNormalIlluminanceUI = 929.03
$Sky002.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky002.CIEDirectNormalIlluminanceUI = 929.03
$Sky002.PerezDiffuseHorizIlluminanceUI = 929.03
$Sky002.PerezDirectNormalIlluminanceUI = 929.03
$Sky002.CIEDiffuseHorizIlluminanceUI = 929.03
$Sky002.CIEDirectNormalIlluminanceUI = 929.03
macros.run “Render” “Exposure_Control”
SceneExposureControl.exposureControl.preset = 0
SceneExposureControl.exposureControl.exposure_value = 15
SceneExposureControl.exposureControl.film_isoUI = 100
SceneExposureControl.exposureControl.f_stop = 8
SceneExposureControl.exposureControl.shutter_speed = 512
Plane length:170.302 width:299.768 pos:[4.40836,1.39211,0] isSelected:on
actionMan.executeAction 0 “50013” – Tools: Zoom Mode
Sphere radius:10.9517 smooth:on segs:32 chop:0 slice:off sliceFrom:0 sliceTo:0 mapcoords:on recenter:off pos:[28.0742,15.0812,0] isSelected:on
move $ [0,-16.2616,0]
move $ [-8.83768,0,0]
select $Plane001
actionMan.executeAction 0 “40020” – Edit: Delete Objects
delete $
select $Sphere001
actionMan.executeAction 0 “40020” – Edit: Delete Objects
delete $
move $ [0,-16.2616,0]
move $ [-8.83768,0,0]
delete $Plane001
delete $Sphere001
-- select $Plane001
-- actionMan.executeAction 0 "40020" -- Edit: Delete Objects
-- delete $
-- select $Sphere001
-- actionMan.executeAction 0 "40020" -- Edit: Delete Objects
-- delete $