Created
July 25, 2016 00:59
-
-
Save jesgs/3d6e5ecfd09d89ba1ba1f0903caf890b to your computer and use it in GitHub Desktop.
Correct LineWidth values for ToonShader nodes for Poser 7 and earlier. Poser versions prior to 8 handled the LineWidth node value differently than Poser 8 and later. This script allows you to batch-correct the line-value, saving the effort of having to click on every single material.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Correct LineWidth values for ToonShader nodes for Poser 7 and earlier | |
# | |
# Poser versions prior to 8 handled the LineWidth node value differently | |
# than Poser 8 and later. This script allows you to batch-correct the line-value, | |
# saving the effort of having to click on every single material. | |
import poser | |
scene = poser.Scene() | |
actor = scene.CurrentActor() | |
mats = actor.Materials() | |
def changeNodeVals(mat, nodeId, lineValue): | |
tree = mat.ShaderTree() | |
root = tree.Node(0) | |
for node in tree.Nodes(): | |
if (node.Type() == poser.kNodeTypeCodeTOON): | |
node.Input(nodeId).SetFloat(lineValue) | |
tree.UpdatePreview() | |
nodeId = 4 | |
fName = poser.DialogTextEntry(None, "Enter value", '') | |
fName.Show() | |
lineValue = float(fName.Text()) | |
for mat in mats: | |
changeNodeVals(mat, nodeId, lineValue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment