I was looking for an octane alternative to modos variation texture in item mode. Here is a script that assigns a weightmap with unique values to selected meshes. You can then use these with a greyscale vertex attribute texture in octane.
Code: Select all
# python
import lx
selected_items = lxu.select.ItemSelection().current()
x = 0
for item in selected_items:
item_name = item.UniqueName()
try:
weight = x/(len(selected_items)-1)
except:
weight = 0
lx.eval('select.drop item')
lx.eval('select.subItem %s set mesh'%item_name)
lx.eval('!vertMap.new Weight wght value:%f' %weight)
print("Item Name: "+item_name + " Assigned Weight: " + str(weight))
x = x+1
print("Processed Items: "+str(len(selected_items)))
Here is an alternative script that assigns a random seed value to each mesh. It's possible to use that with the random color texture in Octane. Thanks to funk for pointing that out.
Code: Select all
# python
import lx
selected_items = lxu.select.ItemSelection().current()
seed = 0
for item in selected_items:
item_name = item.UniqueName()
lx.eval('select.drop item')
lx.eval('select.subItem %s set mesh'%item_name)
try:
lx.eval('item.channel oc_randomSeed %i'%seed)
except:
print("no randomSeed available")
print("Item Name: "+item_name + " Assigned Seed: " + str(seed))
seed += 1
print("Processed Items: "+str(len(selected_items)))
I hope this is useful to someone.