Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
It's there. parm.SetHidden(1) hides the dial; parm.SetHidden(0) shows the dial. Look at my UnhideXYZ script for an example. ockhamsbungalow.com/python/UnhideXYZ.ZIP
My python page
My ShareCG freebies
Oh! Hiding body parts on the menu! I never considered that before, and I don't see any way to do it internally. Your new PZ2 approach is probably the best way. Python could write and load a PZ2 to fit a specific need, but that seems a bit wasteful when the user can just load a PZ2!
My python page
My ShareCG freebies
Yes, but the PZ2 are coded with the body part names. So I have to make a PZ2 for every figure type. For characters, it's quite easy : they all have fingers. But for some other figures, say EasyPose tentacles (no, no connections to nakked vickies intended...), it might be useful to select a body part and hide its children. Well, if you thinks it cannot be done, it cannot be done. Another question : I have made a procedure to convert V3 clothes to V2. It involves applying a preset pose, then another pose (to change the centers), then a set of magnets. Could this all be made into one python script ? And still another, related question : when all these magnets are applied, I have to select each body part whose geometry is modified, spawn a new morph, then delete the magnets, and make all these new morphs into a Full Body Morph. Could this procedure be automated ? Thanks in advance for your help (I'm absolutely not experienced enough in Python to try and do these procedures by myself...).
1st question: ".....it might be useful to select a body part and hide its children......." Yes, that would be a useful general trick. And it could be done by the indirect method; Python writes the PZ2 then loads it. I'll work on this. (I already have PZ2-writing actions in Python, so it shouldn't be hard to specialize.) 2nd question: If the magnets are contained in a PZ2, this would be easy. Just combine three steps into one. If the magnets need to be set "visually", then difficult or impossible. 3rd question: I don't see any way to do FBM in Python directly. There must be some way to get the same effect; I think it will require storing the state of the entire OBJ first, and then computing deltas after deformation.
My python page
My ShareCG freebies
Can the mags be described numerically? Do you know in advance that Mag 1 goes on the left shoulder, with scale .3, yrot 40, etc? If the mags are "constant" in that sense, Python could do the three things in order. (set centers, apply pose, apply mags.) Obviously I'm not seeing the big picture here.....
My python page
My ShareCG freebies
Yes, the mags are "constant". I apply a pose so that I align the dress with the figure, Then I apply the centers Then I apply the magnets, as a full set in a cr2. I think it would be better to make a python script just to call the 3 files (2 pz2 and one cr2 or pp2) rather than having Python create magnets : I have made magnets for every possible bodypart, but there might be some body part that is missing in th dress. So can Python call, in a predefined sequence, 2 poses and a cr2 to be applied to a dress already selected in the scene ?
Yes, that part is easy! Assume the poses are P1.PZ2 and P2.PZ2 in the folder CompilerPose, and the figure is C1.CR2 in the folder CompilerFig. ------------------------------ import poser import os scene=poser.Scene() BasePathUncut=poser.AppLocation() BP=BasePathUncut[:(-len('poser.exe'))] Pose1=os.path.normpath(BP+'/Runtime/Libraries/pose/CompilerPose/P1.PZ2') Pose2=os.path.normpath(BP+'/Runtime/Libraries/pose/CompilerPose/P2.PZ2') Fig1=os.path.normpath(BP+'/Runtime/Libraries/character/CompilerFig/C1.CR2') scene.LoadLibraryPose(Pose1) scene.LoadLibraryPose(Pose2) scene.LoadLibraryFigure(Fig1)
My python page
My ShareCG freebies
Thank you so very much for this script. I would never have thought to check for the os !!! I'd have a final request, if it's possible : Is there a way to 1-check each part of the dress I just modified with the magnets 2-set the morphs to 0 (and also the dials related to already existing magnets in the dress before the one I added) 3-spawn for each a new morph target, called "conversion" for instance 4-delete all the magnets (save those that were already present) 5-set all the "conversion" morphs to 1 (and also all the dials related to already existing magnets in the dress before the one I added) I know that the parts between the () would be quite tricky to make (I have no idea how I would do this), but even without these parts, it would be great to have the rest. Thanks again for your help. sylvain
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 liked Ockham's "make part and its children invisible" script a lot. Now I would like to modify it to make the children (and not the selected part) "hidden" and not "invisible". I did not find a method to access this parameter in the PoserPython manual. Does anyone know if a method exists to access the "hidden" parameter of a body part ? Thanks in advance.