Forum: Poser 11 / Poser Pro 11 OFFICIAL Technical


Subject: How do you create a mat pose file for a prop?

davo opened this issue on Aug 25, 2020 ยท 12 posts


structure posted Sat, 29 August 2020 at 11:21 AM Forum Coordinator

this script ( needs modifying ) will allow you to apply an mt5/mz5 to to the preview material on a prop

import os.path
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()

for an mc6/mcz use

    actor.LoadMaterialCollection( file )

How it Works:

it tests the currently selected actor to see if it is a prop and has a parent

if there is no parent ( UNIVERSE will be the parent ) it temporarily parents the prop to the GROUND

after applying the material ( in this case a temporary mat ) if the prop was not parented

it reparents the prop to the UNIVERSE

=========================

Locked Out