edit selected lights at once

hi all

I need to edit some values of different vray lights, but with light lister it’s not possible to do it for all lights at once…

I need to change http://c2n.me/3ItiqqN.png

is this possible and easy to make? I think I have to do it via maxscript…
has anybody an idea to do it?

thanks in advance.

best regards
themaxxer

This one should do the job:

for each in selection where classof each == VRayLight do
(
each.invisible = on
each.lightDistribution = 1 --directionality
each.size1 = 10 --half width
each.multiplier = 20
each.affect_diffuse = off
each.affect_specualr = off
each.affect_reflections = off
each.color_mode = 1 --temperature
each.color = color 251.15 252.763 255 --temp color
each.color_temperature = 6630.65 --temp value
    )

Just replace the values or states as you wish.

Hi,

You’re right it can be done relatively easily with maxscript especially if you don’t need a floating window with a UI.

Have a look at the code below. It will change four properties of any V-Ray lights selected (half-width, mode, invisible and units). You can add more lines between the parentheses to change more properties at once.```
(
for vrLight in selection where isKindOf vrLight vrayLight do
(
vrLight.size1 = 0.5 --Half-width
vrLight.color_mode = 1 --Mode
vrLight.invisible = true --Invisible
vrLight.normalizeColor = 0 --Units (0 for Default, 1 for Luminous Power, 2 for Luminance)
)
)


Here is a complete list of all the properties that can be changed this way. With some it's obvious which property they relate to, others might require a bit of trial and error.```
on : boolean
  .type : integer
  .targeted : boolean
  .target_distance : worldUnits
  .color_mode : integer
  .color_temperature : float
  .color : RGB color
  .multiplier : float
  .normalizeColor : integer
  .size0 : worldUnits
  .size1 : worldUnits
  .size2 : worldUnits
  .castShadows : boolean
  .doubleSided : boolean
  .invisible : boolean
  .affect_diffuse : boolean
  .diffuse_contribution : float
  .affect_specualr (affect_specular) : boolean
  .specular_contribution : float
  .affect_reflections : boolean
  .ignoreNormals : boolean
  .noDecay : boolean
  .storeWithIrradMap : boolean
  .skylightPortal : boolean
  .simplePortal : boolean
  .subdivs : integer
  .shadowBias : worldUnits
  .cutoffThreshold : float
  .notUsed : integer
  .notUsed : integer
  .smoothSurfaceShadows : boolean
  .texmap : texturemap
  .texmap_on : boolean
  .texmap_resolution : integer
  .texmap_adaptiveness : float
  .texmap_locktodome (Lock_texmap_to_dome_orientation) : integer
  .dome_emitRadius : worldUnits
  .dome_targetRadius : worldUnits
  .dome_spherical : boolean
  .dome_affect_alpha (Affect_alpha) : boolean
  .dome_rayDistanceMode : integer
  .dome_rayDistance : worldUnits
  .dome_visibleOriginal : integer
  .mesh_source : node
  .mesh_replaceOnPick : boolean
  .mesh_flip : boolean
  .lightDistribution : float
  .preview_distribution (type) : integer
  .preview_texmap (texmap_preview) : boolean
  .use_mis : boolean
  .enable_viewport_shading : boolean
  .viewport_wire_color_on : boolean
  .viewport_wire_color : RGB color
  .icon_text : boolean
  .excludeList : node array
  .includeList : node array
  .inclExclType : integer

For batch changing just about everything in max I recommend you use this: Modifier Modifier Zorb | ScriptSpot

man I use zorb for modifiers but have not noticed the other useful options, thank you. :slight_smile:

thank you guys, very helpful and it takes some fear of maxscript away from me… I will use it more often now it seems possible even for me. :slight_smile:

You’re welcome.

It can be frustrating at first as it’s generally intolerant of small typos. If you get stuck just post on here, I’m sure someone will be able to help.

you can use my script as well if you want to.

download version 1.20:
MohseniLightTools_120.zip (334 KB)

thank you mohammadreza, nice script. if you can add the directional parameter and the multiplier options like “units” then it would be very helpful.

There is also Mission Control (http://reformstudios.com/mission-control-for-3ds-max/)
Still in alpha, but workable. If you want to be able to access ALL parameters in ANY kind of object, light, material, etc. this is the next thing.

for sure I will add it in next weekend. thanks for feedback.