Jump to content

DALII

Registered Member
  • Posts

    49
  • Joined

  • Last visited

Everything posted by DALII

  1. Hi Smolak, thanks for your approach / setup to that problem. I tried your scene and while I'm still a little bit overwhelmed with all that stuff, some things I didn't even know they exist, I'm happy about the outcome. Even tried to use the Projection object and it still works fine. One thing that probably could be done inside expresso is the extension of the source spline. If I want to separate a segment and / or extend it a little bit I have to add the nodes manually inside the XPresso tag. But if it works it's worth the time! Being able to use the Projection object really is a bonus. Thank you! Now I'm off to check out what these purple splines are and why they make some gaps between the cubes 😄
  2. Would it be possible to mimic the Cubic (World) projection with this setup? That would result in an uniform UV scaling over multiple assets? Would be nice to use it with Corona Patterns that are configured to work with the Cubic mapping?
  3. Yes, looking for an option to split a spline into those straight segments / lines. Here is a screenshot of the current version of the Python Generator with an Extrude. In this example the spline is projected on the floor beneath and the step effect is irregular. (not like how it would be possible with a Cloner). Sadly in my Python Generator it is not possible to use the new Projection Object to keep the spline on the floor in a non-destructive easy way. For this I had to change the spline points manually. (But! With your Node setup it would be possible) Also attached is a scene with the screenshot setup + the stacked nodes to get a nice fence. FenceFence.c4d
  4. Thanks for the node! One thing I really want the node to do is the flattening of the single line elements. Both points should have the Y value of the first point. That would give me the stepped spline. But regarding the understanding: The first group is only to define if the spline should be closed or not. Then it looks like, inside the Control Point Logic, the position value for points of a spline is stored inside the color? What I really don't understand is why I need a Position value for the Split Spline node. 😄 But the whole setup looks quite manageable if everything is clear. Guess I'd need another Spline Control Points loop, but one that can iterate through pairs of points, or even through segments only. But then the thing with the position and the color comes back and why the position is only in the red channel, which should only define one axis? :S It is still quite confusing for me. There is no real F1 / Documentation right? And also the Data Inspector in the Debug menu shows the same information over and over again. But yeah. That was a quick dump of my experience with the nodes. Anyway a big thanks for your node object thingy. 🙂
  5. Nope. But sadly my skills with nodes are way worse than with Python code. I already tried to wrap my head around some of your great examples in the capsule file pit thread, but at least a few months ago I had to give up. (Even though I already build one or two generator-like things with the 'stacking the child nodes below a primitive' method. Using them inside the node editor still confuses me. If you would try your luck with that example I'd really appreciate it! I believe that generator node could be useful to a lot of people. At least in ArchViz we sometimes have to create such kind of walls / fences. One addition: I've adapted my code to give me the in-code possibility to create gaps. Kind of a nice workaround for not having the option to add more than one child below the Python generator. Really looking forward to your solution (only if you want, of course!) All the best! import c4d doc: c4d.documents.BaseDocument # The document the object `op` is contained in. op: c4d.BaseObject # The Python generator object holding this code. hh: "PyCapsule" # A HierarchyHelp object, only defined when main is executed. def main() -> c4d.BaseObject: """Called by Cinema 4D to retrieve the cache of the Python Generator object. """ source = op.GetDown().GetClone() pointcount = source.GetPointCount() return_null = c4d.BaseObject(c4d.Onull) temp_splines = [] empty = [1,8] for i in range(pointcount-1): if i in empty: print ("Gap Gap Gap") else: spline_temp = c4d.SplineObject(2,0) pos0 = source.GetPoint(i) pos1 = source.GetPoint(i+1) pos0_new = c4d.Vector(pos0[0], pos0[1], pos0[2]) pos1_new = c4d.Vector(pos1[0], pos0[1], pos1[2]) spline_temp.SetPoint(0, pos0_new) spline_temp.SetPoint(1, pos1_new) temp_splines.append(spline_temp.GetClone()) print (len(temp_splines)) for i in range(len(temp_splines)): temp_splines[i].InsertUnder(return_null) c4d.EventAdd() return return_null
  6. Hi all! Wish you a happy new year! I'm challenging myself with a Python Generator in C4D that uses a Spline as a child object and splits it up into multiple segments, that each point to point connection turns into a separate line. That line then has the identical Y value for both points, which makes it a straight line regarding the height. If the source spline has some elevation, the output spline should have a 'step effect'. The end result should be a spline / generator that I can put under a Extrude and Thicken, which gives me a stepped brick wall for example. Here is my Python Generator code. I'm no real programmer - what should explain the lines below. But hey, it works under some circumstances. If I have only one spline as a child object and if I disable the spline after my Generator did its magic I get a spline which can be extruded. My question for this setup would be: Is it possible to tell my Generator that it should ignore the child object with the output? Because if I enable the child object spline, the output has the step-spline and also the original spline included. And a follow up question if someone is interested: Is it possible to get a better version of this? My first idea was a single c4d.SplineObject where I rebuild all segments into one single spline object. This way I may could think of an option to add more than one child. But this is everything I could achieve for now. Hope you're doing fine! import c4d doc: c4d.documents.BaseDocument # The document the object `op` is contained in. op: c4d.BaseObject # The Python generator object holding this code. hh: "PyCapsule" # A HierarchyHelp object, only defined when main is executed. def main() -> c4d.BaseObject: """Called by Cinema 4D to retrieve the cache of the Python Generator object. """ source = op.GetDown().GetClone() pointcount = source.GetPointCount() return_null = c4d.BaseObject(c4d.Onull) temp_splines = [] for i in range(pointcount-1): spline_temp = c4d.SplineObject(2,0) pos0 = source.GetPoint(i) pos1 = source.GetPoint(i+1) pos0_new = c4d.Vector(pos0[0], pos0[1], pos0[2]) pos1_new = c4d.Vector(pos1[0], pos0[1], pos1[2]) spline_temp.SetPoint(0, pos0_new) spline_temp.SetPoint(1, pos1_new) temp_splines.append(spline_temp.GetClone()) print (len(temp_splines)) for i in range(len(temp_splines)): temp_splines[i].InsertUnder(return_null) c4d.EventAdd() return return_null
  7. Big fan of both plugins mentioned above. Thought of mentioning this here after I've found this topic and realizing there are no feedback answers yet. 🙂 Using the RMB plugin for many operations, depending on what I'm working right now. Welding, Splitting and so on ... Dials plugin is opened with TAB. PS. Don't want to bother you but it looks like that the RMB and DIals plugin are not working with the new 2024 version. SearchMaterial on the other hand works fine. Just mentioning it here ... No pressure 🤓
  8. Unfortunately not, no. "Importing" the external data is still done by hand. 🙂 Combining both actions as shown above would be the next big help to make that process a little bit faster. But those SendModelingCommands are still a mystery to me ... 🤓
  9. Hi @kalugin, what exactly do you mean with source files? The script above is all I have regarding code and the scene contains only a simple plane with one face. In poly edit mode I use the 'Create Point' tool to create a new vertex at the desired position, then I run my script once which brings the dialog to enter my height, after that it starts again with using the 'Create Point' tool and so on. Quick screenshot of the test scene. I've attached the two tools I'm using into the interface for quicker editing. (marked yellow) Nice outcome would be that the script executes automatically after I've created the new vertex. What way of even more automated are you thinking of? Always open for a even more automated process. 🙂
  10. Hi all! My goal would be a script that merges together some steps I'm doing right now to create a plane with height spots / points on it to build a terrain based on information I get from PDFs / other external sources. Right now I create a simple plan with no subdivisions, then use the 'Create Point' tool to click on the spot where I want my new point, and after it creates a point I give that point the right height information and so on and so on. I've already created a script that gets the last point index and with a dialog window I can enter the relative height of that point. from typing import Optional import c4d from c4d import gui from c4d import utils doc: c4d.documents.BaseDocument # The active document op: Optional[c4d.BaseObject] # The active object, None if unselected def main() -> None: GetLastPointID(op) def GetLastPointID(PointObj): if PointObj is None: c4d.gui.MessageDialog("Please select one point based object!") return elif not PointObj.CheckType(c4d.Opoint): c4d.gui.MessageDialog("Please select one point based object!") return else: maxPoints = PointObj.GetPointCount() pointHeight = gui.InputDialog("Height?") pointHeight = pointHeight.replace(",",".") PointObj.SetPoint(maxPoints-1, ((PointObj.GetPoint(maxPoints-1)[0]), float(pointHeight), (PointObj.GetPoint(maxPoints-1)[2]))) c4d.EventAdd() if __name__ == '__main__': main() Now: Everything would be a little bit more user-friendly, if that script could open the 'Create Point' modelling tool, let me do my work and after I've created a new point the 'height part' should follow. A really nice-to-have would be that the modelling tool would stay active and I don't have to activate it again. I've found the section about the c4d.utils.SendModelingCommand in the documentation (c4d.utils — Cinema 4D SDK 2023.1.0 documentation (maxon.net)) and also the ID for the 'Create Point' action (ID_MODELING_POINT_ADD_TOOL), but it looks like the SendModelingCommand doesn't work well with actions that require user action afterwards? It only creates new points automatically everywhere (because of MODELINGCOMMANDMODE_ALL, I guess) My question is: Is there any chance that my desired script-combination is possible? 🙂 I'm not really that into programming / scripting, just some python fun from time to time, which kind of limits me to these small little scripts / executables. Guess with writing a whole plugin such a script would be easy possible. Anyway, thanks for any answer in advance!
  11. Really appreciate your help here! Thank you! I tried your asset setup and it works really well. I even tried to add my little connect node, which now allows me to use an Extrude node for the whole spline - finally editable thickness for my walls. But it looks like - obviously - that an offset applied with scale isn't the best way for correct measurement. (If the Scale node does that work(?)) Guess the 'Create Outline' does work a little bit different. But it is again a really nice example for asset / capsule creation to learn from. I realy don't want to fill that capsule file pit with my comments now 🙂 Again: Thank you, really awesome stuff! Quick screenshot of the working thing. 🤓
  12. Hi! Me again. Since I downloaded your scene I've tried many times to somehow get a working, usable Asset / Capsule out of the nodes, but no luck. Would this be even possible with that setup? The most promising thing I could attach together is my little Geometry Modifier Group where I rearranged the input node to the new Geometry input. The double output is only for testing. Tried to output only the bottom Geometry Op, to get only the modified spline, but doesn't work either. (Guess to use it as a correct working modifier I have to assemble both point arrays into one spline somehow) But for now, would you say that it is possible to create a usable Capsule (hope I'm using the right term for these objects) out of it? Really like fiddling around, but the few resources that exist on that topic make it a little too hard. 😕
  13. This is exactly what I was after, yes! There is no need for overlap detection for my use cases. It looks like the built-in Outline tool works the same way as your capsule anyway? 🙂 I'm proud to say that I even understand the nodes beneath (I guess, at least) Thank you! I'll have a look into the other provided capsules here and maybe understand that stuff in the future 🙂
  14. Ok, I understand. 🙂 At least now I know that I need a workaround if the other 5% happen! Thank you for your explanation!
  15. Ah - that's it, yes. At least an answer that removes the guesswork 🙂 In the Extrude node is the option to reverse the normals, which turns every segment on the opposite site. Just one last question from my side: Wouldn't it be 'logical' that reversing one segment of the spline also changes the 'normals side' of that specific part? Anyway, a big thank you! Splitting the spline and usin the 'Reverse normals' option works for me now 🙂
  16. Really nice examples! Would it be possible to recreate the 'Create Outline' function, but in a non-destructive way with a capsule? Changing the offset afterwards would be awesome! Instead of deleting the additional part and re-applyin a new outline.
  17. Thank you Cerbera! What I discovered recently was that the segment extrudes in the right direction if the 'bottom, vertical part' of the segment is shorter than the top part. (as seen in the screenshot, I've moved the selected point upwards until it flipped)
  18. Hi! Trying out the new stuff that came with 2023.2 and while playing with the new Thicken modifier I came across a funny 'problem'. I have a simple scene: A spline with an Extrude (Y axis) and a Thickness modifier to create, yeah, thickness. The problem is this: While the spline contains only one segment and is closed, the thickness stays correct in all directions, for each position amount (-100% and 100%). But if I split the spline into parts / segments, there is that one point where it all kind of breaks and one of the segments starts to 'extrude' in the different direction than the others. Reversing the segments direction doesn't do anything at this point. (I've screenshots attached for each situation + the scene) This setup would allow me to create a thick wall with only one spline which would be great. I'm not sure if it is a problem for the Thickness modifier or if I simply don't understand splines good enough. I believe I've gotten into such a situation before but with the good old Sweep. Is there anything I could do to change this or at least to understand this? Regards, David Spline_Test_Scene.c4d
  19. Yeah, Mat is not the best option for internal materials. The only thing I could imagine is a check for the Color Channel / Texture slot, because the material has a sky object connected. But I guess that is no good workaround either and only works in that specific situation. Maybe I'll contact support and demand a name change!
  20. Finally! Whole thing bothered me quite a while now, but I'm quite certain now: We're using Corona Render including Corona Sky. It seems like the material that appears after I click your script is the internal material for the Corona Sky object. After the material is visible, I can change something inside the Corona Sky object and the changes also happen inside the material. When I delete the material, the viewport background changes and the sky disappears. Looks like the material is solely for the viewport background, because the rendering still works - it is only affecting the viewport. Quite funny: 'Delete Unused Materials' deletes the material too and the background disappears. Adding a new Corona Sky works and the sky is visible again ... I guess your script digs a little too deep into the material hole in that case. Nothing is lost there, but I imagine it could be frustrating if you don't know what is going on. I've created a new comment in case someone else is looking for that behavior
  21. In this regard: It maaaybe wasn't that simple. If I open the template scene, delete unused materials and then use your script, no additional material appears. But if I open the template scene, delete unused materials and then save the scena as my new template scene, the same happens again if I open the new template and use your script afterwards. Of course it won't happen if the unused materials are deleted before, again. Really strange problem, but it has definitely something to do with our template scene. But, to be honest it is no big deal to delete that material once. I don't want to bother you with that any further
  22. Did a quick test: This only happened with our new / template scene. In a blank new project everything worked fine, as it should be. It looks like it is fixed, if I use 'Delete Unused Materials' before executing the script the first time. Maybe there is an old material somehwere unused in the cache / system / or whatsoever (?) Seems fixed now! Thank you for pointing out that it had to be on our end!
  23. 2023.1.3 works for me! But it looks like the plugin always creates a material called 'Mat' with a Sky texture applied when it is used the first time in each new project. Kind of strange behavior. After that I can delete the material and it won't appear again. Anyway, really great little plugin to work with in big scenes! Thank you!
×
×
  • Create New...