Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. This tutorial is similar to your scene and has a similar lag problem. The guy has his XPresso in 4 windows and he sets the priority of the last XP tag (furthest to the right) to generators -499. Seems to fix the lag. If all your XP is in one tag, maybe you should break it down a bit.
  2. Looks like I got through to the 'bad Python Guy'. In his latest tutorial he uses the correct methods for variables. When he types in variable values, he actually says 'now in times past I would have done that [], we're not going to be doing that any more because I've been educated since our last meeting with Python and I'm not going to be using that technique any more there's a much better way of doing it that is a much more efficient way of doing it but it's all a learning curve and I'm a student too'
  3. You won't find 'get cube Y position' on any learn Python website. I was, of course, referring to Python after the c4d module has been imported.
  4. IMO there's 2 types of Python - regular Python and C4D Python. Regular Python tends to be a run once scenario - start at the top, execute the code, done. There's a million websites where you can learn regular Python. C4D Python tends to be code that runs every frame, getting and writing data on the go and interacting with the host program. C4D Python is therefore more complex. The Maxon documentation for Python is a nightmare - The Official Cinema 4D 2023.1 Python Documentation — Cinema 4D SDK 2023.1.0 documentation (maxon.net) Try searching for something as basic as 'get current frame' and you get 100 pages to sift through. My method for finding code snippets is to find a script that is similar to what you are doing, look at their code, and copy the relevant lines. The Maxon method takes hours, my method takes 10 minutes and yields frame = doc.GetTime().GetFrame(doc.GetFps()) # get current frame For these reasons I like to see YouTube videos where folk can just copy the lines of code they need - providing the code is correct. That's why I took issue with the guy who inspired this rant.
  5. The guy has talent . On this Geneva lock scene he did all the heavy lifting ie getting the shapes right. I just did a bit of arctangent - his XPresso was pants Geneva Lock - Sketchbooks - Core 4D Community Ditto these jumping platonics - his idea is good, but needed better Python Jumping Platonics ! - Sketchbooks - Core 4D Community YouTube comments aren't really the platform for helping people like him. Comments can be held back for approval, and anything other than 'cool tutorial bro' gets deleted.
  6. The YouTube guy has been running his channel for 4 years, so I guess he sees it as something important in his life. To have someone like me come along and say 'all your work is rubbish' must be a bit hard. He has about 85 videos split between XPresso and Python. I know from experience that a 1 hour tutorial doesn't just take an hour to make. For him to re-write the Python for one tutorial and then record it would take a big chunk out of one's week. Fixing all his bad videos would take about a year. It would also be somewhat soul destroying. Seems to me that he has 2 choices - close down his YT channel, or stick his head in the sand and pretend everything's hunky dory. That's assuming he can see that his coding method 'everything is a list' is wrong. I'm intrigued as to why he thinks everything is a list. In the early days of programming, with some languages you had to declare all your variables first - floats, ints, vectors, arrays etc. Maybe this is why he sees a list as a container for a value (if you only use the 1st element). Maybe. List man must hate my guts 😀
  7. I was just a bit concerned that noobs watching the tutorials would copy the guy and produce nonsense of their own. Even if the dude knew what he was doing wrong, he's unlikely to re-record 50 videos. He actually answered one of my YT comments, but seemed somewhat annoyed - 'if you'r so clever then make some tutorials'. << internet is full of rubbish shock ! >>
  8. What would you do if you saw a C4D Python tutorial channel on YouTube where the Python code was not just occasionally a bit illogical, but every single line of Python was absolutely insanely 150% wrong ? In Python there's the concept of scope where global and local variables are kept separate, for a good reason. When you write a function, the variables inside and outside should never meet. Get it wrong and you won't crash Python - you just get a few unexpected results. Enter our YT script 'expert' - he doesn't understand the above. This dude sees scope, local + global variables as a defect in Python that can be bypassed with some crazy 'hacks'. He has methods to make anything that moves a global variable. His global variables can wander unchallenged through any function, changing values along the way, ignoring any rules about passing variables into the function correctly and only leaving at 'return'. So what are these blasphemous hacks ? Basically, he makes every variable the first element in its own list. Assigning values etc to variables is done using list commands - len(), append(), del(), pop(). Apparently lists are global (I didn't actually know that), but just to be sure he also declares all the variables global. Want to make a variable zero ? Just delete it ! Is a value zero ? test if the length of its list is <1. if trigger == 0: trigger = 1 becomes if len(trigger) < 1: trigger.append(1) His scripts are a sea f unnecessary square brackets, interspersed with list commands. I find myself reverse engineering his nonsense, just to see what's going on. Sometimes it's just too much and I give up. To be fair, some of the guy's scenes are interesting, but I opened one tutorial recently and he began 'OK we've got 6 variables, so we're gonna need 6 empty lists'. I'm screaming NOOOOOOOO at my monitor. I'm not on social media, but I might sign up just to name and shame the Python Cowboy. What would you do ? Reminds me of a line from an xkcd comic - 'whatever - it runs doesn't it ?' 'so does a burning bus...'
  9. @bezoit's working ok now
  10. Panic over - everything returned as mysteriously as it disappeared. @MashI'll bookmark that bookmark tip 😀
  11. I've always found the C4D dope sheet a bit of a minefield. Today I wanted to make a spline linear, so I went to f curves but it was blank. Ditto dope sheet.I must have clicked something. I'm sure in the past I've clicked automatic something or other and all the curves reappeared. This is on R23 and there's a million checkboxes... I'm getting too old for this malarkey.
  12. I was watching a YouTube tutorial on the Geneva Lock, and the animation part was a real mish-mash of illogical XPresso and some bad Python. What I'd call the interesting part - the peg and slots interaction - he just used a rangemap and tweaked it until it kinda worked. The poster admitted he wished he had the math skills to do an accurate version where everything lined up correctly. Now there's a challenge I couldn't resist ! There's some math in the zip file. geneva.zip
  13. Homer and Bart moon the Google van homer.zip
  14. The YouTube guy has an Essex accent, so we speak the same version of English 😀 Am I right in thinking I must select some edges to make the mouse SDS weight thing work ? Here's the video in question https://youtu.be/IbHntU5MiU4?t=141 about 2m20s in
  15. Just been watching a tutorial where the guy has an extruded cube in a SDS, then he says something like 'hold down full stop and click and drag' - see before and after. Any idea what's going on and what it's called ?
  16. Here's a Python Effector animation based on an idea by Expresso Mechanic on YouTube 1 platonic.c4d
  17. Try this arrow Tool.c4d tested on R21, 2023
  18. An XP version is probably going to be non dynamic. Here's a Python sim - if you want the sphere to roll, you'll need Roll It or equivalent sph2.c4d Roll-It 2020 EN – eggtion.net
  19. If you explain what you are trying to do, maybe someone with more Python knowledge than me can help you.
  20. Reading the CallCommand warning, I think you should only use make editable in a script. Maxon info was from here.
  21. oops - my mistake. I have tried 23, but wasted too much time playing where have they moved 'x' to. Then there's the nodes... Compared to other software, C4D has been amazing in the past re compatibility across different versions. Old dog new tricks etc.
  22. 'Set initial state' will set dynamics at F0 to dynamics at current frame.
  23. Don't think you can do this from XP
  24. Rad and bounding box work a bit differently - rad returns size along object x, y, z (result doesn't change when obj rotates) bounding box returns size along scene axis (result changes when obj rotates) here top is the parent null containing 3 objects import c4d from c4d import utils def main(): global x, y, z mg = top.GetMg() result = utils.GetBBox(top, mg) # returns 2 vector tuple >> center position and radius of bounding box radius = result[1] x = radius.x * 2.0 y = radius.y * 2.0 z = radius.z * 2.0 bounding box 3 objects.c4d Bounding Box position can sometimes give the 'wrong' result.
  25. Sort of - but it's a bit flaky. You can use the standard hierarchy path to go up/down etc using a reference node. I just used D to go down one level from sphere to figure, then similar XP as the radius to control the figure height. I tried using scale, but it exploded. Object Disappearance_0002.c4d
×
×
  • Create New...