Jump to content

pdeb

Regular Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

1 Noble Beginner

About pdeb

  • Rank
    Cafe Ronin

Profile Information

  • First Name
    Peter
  • Last Name
    Debay
  • C4D Version
    13 Broadcast
  • Location
    Vancouver

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks Jed. Until I get my python chops I decided to go a different route, albeit hacky. I used a python script to export the runner's Y-position values to a CSV, then used Niklas Rosenstein's CSV effector to give each of my clones (as each appears on its own frame) the Y-value from the CSV. It works fine. it just means spitting out values to the CSV if I decide to change the path. But for now it will do the trick, thanks for your help, p
  2. Thanks for the reply Havealot, The attached will help describe what I'm trying to do. The clones would form the top of the elevation profile (reds/oranges/yellows). I hacked it by having 1 clone take the Y-value of the null traveling along the red path on the terrain, and moving it along x with a Time Effector. I tried embedding a conditional in the loop, telling Python to ignore any clone index which wasn't == current frame, but that didn't seem to do anything despite passing back no errors. It was more an exercise in going deeper into Python, so I'll read up on the BaseContainer and storing values, as it looks quite powerful.
  3. Hi all, Python novice trying to solve a mograph puzzle, thanks in advance for pointers. I'm trying to create an infographic similar to a runner's path elevation over time, where each cloner inherits the Y-value of the Null following a path over terrain, on that specific frame. The cloner has an Xpresso tag where Time generates clone count, so on each frame a new clone in the line appears, and a Tracer creates a growing elevation profile. I've tried the following code, and to no one's surprise, each cloner has the same value on each frame, so they all rise and fall in unison. import c4d from c4d.modules import mograph as mo #Welcome to the world of Python def main(): md = mo.GeGetMoData(op) if md is None: return False cnt = md.GetCount() marr = md.GetArray(c4d.MODATA_MATRIX) fall = md.GetFalloffs() Traveler = op[c4d.ID_USERDATA, 1] TravPos = Traveler.GetRelPos() TravPosY = TravPos[1] print TravPos for i in (xrange(0, cnt)): marr[i].off = c4d.Vector(marr[i].off.x,marr[i].off.y+TravPosY,marr[i].off.z) md.SetArray(c4d.MODATA_MATRIX, marr, True) return True Can someone point me to a way for each clone to take on the value on the frame it was generated, and then freeze in position? Is it a matter of a BaseContainer and storing values? I can't seem to find a way in the SDK to feed the Null's position a time or frame argument. thanks muchly, pdeb
  4. Worth noting that Niklas Rosenstein ported a couple of Jürgen Meier's COFFEE plugins to R20, one of which is a torus knot, but other nice procedurals as well. https://github.com/NiklasRosenstein/c4d-nr-toolbox/blob/master/docs/pr1mitive/README.md http://www.3d-meier.de/
  5. Give this a go...I'm still working on the math to range map the Spline Curve user data's start and end to the Spline Effector's start/end/offset, so for the time being I hacked it with a MoSpline as a source for the Effector, as annotated. Perhaps someone with greater Python skills can figure out the remap code so that when, for instance, if the Spline Effector's start/end is moved to 10%/90%, the Spline Curve compresses accordingly and bias shape is maintained in the smaller x range as opposed to clipping on either side. But for the purposes of having the bias work, a good first go. splineDistBiasc4dcafe_b0.1.c4d
  6. Eureka! I had failed to put the Python Effector into 'Full Control' mode - it works!
  7. Very novice python coder here, could I please ask for help getting this Python Effector into the barn. I’d like to use a Spline Curve User Data to redistribute clones on a spline (Spline Effector) for example, if I changed the UD spline to say Cubic, more clones would be bunched up against the start with larger and larger distances between clones towards the end. I have a (very very slow) python effector which properly remaps values along the spline, and when I manually place nulls to console positions on the spline as read out by a print marr.off line, they match up. When I add the md.SetArray line, the clones don’t seem to move to their affected positions. Code attached, thanks to anyone who can help me figure out why setArray isn’t working, or why I have a “TypeError: main expected float or c4d.Vector, not bool” error in the console Thanks, P import c4d from c4d.modules import mograph as mo def main(): sdo = doc.SearchObject('UserData') sd = sdo[c4d.ID_USERDATA,1] spl = sdo[c4d.ID_USERDATA,2] if spl.GetRealSpline() is None: return False sso = doc.SearchObject('SplineEff') se = sso[c4d.MGSPLINEEFFECTOR_END] sh=c4d.utils.SplineHelp() sh.InitSpline(spl) md = mo.GeGetMoData(op) if md==None: return False marr = md.GetArray(c4d.MODATA_MATRIX) cnt = md.GetCount() for i in (xrange(0, cnt)): itr = float(i) pospercent = (itr*1/(cnt))*se myRemap = sd.GetPoint(pospercent).y pos = sh.GetPosition(myRemap) marr[i].off = pos print marr[i].off md.SetArray(c4d.MODATA_MATRIX, marr, True) sh.FreeSpline() return True
  8. Hi Rad, If you need a robust CSV reader with lots of functionality, check out Niklas Rosenstein's github, which has both a CSV MoGraph effector and CSV Xpresso node https://github.com/NiklasRosenstein/c4d-nr-toolbox hth P
  9. There's also Point Projector from Frank Willeke: https://fwilleke80.github.io/PointProjector/ works on spline and geo, non-destructively. pdeb
  10. This seems to work. import c4d from c4d.modules import mograph as mo def main(): md = mo.GeGetMoData(op) if md is None : return False vtxu = op[c4d.ID_USERDATA,1] if vtxu is None : return False nb = md.GetCount() warr = md.GetArray(c4d.MODATA_WEIGHT) vtxs = vtxu.GetAllHighlevelData() if len(vtxs) != nb : return False for i in xrange(nb): vtxw = vtxs[i] warr[i] = vtxw md.SetArray(c4d.MODATA_WEIGHT, warr, True) return True
  11. Hi all, Python question from a complete and utter coding novice. I have a cloner set to object, and the reference object has an animating vertex map. I'm fumbling with the Python Effector to translate the individual point vertex map values to mograph weights for clones positioned at the corresponding vertices. The Python Effector would store the weights and subsequent effectors (like Inheritance) would use the weights as Falloff, so clones would animate as the vertex map animated. Here's my first go at the Python. I feel I'm close but somehow the array from the vertex map is not getting to the mograph weights (does it call for a RangeMap?). If anyone can help, would be greatly appreciated. import c4d from c4d.modules import mograph as mo from c4d import utils as u arr = [0.0] def main(): global arr sourceVmap = op[c4d.ID_USERDATA,1] sourceData = sourceVmap.GetAllHighlevelData() cnt = len(sourceData) if len(arr) != cnt: diff = cnt - len(arr) arr.extend([0.0]*diff) md = mo.GeGetMoData(op) if md is None: return False count = md.GetCount() index = md.GetCurrentIndex() marr = md.GetArray(c4d.MODATA_MATRIX) warr = md.GetArray(c4d.MODATA_WEIGHT) fall = md.GetFalloffs() for i in xrange(0, count): arr[i] = sourceData md.SetArray(c4d.MODATA_WEIGHT, arr, True) return True
  12. Hi all, A few years ago I bought a suite of xsyann's plugins, and now need to download the latest versions of what I purchased. I've tried to reset my account password on his website, but to no avail (I get an error), and messages to his website contact form go unanswered. Does anyone know if he's still actively administering his account? thanks in advance, Peter

Latest Topics

Latest Comments

×
×
  • Create New...