About my most recent question related to SMinMax? I think it got lost in the discussion.
Posts made by eldiren
-
RE: Generator crashes and guidance
-
RE: Generator crashes and guidance
I've refactored my generator so it generates the BaseObjects more direct rather than through some proxy nodes, since I'm just thorw the BaseObject out there and not storing them in a intermediary, specifically a std::vector the renaming, random crashes, and Meakeditable crashes have gone away.
I still have an issue with rotation via mouse and clipping. Since my generator does create OPolygon, OCamera, Olights, Osplines, etc. according to the docs I need to implement GetDimension(). I've recently done that in my Poly and spline generation code like so:
for (int i = 0; i < pnts.size(); i++) { CacheVec pos = pnts[i]; Vector pnt(pos[0], pos[1], -pos[2]); pntsPtr[i] = pnt; _cacheBounds.AddPoint((Vector32)pnt); }
_cacheBounds being a private variable of the type SMinMax. In GetDimension I use it like so:
*mp = (Vector)_loader.GetCacheBounds().GetMp(); // Bounding box center *rad = (Vector)_loader.GetCacheBounds().GetRad(); //box size
The generator is still producing a situation where when I Alt+left click the camera moves about the pivot of scene rather than around the object I picked, and things clip randomly. When I make my generator editable I also still can't orbit about the objects. I wonder if I not setting up the PolygonObjects/SplineObjects properly.
-
RE: Generator crashes and guidance
I'm sorry, I kept the code sample brief and changed some stuff to protect my code.
while (node) { // add obj to virtual hierarchy if (!node->GetUp() // the parent is root node>InsertUnder(lumiCache); obj = _loader.GetNextObject(); }
This is closer to what the actual function looks like, the loader gets the next object form the caching format and does some processing to make it a BaseObject. Since I'm creating a number of BaseObject, I'm wondering about ownership, does C4D own these once their inserted and passed back via GetVirtualObjects(), or am I still responsible for them, because right now I'm just throwing them in there and not maintaining them. Behind the scenes my loader holds these cache objects in a std::vector for later run when it get dirty. Maybe something with that state is also causing issues?
-
RE: Generator crashes and guidance
I have a FILENAME in my res file for the generator that I reference similar to so:
Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTYFLAGS::DATA); // if the frame changed since last time the object should be dirty if (_frame != doc->GetTime().GetFrame(doc->GetFps())) dirty = true; // if user changed fps since the last time the object should be dirty, and we should recalculate our frame ranges if (_frame != doc->GetTime().GetFrame(doc->GetFps())) { dirty = true; _loader.SetFrameTimes(doc->GetFps()); } _frame = doc->GetTime().GetFrame(doc->GetFps()); if (!dirty) return op->GetCache(hh); else { // always pass c4d back a null, otherwise the system will keep polling this function and get real annoying lumiCache = BaseObject::Alloc(Onull); lumiCache->SetName(op->GetName()); maxon::String file = bc->GetFilename(CACHEFILE).GetString(); if (file.IsPopulated()) { _loader.GetCacheManager()->Load(file, doc); BaseObject* node = _loader.GetRoot() while (node) { node->InsertUnder(lumiCache); } lumiCache->Message(MSG_UPDATE); return lumiCache;
The objects it inserts could be cameras, lights, meshes, splines, etc.
-
Generator crashes and guidance
I have a relatively complicated generator. It's loads a caching format similar to Alembic and builds and internal hierarchy in GetVirtualObjects. I need a little bit of clarity, and info is strewn in a lot of different places, it's hard to piece together.
My generator doesn't get centered on when Alt left clicking with the mouse and moving and it blinks out of view and certain camera angles, I assume something is wrong maybe with my bounds for that?
My generator crashes C4D when Ctrl copied, and when placing it under something that is being instanced. I assume CopyTo and my lack of an implementation of it might be the culprit?
My generator crashes when renaming, something probably to do with CopyTo again maybe?
Thanks for the insights on this matter.
-
Prorender style viewport rendering
I'm in the process of adding a renderer to the viewport of C4D and I wanted some clarity on functions I should be looking into. I've gathered that I need to make a VideoPostData plugin, and I've used Execute pixel to blanket the viewport in red on hitting the render in viewport button. I also discovered that I could use
GetMenuResource(maxon::String("M_VIEW_WINDOW"))
to add items to the Viewport menu. I'd like to have the user be able to turn my renderer on and off similar to Prorender and draw interactively in the viewport. What documentation, functions, or examples should I be looking into to achieve this?
-
RE: Make plugins work in R13? how?
Maybe a combination of both. Maybe FBX 7.1 didn't support it back then, or maybe Maxon didn't implement it. I think it's probably that Maxon didn't implement it. I'm no longer using the R13 SDK personally. There are other options that are shaping that are far better than FBX, but they require a newer version.
As a solution for you I'd say export the pose morphs as obj, then import them into Blender and FBX export from there.
FBX also has a python API so maybe you could script an export without having the dive into the older R13 C++ API. -
RE: Make plugins work in R13? how?
Where are you exporting the morph targets to? its wholly possible your other package supports creating morph targets from obj files, or alembic. I can't recall if R13 supported Alembic or not. Sadly plugins are forward compatible not backwards. Sorry.
-
RE: Compling against Alembic
I'm getting one linker error. It's better than with the R19 SDK, I used to get a lot more. I'm using the R20 SDK against Cinema 4D R20 with Alembic 1.7.1.
LNK2019 unresolved external symbol "public: void __cdecl Alembic::Abc::v10::ErrorHandler::operator()(class stdext::exception &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??RErrorHandler@v10@Abc@Alembic@@QEAAXAEAVexception@stdext@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function __catch$??0?$ISchemaObject@VICurvesSchema@v10@AbcGeom@Alembic@@@v10@Abc@Alembic@@QEAA@AEBVIObject@123@W4WrapExistingFlag@123@AEBVArgument@123@2@Z$0
-
Compling against Alembic
I'm making a tool that compiles against Alembic and I'm getting a Linker error. Normally I'd use the MSVC FORCE option and ignore the error since on the surface it rarely causes any major issues, but I'm really curious of late. Is there nay specific gotchas I need to be aware of in the C4D MSVC configurations to get get this error to go away?
On another note, is their C4D API specific ways to directly open and write Alembic archives?
-
Asset Manager
I'm looking into developing my own content browser of sorts. An interface into a a version control system we have at our studio. I was looking into the Url api, and I remembered that you guys have that whole preset:// thing going with lib4d assets. Is it possible using the C++ that I could resolve my own custom URL/URIs to assets and images in C4D, or is the preset:// thing custom logic internal to only the built in content browser.
-
FileFormat Exporter
I'm not entirely sure the maxonsdk.module example loaded, or exactly what I'm supported to see from it in R20, but I noticed it has some examples of mediainput and mediaoutput. How exactly do I create a new geometry importer and exporter, such that it appears in the export menu. I noticed Redshift has one for their proxy format. I'd like to use the open/merge menu like I would on an alembic, or fbx, bring up a dialog to select options, and then populate the manager with my custom generators. I'd like to go into the export menu, pick my format, have the dialog open for options, and then translate the scene as needed.
With the maxonsdk.module example I imagined the .image format it's talking about would have popped up as an export option or something.
-
Custom framework locations
I'm incorporating some external libraries into my build and so I have a custom hierarchy built up. I've been able to figure out on my own how access my projects in a solution i.e:
/plugins/my-custom-folder/plugin1 /plugins/my-custom-folder/plugin2 /plugins/my-custom-folder/plugin3
But I cannot figure out how to use my custom common api. Assuming I've given it the ModuleID com.company.common.framework and placing it in my-custom-folder I've tried adding it a few different way to a projectdefinition.txt
1. APIS=plugins/my-custom-folder/common.framework 2. APIS=common.framework 3. APIS=plugins/my-custom-folder/com.company.common.framework 4. APIS=com.company.common.framework
The ones where I specify plugins/ get close, the project gets generated but the reference can't be found, and it doesn't pop up in my solution's framework list. The framework folder itself is called plugins/my-custom-folder/common.framework. Maybe it needs to be com.company.common.framework after the ModuleID defined in the projectdefintion.txt. I also noticed the C4D frameworks don't even use the ModuleID field.