Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
There is a method that will turn smoothing on or off but I do not believe there is one to set the crease angle.
A solution would be to do it via a pose file in the format as below:-
Code:
<pre class="alt2" dir="ltr" style="border-right:1px inset;padding-right:6px;border-top:1px inset;padding-left:6px;padding-bottom:6px;margin:0px;border-left:1px inset;width:640px;padding-top:6px;border-bottom:1px inset;height:130px;text-align:left;">
{
actor abdomen:1
{
creaseAngle 40
}
}
You could write the script to prompt the user for a value then have it write the pose file and apply it.
That should work! Thanks, Phil. Never would have thought to do that on my own.
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
Quote - There is a method that will turn smoothing on or off but I do not believe there is one to set the crease angle.
A solution would be to do it via a pose file in the format as below:-
Code:
<pre class="alt2" dir="ltr" style="border:1px inset;margin:0px;padding:6px;width:640px;height:130px;text-align:left;"> { actor abdomen:1 { creaseAngle 40 } }
You could write the script to prompt the user for a value then have it write the pose file and apply it.
Phil,
I can't seem to get a pose file that works. Every time I add "crease angle" to the pose, it tells me that it's not a valid poser file. Is crease angle something that you can change with a pose? If you have a pose file -- ANY pose file -- with a correct reference to this, I'd love to see an example.
Karen
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
That works. I must have had some sort of syntax issue.
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
Thanks for your help. The final result is here: http://www.karibousboutique.com/shares/setcreaseangle.zip
Works like a charm!
Karen :)
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
Cool you are apparently putting my Python manual to good use :)
However if you open temp.pz2 in a text editor you'll see where you are not quite right yet.
Change line 23 to:-
for actor in figure.Actors():
and in line 29 change currentActorName to actor.InternalName()
Hope that helps.
Quote - Cool you are apparently putting my Python manual to good use :)
However if you open temp.pz2 in a text editor you'll see where you are not quite right yet.
Change line 23 to:-
for actor in figure.Actors():and in line 29 change currentActorName to actor.InternalName()
Hope that helps.
Thank you for the help!! And yes, the manual is a HUGE help! (You should go to lulu.com and offer it for sale in a bound version. I've got mine printed in a binder, but a bound hardcover would be awesome!)
The currentActorName is a variable that I defined earlier with actor.InternalName. (See line 9)
currentActorName = scene.CurrentActor().InternalName()
(I figured out the need for the internal name the hard way -- when the script ran but didn't change anything, LOL!) And you're right about the end bracket. I'll fix that.
As for line 23... So, the "for actor in figure.Actors()" can replace the counter I set up? (Am I in the right spot? I edit in notepad, so no line numbers!) Cool.
Thanks for your help!!
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
Quote -
The currentActorName is a variable that I defined earlier with actor.InternalName. (See line 9)
currentActorName = scene.CurrentActor().InternalName()
And now I understand... Since it was defined in line 9... it uses the same name defined at the start of the program.
I defer to your Python Greatness. :)
Thanks again!
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
Phil, I've tweaked and updated. (Script looks a tad different now because I poked around with it so much.) It works, but not quite the way I want it to work. If I use the "for actor in figure.Actors():" line as suggested, it goes through EVERY actor and writes a pose file that includes deformers, etc. I can't get it to only work for ONLY bodypart actors. If I leave the bodypart counter in, then my pose file does, indeed, have the correct number of body part lines in it -- but they all read the current actor. The file has been updated at the previous link's location. At your leisure, if you can offer a suggestion, I'd be very grateful. (I'm cross-eyed from staring at the darn thing for so long!)
Thanks.
Karen
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
Try:-
for actor in figure.Actors():<br></br>
if actor.IsBodyPart():<br></br>
# do-stuff #<br></br>
else:<br></br>
pass<br></br>
In the copy of the script that you posted earlier you have the test for body part first so that providing that the current actor is a body part then the pose file will get written for everything. Conversely if you test each actor you can be selective.
I swear, I THOUGHT I already tried that... But I just did exactly what you wrote, and Voila! Perfect.
Thanks, Phil!!
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
I'm trying to alter the crease angle (for poly smoothing) with a python script. I don't see a "SetCreaseAngle()" method in any of the manuals or documentation, so should I assume it doesn't exist? If it doesn't, is there anything else I can do to change this property? It's in the properties tab, not in the parameters tab. I'm stumped.
Intel Core i7-8700 6-Core 3.2 GHz (4.6 GHz Turbo), 32GB RAM, two GeForce GTX 1080 Ti GPUs
DS 4.10, Photoshop CC and CS6, Poser 11 Pro, Vue 2016, CarraraPro 64bit, Autodesk Inventor, Mudbox, and 3DS Max
One in 68 children is diagnosed with autism. One is mine. ♥