Fri, Apr 26, 5:33 PM CDT

Welcome to the Poser 12 Forum

Forum Moderators: nerd, donnena Forum Coordinators: nerd

Poser 12 F.A.Q (Last Updated: 2024 Apr 18 2:45 am)



Welcome to the Poser Forums! Need help with these versions, advice on upgrading? Etc...you've arrived at the right place!


Looking for Poser Tutorials? Find those HERE



Subject: Moving the pivot point for a door


Eronik ( ) posted Mon, 07 June 2021 at 1:44 PM · edited Fri, 26 April 2024 at 2:23 PM

Got this door, and moving the pivot point seems to be impossible.

door.gif

The Origin dials move the whole door, and the EndPoint moves the red cross. What am I missing?


Y-Phil ( ) posted Mon, 07 June 2021 at 2:02 PM

I have the feeling that you will have to use the "Setup room"

PhYl.


Win10 on i7 8700K@4.3Ghz, 64Gb, Asus TUF Gaming RTX 4070 OC Edition, 2x 2Tb ssd + 6+4Tb hd  + 1x 8Tb hd + 1 10T NAS, Poser 11, Poser 12  and now Poser 13 


Eronik ( ) posted Mon, 07 June 2021 at 3:14 PM · edited Mon, 07 June 2021 at 3:15 PM

The setup room it is then.

door.gif

It's swingin' now! Thanks for the tip Phil.

Looks like there is something goofy with this door (an OBJ exported from Maya), because the pivot can be moved just fine on a native Poser prop.


Y-Phil ( ) posted Mon, 07 June 2021 at 3:50 PM

Yes! cool... ?

PhYl.


Win10 on i7 8700K@4.3Ghz, 64Gb, Asus TUF Gaming RTX 4070 OC Edition, 2x 2Tb ssd + 6+4Tb hd  + 1x 8Tb hd + 1 10T NAS, Poser 11, Poser 12  and now Poser 13 


Eronik ( ) posted Mon, 07 June 2021 at 6:39 PM

Got a tip from a fellow Poser-ino:

The center-point can be adjusted right after importing the obj and before moving, scaling, or rotating it.

door.gif

It's mui bueno now!


Y-Phil ( ) posted Tue, 08 June 2021 at 1:34 AM

Thank you for that tip, now I better understand how to rotate some props that seemed to to a have a rather weird logic.... ?

PhYl.


Win10 on i7 8700K@4.3Ghz, 64Gb, Asus TUF Gaming RTX 4070 OC Edition, 2x 2Tb ssd + 6+4Tb hd  + 1x 8Tb hd + 1 10T NAS, Poser 11, Poser 12  and now Poser 13 


Eronik ( ) posted Tue, 08 June 2021 at 11:09 AM

Sure thing Phil. With a program as complex as Poser, we learn something new every day.


Y-Phil ( ) posted Tue, 08 June 2021 at 11:23 AM

Eronik posted at 11:23AM Tue, 08 June 2021 - #4420871

Sure thing Phil. With a program as complex as Poser, we learn something new every day.

Absolutely ?

PhYl.


Win10 on i7 8700K@4.3Ghz, 64Gb, Asus TUF Gaming RTX 4070 OC Edition, 2x 2Tb ssd + 6+4Tb hd  + 1x 8Tb hd + 1 10T NAS, Poser 11, Poser 12  and now Poser 13 


davo ( ) posted Tue, 08 June 2021 at 4:41 PM

Normally I'd open set the view to wireframe or outline then set the camera to top view then open the joint editor. You can drag the green cross with the translate tool to the position you want it. Sometimes the red crosshair is right over the green, but if you drag on it, it usually grabs the green one.


adp001 ( ) posted Tue, 08 June 2021 at 5:05 PM · edited Tue, 08 June 2021 at 5:13 PM

Often the problem is that the geometry center of a prop is displaced (the center of the OBJ is not at coordinate (0, 0, 0)). You don't always notice this because the prop may have been moved to the center of the image with the dials.

This can lead to problems when processing such props further. Among other things, it can cause the prop to rotate around its parent in a strange way.

The following small Python script based on "NumThe script changes the vertices of a prop or actor, not just the poser coordinates.

If you start the script as is, the currently selected Poser Actor will be changed.py" remedies this. Here is the core:

    verts = NP.array([[v.X(), v.Y(), v.Z()] for v in geom.Vertices()])
    v_min = NP.array([NP.min(verts[:, X]), NP.min(verts[:, Y]), NP.min(verts[:, Z])])
    v_max = NP.array([NP.max(verts[:, X]), NP.max(verts[:, Y]), NP.max(verts[:, Z])])
    center = v_min + (v_max - v_min) / 2.0
    for pv, new_verts in zip(geom.Vertices(), verts - center):
        pv.SetX(new_verts[X])
        pv.SetY(new_verts[Y])
        pv.SetZ(new_verts[Z])

And here is a working script (save it under any filename ending with ".py"):

from __future__ import print_function  # Python 3 print function in Python 2
import poser
import numpy as NP

X, Y, Z = range(3)

def geom_ok(geom):
    return isinstance(geom, poser.GeomType) \
           and geom.NumVertices() > 0


def actor_has_geom(ac):
    return isinstance(ac, poser.ActorType) \
           and hasattr(ac, "Geometry") \
           and geom_ok(ac.Geometry())


def set_geom2center(actor):
    if isinstance(actor, poser.GeomType) and geom_ok(actor):
        geom = actor
    elif isinstance(actor, poser.ActorType) and actor_has_geom(actor):
        geom = actor.Geometry()
    else:
        raise AttributeError("Call this function with a Poser actor or geometry.")

    verts = NP.array([[v.X(), v.Y(), v.Z()] for v in geom.Vertices()])
    v_min = NP.array([NP.min(verts[:, X]), NP.min(verts[:, Y]), NP.min(verts[:, Z])])
    v_max = NP.array([NP.max(verts[:, X]), NP.max(verts[:, Y]), NP.max(verts[:, Z])])
    center = v_min + (v_max - v_min) / 2.0
    for pv, new_verts in zip(geom.Vertices(), verts - center):
        pv.SetX(new_verts[X])
        pv.SetY(new_verts[Y])
        pv.SetZ(new_verts[Z])


if __name__ == "__main__":
    set_geom2center(poser.Scene().CurrentActor())
    print("Done.")

The script changes the vertices of a prop or actor, not just the poser coordinates.

If you start the script as is, the currently selected Poser Actor will be changed.




adp001 ( ) posted Tue, 08 June 2021 at 5:18 PM

Ups! Something messed up my post :)

Here is the top part again:

Often the problem is that the geometry center of a prop is shifted (the center of the OBJ is not at coordinate (0, 0, 0)). You don't always notice this because the prop has been moved to the center of the image with the dials.

This can lead to problems when processing such props further. Among other things it can cause the prop to rotate around its parent in a strange way.

The following small Python script based on "Numpy" remedies this. Here is the core:




Y-Phil ( ) posted Wed, 09 June 2021 at 1:31 AM

adp001 posted at 1:30AM Wed, 09 June 2021 - #4420895

Ups! Something messed up my post :)

Here is the top part again:

Often the problem is that the geometry center of a prop is shifted (the center of the OBJ is not at coordinate (0, 0, 0)). You don't always notice this because the prop has been moved to the center of the image with the dials.

This can lead to problems when processing such props further. Among other things it can cause the prop to rotate around its parent in a strange way.

The following small Python script based on "Numpy" remedies this. Here is the core:

Thank you so much ?

PhYl.


Win10 on i7 8700K@4.3Ghz, 64Gb, Asus TUF Gaming RTX 4070 OC Edition, 2x 2Tb ssd + 6+4Tb hd  + 1x 8Tb hd + 1 10T NAS, Poser 11, Poser 12  and now Poser 13 


EldritchCellar ( ) posted Wed, 09 June 2021 at 5:47 PM

I wouldn't mind chiming in on a few things I've noticed with the joint editor.

Sometimes when you have the joint editor open and you're trying to translate the object center to a new position you'll find that for some reason you can't get the little bullseye cursor to appear when hovering over either the center or end point. The cursor will just stay stuck in whatever tool mode you had currently active before that point. An easy way to remedy this is to either click on or select another object and than reselect the the intended object. That usually clears it up and you'll have the bullseye cursor.

Also let's say you imported an object from some external modeler or you import a file not specifically intended for Poser's relatively tiny scale. Generally you want to import with one of poser's scaling options or prep externally with Poser's scale in mind. Scaling an object after the fact within Poser will invariably screw up any attempts to change it's origin with the joint editor as this will cause the entire object to translate in the workspace rather than just translating it's origin. You'll be wondering why your object is flying around when this happens...

Here's a sphere prop loaded from primitives; front camera, outline preview, joint editor open, default scale...

ill1.png



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




EldritchCellar ( ) posted Wed, 09 June 2021 at 5:49 PM

I change the center point by translating it to -0.049 in the Y axis...

ill2.png

It behaves as expected.



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




EldritchCellar ( ) posted Wed, 09 June 2021 at 5:52 PM

Ok. Let's try something different. I load the same sphere again but this time I scale it up to 200%

ill3.png



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




EldritchCellar ( ) posted Wed, 09 June 2021 at 5:55 PM

I then open the joint editor and try translating the center point in a like manner as the first sphere. Something different happens this time, the sphere object itself translating while I move the center point. Note the camera has not changed...

ill4.png



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




EldritchCellar ( ) posted Wed, 09 June 2021 at 5:57 PM

Here's an overlay of the before and after of the editing attempt... ill5.png



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




EldritchCellar ( ) posted Wed, 09 June 2021 at 6:04 PM

One way to scale an object after import with the intention of adjusting it's origin after is to bake it's scale before even touching the joint editor. Scale the object to it's desired scale in Poser and then immediately export it as obj (all options unchecked) and reimport likewise, this will bake the scale as default and you can edit it's origin without that behavior.



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




adp001 ( ) posted Wed, 09 June 2021 at 8:32 PM

I had a different idea. Changing (changing) the objects vertices instead of just doing a Poser scale. With the following script this is as simple as the standard way.

The following script creates a new parameter inside the currently selected prop/actor. This prop contains the height of the prop measured in centimeters. If you dial it, the prop will scale (or if you type in a value in cm).

Note: Poser scale dials are not affected! The geometry changes, not the dials. The prop/actor is flagged as changed, so Poser can take actions accordingly.

And now the fun part:

from __future__ import print_function  # Python 3 print function in Python 2

import sys
import numpy as NP

def actor_has_geom(ac):
    return isinstance(ac, poser.ActorType) 
           and hasattr(ac, "Geometry") 
           and geom_ok(ac.Geometry())

def get_props_height_pnu(actor):
    if isinstance(actor, poser.ActorType) and actor_has_geom(actor):
        geom = actor.Geometry()
        verts = NP.array([[v.X(), v.Y(), v.Z()] for v in geom.Vertices()])
        return NP.max(verts[:, Y]) - NP.min(verts[:, Y])


def get_props_height_cm(actor):
    return get_props_height_pnu(actor) / 0.0038145


def change_props_size(actor, scale):
    if isinstance(actor, poser.ActorType) and actor_has_geom(actor):
        geom = actor.Geometry()
        for pv in geom.Vertices():
            pv.SetX(pv.X() * scale)
            pv.SetY(pv.Y() * scale)
            pv.SetZ(pv.Z() * scale)
        actor.MarkGeomChanged()

__lastsizes = dict()  # storage to remember scales

def dynamic_height_prop(actor):
    global __lastsizes

    def cb_func(parm, value):
        ac = parm.Actor()
        iname = ac.InternalName()
        old = __lastsizes[iname]
        if old != value:
            scale = 1.0 / old * value
            change_props_size(ac, scale)
            __lastsizes[iname] = value
        return value

    if isinstance(actor, poser.ActorType) and actor_has_geom(actor):
        parmname = "Dyn Height cm"
        parm = actor.Parameter(parmname)
        if parm is None:
            parm = actor.CreateValueParameter(parmname)
        last_value = __lastsizes[actor.InternalName()] = get_props_height_cm(actor)
        parm.SetValue(last_value)
        poser.Scene().DrawAll()
        parm.SetUpdateCallback(cb_func)


if __name__ == "__main__":
    dynamic_height_prop(poser.Scene().CurrentActor())
    print("Activated.")




adp001 ( ) posted Wed, 09 June 2021 at 8:40 PM · edited Wed, 09 June 2021 at 8:41 PM

Forgott to copy the declarion of X, Y and Z. Put the line

X, Y, Z = range(3)

just before the fist line starting with "def"




adp001 ( ) posted Wed, 09 June 2021 at 8:53 PM · edited Wed, 09 June 2021 at 8:54 PM

This editor removed some important things nd I missed to copy something to.

Click here to download the tested script from my webpage.




EldritchCellar ( ) posted Wed, 09 June 2021 at 9:30 PM · edited Wed, 09 June 2021 at 9:30 PM

What witchcraft is this?!

Just kidding adp... maybe I'm totally not getting this right but why does this feel like 'match centers to morph' sorta.



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




EldritchCellar ( ) posted Wed, 09 June 2021 at 9:37 PM

I see what it is now. It's a scale change but the scale dials are uneffected? So your changing the vert coordinates so wouldn't that be... a morph?



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




adp001 ( ) posted Thu, 10 June 2021 at 3:31 AM · edited Thu, 10 June 2021 at 3:32 AM

EldritchCellar posted at 3:19AM Thu, 10 June 2021 - #4420958

I see what it is now. It's a scale change but the scale dials are uneffected? So your changing the vert coordinates so wouldn't that be... a morph?

The objects vertices are changed. So it is not a morph. All further operations on the object are affected by the change. A morph is a set of additional data used to change the appearance while displaying it.

The script can be useful while developing something. After that the standard scales should be used.

I use something like that in the process of making dyn cloth (it's part of a bigger script with mutch more other things I made over time).




adp001 ( ) posted Thu, 10 June 2021 at 3:38 AM

By the way: What I forgot to add to the script here is correcting the origin and the endpoint according to the new computed size.




EldritchCellar ( ) posted Thu, 10 June 2021 at 8:24 AM

Got it. Hope it doesn't "change" the winding order, wouldn't that be a surprise.



W10 Pro, HP Envy X360 Laptop, Intel Core i7-10510U, NVIDIA GeForce MX250, Intel UHD, 16 GB DDR4-2400 SDRAM, 1 TB PCIe NVMe M.2 SSD

Mudbox 2022, Adobe PS CC, Poser Pro 11.3, Blender 2.9, Wings3D 2.2.5


My Freestuff and Gallery at ShareCG




adp001 ( ) posted Thu, 10 June 2021 at 2:11 PM

EldritchCellar posted at 2:11PM Thu, 10 June 2021 - #4420977

Got it. Hope it doesn't "change" the winding order, wouldn't that be a surprise.

It does not.




Y-Phil ( ) posted Thu, 10 June 2021 at 2:11 PM

adp001 posted at 2:11PM Thu, 10 June 2021 - #4420951

Forgott to copy the declarion of X, Y and Z. Put the line

X, Y, Z = range(3)

just before the fist line starting with "def"

Thank you ?

PhYl.


Win10 on i7 8700K@4.3Ghz, 64Gb, Asus TUF Gaming RTX 4070 OC Edition, 2x 2Tb ssd + 6+4Tb hd  + 1x 8Tb hd + 1 10T NAS, Poser 11, Poser 12  and now Poser 13 


Privacy Notice

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.