[Sidefx-houdini-list] Some hom question
Sheldon Serrao
emailsheldon at gmail.com
Fri Apr 2 18:46:12 EDT 2010
Thank you Captain Hammy!
You saved me a lot of time.
I will ask more questions as I explore the hom universe.
Sheldon
On Fri, Apr 2, 2010 at 2:06 PM, Graham Thompson <captainhammy at gmail.com> wrote:
> 1. If you want the world space position you'll need to multiply the
> position vector by the world transform of the parent object.
> sopnode is an instance of hou.SopNode
> point_pos = sopnode.geometry().iterPoints()[0].position()
> parent_xform = sopnode.parent().worldTransfom()
> world_pos = point_pos * parent_xform
>
> 2. From a mathematical standpoint you can't actually divide a vector.
> To divide a vector you want to multiply it by the inverse of what you
> wish to divide by.
>
> For example. to do what you want you can just do
> vec = hou.Vector3(3,3,3)
> vec = vec * (1.0/3)
>
> This performs a multiplication of your vector by the value 1/3, or 0.333.
>
> 3. If you want to delete all the geometry all you have to do is call
> hou.Geometry.deletePrims(hou.Geometry.prims()). It also gives you the
> option of keeping all the points.
>
> 4. You can get geometry from input objects by going
> hou.SopNode.inputs()[inputnum].geometry(). This geometry is read-only
> though. If you want to merge it into the main geometry you can call
> hou.Geometry().merge(inputgeo).
>
>
> On Fri, Apr 2, 2010 at 1:42 PM, Sheldon Serrao <emailsheldon at gmail.com> wrote:
>> I apologize if these questions have been answered before.
>>
>> 1) When I query the position of a point on a geometry, how can I get
>> the world space of that point? I tried geo.prims() but it gives me in
>> the local space. If the user is going to have multiple objects on the
>> top level it would be hard to actually traverse all transformations.
>> 2) Right now I am trying to rescale my vector like so:
>> vec = hou.Vector3((3,3,3))
>> vec[0] /= 3
>> vec[1] /= 3
>> vec[2] /= 3
>> this is a lazy request but it would be nice to have a vec /= 3
>> 3) just like a scatter sop, how can one say "ok delete all incoming
>> geometry but only output a single point for me?"
>> 4) how can I get the incoming geometry data from the input of my
>> python sop geometry node? If I have 3 inputs for example, how can I
>> ask hom to give me geometry from input2 or input3?
>>
>> Cheers :)
>> Sheldon
>> _______________________________________________
>> 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
>
--
add: 828 Franklin Apt 311
San Francisco CA
94109
tel: (415) 283 5820
More information about the Sidefx-houdini-list
mailing list