Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nifplg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
nifplg
Commits
d06ba89f
Commit
d06ba89f
authored
16 years ago
by
sacarrow
Browse files
Options
Downloads
Patches
Plain Diff
Added notifiers for hide & unhide events.
parent
d02efb0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
NifPlugins/DllEntry.cpp
+64
-0
64 additions, 0 deletions
NifPlugins/DllEntry.cpp
with
64 additions
and
0 deletions
NifPlugins/DllEntry.cpp
+
64
−
0
View file @
d06ba89f
...
...
@@ -11,6 +11,11 @@
*> Copyright (c) 2006, All Rights Reserved.
**********************************************************************/
#include
<notify.h>
extern
void
DoNotifyNodeHide
(
void
*
param
,
NotifyInfo
*
info
);
extern
void
DoNotifyNodeUnHide
(
void
*
param
,
NotifyInfo
*
info
);
extern
Class_ID
BHKLISTOBJECT_CLASS_ID
;
extern
ClassDesc2
*
GetMaxNifImportDesc
();
extern
ClassDesc2
*
GetNifExportDesc
();
extern
ClassDesc2
*
GetNifPropsDesc
();
...
...
@@ -61,6 +66,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
controlsInit
=
TRUE
;
InitCustomControls
(
hInstance
);
// Initialize MAX's custom controls
InitCommonControls
();
// Initialize Win95 controls
RegisterNotification
(
DoNotifyNodeHide
,
NULL
,
NOTIFY_NODE_HIDE
);
RegisterNotification
(
DoNotifyNodeUnHide
,
NULL
,
NOTIFY_NODE_UNHIDE
);
}
if
(
fdwReason
==
DLL_PROCESS_ATTACH
)
InitializeLibSettings
();
...
...
@@ -203,3 +210,60 @@ __declspec( dllexport ) ULONG LibVersion()
{
return
ULONG
(
libVersion
);
}
static
void
DoNotifyNodeHide
(
void
*
param
,
NotifyInfo
*
info
)
{
int
code
=
info
->
intcode
;
INode
*
node
=
(
INode
*
)
info
->
callParam
;
if
(
Object
*
obj
=
node
->
GetObjectRef
())
{
// Look for messages in network\Max.log
// MAXScript_interface->Log()->LogEntry(SYSLOG_DEBUG, NO_DIALOG, "NifTools Max Plugin",
// "Entered DoNotifyNodeHide; node is -%s- and class ID is %ld\n", node->GetName(), obj->ClassID().PartA());
if
(
obj
->
ClassID
()
==
BHKLISTOBJECT_CLASS_ID
)
{
const
int
PB_MESHLIST
=
1
;
IParamBlock2
*
pblock2
=
obj
->
GetParamBlockByID
(
0
);
int
nBlocks
=
pblock2
->
Count
(
PB_MESHLIST
);
for
(
int
i
=
0
;
i
<
pblock2
->
Count
(
PB_MESHLIST
);
i
++
)
{
INode
*
tnode
=
NULL
;
pblock2
->
GetValue
(
PB_MESHLIST
,
0
,
tnode
,
FOREVER
,
i
);
if
(
tnode
!=
NULL
)
{
tnode
->
Hide
(
TRUE
);
}
}
}
}
}
static
void
DoNotifyNodeUnHide
(
void
*
param
,
NotifyInfo
*
info
)
{
int
code
=
info
->
intcode
;
INode
*
node
=
(
INode
*
)
info
->
callParam
;
if
(
Object
*
obj
=
node
->
GetObjectRef
())
{
// Look for messages in network\Max.log
// MAXScript_interface->Log()->LogEntry(SYSLOG_DEBUG, NO_DIALOG, "NifTools Max Plugin",
// "Entered DoNotifyNodeUnHide; node is -%s- and class ID is %ld\n", node->GetName(), obj->ClassID().PartA());
if
(
obj
->
ClassID
()
==
BHKLISTOBJECT_CLASS_ID
)
{
const
int
PB_MESHLIST
=
1
;
IParamBlock2
*
pblock2
=
obj
->
GetParamBlockByID
(
0
);
int
nBlocks
=
pblock2
->
Count
(
PB_MESHLIST
);
for
(
int
i
=
0
;
i
<
pblock2
->
Count
(
PB_MESHLIST
);
i
++
)
{
INode
*
tnode
=
NULL
;
pblock2
->
GetValue
(
PB_MESHLIST
,
0
,
tnode
,
FOREVER
,
i
);
if
(
tnode
!=
NULL
)
{
tnode
->
Hide
(
FALSE
);
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment