Skip to content

ExamplesPythonGeneral

Ben Toogood edited this page Jun 13, 2013 · 2 revisions

Introduction

Cortex is not tied to an application and lots of it's functionality can be utilised from a vanilla Python shell. This can be a very useful tool for TDs.

Code

 $ python2.5Python2.5.2 (r252:60911, Dec52008, 10:21:08)
[GCC4.1.220071124 (RedHat4.1.2-42)] onlinux2Type"help", "copyright", "credits"or"license"formoreinformation.
importIECoregeo=IECore.Reader.create( "myGeometry.bgeo" ).read()
geo.keys()
> ['P']
geo.numPoints>100geo['P'].data[10:12]
>IECore.V3fVectorData( [ IECore.V3f( 1.40451, -0.293893, 9.15294e-07 ), IECore.V3f( 1.13627, -0.293893, -0.825549 ) ] )

Clone this wiki locally