Hi all,
I'm updating Lighting Device properties via a script and the changes aren't sticking.
I can see the updated values in the Object Info panel when I click on the objects, but as soon as I refresh the objects, or call vs.ResetObject(), the Object parameters change to what they we're before.
The code below loops over every "Lighting Device" in the document, checks if the channel field matches one stored in a dict, then updates each parameter from the dict.
vs.ForEachObject( update_from_data, "( (PON='LIGHTING DEVICE') )")
def update_from_data(h):
objinfo = vs.GetCustomObjectInfo(h)
recordHandle = vs.GetParametricRecord(h)
recname = vs.GetName(recordHandle)
local_fixnum = vs.GetRField(h, recname, "channel")
local_vwid = vs.GetRField(h, recname, "uid")
if True:
# update by channel
for fixnum in import_fix_list_chan:
if fixnum == local_fixnum:
settings.message_append("TEST PASSED" + str(fixnum) + " " + str(local_fixnum))
set_fixture_data(h,recname,import_fix_list_chan[fixnum])
def set_fixture_data(h, recname, fixdic):
for key, val in fixture.parameters_for_import.items():
if val and key:
#data = getattr(self, key, data)
data = fixdic[key]
settings.message_append("(" + val + " = " + str(data) + ")")
vs.SetRField(h, recname, val, data)