• Aligning object local axis to world axis via Python

    python r25
    10
    0 Votes
    10 Posts
    2k Views
    ferdinandF
    Hello @Peek, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • Takes - material override in Python

    python
    4
    0 Votes
    4 Posts
    815 Views
    ferdinandF
    Hello @stanDM, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • Recording Object Animations with the Mouse

    python
    3
    0 Votes
    3 Posts
    418 Views
    ferdinandF
    Hello @leon6498 , without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • Mac M1 bug?

    r25 python
    8
    0 Votes
    8 Posts
    1k Views
    ferdinandF
    Hello @pim, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • Where do I find IDs?

    python
    8
    0 Votes
    8 Posts
    2k Views
    ferdinandF
    Hello @jakub, without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022. Thank you for your understanding, Ferdinand
  • Map Cubic Projection of object down to UVs with IDM_ASSIGN_UVW

    python r21
    2
    0 Votes
    2 Posts
    426 Views
    FSSF
    We life and learn. Turns out one must select the material tag with doc.SetActiveTag(textureTag) before calling the command c4d.CallCommand(CMD.GENERATE_UV_COORDS, CMD.GENERATE_UV_COORDS) to bake the projection down, down into the ground. It now works as intended.
  • Packed Automatic UVs Command in S22?

    s22
    10
    0 Votes
    10 Posts
    2k Views
    DunhouD
    @ferdinand Thanks for your example,I do select a op in the OM.Last time I try it ,it did not work ,but this time it works well,I think last time I use S26 preset python text, and Optional is not import probly, anyway It's work well right now . Great thanks for you
  • Multi threading in C4D python

    python s24
    3
    0 Votes
    3 Posts
    925 Views
    A
    thanks Ferdinand this cleared things up for me
  • CommandData plugin catch Switching documents event

    python r23
    3
    0 Votes
    3 Posts
    426 Views
    mikeudinM
    @ferdinand Thank you!
  • Draw editable spline in the viewport

    python
    5
    0 Votes
    5 Posts
    1k Views
    bacaB
    @ferdinand thanks for explanations and example.
  • Get parameter value at given time.

    r25 windows c++
    8
    0 Votes
    8 Posts
    2k Views
    D
    Hi @ferdinand and @Cairyn, thanks for the answers. There may be a simpler way to achieve an effect similar to what we want (for example, by caching the world matrix at the time t) but I'm still thinking of alternate ways to be able to access the full mesh information at time t. Caching the full mesh is probably not a good option since we would have to update that cache every time the mesh is changed at any time before t (since this might change the mesh at t). A possible option is to restrict the usability a bit and always evaluate the mesh at time 0, I'm checking if this is something we can do. Feedback loops could be an issue, but it should never happen that (using the example @ferdinand wrote) P relies on T and T also relies on P in this specific plugin. Also, t should always be a time before the current time, although that might not alleviate this particular problem. In any case, I'm going to go ahead and mark this as solved, I think I got all the information I need to find a solution. Thank you both very much for helping me out, Daniel
  • Create Polygon Selection Tag

    python
    5
    0 Votes
    5 Posts
    1k Views
    D
    @ferdinand aaaa i understood, thanks for help megaman)
  • Is there a fixed Manager ID like c4d.CONSTANT?

    python
    2
    2
    0 Votes
    2 Posts
    299 Views
    ManuelM
    Hi, Those IDs should not change but there are not guaranties. There are no symbols to define those IDs. You can use the following code to displays all the registered Managers. import c4d from c4d import gui def main(): pluginList = c4d.plugins.FilterPluginList(c4d.PLUGINTYPE_MANAGERINFORMATION, True) for plugin in pluginList: print (plugin, plugin.GetID()) # Execute main() if __name__=='__main__': main() Cheers, Manuel
  • How to Create and Populate a Layer Shader?

    python
    3
    0 Votes
    3 Posts
    2k Views
    indexofrefractionI
    @ferdinand hey ferdinand , thanks for all of this information ! i also noticed that definitions are missing in the python SDK (specifically the BlendModes)
  • Create Gradient Attribute for Nodes Programmatically

    c++ r25
    12
    1
    0 Votes
    12 Posts
    2k Views
    ManuelM
    hi, Sorry for the late reply, but this needed investigation and test from my side and communication between me and the dev. You can create the NodeTemplate that way. I am using the class GradientWorkaround to create the template. NodesLib::BuildNodeFromDescription must be called with false set to not create the dependency wires. NodeTemplate t = NodesLib::CreateLazyTemplate(firstNodeId, [firstNodeId]() -> Result<NodeTemplate> { iferr_scope; maxon::nodes::NodeTemplate templ = maxon::nodes::NodesLib::BuildNodeFromDescription(firstNodeId, CoreNodesNodeSystemClass(), false) iferr_return; templ = GradientWorkaround::CreateInit(templ) iferr_return; return templ; }, CoreNodesNodeSystemClass()) iferr_return; The class itself look like this. We can create a gradient node inside the usernode itself and connect the ports. This is done inside the function InstantiateImpl. class GradientWorkaround : public maxon::Component<GradientWorkaround, maxon::nodes::NodeTemplateInterface> { MAXON_COMPONENT(NORMAL, maxon::nodes::NodeTemplateBaseClass); public: maxon::ResultOk<void> Init(const maxon::nodes::NodeTemplate& templ) { _wrapped = templ; return maxon::OK; } MAXON_METHOD maxon::Result<Bool> SupportsImpl(const maxon::nodes::NodeSystemClass& cls) const { return cls.IsSubclassOf(CoreNodesNodeSystemClass()); } MAXON_METHOD maxon::Result<maxon::nodes::NodeSystem> InstantiateImpl(const maxon::nodes::InstantiationTrace& parent, const maxon::nodes::TemplateArguments& args) const { iferr_scope; maxon::nodes::NodeSystem sys = _wrapped.Instantiate(parent, args) iferr_return; maxon::nodes::MutableRoot root = sys.BeginInstantiationModification(self) iferr_return; // Asset ID : net.maxon.pattern.node.generator.gradient const AssetRepositoryRef& repository = AssetInterface::GetBuiltinRepository(); nodes::NodeTemplate gradient = nodes::NodesLib::LoadTemplate(repository, Id("net.maxon.pattern.node.generator.gradient")) iferr_return; MutableNode gradientNode = root.AddChild(Id("Gradient"), gradient) iferr_return; const maxon::nodes::MutablePort output = root.GetOutputs().FindPort(maxon::Id("testoutput")) iferr_return; const maxon::nodes::MutablePort gradientPort = root.GetInputs().FindPort(maxon::Id("gradient")) iferr_return; const maxon::nodes::MutablePort gradientResult = gradientNode.GetOutputs().FindPort(maxon::Id("result")) iferr_return; const maxon::nodes::MutablePort gradientGradient = gradientNode.GetInputs().FindPort(maxon::Id("gradient")) iferr_return; gradientResult.Connect(output) iferr_return; gradientPort.Connect(gradientGradient) iferr_return; sys = root.EndModification() iferr_return; return sys; } private: maxon::nodes::NodeTemplate _wrapped; }; MAXON_COMPONENT_CLASS_REGISTER(GradientWorkaround, "net.maxonexample.nodes.class.gradientworkaround"); It is just like having a group of nodes and propagated ports. Cheers, Manuel
  • Modul import

    r21 python
    3
    0 Votes
    3 Posts
    706 Views
    W
    Thank you very much!
  • What is my Clipboardowner for a script?

    c++ python
    4
    0 Votes
    4 Posts
    771 Views
    ferdinandF
    Hey @cairyn, yeah, you are right. @m_adam already pointed this out too. I screwed up and overwrote my clipboard when I tried this out. I have edited my initial posting, to not confuse future readers. GetC4DClipboardOwner works fine in regards to the Picture Viewer and Bodypaint, but the argument ownerid of CopyBitmapToClipboard is effectively meaningless in the public API, as it lacks the window handle context to actually cause the ownerid to be stored. The owner id will always be set to 0. And to underline the answer to your major question: It seems very unlikely that you could crash Cinema 4D with writing a made-up owner id into the clipboard (in the case the function would work properly and actually store the id). It is hard to give here absolute answers, as there is a lot of code in our code base. In the context of the clipboard alone, crashing can be excluded, but there could be other parts of Cinema 4D which make assumptions based on the owner id. Which is why I would recommend not using the predefined ones (which is rather theoretical due to said limitations of CopyBitmapToClipboard). Cheers, Ferdinand
  • How to make a Python Plugin...

    python
    5
    1 Votes
    5 Posts
    2k Views
    mikeudinM
    @noseman seems that it's needs to be updated https://github.com/nrosenstein-c4d/c4d-prototype-converter/issues/52
  • Is there a successful example of c4d.gui.SplineCustomGui?

    python
    3
    1
    1 Votes
    3 Posts
    772 Views
    L
    @m_adam Thanks so much! You are a very professional guy!!!
  • Beginner:How to assign A-material to B-cube by python?

    Moved
    5
    1
    0 Votes
    5 Posts
    2k Views
    ManuelM
    hi @cinamatic , You should open a new thread for your question as it is not related to this thread. I found this thread where you will find some useful information about takes and material. If you have any question, please open your own thread explaining what you are trying to achieve and pointing to those different threads. Futur user will find every information to follow the discussion. Cheers, Manuel