Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/07/2011 at 02:30, xxxxxxxx wrote:
kind of a n00b question, but ...
are there a python bindings for lib_snapping?
I could find almost everything else from the c++ api, just not this
On 05/07/2011 at 04:46, xxxxxxxx wrote:
What is this 'lib_snapping' ? Never heard of it.
Cheers,
On 05/07/2011 at 05:03, xxxxxxxx wrote:
it's part of the c++ api. Search for DetectSnapping. This is a class that does snapping for you. You give it some point and it returns the location at which the point snaps.
On 05/07/2011 at 06:57, xxxxxxxx wrote:
Originally posted by xxxxxxxx Bool SnapTo(const Vector& t_p, Vector* delta)_<_h4_>_ Calculates snapping for a point. The delta between the snapped point and the original is returned in delta. _h5_<_h5_>_rn > Bool > >> TRUE if a snap delta was found, otherwise FALSE. > > _uote> > > ##### _ <_h5_>_eters > >> constVector& t_p >> >>> The point to snap. >> >> Vector* delta >> >>> Assigned the found snap delta. The caller owns the pointed object.
Originally posted by xxxxxxxx
Calculates snapping for a point. The delta between the snapped point and the original is returned in delta. _h5_<_h5_>_rn > Bool > >> TRUE if a snap delta was found, otherwise FALSE. > > _uote> > > ##### _ <_h5_>_eters > >> constVector& t_p >> >>> The point to snap. >> >> Vector* delta >> >>> Assigned the found snap delta. The caller owns the pointed object.
>>> >>> Shouldn't this return a vector ? >>> >>> Anyway, that's not hard to calculate, is it ? >>> >>> > Cheers, >
On 05/07/2011 at 07:44, xxxxxxxx wrote:
Hy Nux,
actually it is returning a Vector. "delta" is a pointer to a Vector. So I guess you supply an empty Vector which gets set to the newly found values (if found).
What is that method supposed to do exactly? Can someone give me an example usage?
Cheers, maxx
On 05/07/2011 at 08:05, xxxxxxxx wrote:
It's used to find the nearest snapping point for an arbitrary point. It's used in plugin tools for instance to support snapping.
The sum of the passed point and the returned delta is the snapping point.
cheers, Matthias
On 05/07/2011 at 09:55, xxxxxxxx wrote:
Yes. Does this class exist in python, too?
On 06/07/2011 at 00:30, xxxxxxxx wrote:
Doesn't seem to. So this is used when I'm holding shift and moving an object ? If yes, try this:
def snap(origin, point, grid) : def singlesnap( (o, p, d) ) : p = p - o p_d = p % d if p_d < d / 2.: return p - p_d + o else: return p - p_d + o + d return map(singlesnap, zip(origin, point, grid))
Cheers, Niklas
On 06/07/2011 at 01:33, xxxxxxxx wrote:
Originally posted by xxxxxxxx So this is used when I'm holding shift and moving an object ?
So this is used when I'm holding shift and moving an object ?
No, it's used to snap points to the world grid for instance, or basically to what you set in Cinema's snapping options.
On 06/07/2011 at 03:48, xxxxxxxx wrote:
| o | | | ------- snaps to ? ----- o | | | |
Right ? This is what the function above does. (see here) Cheers,
On 06/07/2011 at 05:18, xxxxxxxx wrote:
Originally posted by xxxxxxxx | o | | | ------- snaps to ? ----- o | | | | Right ? This is what the function above does. (see here) Cheers,
Not quite, the function uses Cinema's snapping system. So it knows which snapping point is closest to the point you want snapping applied to. Have you worked with snapping in Cinema itself?
I'm talking about this stuff:
On 07/07/2011 at 23:40, xxxxxxxx wrote:
I take it as a "no it's not in there" :[
On 08/07/2011 at 02:03, xxxxxxxx wrote:
Sorry for the delay. Unfortunatly the snapping library is currently not avaible in Python.
On 08/07/2011 at 02:16, xxxxxxxx wrote:
Will the library be implemented in the future?
On 08/07/2011 at 02:41, xxxxxxxx wrote:
Originally posted by xxxxxxxx Will the library be implemented in the future?
I am sorry but I can't make any statements about future development of CINEMA 4D.
On 08/07/2011 at 02:46, xxxxxxxx wrote:
Thank you.
You can't or your mustn't?