• The layer material ID is the same as the node material ID.

    r21 python
    8
    0 Votes
    8 Posts
    2k Views
    indexofrefractionI
    I also just ran into this... < R24 you dont have BaseList2D.IsNodeBased, but as a small hack you can do: def isNodeMaterial(op): return True if op.GetType == c4d.Mmaterial and '[Node]' in op.GetBubbleHelp() else False
  • Iterate through selected Materials

    3
    0 Votes
    3 Posts
    852 Views
    M
    @ferdinand Thank you very much! The second way works great. I didnt get the first approach to work, but the second does well Here is the script if someone needs it. It is probably messy I am not a programmer, but it does write the names of the selected materials into the texturname import c4d from c4d import gui from c4d import storage import os #Welcome to the world of Python def changeTexture(shader): # shader ID texturePath = shader[c4d.BITMAPSHADER_FILENAME] # split aboslute path oldTexturename = os.path.split(texturePath) fileExtension = os.path.splitext(texturePath) # add prefix to newTexturename = matName + fileExtension[1] print (newTexturename) newTexturePath = os.path.join(oldTexturename[0], newTexturename) print (newTexturePath) # rename texture try : os.rename(texturePath, newTexturePath) print("Source path renamed to destination path successfully.") except OSError as error: print(error) # Assign the new value shader[c4d.BITMAPSHADER_FILENAME] = newTexturePath shader.Message(c4d.MSG_UPDATE) # Main function def main() : c4d.CallCommand(1029486) # Project Asset Inspector... c4d.CallCommand(1029816) # Select Assets of Active Elements c4d.CallCommand(1029820) # Globalize Filenames # Iterate over selected material material = doc.GetFirstMaterial() if not material: return while material: if material.GetBit(c4d.BIT_ACTIVE): shader = material.GetFirstShader() global matName matName = material.GetName() while shader: # Test if the current node is a bitmap shader. if shader.CheckType(c4d.Xbitmap) : changeTexture(shader) shader (shader.GetDown()) shader = shader.GetNext() material = material.GetNext() c4d.CallCommand(200000273) # Reload All Textures # Execute main() if __name__=='__main__': main()
  • C++ Plugin Development Tutorials

    Moved
    5
    8 Votes
    5 Posts
    7k Views
    kbarK
    @thomasb said in C++ Plugin Development Tutorials: This is great, why does nobody make this for Python, I mean Plugin development @Cairyn already has: https://www.patreon.com/cairyn In my opinion he should be charging $50 - $100 a month to make it viable to keep going.
  • [Fork] Detailed C++ Plugin Development Process Tutorial

    Moved c++
    4
    1 Votes
    4 Posts
    1k Views
    ferdinandF
    Hello @x_nerve, excuse my late reply. But our answer remains the same, we can give no guarantee that we will do this immediately and it is rather unlikely that we will do it. The reason being, that the information is already there, mostly in Getting Started: Introduction, it just happens to be in a slightly inconvenient form. And doing it here in the forum instead of the documentation would not be an improvement, especially if it is meant to be "detailed", as we then would do work that is not integrated with the document space users usually use to learn about concepts in the SDK, the SDK documentation hosted on develeoprs.maxon.net. As most people and companies, we have to plan where we invest our time best. And writing and maintaining the SDK documentation is only a part of our tasks. Which is why we did decide against doing it right now. Thank you for your understanding, Ferdinand
  • We are looking for plugin developers!

    Moved
    2
    1 Votes
    2 Posts
    547 Views
    kbarK
    Just checked out your website, looks really great. Can't wait to see that in C4D. Best of luck with the project!
  • Email Links Broken in Template

    5
    1
    0 Votes
    5 Posts
    1k Views
    r_giganteR
    The issue has been recently investigated and it should have been just fixed. Please confirm the links are correct now on your side.
  • WeightManager/Autoweight > set the amount of Joints in Python?

    r23 s24 python
    6
    0 Votes
    6 Posts
    1k Views
    jochemdkJ
    So, now we have a maxon.Int :} Yes, the system is working - thx @m_adam Consider it solved // more info in general on the maxon framework - especially on the python side - would we be welcome..
  • Cubic Spline Looks Jagged

    5
    0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @johntravolski, without further questions or postings, we will consider this topic as solved by Wednesday and flag it accordingly. Thank you for your understanding, Ferdinand
  • How to create a material with the selected object as assigned?

    r20 python
    4
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hello @JH23, without further questions or postings, we will consider this topic as solved by Wednesday and flag it accordingly. Thank you for your understanding, Ferdinand
  • create a material with a set texture?

    r20 python
    3
    0 Votes
    3 Posts
    959 Views
    JH23J
    Hi. Oh I understand, thanks for your answer, it has helped me a lot.
  • How to get Pixel Coordinates of Spline point on 2D render canvas?

    5
    1
    0 Votes
    5 Posts
    1k Views
    constantine_sazonovC
    @ferdinand Thank you very much for the info!
  • Rotate object around world axis regardless of orientation

    python
    4
    0 Votes
    4 Posts
    2k Views
    ferdinandF
    Hello @codysorgenfrey, without any further questions, we will consider this topic as solved by Monday and flag it accordingly. Thank you for your understanding, Ferdinand
  • No notifications of replies

    Moved
    14
    0 Votes
    14 Posts
    3k Views
    C4DSC
    @ferdinand We are indeed talking about the little bell icon with a number next to it. The strange thing is (as mentioned earlier as well) is that the unread icon does show up with a number of new unread posts. So, some of the notifications are working. Just not the bell icon. When I re-enable a notification in the dropdown of the bell icon, I do see the number show up. I noticed just recently that when I am currently looking at the forum page and someone replies, the number do show up. But without reading the posts, nor doing any actions and I leave the page, then come back to the forum ... the number on the bell icon is gone. Still the dropdown of the bell icon shows the list of notifications with a black circle next to it. Indicating that the replies have not been read yet. I don't have any content, script, or ad blocker. All was working fine with previous plugincafe. I have tried with Microsoft Edge (which isn't my default browser), and have exactly the same issues there. The number on the icon bell isn't displayed. To me this sounds like it isn't browser related. Do I have some setting in my account which causes this - no idea? As said, all worked fine with previous plugincafe, and as far as I remember I haven't changed anything in my account settings since the switch.
  • Search results

    Moved
    2
    1 Votes
    2 Posts
    725 Views
    ferdinandF
    Hello @C4DS, Thank you for reaching out to us and getting involved in shaping Plugin Café. While the requested functionality of yours would certainly be useful, we cannot provide it currently. I agree that the excerpts provided by the search function are too long for the common use case and information needs of users, but fixing that would require us modifying the search engine of NodeBB; as there are to our knowledge no build-in options of NodeBB to modify that excerpt length. We currently do not have the resources to do that customization of the search engine of NodeBB. Your proposal has been noted and might be taken into consideration in a future iteration of Plugin Café but considering that we just moved to a new system, this might take some time. Thank you for your understanding, Ferdinand
  • Forum "Question status" lost by edit

    Moved
    3
    0 Votes
    3 Posts
    751 Views
    a_blockA
    Hi Ferdinand, right, no worries. I am aware, "Question/Solution" is realized by a plugin and didn't expect it to be an easy fix. To have it documented is a good solution. Personally the topic here was more a kind of personal conditioning for me. Now, that I wrote about it, I won't forget so easily... Cheers
  • Log in annotation tag (python)

    Moved
    10
    0 Votes
    10 Posts
    2k Views
    ferdinandF
    Hello @ROMAN, without any further questions or replies, we will consider this topic as solved by Monday and flag it accordingly. Thank you for your understanding, Ferdinand
  • PySide2 for Python 2.7 Windows Version?

    r21 python
    15
    0 Votes
    15 Posts
    5k Views
    ferdinandF
    Hello @bentraje, no need to be sorry and thanks for closing it Cheers, Ferdinand
  • Does Python plug-in have AES encryption?

    11
    0 Votes
    11 Posts
    2k Views
    ferdinandF
    Hello @hhdhhd, without any further questions or replies, we will consider this topic to be solved by Monday and flag it accordingly. Thank you for your understanding, Ferdinand
  • problema de regreso de código de gestor de scripts

    3
    0 Votes
    3 Posts
    800 Views
    JH23J
    Excuse me, I thought I translated it was my mistake, and in the same way, thank you for your help.
  • How to create a child from the script manager?

    r20 python
    8
    0 Votes
    8 Posts
    1k Views
    ferdinandF
    Hello @JH23, first, I would like to point out that we ask the community here to post separate questions into separate postings, so that other users can find more easily answers when searching the forum. You can read more about the procedures of SDK support in our Forum Guidelines. It is okay in this case, but for future cases we have to ask you to open new topics for follow-up questions that are not directly related to the initial question of the topic (thread). About your question - you have two options when you want to make an object editable: In case you already have the object in question already inserted into the active document and are in the main thread, you can still use CallCommand. For CallCommand you have to keep in mind that it usually relies on an object selection. When running it in a script, you have then make sure that actually the objects you want to be affected are selected when you do run the CallCommand. I have provided an extension of my prior example at the end of this posting. In all other cases, i.e., when the object is either in no document or not in the active one, or you are not on the main thread, then you must use c4d.utils.SendModelingCommand Link. In this case for example for the command MCOMMAND_MAKEEDITABLE. You can find more information about that in our SDK documentation and in the code examples on GitHub. Cheers, Ferdinand Example code: import c4d def main(): # Assuming you want to use a CallCommand, you can do this. In practice # instantiating a cube object is better done in the way shown by Cairyn # in the forums. # The CallCommand for creating a cube object which will also insert and # select the cube. c4d.CallCommand(5159) # Get the currently active object; which is the new cube object due to the # prior CallCommand. The function object() created by the script log, and # used in your code, does effectively something similar. But it has the # overhead of retrieving the active object each time it is being called, # which is not necessary here. # In a script environment there are also the predefined attributes op and # doc, "variables" in non-Python terms. op is the currently active object # when the script is being run and doc the currently active document. # We cannot use op here, since the CallCommand just did change that, but # we can use doc, which we could retrieve also manually if we had to via # c4d.documents.GetActiveDocument(). cube = doc.GetActiveObject() # Set some of the parameters of that cube object. cube[c4d.ID_BASELIST_NAME] = "Cube" cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_X] = 32 cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_Y] = 32 cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_Z] = 32 cube[c4d.PRIM_CUBE_SUBX] = 11 cube[c4d.PRIM_CUBE_SUBY] = 11 cube[c4d.PRIM_CUBE_SUBZ] = 11 # Instantiate manually a cone object and insert it under that cube, i.e., # do it like Cairyn has shown it. cone = c4d.BaseObject(c4d.Ocone) # We can also set the name of a node like this, which is a bit easier to # remember than the ID. cone.SetName("Cone") # Set some parameters of the cone. You can find out parameter ids via # drag and drop and the console, read more about it here: # developers.maxon.net/docs/Cinema4DPythonSDK/html/misc/descriptions.html cone[c4d.PRIM_CONE_HEIGHT] = 32 cone[c4d.PRIM_CONE_BRAD] = 16 cone[c4d.ID_BASEOBJECT_REL_POSITION, c4d.VECTOR_Y] = 32 # Create a phong tag for the cone, so that the cone is being shaded nicely. phongTag = cone.MakeTag(c4d.Tphong) # Enable the angle limit of the phong tag. phongTag[c4d.PHONGTAG_PHONG_ANGLELIMIT] = True # Insert the cone under the cube. cone.InsertUnder(cube) # When we are doing things "manually", i.e., do not use CallCommand, we # have to push an update to Cinema 4D after we have modified the scene # graph. c4d.EventAdd() # Make the cube object the new active selection. doc.SetActiveObject(cube, c4d.SELECTION_NEW) # And run the " Make Editable" CallCommand on that c4d.CallCommand(12236) # Make Editable if __name__ == '__main__': main()