[Sidefx-houdini-list] [HOM] Setting a float attribute value on a point

Andras Ikladi andras.ikladi at gmail.com
Wed Jan 30 04:41:23 EST 2008


Hey Hok,

Just after posting I figured out you needed to pass it a tuple (even if it's
a float attrib you're dealing with). I've tried this previously by passing
it a (1.0) for example, but forgot about a Python thing that it can't create
a tuple1 this way, only as (1.0,).

This second is working with the setAttr(attr,(1.0,)) method as well.
For two floats you need setAttr(attr, (1.2,1.4)) style syntax.

cheers,
Andras

On Jan 30, 2008 10:36 AM, Olex P <hoknamahn at gmail.com> wrote:

> Hey Andras,
> I've found the same problem: setAttr() works fine say for two floats but
> not
> for one.
> Hope someone can explain why...
>
> On Jan 29, 2008 6:32 PM, Andras Ikladi <andras.ikladi at gmail.com> wrote:
>
> > Hey,
> >
> > I'm having a problem with $SUBJECT
> > ..at least I can't get my head around this. Should be simple.
> >
> > First I create two attributes on the geo, both of them initializes
> > properly
> > with these values:
> >
> > ...addAttrib(hou.attribType.Point, "v", (0.0, 1.0, 0.0))
> > ...addAttrib(hou.attribType.Point, "f", 10.1)
> >
> >
> > Then trying to set values per point in a loop
> > This works (hou.Color works too):
> > ...setAttribValue(v, hou.Vector3(1,2,3))
> >
> > But this doesn't:
> > ...setAttribValue(f,1.0)
> >
> > What am I doing wrong? (I did read the doc :D)
> >
> > Thanks,
> > Andras
> > _______________________________________________
> > 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