Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. jed

    Smooth Interpolation

    Have you tried project settings, dynamics, expert, steps per frame. Increasing the default to say 25 or 50 sometimes fixes dynamics. For instance, if an object is moving fast it might intercept a surface even though in theory it should not. Upping steps per frame can give a more accurate calculation and prevent this.
  2. jed

    Smooth Interpolation

    There's subframe in the dope sheet, but I've not used it. Maybe try higher fps ?
  3. I simplified the python in this version - might be easier to adapt to your purpose raymulti4.c4d
  4. I've cobbled together a quick fix to automatically switch object - not all that elegant, but I'll have another look tomorrow. I made a 3rd list 'hit list', a 1 in the list indicates which object is collided. This value becomes the selected var. If there's no hit (ie between objects), I hide the circle and feed dummy value of 0 to the vectors. This is to stop the circle staying where it last was, and to prevent yellow error condition. It's a bit of a hack. I think the correct way is try + exception, but I'll have to google that (or you could LOL). press play on this file raymulti3.c4d no guarantees, but no error messages in the console ...
  5. This is expandable, stores the vectors in 2 lists raymulti.c4d
  6. 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
  7. 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
  8. 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 ...
  9. 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 ?
  10. 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)
  11. You don't need the rangemapper to convert to percent. XPresso treats 0 - 1 decimal as 0 - 100%. > Mr Pedantic
  12. Another from the guys about the perils of using unconditional jump https://xkcd.com/292/ explanation
  13. coding joke https://xkcd.com/1695/
  14. 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.
  15. @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/
  16. 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
  17. 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
  18. 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 ...
  19. 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.
  20. 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
  21. 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.
  22. More info on the base80 wheel - BaseWheel1.7.c4d base80onaspline2.c4d
  23. Look in my file - there's an XPresso tag for the base80 wheel with some matrix math.
  24. 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.
×
×
  • Create New...