This is a nice trick. Thanks Alan! (And everyone else for all the help). I ended up doing what Eric explained (I needed to move on), and it worked fine. Other approaches are still very useful. Cheers!


On 07/11/2013 4:16 PM, Alan Fregtman wrote:
...or if you know you've got a collection, print its .GetAsText() result. It'll return an empty string if it's genuinely empty, else it's comma-separated full names.



On Thu, Nov 7, 2013 at 3:58 PM, Orlando Esponda <orlando.espo...@gmail.com> wrote:
you could also use   list(chainRoot.Children)   to convert a collection into a list.


si = Application

chainRoot = si.Create2DSkeleton(0, 0, 0, 10, 0, 0, -90, 0, 0, 4)
print chainRoot
print list(chainRoot.Children)
print list(chainRoot.Bones)
print chainRoot.Effector


On Thu, Nov 7, 2013 at 11:02 AM, Eric Thivierge <ethivie...@hybride.com> wrote:
It's annoying and I'd rather see the word "Collection" instead of None. There was an article on xsisupport.com about it explaining something of why it wasn't changed to say so. Just one of those things you should just learn at this point.


On Thursday, November 07, 2013 11:59:35 AM, Sergio Mucino wrote:
Ah, I see. In other applications, collections come out as an array.
The "None" made me think something went boom.
Thanks Eric! Something new learned... and before lunch time! Cheers!


On 07/11/2013 11:56 AM, Eric Thivierge wrote:
You're printing out collections. When you do a print on a collection
it prints "None".

Instead if you want to get at the objects it would be better to
iterate over the items in the collection:

for eachItem in chainRoot.Bones:
   Application.LogMessage(eachItem)

On Thursday, November 07, 2013 11:46:11 AM, Sergio Mucino wrote:
So, I'm trying to do something pretty simple and straightforward.
Create a 1-bone joint chain, and get back all of its elements. Turns
out this is not being as straight-forward as it should be. Here's the
little snippet of this part of my script...

si = Application
chainRoot = si.Create2DSkeleton(0, 0, 0, 10, 0, 0, -90, 0, 0, 4)
print chainRoot
print chainRoot.Children # Not working
print chainRoot.Bones # Not working
print chainRoot.Effector

'''
Properties taken from here
http://download.autodesk.com/global/docs/softimage2013/en_us/sdkguide/index.html

'''

As you can see, I'm printing out the properties I'd need, but two of
them (the two I'd actually care about) are 'not working' (they return
'None'). Why is this? Are they broken, or am I missing something? Any
help is appreciated. Thanks!
--






--
IMPRESSUM:
PiXABLE STUDIOS GmbH & Co.KG, Sitz: Dresden, Amtsgericht: Dresden, HRA 6857,
Komplementärin: Lenhard & Barth Verwaltungsgesellschaft mbH, Sitz: Dresden,
Amtsgericht: Dresden, HRB 26501, Geschäftsführer: Frank Lenhard, Tino Barth

IMPRINT:
PiXABLE STUDIOS GmbH & Co.KG, Domicile: Dresden, Court of Registery: Dresden,
Company Registration Number: HRA 6857, General Partner: Lenhard & Barth
Verwaltungsgesellschaft mbH, Domicile: Dresden, Court of Registery: Dresden, Company
Registration Number: HRB 26501, Chief Executive Officers: Frank Lenhard, Tino Barth


--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht
der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte
sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and destroy
this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is
strictly forbidden.

Reply via email to