Jump to content

Sascha Koeth

Limited Member
  • Posts

    24
  • Joined

  • Last visited

Everything posted by Sascha Koeth

  1. Thanks for the test file! The mesh-based boolean definitly is way more render intense compared to the volume builder internal subtract version. So for an animated sequence that will be no option. And thanks for your insight on the shder field texturing behavior. So currently I will not go into further research on this and mark it as "C4D + Redhsift not able to produce highres thin layered texture based volumes" And work with just a bump map approach.
  2. Wow! Thanks for all the tests on this! I tried to acoid the "Export as VDB then load that"-Concept because of the file sizes of the VDBs when having longer sequences. And yes. A 3D noise works great in that setup. But I really wonder how to apply a texture to any kind of "field"-object. Specially the Shader-Field should be usable in that way. But I don´t know how to use the shader-field to: 1. Maps the texture spherical with a center from the object below (sphere). Like as if you put a sphere with the texture as alpha mask over a volume light... hope thats understandable. 2. Use the grayscale of the texture to define the "thickness" of the field. Maybe combining a sphere field and shader field? Any idea how to do that? I am not getting anywhere with those ideas when testing setups...
  3. Well... that vector type is more complicated than I thaught... seams to not directly be a 1:1 copy of the SDF concept... and thus it's not usable as a workaround ... At least not for me as a non mathemtician. So the question goes back to: Why does volume builder volume type: "Signed Distance Field" not work with redshift volume matierial as it just creates a box and not responds to the content of the volume builder?
  4. I think I am getting closer to a solution: 100cm sphere in volume builder set to 0,3cm voxel size and to set to SDF with a voxel range of 2 creates 5.400.000 voxels 100cm sphere in volume builder set to 0,3cm voxel size and to Fog creates 145.400.000 voxels 100cm sphere in volume builder set to 0,3cm voxel size and to vector uses the SDF settings to calculate how many voxel it wants to use. So volume type "Fog" is too render intense... "SDF" does not seam to work with Redshift volume out of the box... as it actually just creates the complete box that forms the space around the sphere. But. Vector does seam to render only the SDF voxels and showing correctly in Redshift: will investigate into this further...
  5. Hi again and thanks for the link! In there the volume builder is only used for the atmopshere not for the clouds. the clouds are done with a texture bump deformer only appraoch which is allreaady my fallback so to say. But I tried to find a way to do the clouds with volumes not only as a deformed alpha channeled sphere. By now I found that the c4d volume builder limit (when using with my setup ?) is around 600.000.000 voxels. The problem with the setup is, that I only need "a few" voxels on the surface of a sphere and not ALL voxels inside that box that gets auto created around the sphere. But I do not know any way to tell c4d to just calculate the voxels where "volume" appears or only on a surface... because: the SDF Signed Distance Field mode is not working together with the RS Volume Material Only the Fog Mode works... hope that makes sense 🙂 So If I could use the SDF mode AND c4d would only calculate voxels within the restrictions of the SDF then I guess that would work like in my link shown for the blender setup and I would get enough "voxelresolution".
  6. As this stepping degree: ...seams to be the maximum quality I can achieve with the volume builder in c4d. Maybe I asked from another point of view. Can this be achieved with the RS Nodes in C4D: And I only mean the voxel resolution... not the look and atmopshere...
  7. Thanks for your input! I looked into this from that point of view. And found this: 104px sphere with 512 Segments 0,5 voxel size https://prnt.sc/BsEMgFjVjViH 104px sphere with 512 Segments 0,5 voxel size Sphere set to "perfect primitive" in the volume builder https://prnt.sc/uI8w6g0Ui9SN 104px sphere with 512 Segments 0,5 voxel size Sphere set to "perfect primitive" in the volume builder Added Fog Smooth Filter 100% Gaussian 1/1 https://prnt.sc/UqDzBBVu97RL 104px sphere with 512 Segments 0,5 voxel size Sphere set to "perfect primitive" in the volume builder Added Fog Smooth Filter 100% Gaussian 1/1 Inside Voxel Falloff set to 100 https://prnt.sc/TJ1gGCQhdBUW So basicly the the ribbons only really fade when adding all these options. And probably they are not gone but just not visible because the outer once on the surface are faded to near zero. And some of these options can not be used in my case. Like: I can not use "perfect primitive" on the image deformed sphere because I would loose the deformation.
  8. Here is a more close screenshot of the stepping... for better understanding: https://prnt.sc/pHtvnEffU6hb
  9. Hi! I have some volume cloud render difficulties I could need some help for: Goal is getting an Earth Globe and a volumetric clouds layer that is as detailed as possible and based on a cloudanimation grayscale image-sequence. Currently built by using a 100cm sphere that gets distorted by a displacer using the cloudanimation grayscale image-sequence as the shader for the displacer. Then placing that deformed sphere in a volume builder and subtracting a non-displaced 100cm sphere. Shown here: https://prnt.sc/EiPsYNjXdT5r Now the issues I need help with: Currently with my Ryzen7950X+64GBRAM+RTX3080Ti I can not go below 0,2cm voxel size. Anything below that and Redshift stops to display any volumes. But I still have a lot of those circular bending-steps as shown here: https://prnt.sc/bFkRjyJOrSY9 Although I allready added a Fog Smooth and a Fog Curve to minimize them. They will show in animation way more and specially when the camera gets closer to the globe. And the volume builder calculation time with this setting is allready around 1min. So the question is: Is there any way to get more detail into the clouds, less stepping and still much faster setup times within a cienma4D+Redshift setup? Thanks! Sascha
  10. Hi Cairyn, thanks for going deeper with this! Where is a good place to commission those c4d python scripts and who to contact? I´d love to give this into more qualified hands! About your analysis: True again that in a chaotic bunch of splines there might be constellations where the root-point-jump-over approach leads to cycles. But in my case I have a very organized structure. Where all splines are truely branches of other splines and there is no instance where two branches spring from the same point of the same parent branch so all root-point-find-nearst-point-jumps would lead to a spline that is one branch closer to the root. I am working with neuron representations. Here´s one example: Spline_tree.c4d About my scripting skills: I am just starting with scripting in general and with c4d python specifically. So my way at the moment is create the script structure with "logical descriptions" and then try to translate them into python or add some found snippets on the way. Here´s how far I came with that so far (until line 83 (Main Function Core) it´s supposed to be python allready. From there it´s still my "logical description"... ) import c4d from c4d import gui #Sub-Function definitions # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #Returns the ID(index) of the first selected point of all selected points. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # def sk_GetFirstSelectedPointID(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: listy=[] maxEl=PointObj.GetPointCount() bs=PointObj.GetPointS() for index, selected in enumerate(bs.GetAll(maxEl)): if not selected: continue else: listy.append(index) return [ listy[0] ] #Find segment a point index belongs to # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # def sk_FindSegmentByPoint(spline, index): #spline, point index (int) scnt = spline.GetSegmentCount() #get segment count cnt = 0 #var to help us keep track of count position if index > spline.GetPointCount(): #if index is out of range, print 'index out of range' # return -1 return -1 for i in xrange(0, scnt): #iterate through segments c = spline.GetSegment(i)['cnt'] #find current segment count if cnt < index < (cnt+c-1): break cnt = cnt + c #update count return i #return segment index # Main function # Out of a tree link combinded segment where each branch is one segment the function creates a combined spline with each segment beeing a branch-tip-to-root spline # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # def main(): # Main function Preparation # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Check if a spline object and a single point within this spline object is selected: op = doc.GetActiveObject() # Get the active object #If nothing is active display message if not op: c4d.gui.MessageDialog("Please select a segmented spline in object manager and it´s root point in viewport") return #If the selected object is not a spline display message if not type(op) != c4d.Ospline: c4d.gui.MessageDialog("Please select a segmented spline in object manager and it´s root point in viewport") return #If no point is selected display message if op.GetPointS() = False c4d.gui.MessageDialog("Please select a segmented spline in object manager and it´s root point in viewport") return # Variable definitions: sk_ActiveSpline = BaseDocument.GetActiveObject(self) sk_RootSegment = sk_FindSegmentByPoint(sk_ActiveSpline, sk_GetFirstSelectedPointID(sk_ActiveSpline)) sk_PointPositions = sk_ActiveSpline.GetAllPoints(self) #creates a list of all point positions sk_SegCount = sk_ActiveSpline.GetSegmentCount() #get segment count sk_Count = 0 #var to help us keep track of count position # Main Function Core # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # for i in xrange(0, sk_SegCount): #iterate through segments # Startselection of iterated Segment sk_CurrentSelection = select all points of iterated sk_AllSegements # Select all points through all segments until root segment is reached repeat until sk_CurrentSegment == sk_RootSegment # Set rootpoint of sk_CurrentSegment and find nearset point sk_RootPosition = get position of iterated sk_CurrentSegment point00 sk_NearestPoint = get nearest point around sk_RootPosition from within sk_PointCloud array sk_NearestSegment = get segment of sk_NearestPoint # Add selection of all points from nearest point down to root point of sk_NearestSegment iterate down through sk_NearestPoint until == 0 sk_currentSelection = sk_currentSelection + iterated sk_NearestPoint sk_CurrentSegment = sk_NearestSegment # Create separate spline copy from sk_CurrentSelection and join it´s segments create separate spline copy from sk_CurrentSelection and join it´s segments sk_CurrentSelection = Empty # Execute main() if __name__=='__main__': main()
  11. Hi Cairyn, thanks for the quick feedback. You are absolutly right that my example is not the solution to the shortest connection, but I actually am searching for the shortest connection while still jumping only from the roots of spline segments (Becuase my current complex spline setup is build that way). And I feared allready that there is no easy way to do this... I am allready gathering code snippets... maybe I can hack something together and post it here... or with some luck someone else have done something simmilar allready around here... Thanks again! Sascha
  12. Hi! This has been making me crazy on so many projects by now: Is there any way to select all points on the "shortes connection route" between two selected points on a multi segment spline while always "jumping over" to another segment on the first point of the segment? Why bother? I have a complex tree-like structure of splines. Each branch is one segment. now I want to get a selection from one branch over down to the route point, to have a "shortest route travelpath"-spline in the end. If that does not seam to make sense to you, here´s a different way how to describe this within a more simple setup: I have a 3 segment spline. Each segment with let´s say 200 points. So in short S1P1 ... to ... S1P200 + S2P1 ... to ... S2P200 + S3P1 ... to ... S3P200 I select one point on segment 1 and another point on segment 3. Now the script/c4dfunction/plugin should do the following: Check proximity between the starting points of all segements to find those points that are the closest between seperate segments and their starting points. The result of this search would bring up: S1P1 - S2P36 S1P1 - S3P120 S2P1 - S1P22 S2P1 - S3P12 S3P1 - S1P65 S3P1 - S2P99 Then filter out the longer distances of each segments pairings, leaving the shortes distance pairs for example: S1P1 - S2P36 S2P1 - S1P12 S3P1 - S2P65 Now let´s say I select S1P1 and S3P65 and want to select the shortest "way" jumping from point to point. This should lead to a selection like this one: S3P65 ... to ... S3P1 + S2P265 ... to S2P1 + S1P12 ... to S1P1 Now I could separate those selected points on the 3 segments and join them into one new spline and would have the shourtest spline connection between the two initaly selected points. Within a complex multi segment construction. Attached an even more simple example. Anyone capable of writing this script or even better, is there a c4d built-in solution or another easier way or a plugin? Thanks! Sascha
  13. Thanks a lot for the detailed feedback !! I was distracted from going on with the script due to another project that is more urgent, but I will get back to this very soon and test it!
  14. Hi DAST and CAIRYN, thanks so much for giving this a thought! The thing is I started of with: " # Loop through selected directory for file in sk_filteredfiles: # Load and activate current project from list c4d.documents.LoadFile(file) c4d.documents.GetActiveDocument() " But that does NOT load the scene into the editor and use it as the CurrentActiveDocument. It only loads it into the editor list of documents. So here are my updated questions integrating your answers: - How to use LoadDocument and inserting it as the current "ActiveDocument" (Which I think is the "state" needed) without "instantly losing it" ? Meaning how to use InsertBaseDocument() correctly in my case ? - How to use LoadFile and then actually putting that file as the currently ActiveDocument ? Meaning how to "select" it out of the editor list of loaded documents ? As I said I think there can be 3 different states a document can be "loaded" but not be the currently ActiveDocument: A) Beeing loaded into the memory with LoadDocument() B) Beeing loaded into the editors list of available documents with LoadFile () C) Beeing loaded into the state of beeing the BaseDocument which probably is similar to A) and could be done with MergeDocument () I tried to visualise that for me to better understand it: https://miro.com/app/board/o9J_kjIM1Ko=/ And i tried to use c4d.documents.InsertBaseDocument() c4d.documents.SetActiveDocument() c4d.documents.GetActiveDocument() ...to get them out of one of those 3 for me unusable states into beeing the ActiveDocument But obviously in the wrong way... So any kind of guidance or example how to properly use InsertBase / SetActive / GetActive Document in my case would be amazing! Thanks! P.s.: And beyond that I would be highly interested in a link to any kind of knowledgebase (Not the SDK as that is nothing more than a glossary without context) that teaches the differences, (dis)advantages or basicconcepts of the two states: Beeing the active document (visible in the editor) and beeing loaded but beeing a "non-active" document. I guess it is mostly about performance and handling multiple document contents at the same time.
  15. Hi! I am a total beginner in python ... so this might be easy :) I am using C4D Release 20 and looking for a way to import files and then work with the files as if they where actually in my C4D Editor. With that I mean I want to work with those CallCommands etc. I know that´s not the pro way but... I am not a pro yet ;) Down below you se the code so far. The issue now is that this line: c4d.documents.LoadDocument(sk_doc, loadflags = 0) ...does not really load the file into a state where I can work with it. At this point my editor still shows my empty "BaseDocument" and if I try to "GetActiveDocument" I get a FALSE boolean return. So for python I still have loaded nothing it seams. I allready tried all sorts of other "loading" methods as you can see here: https://miro.com/app/board/o9J_kjIM1Ko=/ So somehow I think I need to get the loaded file out of some obscure hidden "position/state" into the state of the "ActiveDocument". So I added those lines here: c4d.documents.InsertBaseDocument(sk_doc) c4d.documents.SetActiveDocument(sk_doc) But with them I get a "TypeError: argument 1 must be c4d.documents.BaseDocument, not str" And I have no idea how to change the file URL into a "c4d.documents.BaseDocument"-Type... Any idea anybody? Thanks! Sascha import c4d import os from c4d import gui from c4d import documents # Main function def main(): def tool(): return c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL) def object(): return doc.GetActiveObject() def tag(): return doc.GetActiveTag() def renderdata(): return doc.GetActiveRenderData() def prefs(id): return c4d.plugins.FindPlugin(id, c4d.PLUGINTYPE_PREFS) # Set Variables for pathes with dialog c4d.gui.MessageDialog("Please select the folder with the BVH files.", type = 0) sk_sourcefolder = c4d.storage.LoadDialog(flags = 2) c4d.gui.MessageDialog("Please select the destination folder for the converted .c4d files.", type = 0) sk_exportfolder = c4d.storage.LoadDialog(flags = 2) # Listing and filtering all .bvh files in directory sk_filteredfiles = filter(lambda x: x.endswith(".bvh"), os.listdir(sk_sourcefolder)) # Loop through selected directory for file in sk_filteredfiles: # Load and activate current project from list sk_doc = file print sk_doc c4d.documents.LoadDocument(sk_doc, loadflags = 0) c4d.documents.InsertBaseDocument(sk_doc) c4d.documents.SetActiveDocument(sk_doc) # Set Render Settings c4d.CallCommand(600000098) # Projectname_As_Rendername c4d.CallCommand(12161) # Edit Render Settings... renderdata()[c4d.RDATA_RENDERENGINE] = 300001061 # Use Hardware OpenGL renderdata()[c4d.RDATA_XRES] = 400 # X Render Resolution renderdata()[c4d.RDATA_YRES] = 400 # Y Render Resolution renderdata()[c4d.RDATA_FRAMERATE] = doc[c4d.DOCUMENT_FPS] ... a lot more code to follow
×
×
  • Create New...