Hi,<br><br><div class="gmail_quote">On Thu, Oct 29, 2009 at 12:05 AM, Nathan Vegdahl <span dir="ltr"><<a href="mailto:nathanvegdahl@gmail.com">nathanvegdahl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm sending this to Campbell too, since he's not on the animsys mailing list.<br>
<div class="im"><br>
> 1) Unfortunately, this is hard to guarantee, since the types exposed via the<br>
> Python API directly correspond to the actual state of the data internally.<br>
<br>
</div>    Fair enough.<br>
    In that case, could we instead get an api function or operator<br>
that sets the current mode:  bpy.ops.set_mode("POSE_MODE")<br>
    Or something like that?  That way scripts can easily guarantee<br>
that they are in the mode they need to be in.  Trying to toggle all<br>
the modes to get things where you need them to be is kind of nasty<br>
from a scripting standpoint.<br>
    (Incidentally, this would also open up more possibilities for the<br>
UI too, if people want to set hotkeys for setting modes rather than<br>
toggling.  And it's also more robust from a macro standpoint.)<br></blockquote><div><br>I'm sure that there should be an operator that does this... <br><br>Quickly checking, this should be:<br>bpy.ops.object.mode_set(mode='OBJECT', toggle=False)   <--- set the mode value as appropriate<br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
> 2) Personally, I hate functions throwing exceptions. If making them read<br>
> only solves the problem, then great. Or perhaps just hiding all the invalid<br>
> types in certain modes will do will be sufficient. I have a feeling that<br>
> hiding the data may be the most effective way...<br>
<br>
</div>    Well, the important point is just that things shouldn't fail<br>
silently.  They should fail loudly and annoyingly.  Whether we do this<br>
by making things read-only or through hiding the properties isn't so<br>
important.  But failure should always throw an exception.  Otherwise<br>
how is a script supposed to know that it failed at what it was trying<br>
to do?<br>
<br></blockquote><div>Fine, I guess that's a valid argument. I see what you're getting at now<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
> 6) Any reason not to just read it from the EditBones?<br>
<br>
</div><br>    Convenience.  But it's not critical by any means.  Feel free to<br>
ignore this one. :-)<br>
    I can accomplish the same stuff through the bone's matrix.<br></blockquote><div>Seeing Campbell's "fix" for getChildren, I guess this could be added quite simply too as a utility function...<br> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> 7) The tags in the names were really to make it "clearer" where in the<br>
> evaluation pipeline those values were used. Maybe we could drop them :)<br>
<br>
</div>   Well, it's just that the ones that are actually called "head" and<br>
"tail" don't seem to do anything, or at the very least aren't what I<br>
expected from the names.  Intuitively I expected "head" and "tail" to<br>
actually be what "armature_head" and "armature_tail" are (in fact, I<br>
think I even complained to Campbell about them not working).<br>
   So it actually ends up making it less clear, IMO, because it's not<br>
what the user expects (though maybe I'm not so representative of a<br>
typical user in this case).<br>
<br>
   (Ultimately I think the real issue is just that armatures are way<br>
more complex than they ought to be, even from just a normal user<br>
standpoint.  IMO bones should be objects, and armatures shouldn't<br>
exist.  But that's a discussion for another year...)<br>
<br>
--Nathan V<br>
<br></blockquote><div>Ahh... I'd have to check again. It's been a while since I had a look at the low-level details.  <br></div></div>