Jump to content

dast

Premium Member
  • Posts

    1,281
  • Joined

  • Last visited

  • Days Won

    68

Everything posted by dast

  1. [Edit - Note: this thread should be located in the "Programming - C++" section of the forums. It ended up in the "Python" section by accident during one of the forums reorganizing sessions] While working on a plugin I got the idea of making this small utility: Wheel Of Tools. It allows the user to set up a list of most used tools, which are presented as a circular palette to select from. Available directly within the viewport. Current state of the plugin is only a concept, and I am mostly focusing on the actual tool selection. The part where user does set up the tools still needs to be worked out. For those familiar with PolyGnome, you probably already understand where I will be heading to ... Wheel Of Tools, once fully implemented, will be the base for a new way of interacting for the main part of the PolyGnome plugin. Edit: While many have seen in this plugin what they expected it to be, this is NOT a radial menu plugin. It merely represents a list of tools in a circular way.
  2. I don't have the python SDK in front of me, but I guess NBIT_OHIDE is that flag you're looking for
  3. While version 1.3 is currently in beta, I couldn't resist working on yet another feature: interactive rotation of assets. As always, I first prepare some concept to try out and see if things can get worked out. While being far from fully functional, I simply had to share next concept video showing off the interactive rotation (interactive scaling is next on the list). I am not planning to include this feature in the 1.3 version as this would delay the release, but hopefully will get it ready for a next update.
  4. For sure I remember your request during beta testing. Back then I mentioned this was a very nice feature, with great added value. But I also mentioned I wasn't able to provide a user-friendly solution, and as such it needed to wait before being implemented. As a result of the newly added Assetizer, I could now easily introduce this feature. Apologies for taking so long to finally get your feature implemented. Welding is performed by the plugin. No manual weld/optimize is required. I tried showing it in the video, but I just realized now I erroneously used points instead of polygons to demonstrate the feature.
  5. Further adding features to the latest version. For those assets that require some helper / placeholder / proxy / whatever you may call it: Disposable Polygons. This is something I wanted to provide for a long while now, but needed the "Assetizer" functionality to be able to handle this feature.
  6. It has been decided to put the plugin on an early retirement scheme ... The alternative solution using a script and short-cut key(s) is a much more user-friendly approach, which I actually prefer over a plugin. And it's platform independent, as well as release independent (unless the R20 SDK does break it). But all effort to make the original plugin is not gone to waste. Firstly, I learned a few things while implementation this "sneaky background" action. Secondly, it resulted in a much easier to maintain scripted solution. I will probably provide some update to the script, as I figured out a few extras. But I am currently too busy, so that will have to wait for a while.
  7. While I still believe the current plugin to be obsolete, I agreed to let user @natevplas beta test it. If only to test the provided mechanism does work without introducing any lag or delayed user response. This mechanism could then, potentially, be used in future for other purposes Why I believe the plugin to be obsolete? Well, it is only a matter of creating appropriate short cut keys in order to provide the current behaviour (keep unused points), or the custom behaviour (auto remove points). Currently, the backspace and delete keys are assigned to the current behaviour. But people can simply assign a different short cut key to the current behaviour and assign the backspace and delete key to the above script. This way, it's up to the user to define the default and custom behaviour ... without the need of a plugin (which will probably not work in future releases anyway).
  8. Copy following code into the Script Manager window and save it as i.e "Delete+Cleanup" Then with "Customize Commands", filter on the entered file name, and assign it "Shift+Delete" as shortcut keys ... and Bob's your uncle. Makes this whole AROP plugin I made completely obsolete ;-) Just why I didn't think of that before starting this whole plugin. import c4d def main(): # perform the delete (ID=12109) c4d.CallCommand(12109) # perform the clean up # get the currently active polygon objects objects = list() activeObjects = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN) for obj in activeObjects: if obj.IsInstanceOf(c4d.Opolygon): objects.append(obj) # remove unused points settings = c4d.BaseContainer() settings[c4d.MDATA_OPTIMIZE_UNUSEDPOINTS] = True res = c4d.utils.SendModelingCommand(command = c4d.MCOMMAND_OPTIMIZE, list = objects, mode = c4d.MODELINGCOMMANDMODE_ALL, bc = settings, doc = doc) c4d.EventAdd() if __name__=='__main__': main() Edit: Had some typos in the code, fixed now.
  9. Well, the very first name I used when setting up the research for this project was "Auto Orphan Killer". It's just a name, I thought at that point. And while it might sound funny in a way, I don't think many would have appreciated it. Another plugin of mine (PolyGnome) was originally meant to contain "enjoliver" in its name (french for embellish-er). Guess I better not call this new plugin "enjoliver twist" then. Nice idea, I didn't think about that. However, deleting is handled by Cinema itself, then the plugin does some post-processing. As such it does not detect the "delete" nor "shift-delete". Currently when you use "shift+delete" nothing happens, as Cinema does not know what that shortcut actually means. Had a quick look in "customize commands" and apparently the delete key (when meant to delete the current selected polygons, edges, points) is assigned ID 12109. For the "shift+delete" to work the way you mentioned you could assign it to some script, which does a delete + clean up. Which is probably easier to create than this whole plugin I made ... Again, didn't think of that. My pleasure.
  10. I am working on a new plugin, and would like to query for user interest. Background info: I am not an expert at modeling, but from time to time I create some objects for short stories I am making, or other projects I am working on. For the past 2 years or so, I have spent most of my time writing some plugins. As such I didn't quite follow the progress of modeling tools (or lack thereof) in the recent Cinema 4D releases. Recently I was creating a mesh, representing a faceted low-poly gnome to be used as illustration for one of my plugins, when I noticed that removing polygons still left orphaned points behind. Same behaviour as always, from the early days I worked with Cinema, till the last time I modeled something before focusing on plugin writing, and then even today. So, over the span of 10 Cinema 4D releases (R9 - R19), nothing seems to have changed regarding this behaviour. Now, I can understand some of the reasoning behind the current behaviour. Still, I wonder how many requests I have submitted to MAXON over the years, to provide an option to allow the user to decide if orphan points should, or should not be removed automatically when deleting polygons. I don't know what R20 will bring, but I didn't want to wait any longer for MAXON to provide said option, and decided to write my own plugin to perform the task of removing these orphan points ... while providing an option to do so or keep the current behaviour (avoiding the need of removing the plugin when user wants to switch between these different behaviours). The plugin: It's a free R17-R19 plugin, currently Windows only, but will be made available for MacOS when time permits. It might also become available for R16, but nothing promised at this time. The plugin is document based, and simply runs in the background. No user interaction is required, as removal of orphan points is done automatically, whatever mode the user is working in. Simply enable the plugin (scene configuration) ... and model away. Naming request: Since the project is still ongoing, I haven't decided for a final name yet. The project is currently named AROP, short for Auto Remove Orphan Points. But could as well end up being named URP (Unused Point Remover), or anything closely related. If anyone comes up with a fancy name, just let me know. Beta testing request: As with all my plugins, it is closely based on the workflow I am familiar with. While good enough for me, this might not be the case of more expert users, or even beginners for that matter. As such, I'd like to ask for a few people's time to spend testing this plugin, before being officially released. Contact me for details. Most important feedback I am looking forward to: - is the plugin slowing down the performance of Cinema 4D - any lag related to the use of the plugin on small or large objects - are there any orphan points still left untouched by the plugin - what's the total user experience using this plugin Thanks for reading Daniel
  11. When I started creating this plugin there were a few features I had in mind, but simply could not find a way to provide these. And while this plugin is no rocket science (far from it), things require quite some tricky solutions now and then. Luckily, I seem to be getting smarter day by day ... yeah, I wish! Still, features I didn't quite know how to implement then, seem to be feasible now. A result of this is that I now have introduced an "auto setup" for assets, which -in theory- should work for most of the assets people are creating. In occasions where the auto setup fails to detect the necessary base and orientation, extra tools are provided to make the manual set up more user friendly. Here's a demonstration video of the latest alpha version I am working on, before going to beta: Another "feature" of this version is a change in library format. Each library used to be a single Cinema 4D scene file, making sharing and distributing single assets a nightmare. I have reworked the whole plugin to work with separate asset files instead. A conversion utility is part of this newer version to convert from the old format to the new one. There is however a major drawback on this new way of storing assets. Cinema 4D takes about 70 to 100 milliseconds to load a scene file. No big deal, you would think. But what if a library consists of 50 assets? That would then take approx. 5 seconds to load and display. Trust me, 5 seconds is a very long time to wait after you selected a library. As such, I also had to introduce a caching mechanism to reduce the loading time of libraries again and again. You'll only have to wait the first time a library is selected. Next times, it should like in a blink of an eye. Next to these changes, the usual bug fixes and optimizations ... no big deal ;) Public release of this new version will be announced when beta-testing has been completed. Thanks for reading.
  12. Haven't used Xpresso lately, but there is a Memory node, if I recall correctly, which allows for a history level.
  13. The error you get in the console should help you understand what is going wrong. You are trying to call "InsertUnder" on the wrong object. When you used "GetActiveObject" the function returned you a c4d.BaseObject. By switching to "GetActiveObjects" the function then returns you a c4d.BaseList2D of c4d.BaseObject. The function "InsertUnder" is not available on the c4d.BaseList. As such, you need to iterate over each c4d.BaseObject in the returned list objs = doc.GetActiveObjects(flags=c4d.GETACTIVEOBJECTS_0) for obj in objs: obj.InsertUnder(pred) where "pred" is your null, or preferably the last child inside the null (so to provide appropriate ordered children inside the null)
  14. 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()
  15. 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.
  16. 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.
  17. Version 2.5 has been released, and sent out to the current customers. Demonstration video showing the new additions:
  18. 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.
  19. 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".
  20. 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()
  21. use the SetName() function on your tagm, as in: tag().SetName(newName)
  22. 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
  23. 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.
  24. 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.
  25. 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?
×
×
  • Create New...