When you’re using Get Closest Locations, positions are local. That is, they are relative to the local coordinate system of the object that “owns” the ICE tree. The input Position is in local coordinates, so in most cases, (0, 0, 0) will do fine. And if you use the output locations to get positions, those positions will be in the local coordinate system of the ICE tree owner.
Hat tip: Gray, who has posted this several (many?) times over the years.
Given something like this:
Here’s how you get all shaders under a light, even the disconnected ones:
from sipyutils import si # win32com.client.Dispatch('XSI.Application')
from sipyutils import log # LogMessage
from sipyutils import C # win32com.client.constants
from sipyutils import disp # win32com.client.Dispatch
si = si()
def dispFix( badDispatch ):
# Re-Wraps a bad dispatch into a working one:
oLight = si.Selection(0)
oDisconnected = disp( "XSI.Collection" )
if oLight.IsClassOf( C.siLightID ):
for oShader in oLight.GetAllShaders():
oOut = dispFix( oShader.Parameters( "out" ) )
if oOut.Targets.Count == 0:
oDisconnected.Add( oShader )
log( oDisconnected.GetAsText() )
Hat tip: Matt Lind, who provided the GetAllShaders answer to the question “how to get all shaders in a light, even the disconnected ones”
With Arnold, it’s all in the ICE tree. SItoA looks for attribute names like ArnoldLight_intensity and automatically uses those attributes to set the corresponding parameter values on the point_light nodes it exports to Arnold.
Dividing an integer N by itself doesn’t always give you 1.
I think it’s a problem in the Divide by Scalar node (the division is probably returning a scalar like 0.99999999, and then that is truncated to zero when it is converted to an integer).
A workaround is to do all your division with scalars, and then use modulo to determine whether you Round or Floor the result. Here’s an example compound by Guillaume Laforge: