Scripting: finding values of Custom Parameters 2005-02-04 - By Denis-Jose Francois
Back Hi Folks
Here is the situation:
I am having trouble determining if a custom parameter exists on a particular object (in this case, a polymesh).
As I have a script which is intended to run over many and varied objects looking for these particular parameters, I do not wish to hard code them into the script.
The CustomPSet will be consistently named however, and I am able to find this with no problem.
The following piece of code will add a custom parameter to any object or selection of objects:
'begin code-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- ---- ---- --->8
MySel = GetValue("SelectionList") Set MyCol = CreateObject("XSI.Collection") MyCol.setastext MySel
for each elem in MyCol element = elem.Parent & "." & elem.Name SelectObj element
AddProp "Custom_parameter_list", , , "lightscape_surface_properties" SIAddCustomParameter element, "surface", siDouble, 1, 0.04, 10, , 4, 0.04, 10 SIAddCustomParameter element, "Occluding", siBool, 1, 0, 1, , 4, 0, 1 next
DeselectAll
for each elem in MyCol element = elem.Parent & "." & elem.Name AddToSelection element next
'end code-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- ---- ---- --->8
Once the properties of the custom parameter have been modified, I need to have another script read back the properties from all objects that have this parameter set. This means it has to trawl through all of the items in the scene *and first determine if the parameter has been applied*. Then read back the current settings.
Any thoughts?
Mark Ludford Fallen Angels
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|