Jump to content

Add Point


sparkChan

Recommended Posts

hi, everyone.

I want to add a point to sphere when frame is equal to 10.so I create a python sop and write:

geo = hou.pwd().geometry()
if hou.frame() == 10:
   point = geo.createPoint()
   point.setPosition((1,0,0))

but when frame is greater than 10, the point disappears.

I want to keep the point, so what's the problem?

thanks.

Link to comment
Share on other sites

after frame 10 the condition is not true so not point is generated. this only works in dops(sopsolver) or pops (source)

hi, everyone.

I want to add a point to sphere when frame is equal to 10.so I create a python sop and write:

geo = hou.pwd().geometry()
if hou.frame() == 10:
   point = geo.createPoint()
   point.setPosition((1,0,0))

but when frame is greater than 10, the point disappears.

I want to keep the point, so what's the problem?

thanks.

Link to comment
Share on other sites

after frame 10 the condition is not true so not point is generated. this only works in dops(sopsolver) or pops (source)

In my mind, I think if I create a point, it will keep it, no matter the condition is true or false.

just like sop solver, it can keep the previous state.

do you think what should I do to add point to sphere under this condition?

thanks

Link to comment
Share on other sites

In a sense there is no previous or after in sops. Any frame can be cooked independently from any other, so it is possible to cook frame 234 without ever visiting Frame 10.

Well, that's how I understand it. :unsure:

Edited by Macha
Link to comment
Share on other sites

hi, everyone.

I want to add a point to sphere when frame is equal to 10.so I create a python sop and write:

geo = hou.pwd().geometry()
if hou.frame() == 10:
   point = geo.createPoint()
   point.setPosition((1,0,0))

but when frame is greater than 10, the point disappears.

I want to keep the point, so what's the problem?

thanks.

there is no problem . in reality , you simply wanted the point to appear on Frame 10 and beyond ...

if so , replace the "==" with ">" .

geo = hou.pwd().geometry()
if hou.frame() > 10:
   point = geo.createPoint()
   point.setPosition((1,0,0))

edit: forgot , also replace the "10" with "9" ..

.cheers

Edited by zarti
Link to comment
Share on other sites

The node network is cooked on every frame. That's why it disappears.

the point disappears because the code tells it 'to disappear' .. or better lets say ; 'to not appear' .

try my suggestion ..

Link to comment
Share on other sites

the point disappears because the code tells it 'to disappear' .. or better lets say ; 'to not appear' .

Yes, I was trying to point out the concept that the network is cooked on every frame. If the coder understand, then he would understand his mistake ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...