Hi @i_mazlov
I can't use C++ at the moment, so I thought I'd try MultilineEditText
for my purposes.
I looked for This post in the forum and now I have some ideas.
Thank you for your reply!
Cheers~
Hi @i_mazlov
I can't use C++ at the moment, so I thought I'd try MultilineEditText
for my purposes.
I looked for This post in the forum and now I have some ideas.
Thank you for your reply!
Cheers~
Thank you for your reply and solution!
Cheers~
Hi, everyone!
I'm looking for a way to get and set parameters from anywhere by dragging and dropping, just like GSG's Signal tag plugin does.
I checked a lot of forum posts and saw that python doesn't support to do that.
I came up with GeUserArea, but GeUserArea can only be used in GeDialog.
I also wondered if I could use CustomDataType to create a drag-and-drop operation that accepts parameters, but it doesn't seem possible to create CustomDataType in python.
I don't know if there's another or similar way to do that.
Hi Everyone!
I'm Trying to use GeListNode.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_SET)
to hide some objects and save the project file and close it.
And I open the project file again and try to using GeListNode.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_CLEAR)
, I find that although the code works, but the hidden objects are still not displayed in viewport.
Is this a bug or something special thing happend?
This is the project file I tested, and it's already hide the 4 objects top of the OM:
show-hide_test.c4d
And this the simple testing code for displayed them:
import c4d
doc: c4d.documents.BaseDocument # The currently active document.
op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`.
def main() -> None:
objs = doc.GetObjects()
for obj in objs:
if obj.GetNBit(c4d.NBIT_EHIDE):
print(obj.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_CLEAR))
print(obj.GetNBit(c4d.NBIT_EHIDE))
c4d.EventAdd()
if __name__ == '__main__':
main()
P.S: I also found that after running the test code in the above project file and saving the project, closing it and then opening it again, those hidden objects came back.
Hi ! @Gemini ,
You can simply drag and drop the parameter you want to Script Manager to get or set it.
Just like this:
Hi @ferdinand !
Sorry for late reply, and thank you very much for your detailed and thorough explanation, and for taking the time to explain the relationship between linear algebra and trigonometry in the context of computer graphics and transformations.
As a beginner, all I want to do here is to practice as much as I can with the knowledge I've learned, and I apologize if I didn't explain clearly.
Yes, in the code I want to implement is placing two tangent handle relative to the two input objects a and c.
Compared to calculating with trigonometric functions, your suggestion seems more straightforward and clear, and I never would have thought to use vectors to achieve this, I need to keep practicing.
I will take the time to review the thread you mentioned.
Thank you again for your support and guidance. Thank you very much for your insights!
Hi everyone!
I have recently been learning some basics of linear algebra.
In order to verify my learning results, I created a Bezier spline Generator with Python Generator.
But when I set the tangents of the spline, something confused me.
When I moved the point of the spline, the left and right handles of the tangent would switch positions, or would they flip 180 degrees? I don't quite understand what's going on here.
And there is my test code and Scene file:
import c4d
import math
def main() -> c4d.BaseObject:
null = c4d.BaseObject(c4d.Onull)
a = op.GetDown()
b = a.GetNext()
c = b.GetNext()
obj = b.GetClone(0)
obj[c4d.NULLOBJECT_RADIUS] = 5
obj[c4d.ID_BASEOBJECT_USECOLOR] = 2
obj[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(1,0,0)
obj2 = obj.GetClone(0)
obj2[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(0,1,0)
a_pos_local = ~b.GetMg() * a.GetMg().off
a_polar_angle = math.atan2(a_pos_local.y, a_pos_local.x)
a_length = a_pos_local.GetLength()
b_pos_local = ~b.GetMg() * c.GetMg().off
b_polar_angle = math.atan2(b_pos_local.y, b_pos_local.x)
b_length = b_pos_local.GetLength()
polar = (a_polar_angle + b_polar_angle)/2 + (math.pi / 2)
leng = (a_length + b_length)/2
x = leng * math.cos(polar)
y = leng * math.sin(polar)
vec = c4d.Vector(x,y)
move_vec1 = vec.GetNormalized() * op[c4d.ID_USERDATA,1]
m1 = ~op.GetMg() * b.GetMg() * c4d.utils.MatrixMove(move_vec1)
m2 = ~op.GetMg() * b.GetMg() * c4d.utils.MatrixMove(-move_vec1)
obj.SetMg(m1)
obj2.SetMg(m2)
obj.InsertUnder(null)
obj2.InsertUnder(null)
spline = c4d.SplineObject(3, c4d.SPLINETYPE_BEZIER)
spline.SetPoint(0, a.GetMg().off)
spline.SetPoint(1, b.GetMg().off)
spline.SetPoint(2, c.GetMg().off)
vl = ~b.GetMg() * obj.GetMg().off
vr = ~b.GetMg() * obj2.GetMg().off
spline.SetTangent(1, vl, vr)
spline.InsertUnder(null)
return null
Thanks for your explaination @ferdinand
Now I understand what's going on here.
Cheers!
This is my plugin , I promise I'm not reuse plugin id, and I can't use it, it will show that the plugin ID has been registered
But I get this: (It's a TagData Plugin, but I can get another Command-Type here.)
So many Object, Tool and Tag type plugins have a command type.
Hey @ferdinand ,
Thank you for your clarification.
What I meant by the difference is what will happen when users execute commands with the same ID but different types.
How do they differ in terms of their functionality?
For instance, if executes a Tool-type Cloud Tool and Command-type Cloud Tool, what would happen in each case?
and if they perform the same function, can I then avoid manually screening them?
Hi @ferdinand
I'm sorry I wasn't clear. Currently I'm using PySide to create my plugin, And my final goal is fully recreate the Command Manager Dialog, and Drag and Drop the Commands to my other UI widgets just for better experience.
I have created a user interface similar to a command manager, but I've noticed that some commands retrieved using the plugins.FilterPluginList()
method are duplicated.
In my understanding, Plugin IDs are meant to be unique in Cinema 4D, but encountering duplicate command IDs has confused me.
For example, I get three "Cloud Tool" with same ID using plugins.FilterPluginList()
but diffrent type (tool, command, node).
While I can manually filter them, but I think this complicates the workflow unnecessarily.
So I would like to know why commands with the same ID have different types, and what their differences are.
An my second question: How do I get the information in the plugin column in Command Manager?
In Cinema 4D, many commands share the same icon and name. I believe when users search for a command by its name, encountering multiple identical commands can be confusing. Therefore, additional information about the commands is needed to help users filter them effectively. In now , I can get the icon, name, shortcut key, help string of command, but I don't know how to get "the information in the plugin column in Command Manager" or the owner like you said.
Thanks for your reply
Cheers~
Hi Everyone!
Currently I'm recreating the Command Manager Dialog in Cinema4D, because I need to drag and drop these commands to other plase in my plugin.
And I have some questions:
Is there a shortway to get all the commands in Command Mnager directly? because the plugins.FilterPluginList(PLUGINTYPE_ANY)
give everything in cinema , it have some folders, and some commands are repeated, the plugin id is same but diffrent plugin type and diffrent info, some commands do not have names, I'm a little confused in this situation.
if there are no shortway to get all commands in Command Manager, How do I get the information in the plugin column in Command Manager?
Thanks for your explanation @m_adam , Yes it's a CommandData plguin but no GeDialog.
Because of some limitations, I had to use PySide to create my plugin's special user interface.
Thank you @m_adam , I will try it later today!
Cheers!
Hi everyone!
I want my plugin to do different things on different Windows, similar to Commander in Cinema 4D.
So I try to get the current active window, such as; Object Manager, Material Manager, Node Editor, etc.
But I didn't find anything about this in the SDK documentation.
So is that possible to do that?
Hi everyone!
I saw in SDK documenation that c4d.GetCommandHelp
can only be called in the main thread.
Is there a way to get help string in other threads?
Hi @ferdinand,
Thanks for your reply.
I just want to make sure if it's possible.
And I'll try the BaseDraw.DrawObject
later.
Hi everyone,
I'm trying to Hide the selected Objects in Active(selected) viewport, but still show in other viewport, is that possible?
I know the NBIT_EHIDE
, but it seems to be global , the object is hidden in all viewports.
I just want to hide it in active viewport.
Thanks so much for @Dunhou and other Boghma member to do this amazing things!