Profile Picture

How do I get the attached props from a parent?

Posted By Kelleytoons Last Year
You don't have permission to rate!
Author
Message
Kelleytoons
Kelleytoons
Posted Last Year
View Quick Profile
Distinguished Member

Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)

Group: Forum Members
Last Active: Last Year
Posts: 9.2K, Visits: 22.1K
So... I thought I knew this, but apparently either I've forgotten or I've never known.

When I get an avatar I get ALL the mesh names of the clothing and even props attached to it with:
mesh_list = avatar.GetMeshNames()
but this does not work for a prop, which if it had attached children and I:
mesh_list = prop.GetMeshNames()
only gives me the parent props mesh names.

Is there no way to do this?  I searched the API (both 7 and 8) and found only mentions in passing of how they might have had some references to prop's children but no actual language on how to do it.




Alienware Aurora R16, Win 11, i9-149000KF, 3.20GHz CPU, 64GB RAM, RTX 4090 (24GB), Samsung 870 Pro 8TB, Gen3 MVNe M-2 SSD, 4TBx2, 39" Alienware Widescreen Monitor
Mike "ex-genius" Kelley
Victor.Soupday
Victor.Soupday
Posted Last Year
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: 3 days ago
Posts: 569, Visits: 9.0K
I've been dealing with props recently for the datalink to Blender:

This is what I use to find all the attached lights, camera's, props, clothing, accessories and hair to an avatar or prop

attached = RScene.FindChildObjects(object,
                                    EObjectType_Light |
                                    EObjectType_Camera |
                                    EObjectType_Prop |
                                    EObjectType_Cloth |
                                    EObjectType_Accessory |
                                    EObjectType_Hair)

It seems to be recursive so it will also find sub props of sub props.

Kelleytoons
Kelleytoons
Posted Last Year
View Quick Profile
Distinguished Member

Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)

Group: Forum Members
Last Active: Last Year
Posts: 9.2K, Visits: 22.1K
Thanks for replying, Victor, but that doesn't seem to be working for me (so I suspect I'm doing something wrong).

I'm calling it as:

prop_name = "Car Body"
other_props = RLPy.RScene.FindChildObjects(prop_name, RLPy.EObjectType_Prop)

but it throws an error in FindChildObjects, even though that prop exists and has lots of children.  Any clue as to what I'm not doing right?




Alienware Aurora R16, Win 11, i9-149000KF, 3.20GHz CPU, 64GB RAM, RTX 4090 (24GB), Samsung 870 Pro 8TB, Gen3 MVNe M-2 SSD, 4TBx2, 39" Alienware Widescreen Monitor
Mike "ex-genius" Kelley
Victor.Soupday
Victor.Soupday
Posted Last Year
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: 3 days ago
Posts: 569, Visits: 9.0K
FindChildObjects is called with the prop object itself, not it's name. So it would be:

prop_name = "Car Body"
prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, prop_name)
other_props = RLPy.RScene.FindChildObjects(prop, RLPy.EObjectType_Prop)

Kelleytoons
Kelleytoons
Posted Last Year
View Quick Profile
Distinguished Member

Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)

Group: Forum Members
Last Active: Last Year
Posts: 9.2K, Visits: 22.1K
Thanks, Victor - I could have sworn I called it that way the first time (and when I couldn't get it to work I changed it to name) but apparently I did not for it all works now.



Alienware Aurora R16, Win 11, i9-149000KF, 3.20GHz CPU, 64GB RAM, RTX 4090 (24GB), Samsung 870 Pro 8TB, Gen3 MVNe M-2 SSD, 4TBx2, 39" Alienware Widescreen Monitor
Mike "ex-genius" Kelley



Reading This Topic