Jump to content

dast

Registered Member
  • Posts

    1,280
  • Joined

  • Last visited

  • Days Won

    68

Everything posted by dast

  1. I didn't read the whole code, but using GetActiveObject does only work when a single object is selected. When multiple are selected it returns None. You should be using the GetActiveObjects(flag) Try following script with one and then two objects selected, and notice the difference. import c4d def main(): obj = doc.GetActiveObject() print obj objs = doc.GetActiveObjects(flags=c4d.GETACTIVEOBJECTFLAGS_0) print objs if __name__=='__main__': main()
  2. The default custom checker doesn't use a tiling option, it simply allows to indicate how many cells the checkerboard consists of. Not sure I can introduce tiling in an easy way, but I understand the reason for wanting this. Nothing promised, but I'll see what can be done in a future update.
  3. Thanks for the feedback, Gezza. And apologies for a late reply. It is true you cannot align by selected items. The align tool allows for its own interactive selection instead. The reason for this is to avoid having to perform quite some validation on the user-selected items when performing an align. When only dealing with the align tool's interactive selection, that selection is sure to be valid, and also visually indicates what will be aligned. Additionally, due to the tool's possible options (parallel loops, parallel rings) there needs to be an interactive selection anyway. More so, the interactive selection allows to specify which edge or polygon is to be the reference for the whole alignment to be performed. As such, introducing alignment on selected items will require quite some work, while providing only a limit functionality to what is currently available via the interactive align selection. I could indeed allow the items to remain selected after the align tool has been used (via an option in the Attribute Manager, or via an option/modifier key). This would indeed allow for a quick repositioning after the alignment, without the need of re-selecting things. Then I wonder why this small repositioning is required afterwards. You could also reposition the reference item being used for the alignment, before the alignment is performed. I agree this will probably not work for all scenarios and will consider your selection request for a next update.
  4. Version 2.5 has been released, and sent out to the current customers. Demonstration video showing the new additions:
  5. Just for completeness, and future reference, I will include the answer I provided on your same thread over at the plugincafe. Having explained that the best option was to rename the tag after it was created, of course, you need to be able to obtain the created tag. Which obviously cannot be done directly from the callcommand. So I came up with following code. Maybe not the best approach (I am not a Python developer). import c4d def main(): doc = c4d.documents.GetActiveDocument() obj = doc.GetActiveObject() tags = obj.GetTags() c4d.CallCommand(12235, 12235) newtags = obj.GetTags() newname = "NewName" for tag in newtags: if tag not in tags: # this is your newly created UVW tag # rename it tag.SetName(newname) c4d.EventAdd() if __name__=='__main__': main() Basically, you get the list of tags applied to your object, then perform your callcommand to generate the UVW tag. Then you get the list of the tags after. The difference between the tags after and before your callcommand will give you the UVW tag being created. Then it's simply a matter of setting its name. Notice that I left out validation code, checking if an object was selected ... and such things as error checking.
  6. As explained the code I provided gets the first UVW tag. Have a look into the Cinema 4D Python SDK documentation how to obtain the second UVW tag. In your case (when you want the second uvw tag), use the index value 1 (since zero-based). As such you will need to write: uvwtag = obj.GetTag(c4d.Tuvw, 1) But in some situations the tag you need won't be the second one. As a result you'll probably have to find a way how to make sure that the obtained uvw tag is the one you need. Coming back to you original question, where you mention that you are able to create an UVW tag, but are unable to rename it. If you create a tag, you should store the created tag in a variable, which you can then use to rename it. Much simpler than trying to get to the appropriate tag afterwards. So, when you create it, get a "pointer" to it, and rename it via its "pointer".
  7. If it changes the texture tag's name, that means you have that tag selected, as your function tag() return the currently selected tag. Try the next piece of code instead. It gets the currently selected object from your scene and gets the first UVW tag of that object, then renames it to "NewName". import c4d def main(): doc = c4d.documents.GetActiveDocument() obj = doc.GetActiveObject() if obj == None: return uvwtag = obj.GetTag(c4d.Tuvw) if uvwtag == None: return uvwtag.SetName("NewName"); c4d.EventAdd(); if __name__=='__main__': main()
  8. use the SetName() function on your tagm, as in: tag().SetName(newName)
  9. The product page doesn't contain the version number, since I have no access to update/manage the store pages. For every change in product description I would need to contact the owner of the C4DCafe website to make these changes. As such, I had decided not to include any reference to plugin version number, as this would require more maintenance for store owner. When purchasing the plugin via the C4DCafe Store you actually only purchase the license. As mentioned in the product description you then contact me via PM or e-mail (preferably e-mail) with the necessary information to complete the order, upon which you will be sent the latest version of the plugin. Which currently is 1.2
  10. Thanks for replying bezo. The plugin has been released about something more than a year ago, what was then version 2.0 Since then updates have been released with additional features. Price of the plugin has also increased over the past year since more and more features have been added, but customers have received these updates for free. I am currently finalizing version 2.5, with some more updates coming in the future.
  11. I can provide a solution where the image is kept non-square while the UV canvas remains square. For this I would then provide two options: "fit" and "fill" The "fit"option will fit the image with the largest dimension into the UV canvas (in the above example: the width), this will introduce blank spaces above and below. With the "fill" option the smallest dimension is used to fit into the UV canvas (in the above example: the height), resulting in the image being clipped in the width. I might introduce additional options to allow offsetting the image into the UV canvas after fitting. By default the image would be centered into the UV canvas.
  12. I will see what I can come up with, but cannot promise any solution available in the 2.5 time frame Just to make sure we're on the same track. What exactly do you expect to achieve with the fitting? Do you want the UV's to fit to the non-square inage, or the non-square image to be fitted to the square UV canvas? What do you mean by "it changes the image" when using the Texture Size command? How is the image adjusted, and in waht way would you want it to adjust instead?
  13. Thanks for the feedback so far. @bezo One thing to understand is that most of the UV editing functionality is not available to plugins. I always wondered why so few UV related plugins existed for Cinema 4D. Once I started writing my own I soon understood the reason. As a result, all required features have to be designed and written from scratch. No way to simply re-use built-in features. At least not with the current R19 SDK. Who knows what R20 will bring us. @avideditor I usually want to introduce more than just a few changes per update. As such, the release of 2.5 update will need to wait after the necessary additions are all implemented. Then a beta cycle follows, which might last a while depending the issues encountered. The fewer extra features are added the sooner the update is released ... It all comes down to balance between the number of features to add and the time the customer wants to wait between updates. @Cerbera The distortion display mode was something I wanted to try. I still am wondering about the right distortion indication to use. The standard seems to be to visualize red polygons where the UV's are stretched, and blue where they are compressed. Logically I would expect the opposite (red for compression -> hotter, blue for expanded/stretched -> colder). I suppose it depends how you want to indicate the distortion: from point of view of UV -> Texture -> Mesh, or from point of view of Mesh -> Texture -> UV. Seems the standard is Mesh -> Texture -> UV: when a large mesh surface gets a small texture area, the mesh gets compressed into a small UV space (= red). Logically I would expect you're interested in the UV space being stretched out onto the mesh (=blue) Maybe I'll need to provide alternative distortion viewing options: logical distortion versus "think different" distortion, where the blue and red colors get swapped. With the introduction of the Texture Display Mode, I now can finally provide the "snap to pixel" feature I wanted to implement for a while. Haven't recorded a video showing that feature, but it's already implemented. Another item ticked off from the to do list. Next is figuring out if I can also provide the quantization in pixel units without cluttering the user interface too much. Using cursor keys to precisely move items (points/edges/polygons/islands) has also been implemented in this update.
  14. Working on the next update ...
  15. Here's a scene file I created more than 10 years ago (time flies) which I used to insert greenscreen keyed video footage into 3D environments. With the use of the userdata I could then move the keyed live action character into my 3D scene. I extensively used this setup for a short story I created. Camera_Resize_RefPlane.c4d
  16. Happy New Year, and congrats with the 50000 members.
  17. For a start your XGroup is set to disabled, hence the reason you don't get any motion. Uncheck the disable flag (right mouse click on the XGroup in the Xpresso editor). From then on your XPresso will at least be evaluated, which wasn't the case now. Secondly, your second input of the math:multiply is now set to 0. I still don't quite get why you would want to multiply. Instead, I would expect a Modulo function using the time it takes for your disc to perform a full revolution.
  18. Then I suppose there's something else going wrong. Please upload the scene file so we can investigate what the issue is.
  19. What is the result you get now? Do you have motion in the body or not? The unit of movement depends on your project settings. When your scene settings (scale) is set to 1 centimeter the values 15 and 50 will be seen as cm. Notice in your xpresso that you use 0 and 1 as range mapper input. This means that any input value between 0 and 1 will be interpolated from 15 to 50. I assume the problem is with your range mapper input. The time node outputs a value depending your project settings. When this is set to 30 FPS, then each frame is 1 / 30. Which means that after 30 frames you reach the max limit of the range mapper input (1).
  20. The official release of version 1.2 had been delayed but has now been finalized. New in version 1.2: - resizable thumbnails - filtering of assets - use edge selections or polygon selection to insert assets - insert asset multiple times at once - improved material handling on assets - merge point/edge/polygon selection tags by name - insert asset into scene at world's origin without host object or edge/polygon selection - removal of coinciding polygons - new "on surface" positioning option - added support for tags of type point/edge selection, XPresso, vertex map
  21. This is just a pointer in the right direction, not a complete solution. You can assign a Python tag to your instance and implement the checking there as follows: import c4d def main(): # 'op' is an internal defined variable # which represents the current "object", # in our case the Python tag if (op): # get the object hosting the Python tag hostObj = op.GetObject() # check if hostObj has a parent # and if it is a null parent = hostObj.GetUp() if parent and parent.IsInstanceOf(c4d.Onull): # do whatever is needed print "parent is null"
  22. Version 2.4 has been released to current customers. Here's a video demonstrating the new features added in this update:
  23. dast

    Cube on a dynamic rope

    Here is quick example: dynamicRope with cube.c4d I am using two nulls which I assign via your Xpresso node the position of the end point and the penultimate point, or as in your example the first and the second points. The end point I assign an Aim constraint tag (a look-at tag would work as well), an make it aim at the other null The end null is thus always pointing towards the previous one. I then made the cube child of that end point, and that's it. Note that you can "implement" the Aim constraint in the Xpresso node if you want to. "Simply" use some trigonometry functions, etc. ... but I'll leave that up to the reader.
  24. dast

    Cube on a dynamic rope

    A point does not have a rotation nor orientation. One solution is to introduce an additional point into the equation. Assume a spline, where you want the cube to follow the last point. The first point on a spline is at 0% while the last point on the spline is at 100%. Say you introduce an extra point at 99%. The vector from this point to the last point will give an orientation ... but only for 1 axis (let's say the Z-axis). You then still need to find a way to indicate what is its Y and X axis.
  25. Note that the Vegas Pro provided is version 14, and the "Edit" version. Vegas Pro 15 Edit is available at $149 on their website. The humblebundle thing might still be a legitimate version. Just wanted to mention it's not the latest and top trier version.
×
×
  • Create New...