Here's the finished path extrusion script. There are two GUIs, so it will run in both Poser 8+ (as wx) and Poser 7 and below (as Tk). Capped ends, flattening along relative axes, and the option for a closed path have all been added. The script no longer uses the scene callback and seems to be stable.
Basic instructions, also at the top of the script:
Use:
- Run the script.
- Press "Add marker" to create a path marker.
- Translate each marker as desired. Place at path transition points.
- Place multiple markers (at least 3) close together to specify a sharper transition.
- Each marker will point at the previous one. This is for display purposes only. Marker rotation has no effect on the final path.
- Set "Spline type (0,1,2)" to define the type of spline used for the path.
0 = NaturalCubicSpline ---> smooth path
1 = Polyline ---> straight lines, sharp corners
2 = BlendedQuadraticSpline ---> similar to 0, with different handling of ends
- Set "Keep markers" to any non-zero value to retain the marker props at the end of a script run.
- Set "Close path" to any non-zero value to create a loop instead of an open-ended tube.
- "Flatten X" and "Flatten Z" can be set to non-zero values, to squash or stretch the tube along its relative X and/or Z axes.
- Negative values will squash the tube; positive values will stretch.
- "Flatten dot value" specifies the angle of inclusion for Flatten (as a dot product result). 0.0 = 180 degrees of inclusion; 1.0 = only vertices which are aligned with the axis.
- The "Flatten smooth reps" can be set to specify an amount of smoothing to apply to the flattening results.
- Examples:
A broad, flat tube:
Flatten Z = -0.3
Flatten X = 2.0
Flatten dot value = 0.9
Flatten smooth reps = 3
An indented tube, similar to an electrical cord:
Sections = 20 (for adequate resolution)
Flatten Z = -1.0
Flatten X = 1.0
Flatten dot value = 0.9
Flatten smooth reps = 3
- The other options work the same as those for the loop-making script.
- When the markers are placed, move the "RUN SCRIPT" dial. The tube will be created.
- Move "END SCRIPT" to quit.
Notes:
- Some functions and classes below are adapted from various sources online. See function notes for details.
===========================sigline======================================================
Cage can be an opinionated jerk who posts without thinking. He
apologizes for this. He's honestly not trying to be a
turkeyhead.
Cage had some freebies, compatible with Poser 11 and below. His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.