DOPs expression problem

   2504   2   1
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Hi,
In a DOP sim I'm using a hand-crafted constraint to glue the ends of two wires together until their cumulative constraint forces exceed a value, and the constraint is broken. I have it working fine but encountered a particularly annoying problem using the dopoption() expression.
Basically, I add up the force from each point constraint, then set an extra piece of data called “stick” to 0 when the forces exceed some value. This all works fine, very much like the RBD Autofreeze DOP (which in fact I ripped off).
The problem is, I use a dopoption() expression in the Activation field of the Constraint to look at the “stick” data. On frame 1, this gives me 0 and the constraint data isn't created until frame 2! However, I init the “stick” data to 1 from the very beginning and it appears in the Details view on frame 1 at a value of 1. Worse, the expression show me 1 on frame 1.
I've worked around it with an if() statement but it's annoying to say the least.

Cheers,

Peter B
User Avatar
Member
387 posts
Joined: July 2005
Offline
Some ideas: Have you considered setting values at the top of the DOP Network, like “Offset Time” and “Initial State”? Are you using $SF, or just $F? (ie: Use sub-frame/floating-point variables: $SF and $FF)?

cheers,
b.
''You're always doing this: reducing it to science. Why can't it be real?'' – Jackie Tyler
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Hi Ben,
I don't like to mess with the top-level parms because it throws other things out of whack. The way I have it set up now is working OK, the main issue is that it incorrectly shows you it's returning 1 when in fact it isn't.
Yep, using $SF always internally (except $ST when needed of course).

Cheers,

Peter B
  • Quick Links