Jump to content

Cairyn

Developer
  • Posts

    800
  • Joined

  • Last visited

  • Days Won

    18

Community Answers

  1. Cairyn's post in Can't Get Any Objects was marked as the answer   
    Without trying the code, I suspect you should use some other filter than c4d.SCENEFILTER_0, maybe SCENEFILTER_OBJECTS to actually get objects loaded?
  2. Cairyn's post in Remove tool shortcut in viewport was marked as the answer   
    Yes?
     

    But that's only when you drag the tool itself into the HUD. Not necessarily what you did.
     
    Try something different: go to the Attribute Manager, select mode "View Settings".
    Go to tab "HUD", click checkbox "Active Tool".
    This toggles a HUD setting where the tool is visible as well, with the menu items you describe.
     
    This looks more like what you have.
  3. Cairyn's post in Having tick/cross buttons for all the objects? was marked as the answer   
    You don't. The tick and the two dots are completely different functionalities. The dots control the visibility, while the tick controls the activation. Therefore, only special classes of objects (e.g. Generators, but not polygon objects) have the tick, because only these can / need to be activated.
    Other classes (e.g. cameras) may have different functionalities in place of the tick.
  4. Cairyn's post in Cinema 4D Licensing Error was marked as the answer   
    As the website itself says,
    "This educational license is only available for Release 23 and greater."
    See https://www.maxon.net/en/educational-licenses
     
  5. Cairyn's post in Cinema 4D Licensing Error was marked as the answer   
    As the website itself says,
    "This educational license is only available for Release 23 and greater."
    See https://www.maxon.net/en/educational-licenses
     
  6. Cairyn's post in Creating new polygons by extruding an edge? was marked as the answer   
    Normally you would use the PolygonPen for this, or the Extrude tool. But it's quite hard to judge (the cursor shows the standard "duplication" icon), as you don't include a link to the video, nor tell us the version of C4D that is used in the video (may be ages old), nor what version you are using yourself. I can only make the vaguest guess what's happening here.
    Use the PolygonPen for starters, which should cover your edge extrude / polygon creation needs nicely enough.
    (And you may want to fill your profile.)
  7. Cairyn's post in Why does my object move when I am trying to modify the axis? was marked as the answer   
    If you're really using a default cube: This is a parametric object that is created by the system along its axis, so any change to the axis means that the object changes with it. To get around this, either use a parent null to animate, or polygonize the cube so you can modify the axis independently of the points/polygons.
  8. Cairyn's post in How can I duplicate an object including its Xpresso 'Set Driven' parameters was marked as the answer   
    No, XPresso nodes referring an object are not duplicated when you duplicate the object. That would be fairly crazy as C4D doesn't know what you intend to do with an XPresso setup.
     
    What you'd need to do is to create a setup where your original object bears an XPresso tag which contains a node that refers locally to its object. Then, copying the object will copy the XPresso tag too, and the node will refer to the copy, keeping the setup intact for the proper purpose. The driver, on the other hand, would be implemented as absolute node referring a centralized controller.
     
    Of course you say you want one XPresso tag only, so you've lost the game already.
     
    Maybe you can whip up something with an iterator node, depending on how your objects are hierarchically ordered.
  9. Cairyn's post in invert objects order in hierarchy was marked as the answer   
    Well, this is not too difficult in Python:
     
    import c4d from c4d import gui # reverses sequence of objects # if a single object is selected, it reverses the sequence of its children # if not, it reverses the sequence of top level objects def main(): if op != None: childlist = op.GetChildren() else: childlist = doc.GetObjects() if childlist == None or len(childlist) == 0: return for obj in childlist: obj.Remove() if op != None: for obj in childlist: obj.InsertUnder(op) else: for obj in childlist: doc.InsertObject(obj) c4d.EventAdd() if __name__=='__main__': main()  
    Should work in Python 2 and 3.
  10. Cairyn's post in Any C4D dinosaurs around to explain this ? was marked as the answer   
    Obviously, a C++ compiler for Amiga? Maxon did more than C4D; I remember having a text processing program from way back when Maxon was still Merlin.
     
    I do not have the time to fleece through outdated stuff; feed it to Google Translate or DeepL if you are truly interested.
  11. Cairyn's post in GI not working properly in C4D Octane? was marked as the answer   
  12. Cairyn's post in How to forward one of three Link Inputs to a Link Output with Python ? was marked as the answer   
    Works fine for me, see example.
     
    Either your port types are wrong (but then you should not be able to connect them), or your radio button setup is wrong (but C4D should refuse to show the buttons then), or you have errors in the Python code directly (look at the console)...
     
    Anyway, the radio button output is always the value you set in the UserData management, it's not Boolean but Integer. The Python with some if/elif looks simple enough. Since you didn't include a file I can only guess.
     
    Look at my XPresso/Python code; the result node in the XPresso will show the name of the linked primitive when the radio buttons are triggered.
     
    ----------
    Learn more about Python for C4D scripting:
    https://www.patreon.com/cairyn
     
    LinkSelector.c4d
  13. Cairyn's post in UserData button generating KeyError: data['event_data'] (R23) was marked as the answer   
    Anyway, you put code that was written for a Python Tag into the scripting part of an Interaction Tag. You cannot simply interchange code between different execution contexts like that.
  14. Cairyn's post in Rigging table with complex leg structure was marked as the answer   
    Okay, while the rice is cooking...
     
    First, you will get an issue with your chain's starting points because the distance between the "feet" is changing when you rotate the table. The mechanism only allows the foot to be placed perpendicular to the tabletop. Rotate the table, and the line between the feet becomes a diagonal in the original "rectangle" that the table forms, and therefore becomes longer, which causes the feet to slide over the carpet one way or another. You need to model that, or else the mechanism cannot work properly.
     
    Second, I don't quite see what the input and output variables are for the desired model. I will assume that the height and slant of the tabletop are the input, and that the angle of the leg mechanism and the positions of the feet are the output. (Naturally this doesn't always have a solution, e.g. if you lift the table too high, but I'm going to ignore that.) I will also assume that the center of the tabletop is the point of reference where we measure height and rotation.
     
    Third, I'm not sure whether you even need inverse kinematics here. In fact, IK is going to give you several degrees of freedom but you actually have only one DOF in the model (the leg angle) so you need to have constraints to restrict the IK goal in a proper way. The IK can help you finding the angle, but as far as I can see not finding the position of the feet.
     
    Anyway. Starting from the tabletop, you can take the edges' global matrix to get their positions. (They are also the sine of the slant angle multiplied by the distance between edge and center plus the height of the center, if you prefer to calculate them.) Now you can calculate the position of the foot, as the diagram here shows:
     

     
    Watch the left triangle. The pink side is known, it's the global height of the edge. (Let the green line be the floor.) The angle between the cyan and pink sides is also known, it's the same as the slant angle of the tabletop. The angle between the blue and pink sides is 90° by definition of the situation. Therefore the angle between the cyan and blue sides must be 90°-slant angle.
    The length of the blue side must then be the sine of the slant angle multiplied with the length of the cyan side. As the meeting point of the blue/pink sides is just the projection of the edge to the floor, we now know the position of the foot.
     
    If you leave the calculation of the leg angle to the IK, you're done now. The sliding connection of the leg to the tabletop must fit because the three "sides" of the foot are all of equal length.
     
    Hmm, that's actually another assumption... if the foot is asymmetric, this calculation won't work. But I assume it isn't, because otherwise the feet would slide on the ground even if you just change the tabletop height.
     
  15. Cairyn's post in Folding blades Rig with Xpresso was marked as the answer   
    Okay, I did a specific solution for equal segment lengths, check it out here:
    https://www.patreon.com/posts/59026465
    I made the entry public so everyone can benefit and download the demo scenes.
     

     
    It's too late for a more generalized solution, maybe tomorrow or the day after.
  16. Cairyn's post in Adding Subdivision Surface to object with position keyframes moves it away was marked as the answer   
    Keyframes are relative to the parent. If you add an SDS using ALT, then the SDS's position is taken from the cube, adding that value to the position. But the keyframes still are relative, now to the new position, so you end up with an offset.
    This does not happen if you put the SDS at 0,0,0.
  17. Cairyn's post in Custom Toggle hot key between viewport shading. was marked as the answer   
    There is no toggle for the display modes because there are more than 2 modes, so from a general GUI perspective that makes little sense. But you can easily create a script that will do the toggle:
     
    import c4d if c4d.IsCommandChecked(17105): c4d.CallCommand(12540) # Lines else: c4d.CallCommand(17105) # Gouraud Shading (Lines)  
    Assign it to the shortcut of your choice.
     
    ----------
    Learn more about Python for C4D scripting:
    https://www.patreon.com/cairyn
     
  18. Cairyn's post in Reset transforms in Python was marked as the answer   
    SetFrozenPos/Rot then, with a zero vector as argument. The description in the docs should give you an idea what they do.
    The SetMg/Ml methods set the whole matrix, so that is probably not what you are looking for.
    When in doubt, just try them out 😉
     
  19. Cairyn's post in Strange shading on rigged object was marked as the answer   
    Is that a normals tag on the object? What happens if you just delete it?
     
    (Considering that there doesn't seem to be an SDS on the figure, this must be a super-high-res object 😉 )
  20. Cairyn's post in FCurves graph empty + Unable to merge MoText with a Cube inside a Boole was marked as the answer   
    It worked when I copied your objects into a new file, so you just need to press New File, select all your objects, copy them and paste them into the new file. No need to redo everything (although nobody knows where exactly the error lies so it is possible that some error manifests later - I think that is not too likely however).
     
  21. Cairyn's post in Can we sell / transfer subscriptions ? was marked as the answer   
    Subscriptions cannot be transferred:
     
    https://www.maxon.net/en/legal/license-transfer
     
  22. Cairyn's post in Select Parent Insead of Object? was marked as the answer   
    If you don't have a script (since no one mentioned it, I assume that there is no built-in command that I might have missed) use this:
     
    import c4d def main(): if op == None: return parent = op.GetUp() if parent == None: return doc.SetActiveObject(parent, c4d.SELECTION_NEW) doc.GetActiveObject() c4d.EventAdd() if __name__=='__main__': main()  
    Assign it to "Cursor up" or something to select the parent after a click. Works iteratively if you need the grandparent or such.
  23. Cairyn's post in Hair not evenly distributed on the mesh surface? was marked as the answer   
    Well, uh. It does help if you do not click "Flip Normals" in your sweep, which is essentially the root of most evil.
     
    Here, I have changed that, set the Hair Guides high enough to work with the rope, changed the Guide and Hair placement - this is now still procedural:
     

     
    ...and I can't attach the file since the 10000 guides make it 11MB large, awesome. ☠️
  24. Cairyn's post in Extrude Inner Questions was marked as the answer   
    Switch off the "Preserve Groups" option.
  25. Cairyn's post in Selecting Objects by Specific Tag was marked as the answer   
    The scripting would actually be easy (although it's so specific that I don't have any ready-to-use script at hand) but selecting the tag is less so, as there are so many tags and so many external tags defined by other companies which I don't even know of. So, a dropdown with all possible tags (or such) would be very impractical.
     
    I can offer a very short thing: Select a tag, do not have anything selected in the object column. Execute script. Script will select all objects with that tag.
    If you don't have a tag of that type at hand, it won't work.
     
    import c4d from c4d import gui def hasThatTag(tag, tagType): while tag != None: if tag.GetType() == tagType: return True tag=tag.GetNext() return False def traverseTree(obj, tagType): while obj != None: if hasThatTag(obj.GetFirstTag(), tagType): doc.SetActiveObject(obj, c4d.SELECTION_ADD) traverseTree(obj.GetDown(), tagType) obj=obj.GetNext() def main(): tag = doc.GetActiveTag() tagType = tag.GetType() traverseTree(doc.GetFirstObject(), tagType) c4d.EventAdd() if __name__=='__main__': main()  
    (I suppose my followers on the Python course would be able to program that in a second as well...)
×
×
  • Create New...

Copyright Core 4D © 2023 Powered by Invision Community