[Sidefx-houdini-list] More HOM woes ... hou.Point.setAttribValue

Andras Ikladi andras.ikladi at gmail.com
Mon Feb 4 11:43:39 EST 2008


I think originally it was intended to implement lookup by both attribute
name and reference.
If you look in hou.py, it lists 2x3 versions (if I remember correctly), each
as this pair of two.

On Feb 4, 2008 5:41 PM, Rob Pieké <rob-p at moving-picture.com> wrote:

> Ugh!
>
> Turns out this also works:
>
> pt.setAttribValue(geo.findPointAttrib('myAttrib'),pt.attribValue
> ('myAttrib'))
>
> I definitely think it's an implementation problem, given that the hou.py
> file contains:
>         setAttribValue(self, attrib_name, attrib_value)
>
> Thanks Andras!
>
>
> > I'm not sure if this is an implementation problem/state, but I never got
> > referencing by attribute name working.
> > Maybe I'm doing something wrong, saving an attr as a variable (of type
> > hou.Attrib) works:
> >
> > geo = hou.pwd().geometry()
> > attr = geo.addAttrib( hou.attribType.Point, 'myAttrib', ( 0.1, 0.2, 0.3) )
> > pt = geo.createPoint()
> > pt.setAttribValue(attr, pt.attribValue( 'myAttrib' ) )
> >
> > cheers,
> > Andras
> >
> > On Feb 4, 2008 5:27 PM, Rob Pieké <rob-p at moving-picture.com> wrote:
> >
> >> Very simple Python SOP ... doesn't work. The last line causes an error.
> >>
> >> geo = hou.pwd().geometry()
> >> geo.addAttrib( hou.attribType.Point, 'myAttrib', ( 0.1, 0.2, 0.3 ) )
> >> pt = geo.createPoint()
> >> pt.setAttribValue( 'myAttrib', pt.attribValue( 'myAttrib' ) )
> >>
> >> And I checked ... pt.attribValue( 'myAttrib' ) returns (0.1, 0.2, 0.3)
> >> as I would expect.
> >>
> >> Any ideas? :)
> >>
> > _______________________________________________
> > Sidefx-houdini-list mailing list
> > Sidefx-houdini-list at sidefx.com
> > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> >
>
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>



More information about the Sidefx-houdini-list mailing list