English


Profile Picture

Python object count script

Posted By 2IDs media:design 3 Years Ago
You don't have permission to rate!

Python object count script

Author
Message
2IDs media:design
2IDs media:design
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 47, Visits: 697
Hello User and Icloner

is here somebody how can program in python the following thing.


We need a pythonscript that can COUNT and LIST all used Props / Objects in an Iclone scene and EXPORT it out in a csv or txt, xml file.


For example we have a scene with a complex structure so we want to know, how many props of each type we use in the scene.

like 3xcube, 2xsphere, 6xarc, 12xtwisted box and so on......

in our case we need it exactly and it looks like that

3xwalls,   6xfloors,     8xwindows,  4xdoors, ( the names are changed for the props ) the reason is that we use it for architectural design with iclone.


Perhaps there is somebody who can realize it? or are there other solutions for it?
Many thanks and have all a nice weekend.




Kelleytoons
Kelleytoons
Posted 3 Years Ago
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
There's not really much to this:

import RLPy
holder = ""
prop_list = RLPy.RScene.GetProps()
for prop in prop_list:
    prop_name = prop.GetName()
    holder = holder + ", " + prop_name
with open("D:\\iCloneProps.txt", 'w') as propfile:
    propfile.write(holder)
print(holder)






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
Data Juggler
Data Juggler
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 1.8K, Visits: 5.6K
If you want to add to KelleyToons answer. This code gets the child objects for a prop. I just got this answer from someone at IClone after looking for it for a year.


all_level_child_props = RLPy.RScene.FindChildObjects( prop, RLPy.EObjectType_Prop )
child_props = RLPy.RScene.FindChildObjects( prop, RLPy.EObjectType_Prop, False )


Creator of the free website:
PixelDatabase.Net
A Free Online Text Based Image Editor
75% of original size (was 670x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/6e6663e2-0ecf-447a-ab3d-d49d.png




Reading This Topic

0 active, 0 guests, 0 members, 0 anonymous.
No members currently viewing this topic!