Profile Picture

Python object count script

Posted By 2IDs media:design 2 Years Ago
You don't have permission to rate!
Author
Message
2IDs media:design
2IDs media:design
Posted 2 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)Distinguished Member (1.5K reputation)

Group: Forum Members
Last Active: 2 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.




Edited
2 Years Ago by 2IDs media:design
Kelleytoons
Kelleytoons
Posted 2 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)

Group: Forum Members
Last Active: 4 hours ago
Posts: 9.1K, Visits: 21.8K
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 R12, Win 10, i9-119000KF, 3.5GHz CPU, 128GB RAM, RTX 3090 (24GB), Samsung 960 Pro 4TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
Data Juggler
Data Juggler
Posted 2 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)Distinguished Member (12.4K reputation)

Group: Forum Members
Last Active: 4 hours ago
Posts: 1.7K, Visits: 5.4K
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
https://forum.reallusion.com/uploads/images/6e6663e2-0ecf-447a-ab3d-d49d.png




Reading This Topic