Python Scene objects data List

Discussions concerning programming of SOFTIMAGE©
Post Reply
jmquintela
Posts: 31
Joined: 16 Sep 2013, 21:29
Skype: jm_quintela

Python Scene objects data List

Post by jmquintela » 12 Dec 2013, 01:35

Hi,

I'm trying to make a List of Value Names with python of all the Scene object Data.
My Idea is to have a List With all the object of the scene where I can call and set any value just By calling this list in the form of object[1][2][5] ... This list must contain also all the values for the Icetrees it has and any operator apply to them... I'm trying to look for a Loop or a function that can get the job Done.

Also in the same spirit I'm writing List of Ice Nodes so I can write a python script to build Ice Compound Structures...I'm doing the manual Labor of writing this List but is really a pain doing this for all the Ice nodes... So how can this be done with a loop or a function?.....
If at least I can be point out to the information that will help me on this ...

I'm doing something like this for the ice nodes List , this is just for the Lagoa nodes, so you can imagine this for all the ice nodes.:

#---------- ICE Nodes ---------

#------LAGOA-----------

LagoaCacheSimPostEffects = [
"Lagoa Advect Points",
"Lagoa Delete by Density",
"Lagoa Density Color Gradient",
"Lagoa Duplicate and Stretch",
"Lagoa Fluid Shaper",
"Lagoa Point Duplicator",
"Lagoa Velocity Color Gradient"
]
LCSPE = LagoaCacheSimPostEffects

LagoaPresets = [
"Lagoa Setup Advect Mesh",
"Lagoa Setup Basic Emission",
"Lagoa Setup Cloth Mesh",
"Lagoa Setup Cloth Mesh Sticking",
"Lagoa Setup Grains",
"Lagoa Setup Jello",
"Lagoa Setup Jello from Grid",
"Lagoa Setup Pouring Liquid",
"Lagoa Setup Pouring Liquid from Volume",
"Lagoa Setup Soft Mesh",
"Lagoa Setup Sticky Paste",
"Lagoa Setup Sticky Paste From Volume",
"Lagoa Setup Surface Tension",
"Lagoa Setup Throw Breakable Structure",
"Lagoa Setup Throw Breakable Structure from Grid",
"Lagoa Setup Throw Elastic Clusters",
"Lagoa Setup Throw Elastic Clusters from Grid"
]
LPr = LagoaPresets

LagoaConstrains = [
"Lagoa Transform Constraint"
]
LC = LagoaConstrains

LagoaMaterials = [
"Lagoa Main Material",
"Lagoa Material Cloth",
"Lagoa Material Dirt Pile",
"Lagoa Material Foam",
"Lagoa Material Generic Liquid",
"Lagoa Material Granular",
"Lagoa Material Highly Breakeable",
"Lagoa Material Jello",
"Lagoa Material Liquid Splashy Water",
"Lagoa Material Liquid Water",
"Lagoa Material Melt",
"Lagoa Material Paste",
"Lagoa Material Soft",
"Lagoa Material Soft Tissue",
"Lagoa Material Thick Liquid"
]
LM = LagoaMaterials

LagoaElementCreation =[
"Lagoa Emit Mesh",
"Lagoa Emit Grid",
"Lagoa Emit Volume",
"Lagoa Init",
"Lagoa Init Curve",
"Lagoa Init Emitter Volume Data",
"Lagoa Init Geometry"
]
LEC = LagoaElementCreation

LagoaData = [
"Lagoa Get Collision Data",
"Lagoa Get Constrained",
"Lagoa Get Density",
"Lagoa Get Node Type",
"Lagoa Get Phase ID",
"Lagoa Get Point Index",
"Lagoa Get Pressure",
"Lagoa Get Simulation Step",
"Lagoa Get Substeps Data",
"Lagoa Gradient Axis",
"Lagoa Gradient Data",
"Lagoa Gradient XYZ",
"Lagoa Init"
]
LD = LagoaData

LagoaForces = [
"Lagoa Add Forces",
"Lagoa Air Density",
"Lagoa Air Wind"
]
LF = LagoaForces

LagoaPhase = [
"Lagoa Phase"
]
LPh = LagoaPhase

#---final Lagoa Ice Node List ----

LagoaNodes = [LM , LCSPE , LPr , LPh]
LN = LagoaNodes

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: Python Scene objects data List

Post by EricTRocks » 12 Dec 2013, 03:00

Out of curiosity, why in the world would you need to do this?
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

jmquintela
Posts: 31
Joined: 16 Sep 2013, 21:29
Skype: jm_quintela

Re: Python Scene objects data List

Post by jmquintela » 12 Dec 2013, 03:27

maybe there is a better way, but i want to write a single menu with all the scene values per element so I can control all the simulation from one place, and then create a cache and save these values as one list so I can reload them or save them in case they fit what I want to do, this is to construct a cache system really, but I need first an efficient way to get this data without me writin it for each scene..... I have been researching and there are Collection function on Xsi with this data http://download.autodesk.com/global/doc ... =d30e83584 but I don't find documentation on working with them......agg I'm so new on this python scripting stuff.

jmquintela
Posts: 31
Joined: 16 Sep 2013, 21:29
Skype: jm_quintela

Re: Python Scene objects data List

Post by jmquintela » 13 Dec 2013, 06:29

I'm missing something, I guess object on xsi are classes instances rigth???, then How can I call it's proprierties from python? that's the question really, and how can I call them in the most pytonic way I should say, in a way I can remember, and be shure this calls exist and won't change over time hopofully ,..., and when they change I know it because of list sizes, or costum variables .....but the ideal is to call this list elements very succinctly and with it's iconic content so I can remember, a good way would be some picture for each node for example...

I'm trying to build that so I can write some html layouts with more iconic content for the users to explain concepts for Ice Structures, it's an educational project....and in the side of this writing a tool for real time documentation for the scene so the tool user can know usefull things, like what the tool can do, and show him on top of batch renderer caches with his actual scen data.

....I need the best way I can to call this data. it's pretty much like a get and set node problem but on python and XSI object, how can I make this too apps to work together, one without being bombarded by memory overload, and the other to open all it's data, but I don't wan't to call aaal the info , just modules with this data collections.. so I can write proper functions for this tools that won't collapse, and for me to study what's over there.

sorry for my english, hope you understand my inquiry.
BYE!

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests