Group inside a Model

Discussions concerning programming of SOFTIMAGE©
jacobo
Posts: 41
Joined: 10 Jun 2009, 22:06

Group inside a Model

Post by jacobo » 16 Aug 2013, 03:57

Hi;

I have groups inside a model that I just can't seem to get to. I can get to all the children through Findchildren, but I just can't get the models to be detected through ex: oModel.Findchildren ("Geo*" ,siGroupFamily) or oModel.Findchildren (, ,siGroupType)

What's the most suitable way of getting to Groups to do something with them which are within a model?

Thanx;

AJ

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Group inside a Model

Post by EricTRocks » 16 Aug 2013, 04:02

oModel.Groups is a collection
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

jacobo
Posts: 41
Joined: 10 Jun 2009, 22:06

Re: Group inside a Model

Post by jacobo » 16 Aug 2013, 14:39

Thanx Eric. Yet, I just can't seem to get what I want done, which is finding a specific Group under a model, accessing its contents and iterating through them and changing their Render subdiv level. Here's the code:

Code: Select all

	set oparent = PPG.Inspected(0).parent.parent
	set oGroup = oParent.Groups
	set GeoGrp = oGroup(10)
	Set GeoGrpChld = GeoGrp.FindChildren( , siPolyMeshType )
	for each oMember in GeoGrpChld
	SetValue oMember&".geomapprox.gapproxmordrsl", 0
	next
It's embarrassingly simple, I know, but I just couldn't find a way around it... :(

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Group inside a Model

Post by EricTRocks » 16 Aug 2013, 15:25

Code: Select all

# Python

parent = PPG.Inspected(0).Parent.Parent
groups = parent.Groups
geoGroup = groups(10) # You can also go groups("groupName")

for eachMember in geoGroups.Members:
    # You should make sure there is a local one first
    eachMember.LocalProperties("Geometry Approximation").Parameters("gapproxmordrsl").Value = 0

Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

jacobo
Posts: 41
Joined: 10 Jun 2009, 22:06

Re: Group inside a Model

Post by jacobo » 16 Aug 2013, 15:45

Eric, you are so very kind to take the time to help out, I appreciate it so much.

God bless and cheers;

AJ

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: Group inside a Model

Post by xsisupport » 16 Aug 2013, 15:59

FindChildren finds objects of class X3DObject, and a group is not an X3DObject
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage