import os
import poser # get poser
reset = False # set reparent variable
scene = poser.Scene() # define scene
actor = scene.CurrentActor() # get the actor
if len( actor.Materials() ) > 0: # make sure the actor has materials
if actor.IsProp(): # is this actor a prop?
if actor.Parent().Name() == "UNIVERSE": # is this actor parented?
actor.SetParent( scene.Actor("GROUND") ) # set actor parent
reset = True # inform script we need to reparent prop
material = actor.Materials()[0] # get actors preview material
material.LoadMaterialSet(
os.path.join(poser.TempLocation(), "test.mt5" )) # load material
if reset:
actor.SetParent( scene.Actor( "UNIVERSE") ) # if we need to reparent - do so
scene.DrawAll()