Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. This is expandable, stores the vectors in 2 lists raymulti.c4d
  2. I have some smoothing methods for position. Doesn't always work with rotation, but might interest you. In this file there's a sphere with a vibrate tag (camera target) and a cone that follows it smoothly, by adding 10% of the difference between input and output to the input smoothcam.c4d
  3. I'll have a think about multiple objects. Re: Python + Iteration, I've tried that and they don't play well together. Python seems to see each iteration step as an event (ie recalculate). This can sometimes cause problems. Meanwhile, I realized there might be an issue with the cube going below the surface - the cube gets selected rather than the plane. I've added a bit of logic to fix that rays7.c4d
  4. I got an email from one of my suppliers featuring this card at nearly 10 grand. I checked on Amazon - they sell them, and it's not an error. Maybe it's good for mining. I use a GTX 750 Ti ...
  5. What about 2 ray collision nodes node #1 test if cube hit, if not must be plane node #2 use result from #1 to select cube or plane as input rays6.c4d BTW - I'm not very good with matrix (I just copied your code). Is there a simple explanation for Vector2 Matrix and Matrix2HPB, since you're starting with a vector ?
  6. I don't know anything about plugins, but I had a similar problem recently when trying to reference a data file located in the same folder as my C4D scene, without resorting to the full path name (ie to make the folder more portable). This code worked for me import c4d, os def main(): directory = doc.GetDocumentPath() # get doc directory datafilepath = os.path.join(directory, 'testfile.txt') # get data file full path you might be able to adapt it to your needs edit - this is the full answer I got from cg society import os def doc_path_join(doc, *filenames): """ Creates an absolute path given by a document and a filename. The document must have a path, otherwise ValueError is raised. Example: doc_path_join(doc, "test.txt") # /example/path/test.txt doc_path_join(doc, "..", "test.txt") # /example/test.txt doc_path_join(doc, "tex", "test.txt") # /example/path/tex/test.txt @param doc Instance of c4d.documents.BaseDocument. Must have a document path. @param filenames Strings as filenames. """ directory = doc.GetDocumentPath() if not directory: raise ValueError("document has no path") return os.path.join(directory, *filenames)
  7. You don't need the rangemapper to convert to percent. XPresso treats 0 - 1 decimal as 0 - 100%. > Mr Pedantic
  8. Another from the guys about the perils of using unconditional jump https://xkcd.com/292/ explanation
  9. coding joke https://xkcd.com/1695/
  10. I thought doc was a built-in variable, although c4d.documents.GetActiveDocument() must exist for a reason - I've seen people include it. I'm with you re MAXON Python SDK - hard going to say the least.
  11. @SFXP some Python stuff for you - rangemap etc cheatsheets.zip BTW I wouldn't recommend learning Python inside C4D - too easy to lock up the program. I use the free Pycharm. https://www.jetbrains.com/pycharm/
  12. XPresso nodes like compare, rangemap, clamp etc have equivalents in Python, but you have to watch out for data type. XPresso is quite forgiving when connecting say real to string, but Python is more strict. Also be aware that integer division gives integer result in Python eg 3 / 2 = 1 have to specify real eg 3.0 / 2 = 1.5 this can trip you up when using current frame as a value, and is due to C4D using 2.7 Python
  13. jed

    Link as Sweep-Contour

    You can put an instance object where the profile shape is in your hierarchy, then swap out the reference object. I've used XPresso here, but you can just drop the object in from the OM without XP. instance.c4d
  14. For some reason, it seems that cinema doesn't like driving global rotation P on that semi-circle object when it's a child. Use local P or pull it out of its parent and it behaves. Another C4D mystery ...
  15. jed

    OSC message, python, C4D

    I looked on the website, and it says ' Open Sound Control server and client implementations in pure python (3.4+) '. If this refers to minimum Python version, you might be out of luck. Current Python seems to be 3.6, but C4D is still on 2.7.
  16. I would have thought some kind of Python lookup table would be easier - especially when entering the data. I'm not much of an expert in color spaces, but here's a rather lame bit of code for RGB output showing what I mean. I've used lists in C4D Python with several thousand elements, so that's not an issue, although with your setup I'm not sure if the limitation is in the user data or the XPresso. lookup.c4d
  17. Using a vibrate tag for light variation sounds a bit convoluted to me (unless the vibrate is also doing other stuff). I'd use a noise node with a rangemapper set to 0.3 min and 0.45 max as @DeCarlo said. You can tweak the noise frequency although, randomness being what it is, the light will never actually be on 30% or 45%. To achieve that, you could maybe output a higher range and use a clamp node set to the desired values. flicker.c4d you mean the massive effort of making 3 nodes ? Maybe @gurugugu wants to learn XPresso.
  18. More info on the base80 wheel - BaseWheel1.7.c4d base80onaspline2.c4d
  19. Look in my file - there's an XPresso tag for the base80 wheel with some matrix math.
  20. The base80 wheel is a bit like Roll It. You adjust the wheel radius and move the assembly using the parent null, and the wheel rotates correctly. In this file the base wheel is in another null, on a spline. base80onaspline.c4d In a vehicle, you can connect a (hidden) base80 wheel rotation to the real wheel rotation using XPresso. Just make sure both wheels have same radius.
  21. Interesting problem. Here's my XPresso python node idea - has press button. Position is local. def main(): global X control = doc.SearchObject('control') X = obj[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_X] # get X if control[c4d.ID_USERDATA,1] == 1: # if button pressed X *= -1 control[c4d.ID_USERDATA,1] = 0 # reset button back to off switchx.c4d
  22. I don't think obj has any special meaning (like doc, op etc) - it's more of a convention. Could have been for thing in mylist: <perform task on thing>
  23. jed

    Vacuum Tubes ?

    I turned off my adblocker, and saw an ad at the Cafe for a render farm that boasts 'solid state servers'. Really ? Have they just switched over from vacuum tubes ? I wonder what Cinebench scores you get with a couple of pentodes ... for anyone under 40 - vacuum tubes solid-state
  24. I'd say the best approach is to learn a bit of XPresso and create exactly what you want. It opens up a whole new world of animation possibilities - and is a lot of fun. > my $0.02
×
×
  • Create New...