Found 27 posts.
Search results Show results as topic list.
Technical Discussion » Questions about chop
- sparkChan
- 27 posts
- Offline
just because your channels don't match the point number and in channel sop you should use the attribute boxh not boxH. so try to change the Pitch Divisions to 21, and create a new channel sop, I think it will work.
Technical Discussion » glue ojbect
- sparkChan
- 27 posts
- Offline
I found this method is a efficient way to glue objects. so what is the difference the two method.
please look the file in which some nodes are marked with red color.
thanks.
please look the file in which some nodes are marked with red color.
thanks.
Houdini Lounge » container in verwport
- sparkChan
- 27 posts
- Offline
I use the shelf tool to create a container, why does the container look like this:
thanks
thanks
Technical Discussion » triggering a wave chop
- sparkChan
- 27 posts
- Offline
Technical Discussion » need help for chop: keep value
- sparkChan
- 27 posts
- Offline
you can use Expression CHOP, the first input of expression chop is your reference curve, and the second input is the source, and then in the Expression 1 field, typing the expression:if(ic(0,0,$I)>0, ic(1,0,$I), oc(0, $I-1)). I think this is what you want.
Technical Discussion » flock of fishes question!
- sparkChan
- 27 posts
- Offline
kustaahi, kustaa. I have seen your sence, but I can't understand how do you organize your thoughts to achive this effect.
i made a post on odforce while ago on this matter, check it here:
http://forums.odforce.net/index.php?/topic/11329-parting-particles-around-an-object/page__p__73763&#entry73763 [forums.odforce.net]
heres also a little update on the voppop force. scene is slightly messy but behaviour is better than in the previous version
Kustaa
Can you give me some clues about what do you do in your sence.
thanks
Technical Discussion » use point() in DOPs
- sparkChan
- 27 posts
- Offline
Technical Discussion » use point() in DOPs
- sparkChan
- 27 posts
- Offline
oblong
Hi,
I had an example i made but have lost it. I am trying to send a point attribute from sops to a DOPs network.
I used a point() expression and procedurally read each points color which was in turn used to alter the glue attribute. Can someone show me how this syntax would work inside eg the RBDGlueObject
I imagine it was somthing like: point(“/obj/geo1/OUTPUT”, OBJID, “Cd”, 0) but i cannot remember the syntax …
it may be like this: point(“.:dopobject/Geometry”,point_num,“attr”,0)
Technical Discussion » Using color to glue dopobjs
- sparkChan
- 27 posts
- Offline
I want to use the value of color to glue objects in the simulation of DOP.
Although the expression ‘if(“/obj/glue:”+$OBJID+“/Geometry”,0,“Cd”,0)>0,0,-1)’ works, those objects which the value of gluethreshold is 0 has a little little velocity, in other word, they almost keep still.
thanks.
Although the expression ‘if(“/obj/glue:”+$OBJID+“/Geometry”,0,“Cd”,0)>0,0,-1)’ works, those objects which the value of gluethreshold is 0 has a little little velocity, in other word, they almost keep still.
thanks.
Technical Discussion » Python Expression Not Working
- sparkChan
- 27 posts
- Offline
graham
Also, you can access the DOP data directly using HOM without having to use the hscript expression.
objs = pwd().simulation().findAllObjects('sphere')
sphere_obj = objs
impact_data = sphere.findSubData(“Impacts”)
if impact_data:
num_records = len(impact_data.records(“Impacts”))
else:
num_records = 0
I have 7 channels which likes this ‘piece:impulse’ in the CHOP, and I want use those channels in the DOP,
this is my code:
pieces = pwd().simulation().findAllObjects('piece*')
pathfix = “../chopnet1/output/”
pathsuf = “:impulse”
all =
for piece in pieces:
name = piece.name()
if name in all:
allname = pathfix+name+pathsuf
exp = ‘chop(“%s”)’ % allname
a = hou.hscriptExpression(exp)
return 1-a
else:
return 1
I want to know that if those can works.
thanks
Technical Discussion » Python Expression Not Working
- sparkChan
- 27 posts
- Offline
objs = pwd().simulation().findAllObjects('sphere')
id = objs.objid()
exp = ‘dopnumrecords(“/obj/dopnet1”,“id”,“Impacts”,“Impacts”)’
if not hasattr(hou.session, “state”):
hou.session.state =
if hou.hscriptExpression(exp) > 0:
hou.session.state.append(1)
if len(hou.session.state) > 0:
return 1
else:
return 2
when I use those code, I can't get the returned value 1. but if I change the “id” to “1” in the exp, I can get the result 1, assuming that the objid of objs is 1 . why?
thanks
id = objs.objid()
exp = ‘dopnumrecords(“/obj/dopnet1”,“id”,“Impacts”,“Impacts”)’
if not hasattr(hou.session, “state”):
hou.session.state =
if hou.hscriptExpression(exp) > 0:
hou.session.state.append(1)
if len(hou.session.state) > 0:
return 1
else:
return 2
when I use those code, I can't get the returned value 1. but if I change the “id” to “1” in the exp, I can get the result 1, assuming that the objid of objs is 1 . why?
thanks
Technical Discussion » Extending the RBD objects using Python Expression
- sparkChan
- 27 posts
- Offline
Asumming that I have 10 RBD Objects, and I want to extend a rbd to a list every frame, how to achieve that?
frame = hou.frame()
prefix = ‘sphere_’
if(not hasattr(hou.session, ‘objs’)):
hou.session.objs =
sources = hou.pwd().simulation().findAllObjects('sphere*')
for piece in sources:
aList = piece.name().split(prefix)
num = int(aList)
if num == frame:
hou.session.objs.append(piece)
return hou.session.objs
this is my code in the Group 0 Mask parameter of Group Dynamic Objects DOP
but I got a message like this ‘ObjectWasDeleted: Attempt to access an object that no longer exists in Houdini.’
thanks
frame = hou.frame()
prefix = ‘sphere_’
if(not hasattr(hou.session, ‘objs’)):
hou.session.objs =
sources = hou.pwd().simulation().findAllObjects('sphere*')
for piece in sources:
aList = piece.name().split(prefix)
num = int(aList)
if num == frame:
hou.session.objs.append(piece)
return hou.session.objs
this is my code in the Group 0 Mask parameter of Group Dynamic Objects DOP
but I got a message like this ‘ObjectWasDeleted: Attempt to access an object that no longer exists in Houdini.’
thanks
Technical Discussion » No changing when using Python control the input of switch
- sparkChan
- 27 posts
- Offline
Technical Discussion » No changing when using Python control the input of switch
- sparkChan
- 27 posts
- Offline
hi,
there is no change when I use Python to control the input of switch.
for example,I have written a code in the input parameter of switch1:
if hou.hscriptExpression(“$F”) > 20:
return 1
else:
return 0
firstly I connect a sphere to the switch1, then a box.
although the input parameter of switch1 is changed from 0 to 1, there is no change in the scene view.
thanks
there is no change when I use Python to control the input of switch.
for example,I have written a code in the input parameter of switch1:
if hou.hscriptExpression(“$F”) > 20:
return 1
else:
return 0
firstly I connect a sphere to the switch1, then a box.
although the input parameter of switch1 is changed from 0 to 1, there is no change in the scene view.
thanks
Technical Discussion » using Python to get the Geometry subData
- sparkChan
- 27 posts
- Offline
Technical Discussion » using Python to get the Geometry subData
- sparkChan
- 27 posts
- Offline
Technical Discussion » using Python to get subDatas
- sparkChan
- 27 posts
- Offline
grahamI have used hou.session module to keep the value successfully, but if I change the simulation state, the value doesn't change correctly. Is there any way to judge the simulation state. if the simulaton is changed, I will delete the list.
Sorry about that. I was thinking you wanted something different.
If you want to store data you might also consider using the hou.session module as opposed to the file. You can actually store proper data python data structures there and not have to worry about file i/o. You can also store a list to handle multiple times you get impacts.
# Create a list if we don't have one already.
if not hasattr(hou.session, “impact_times”):
hou.session.impact_times =
…
for record in records:
hou.session.impact_times.append(record.field(“creationtime”))
Technical Discussion » 1 particle per point
- sparkChan
- 27 posts
- Offline
Technical Discussion » using Python to get subDatas
- sparkChan
- 27 posts
- Offline
graham
It's something like this:
records = hou.DopObject.findSubData(“Impacts”).records(“Impacts”)
for record in records:
time = record.field(“time”)
You can also check out my attached otl file here for an example.
http://forums.odforce.net/index.php?/topic/9794-particles-created-on-collision/page__view__findpost__p__64423 [forums.odforce.net]
thanks graham,
I have wrotten the code, but I want to keep the value of ‘creationtime’ when the sphere doesn't collided with the ground .
I just use the method creating a file to store the value, and then read the value from the file.
the codes:
obj = pwd().simulation().findObject('active')
check = obj.findAllSubData('I*').keys()
impacts = ‘Impacts’
if impacts in check:
files = open(“chenxiang.txt”,'w')
records = obj.findSubData('Impacts').records('Basic')
for record in records:
time = record.field('creationtime')
files.write(str(time))
files.close()
filename = open('C:\Users\IBM\chenxiang.txt','r')
valueS = filename.readline()
value = float(valueS)
return value
Technical Discussion » using Python to get subDatas
- sparkChan
- 27 posts
- Offline
hi, everyone.
I want to use python to get the value of creationtime which is the subData of Impacts.
I don't how to list the subDatas “Basic” and “Impacts”.
Thanks
I want to use python to get the value of creationtime which is the subData of Impacts.
I don't how to list the subDatas “Basic” and “Impacts”.
Thanks
-
- Quick Links