Thanks for the reply @i_mazlov. Yeah, I already tried the workaround, it worked.
Latest posts made by BruceC
-
RE: Button scaled unexpectedly when it is in the same row with an expanded linkbox
-
Button scaled unexpectedly when it is in the same row with an expanded linkbox
I have a button and a linkbox placed in the same row, however I found the button is always scaled horizontally when the linkbox is expanded.
Could you please help me find out how to stop the button being scaled horizontally?
I have tried applyingDESC_SCALEH
toFALSE
andDESC_FITH
toTRUE
, but it doesn't work after the linkbox is expanded.Before the linkbox is expanded, the button's width is expected.
After the linkbox is expanded, the button is scaled unexpected.
I essentially used the below code snippet to create the button and linkbox in
NodeData::GetDDescription()
Int32 groupID = xxgroupIdxx; const DescID groupDescID = CreateDescID(DescLevel(groupID, DTYPE_GROUP, 0)); { BaseContainer bc = GetCustomDataTypeDefault(DTYPE_GROUP); bc.SetInt32(DESC_COLUMNS, 2); bc.SetInt32(DESC_SCALEH, TRUE); description->SetParameter(groupDescID, bc, CreateDescID(DescLevel(AOV_COMP_PARAMS_GRP))); } { DescID id = CreateDescID(DescLevel(xxButtonIdxx, DTYPE_BUTTON, 0)); BaseContainer bc = GetCustomDataTypeDefault(DTYPE_BUTTON); bc.SetString(DESC_NAME, "test"_s); bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BUTTON); bc.SetBool(DESC_SCALEH, FALSE); //// <<<<<<<<<<< bc.SetBool(DESC_FITH, TRUE); //// <<<<<<<<<<<< I have tried using these two flags, but they don't help description->SetParameter(id, bc, groupDescID); } { const DescID id = CreateDescID(DescLevel(xxLinkIdxx, DTYPE_BASELISTLINK, 0)); BaseContainer bc = GetCustomDataTypeDefault(DTYPE_BASELISTLINK); bc.SetString(DESC_NAME, "test"_s); bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LINKBOX); bc.SetData(DESC_SCALEH, TRUE); bc.SetContainer(DESC_ACCEPT, accept); description->SetParameter(id, bc, groupDescID); }
Thanks!
-
RE: Efficient way of saving array to BaseContainer
Thank you @ferdinand for the help!
Write raw memory does help a lot, appreciate!
-
Efficient way of saving array to BaseContainer
Hi,
could you please help me to find out the efficient way of saving/reading an array with a large size of vectors to BaseContainer?I could store/read each Vector in the array one by one as below, but when the size of the array is large, this method will cause performance issue.
save() { maxon::BaseArray<Vector> arrayData; BaseContainer dataBC; Int dataCount = arrayData.GetCount(); dataBC.SetInt32(XX_COUNT, dataCount); for (Int idx = 0; idx < dataCount; ++idx) { dataBC.SetVector(XX_ITEM + idx, positions[idx]); } } load() { maxon::BaseArray<Vector> arrayData; BaseContainer dataBC; Int dataCount = dataBC->GetInt32(XX_COUNT, 0); arrayData.resize(dataCount); for (Int32 idx = 0; idx < dataCount; ++idx) { arrayData[idx] = dataBC->GetVector(XX_ITEM + idx, Vector(0, 0, 0)); } }
Then I remember vertex color tag has a special way of reading the color data stored. So I think C4D supports an efficient way of save/loading large array data.
I tried the below way by storing a raw memory chunk, but it doesn't work. It seems it only stores the memory address rather than the content of the memory address, and I suspect it will have serialize/deserialize problem when the scene file is opened in another platform (operating system).save() { maxon::BaseArray<Vector> arrayData; BaseContainer dataBC; Int dataCount = dataBC->GetInt32(XX_COUNT, 0); Vector* rawData = NewMem(Vector, arrayData.GetCount()) iferr_return; MemCopy((void*)rawData, (void*)arrayData.GetFirst(), Int(sizeof(Vector) * arrayData.GetCount())); GeData data(rawData, VOIDVALUE); dataBC.SetData(XX_ITEM, data); DeleteMem(rawData); } load() { maxon::BaseArray<Vector> arrayData; Int32 dataCount = dataBC->GetInt32(XX_COUNT, 0); arrayData.resize(dataCount); const GeData& data = dataBC->GetData(XX_ITEM); Vector* rawData = (Vector *)data.GetVoid(); for (Int32 idx = 0; idx < dataCount; ++idx) { arrayData[idx] = rawData[idx]; } }
So could you please help me to find out the right efficient way of saving/reading an array with a large size of vectors to BaseContainer?
Thank you very much!
-
RE: create link parameter accept Alembic tag
@m_adam, Thank you!
Yes,
Message(GeListNode* node, Int32 type, void* data)
works for me.I'm wondering shall my plugin just return
true
after processingMSG_DESCRIPTION_CHECKDRAGANDDROP
in theMessage()
function (set the value ofDescriptionCheckDragAndDrop::_result
) or still callSUPER::Message(node, type, data);
at the end?
It looks to me that callingSUPER::Message(node, type, data);
at the end still works.
But the example in MSG_DESCRIPTION_CHECKDRAGANDDROP Message doesn't callSUPER::Message(node, type, data);
.Thanks!
-
RE: Read Alembic tag's data
@m_adam, Thank you very much, this works for me!
-
create link parameter accept Alembic tag
Hi,
Could you please help me find out how to define the link parameter in res file which only accepts Alembic tag? (And the Alembic tag should also converted from a vertex color tag before the object was backed as Alembic)I'm developing a plugin, and there is a link parameter, previously, in the res file, I used this to make the parameter only accept a vertex color tag.
LINK xxx { OPEN; ACCEPT { Tvertexcolor; } }
I'd like to change this link to only accept an Alembic tag which is converted from a vertex color tag.
I got the "the Alembic tag which is converted from a vertex color tag" by this:
There is an object with a vertex color tag, then the object is baked as Alembic by using the "Bake as Alembic" menu item popped by right click on the object.
Then the backed Alembic file is imported automatically, and the original vertex color tag will become an Alembic tag.I tried
LINK xxx { OPEN; ACCEPT { Talembic; } }
However, this somehow broke the res file, and made all other parameters disappear.
LINK xxx { OPEN; ACCEPT { 1036433; } }
By replacing Talembic with 1036433 (this is the value defined for Talembic in cinema.framework/source/ge_prepass.h), it does give me a link parameter accepts Alembic tags (I don't know why the Talembic doesn't work, but the actual number works here), but it doesn't limit to the Alembic tags converted from vertex color tags (i.e. all kinds of Alembic tags are accepted).
Thanks!
-
Read Alembic tag's data
Hi,
Could you please help me find out how to read data from a Talembic tag?There is an object with a vertex color tag, then the object is baked as Alembic by using the "Bake as Alembic" menu item popped by right click on the object.
Then the backed Alembic file is imported automatically. However, the original vertex color tag becomes an Alembic tag.Can you please help me find out how to read the vertex color data from the new Alembic tag?
Thank you very much! -
RE: how to get vertex color tag's data for a specific frame (different with current frame) without modifying current document?
Thank you very much for all your detailed explanation, @ferdinand!
-
RE: how to get vertex color tag's data for a specific frame (different with current frame) without modifying current document?
Thank you, @ferdinand.
No worries at all, I know you must be very busy, just take your time. I appreciate all the help!
Cheers!