Profile Picture

This doesn't work for me

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 (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 5.6K, Visits: 11.0K
Here's code that is supposed to work, and apparently does for the devs, but not for me:






Alienware Aurora R7, Win 10, i7-8700k, 4.7GHz CPU, 32GB RAM, GTX Titan XP (12GB), Samsung 960 Pro 2TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
RobertoColombo
RobertoColombo
Posted Last Year
View Quick Profile
Distinguished Member

Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)Distinguished Member (6.4K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 1.6K, Visits: 3.0K
Hi Mike,

I tried the first part of your code, the one that gets the Avatars and it does not work for me either.
But I wonder how can we make any kind of code working till the documentation is largely incomplete:

def RLPy.RScene.GetAvatars( args)

Get all avatars in the scene.

Parameters
eAvatarType[IN] avatar type
Returns
avatar list


1. What object type is "args" ? What values shall be passed ?
2. Is it optional ?
3. Is the return a list (i.e. a Python "list" data structure) of objects ? Whjat is the type of each object ? Is it RLPy.RIAvatar ?

Each method and data in the doc lacks all of these information.
RL shall add them if they want us to be able to build something

  Roberto

My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390  RAM: 32GB DDR4 2.6GHz / HD: 2TB+3TB  /  
SSD: 2x512GB Samsung 860 EVO / 
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the VB with an HDMI splitter) / DirectX: 12

Edited
Last Year by RobertoColombo
The-any-Key
The-any-Key
Posted Last Year
View Quick Profile
Veteran Member

Veteran Member (617 reputation)Veteran Member (617 reputation)Veteran Member (617 reputation)Veteran Member (617 reputation)Veteran Member (617 reputation)Veteran Member (617 reputation)Veteran Member (617 reputation)Veteran Member (617 reputation)Veteran Member (617 reputation)

Group: Forum Members
Last Active: 4 hours ago
Posts: 132, Visits: 760
Try something like this:

# Get avatars from scene
avatar_list=RLPy.RScene.GetAvatars()
# Check if avatar was found
if len(avatar_list)>0:
    # Get first avatar
    avatar=avatar_list[0]
    material_component=avatar.GetMaterialComponent()
    mesh_list=avatar.GetMeshNames()
    mesh_name=mesh_list[0]
    material_list=material_component.GetMaterialNames(mesh_name)
    # Check if first mesh in model got material
    if len(material_list)>0:
        material_name=material_list[0]
        print(material_name)
    else:
        print("No material found for mesh")
else:
    print("No avatar found in scene!")






iClone 7, 3DXchange 7 Pipeline, CC3 Pipeline, CT8 Pipeline, Iray, Live Face, iPhone Xr, Win 10, i9 9900K ~5GHz, Nvidia RTX 2080 8GB, 16GB Ram, M.2 SSD
Edited
Last Year by The-any-Key
Kelleytoons
Kelleytoons
Posted Last Year
View Quick Profile
Distinguished Member

Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)Distinguished Member (17.0K reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 5.6K, Visits: 11.0K
No, there is a bug in the male dummy avatar (the devs are aware of this).  There is also, apparently, a bug in some clothing as well (and most props).  GetMaterial won't work in those cases.

This will be fixed.  In the meantime, just be aware the code is... sketchy (in that it will work with some things, and not with others -- in cases like that, it's better to not use it).



Alienware Aurora R7, Win 10, i7-8700k, 4.7GHz CPU, 32GB RAM, GTX Titan XP (12GB), Samsung 960 Pro 2TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley



Reading This Topic