Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Y-Phil posted at 1:27 PM Mon, 30 October 2023 - #2983728
Poser's Material object has a dedicated function: LoadMaterialSet(....) which effectively loads either an MT5 or an MC6 file, which fine.
But I'd like to load an MT5 without removing the existing nodes setup, and this function doesn't seem to have another parameter to control this, as any tests I did with other parameters ended up in an error message "Invalid Spec map" or something like that.
I've been working intensively with Python and the material room in the last few weeks. No, there is no such possibility. This problem is only possible with an extended LoadMaterialSet command. So an add/replace option. But that's a matter for the developers.
Otherwise, you only have the option of loading the nodes somewhere, which you have done, and copying them from there into the target material using a recursive node query. I tried. My brain exploded. What is an additional obstacle is the inability to identify a selected node. This ultimately forces you to make manual changes in the material room. Which I don't think is the point of it.pydoc didn't let me guess any other functions, so that, maybe, there's none.
I had an other idea: create a layer to add the MT5 in, but it looks like a dead end, too.
Thanks in advance.
Greetings
PS: Excuse my bad English. I'm already an older generation. We didn't have English lessons until very late in school. He had left no lasting impression.
The purpose of this script was to ease the upgrade of a character's material. My setups are fairly simple: on the Cycles part, there's a root Cycles node, to which is attached a compound node
How to detect and replace the said compound node: no problems
How to copy-paste a selected node: I think I know how, using the MaterialManager
How to select a specific node: no idea, but I know how to upload a specific MT5, delete any root nodes as these specific nodes don't have such node. Then using the MaterialManager: selectall, then copy, then paste elsewhere
the problem using this steps:
- can't create a new material, and then delete it afterwards
- can create a new layer, but how to load the MT5 in that layer instead of the base layer?
One solution could be to create specific MT5 that are ready-to-load in a specific layer.
I'll check this after my job.
𝒫𝒽𝓎𝓁
(っ◔◡◔)っ
👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️
Response from the support: we'll add a python function that corresponds to "Add to Scene"... Yay
𝒫𝒽𝓎𝓁
(っ◔◡◔)っ
👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️
A poser file parser is probably the only option short of dev additions to the Poser Python API.
The problem with the Python API is that it has so many gaping holes.
Primarily in the form of an absence of methods for creating items in the scene.
However, creating and linking nodes IS possible, but then the parser hurdle is the problem.
Others have developed their own parsers, but they are not available separately, but bundled into products (PFE for example).
As a caveat, though, first invent a reliable method for human suspended animation, before holding your breath.
I see peripherally how much the devs currently have on their plates, and new features might be fairly far down the implementation list.
I'm not trying to be a totally negative Nancy, here, just an informed optimist (i.e. pessimist). My Poser wish list is bigger than Ben Hur and SpaceX's Booster & Starship stack! :-)
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
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.
Poser's Material object has a dedicated function: LoadMaterialSet(....) which effectively loads either an MT5 or an MC6 file, which fine.
But I'd like to load an MT5 without removing the existing nodes setup, and this function doesn't seem to have another parameter to control this, as any tests I did with other parameters ended up in an error message "Invalid Spec map" or something like that.
pydoc didn't let me guess any other functions, so that, maybe, there's none.
I had an other idea: create a layer to add the MT5 in, but it looks like a dead end, too.
Thanks in advance.
𝒫𝒽𝓎𝓁
(っ◔◡◔)っ
👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, Sonoma 14.6.1, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️