Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
My program ran fine, but when I dragged the object properties to the console, it returned the wrong value.It's very confusing. Please help me, thank you!
.h file enum { OBeamlampsGrid = 567678546, BEAM_LAMPS_GRID_PLANE = 1000, BEAM_LAMPS_GRID_PLANE_XZ = 0, BEAM_LAMPS_GRID_PLANE_ZY = 1, BEAM_LAMPS_GRID_PLANE_XY = 2, BEAM_LAMPS_BEAM_LENGTH = 1001, BEAM_LAMPS_ANGLE = 1002, BEAM_LAMPS_INTENSITY = 1003, .....
.res file CONTAINER OBeamlampsGrid { INCLUDE Obase; NAME OBeamlampsGrid; GROUP ID_OBJECTPROPERTIES { LONG BEAM_LAMPS_GRID_PLANE { CYCLE { BEAM_LAMPS_GRID_PLANE_XZ; BEAM_LAMPS_GRID_PLANE_ZY; BEAM_LAMPS_GRID_PLANE_XY; } } REAL BEAM_LAMPS_BEAM_LENGTH { DEFAULT 1500.0; CUSTOMGUI REALSLIDER; MIN 500.0; MAX 50000.0; MINSLIDER 500.0; STEP 100.0; UNIT METER; } REAL BEAM_LAMPS_ANGLE { DEFAULT 3.0; CUSTOMGUI REALSLIDER; MIN 3.0; MAX 35.0; MINSLIDER 1.0; MAXSLIDER 45.0; STEP 0.5; UNIT DEGREE; } REAL BEAM_LAMPS_INTENSITY { DEFAULT 1.0; CUSTOMGUI REALSLIDER; MIN 0.0; MINSLIDER 0.0; MAXSLIDER 100.0; STEP 1.0; UNIT PERCENT; } ...
.str file STRINGTABLE OBeamlampsGrid { OBeamlampsGrid "Beam Lamps Grid"; BEAM_LAMPS_GRID_PLANE "Plane"; BEAM_LAMPS_GRID_PLANE_XZ "XZ"; BEAM_LAMPS_GRID_PLANE_ZY "ZY"; BEAM_LAMPS_GRID_PLANE_XY "XY"; BEAM_LAMPS_BEAM_LENGTH "Beam Length"; BEAM_LAMPS_ANGLE "Beam Angle"; BEAM_LAMPS_INTENSITY "Beam Intensity"; ...
hi, I see you trying to see your properties active from your object or tag plugin. Well just try to delete your (symbolcache file) and restart c4d and it will be fix. lol I is run into this all the time when making NodeData Plugins.
cheers
@Ashton_FCS_PluginDev
Thank you for your reply. I have tried the method you said, but it didn't work. What's more surprising to me is that if I only use the ID of the property, such as xBeamlampsGrid[1001], I can identify it correctly
Hi,
I think the important question would be if your obejct's attributes do read out properly directly from C++, via ApplicationOutput() for example? Assuming you are actually on C++ as your tags state. If you are on Python you probably neglected to init your attributes via NodeData.InitAttr().
ApplicationOutput()
NodeData.InitAttr()
Cheers, zipit
@zipit said in The console does not correctly recognize object properties:
Hello, thank you for your reply. I use C++, in the code, I implemented Init(), and my code can correctly identify the properties, the following two methods are no problem:
auto a = bc->GetFloat(BEAM_LAMPS_BEAM_LENGTH); ApplicationOutput(maxon::String::FloatToString(a));
or
GeData ge; node->GetParameter(BEAM_LAMPS_BEAM_LENGTH, ge, DESCFLAGS_GET::NONE); ApplicationOutput(maxon::String::FloatToString(ge.GetFloat()));
@sean said in The console does not correctly recognize object properties:
I use C++, in the code, I implemented Init(), and my code can correctly identify the properties, the following two methods are no problem:
jeah, that is what I assumed. Your title is a bit misleading then. It should be something like cannot interface the properties of a node linked to my C++ plugin from Python. Anyways, given the fact that the whole symbol thing tends to be a bit messy when it comes to Python, I would do the following two things:
c4d.BEAM_LAMPS_BEAM_LENGTH
for cid, val in xBeamLampGrid.GetData(): print cid, val
You should then report back if these points do what one would expect them to do or not.
Cheers zipit
@zipit
This plug-in has a twin plug-in that has some properties with the same name, and I suspect that the properties with the same name cause conflicts (even if the ids are different).I made the modification and it is normal now.
Thank you for your reply
Cheers