← Back to team overview

yade-dev team mailing list archive

Re: acces to sphere/wall information

 

>  if O.bodies[i.id1].shape=='Facet' or O.bodies[i.id2].shape=='Facet': 
>         print O.bodies[i.id1].shape, O.bodies[i.id2].shape
if O.bodies[i.id1].shape.name=='Facet' etc (did I write it wrong last
time?). shape is Shape object in c++ (used to be InteractingGeometry),
the .name gives you class name as string.

> O.bodies[i.id1].shape['diffuseColor']=(1,0,0),
> O.bodies[i.id2].shape['diffuseColor']=(1,0,0)
> 
> and I get this message
> 
> SyntaxError: can't assign to literal

Works for me; fresh start:
O.bodies.append(utils.sphere([1,1,1],0))
O.bodies[0].shape['diffuseColor']=(3,4,5)
O.bodies[0].shape['diffuseColor']
-> Vector3(3,4,5)

v




Follow ups

References